Mapping an attribute to different classes
I have a class, A that contains an attribute called "state" of type State. Class State is an abstract class that contains 2 methods. Classes ActiveState and CompletedState extend State and none of them have attributes. They only implement the 2 methods. I am having problems trying to map the state attribute of A since the state can be either an ActiveState or a CompletedState. Any suggestions?
Hi Cynthia,
I would assume that the State object itself is un-persistentable as there is in fact no persistent attribute defined in either State or it's subclasses.
If you treat the State as a kind of status flag to A class, you could use Transformation Mapping for the attribute (refer to the manual for the setting of the mapping).
If you do have persistent attributes in State and/or it's subclasses, you could simply use 1:1 mapping from A to State, and use TopLink inheritance support to map State, ActiveState and CompletedState.
King
Similar Messages
-
Same parameter-map used on 2 different classes
Greetings,
If the same parameter-map (type connection or http) is used on two different policy-map classes, will that create a conflict in how traffic for each of serverfarms uses persistence or inactivity timeout (script 1)?
Should we create a different instance of parameter-maps for each policy-map class (script 2)?
Script 1
parameter-map type connection inactivity_2000
set timeout inactivity 2000
parameter-map type http persistence-rebalance
persistence-rebalance
policy-map multi-match L4_POLICY
class L3-4_VIP_A
connection advanced-options inactivity_2000
appl-parameter http advanced-options persistence-rebalance
loadbalance policy L7_Serverfarm_A_Policy
loadbalance vip inservice
loadbalance vip icmp-reply active
class L3-4_VIP_B
connection advanced-options inactivity_2000
appl-parameter http advanced-options persistence-rebalance
loadbalance policy L7_Serverfarm_B_Policy
loadbalance vip inservice
loadbalance vip icmp-reply active
Script 2
parameter-map type connection L3-4_VIP_A_connection
set timeout inactivity 2000
parameter-map type connection L3-4_VIP_B_connection
set timeout inactivity 2000
parameter-map type http L3-4_VIP_A_http
persistence-rebalance
parameter-map type http L3-4_VIP_B_http
persistence-rebalance
policy-map multi-match L4_POLICY
class L3-4_VIP_A
connection advanced-options L3-4_VIP_A_connection
appl-parameter http advanced-options L3-4_VIP_A_http
loadbalance policy L7_Serverfarm_A_Policy
loadbalance vip inservice
loadbalance vip icmp-reply active
class L3-4_VIP_B
connection advanced-options L3-4_VIP_B_connection
appl-parameter http advanced-options L3-4_VIP_B_http
loadbalance policy L7_Serverfarm_B_Policy
loadbalance vip inservice
loadbalance vip icmp-reply active
Thanksyou can reuse the same parameter map.
Gilles. -
Unable to map/get Attributes with import of LDIF Object Class
Hi All,
We are trying to take import of Customized Object Class and Attributes into OID through LDIF.
LDIF import command is:
./ldapadd -p 3060 -h myhost -D "cn=orcladmin" -w Ac123456 -f xyzObjClass.ldif
LDIF contents are:
dn: cn=subSchemaSubentry
changetype: modify
add: objectclasses
objectclasses: ( 1.3.6.1.4.1.1436.2.46 NAME 'ProviderObjClass' SUP ( organizationalPerson $ person $ top ) STRUCTURAL MAY ( attr1 $ attr2 ) )
Note: attr1 and attr2 are already imported into OID.
Result: We are able to create Object Class and also able to inherit Super Class. But we are not able to map the attributes to our Object Class.
Can anybody help me in importing ?
Thanks & Regards,
NewbieAgain, I don't work with Java and you should ask Java-related question in Flex (or Java) forum.
Java or not - you need to package your server side language specific object into something that AS understands (text, XML, AMF object) and load this data into AS via, perhaps, URLLoader. Or you can open socket. Then you parse this data with AS3 code in SWF. -
Hi all,
I'm using EP SP16 with a MSADS flat hierarchy datasource.
I've mapped the attribute "pwdLastSet" in the configuration file but when I list the "attributeNames" of my user, it doesn't exist.
This mapping is no different than previous mapping I've mapped such as extensionAttribute, company, dn and others all done successfully.
Can't "pwdLastSet" be mapped?
Amithie could u please paste the xml configuration file here. Also the attribute pwdLastSet is a read only attribute from ADS.
-
Is there a way to not have to map all attributes
Is there a way to have a attribute in a class not have to be mapped to a
db column? I have a base class that has a property that is used for
convience but doesn't map to any DB column. I am currently getting a No
mapping information was found error.
Thanks
JeffJeff,
That's the right answer, assuming that you may want that field to be in a
serialized object of that class. If you don't want the field serialized,
then making the field transient will cause Kodo to use
persistence-modifier="none" by default.
Thanks,
Greg
"Jeff Krueger" <[email protected]> wrote in message
news:cs3a30$l68$[email protected]..
I think I found my own answer.
in the metadata file add the column and set thepersistence-modifier="none"
like below.
<class >
<field name="sessionName" persistence-modifier="none"/>
</class>
Jeff
"Jeff Krueger" <[email protected]> wrote in message
news:cs27q0$f3o$[email protected]..
Is there a way to have a attribute in a class not have to be mapped
to
a db column? I have a base class that has a property that is used for
convience but doesn't map to any DB column. I am currently getting a No
mapping information was found error.
Thanks
Jeff -
Mapping private attribute in workbench
Hi,
The mappingworkbench will not generate a toplink-deployment-descriptor.xml for directly mapped attributes that have accessibility private. Other comments in this forum and weblinks that date from Webgain-Toplink describe that this should be possible.
So my questions are:
- where can I find current toplink documentation that describes how to map private attributes?
- how can I get around the fact that the mapping workbench does not accept methods with private accessibility?
Thanks for your insights,
Joost de Vries
NederlandHi Donald,
First; what I want to do is create a 'value object' [cf. Fowler], that is: a java object that can be given values for its attributes at creation time, but not afterwards.
So the way I try to accomplish that is by making the mutator (set-method) private.
This is how to recreate the situation: I have a working mapping. I change the set method of an attribute to private. I restart jDeveloper (*), I generate the toplink-deployment-descriptor.xml. The generation fails with the message 'Method setDjiNummer(Integer i) has private access in class org.myOrg.MyClass'.
Sincerely,
Joost de Vries
Nederland
(*) by the way: is there a better way to make sure the Toplink Workbench sees changes made to java classes? -
Mapping object attributes to ArrayField widget
Is there a way to specify get/set methods for fields within an
ArrayField widget instead of public attributes of the mapped type?
We are trying to enforce strict encapsulation of our data objects, but
it seems that the only way to display our data objects in an ArrayField
widget is to bind each field in the ArrayField to a PUBLIC attribute of
our object. I was hopeful that the virtual attribute would take care of
this but apparently, the virtual attributes can only access public
attributes on our class.
An obvious solution to this is to retrieve the private attributes of our
objects via their Get methods and then manually adding them to the
ArrayField widget, but this seems to be a lot of wasted processing.
Any thought would be greatly appreciated. Send replies directly to me at
[email protected]
Thanks,
VanHi,
Refer your suggestion
Confirm that
4. The datatype for the field is same as the data type of the vo attribute.
This is what I need to Solve.The datatypes are not similar
I want to show Students Number in the table column
DataType for the field in the Table is selected as "Number"
In the View Object there is no datatype called "Number".So, I selcted "Integer".
Now, how can I show VO attribute of type "Integer" in a table column of type "Number"..
thanks,
Gowtam -
Problems to map organization attribute from IDM 7 to my own Resource
Hi
I have a problem mapping the organization user attribute to my resource. My Resource xml looks like:
" <AccountAttributeTypes>\n"+
" <AccountAttributeType name='accountId' mapName='loginName' mapType='string'/>\n"+
" <AccountAttributeType name='email' mapName='email' mapType='string'/>\n"+
" <AccountAttributeType name='firstname' mapName='firstname' mapType='string'/>\n"+
" <AccountAttributeType name='lastname' mapName='lastname' mapType='string'/>\n"+
" <AccountAttributeType name='organization' mapName='organization' mapType='string'/>\n"+
" </AccountAttributeTypes>\n"+
but when I try to get the organization attribute in my resource it comes null. I get it like follows:
WSAttributes attributes = user.getWSAttributes();
attributes.getValueAsString("organization")
Does anyone know how to map organization attribute to a Resource?
Thanks.I can pass the Organization attribute to my Resource configuring this in MetaView tab.. But only pass me this attribute when I update an account.
in my resource xml is:
static String gfResourceXml =
"<Resource name='ResourceAdapter' class='com.qoslabs.jes.idm.ResourceAdapter' typeString='ResourceAdapter' typeDisplayString='ResourceAdapter'>\n"+
" <Template>\n"+
" <AttrDef name='accountId' type='string'/>\n"+
" </Template>\n"+ <AccountAttributeTypes>\n"+
" <AccountAttributeType name='accountId' mapName='loginName' mapType='string'/>\n"+
" <AccountAttributeType name='password' mapName='password' mapType='string'/>\n"+
" <AccountAttributeType name='email' mapName='email' mapType='string'/>\n"+
" <AccountAttributeType name='firstname' mapName='firstname' mapType='string'/>\n"+
" <AccountAttributeType name='lastname' mapName='lastname' mapType='string'/>\n"+
" <AccountAttributeType name='organization' mapName='organization' mapType='string'>\n"+
" <AttributeDefinitionRef>\n" +
" <ObjectRef type='AttributeDefinition' name='organization'/>\n" +
" </AttributeDefinitionRef>\n" +
" </AccountAttributeType>\n" +
" </AccountAttributeTypes>\n"+
"</Resource>\n"; and in metaview tab in Admintrator console I configure like this:
AttributeName: organization
Sources: None
How to set Identity Attribute : Set to value
Store attribute in IDM repository: checked
Targets: MyResourceAdapter organization Create, UpdateHow can I configure the meta view to pass me the attribte organization when I create a user account?
Thanks,
Message was edited by:
ima_dev -
Two equal objects, but different classes?
When programming on binding Referenceable object with JDK version 1.5.0_06, I have encountered a very strange phenomenon: two objects are equal, but they belong to different classes!!!
The source codes of the program bind_ref.java are listed as below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
import java.lang.*;
import java.io.*;
import java.util.*;
import javax.naming.*;
import javax.naming.spi.ObjectFactory;
import java.util.Hashtable;
public class bind_ref {
public static void main( String[] args ) {
// Set up environment for creating the initial context
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory" );
env.put( Context.PROVIDER_URL, "file:/daniel/" );
Context ctx = null;
File f = null;
Fruit fruit1 = null, fruit2 = null;
byte [] b = new byte[10];
try {
ctx = new InitialContext( env );
Hashtable the_env = ctx.getEnvironment();
Object [] keys = the_env.keySet().toArray();
int key_sz = keys.length;
fruit1 = new Fruit( "Orange" );
SubReference ref1 = fruit1.getReference();
ctx.rebind( "reference", fruit1 );
fruit2 = ( Fruit )ctx.lookup( "reference" );
System.out.println( "ref1's class = (" + ref1.getClass().toString() + ")" );
System.out.println( "fruit2.myRef's class = (" + fruit2.myRef.getClass().toString() + ")" );
System.out.println( "( ref1 instanceof SubReference ) = " + ( ref1 instanceof SubReference ) );
System.out.println( "( fruit2.myRef instanceof SubReference ) = " + ( fruit2.myRef instanceof SubReference ) );
System.out.println( "ref1.hashCode = " + ref1.hashCode() + ", fruit2.myRef.hashCode = " + fruit2.myRef.hashCode() );
System.out.println( "ref1.equals( fruit2.myRef ) = " + ref1.equals( fruit2.myRef ) );
} catch( Exception ne ) {
System.err.println( "Exception: " + ne.toString() );
System.exit( -1 );
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
All the outputs are shown as below:
=======================================================
Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
--------- (i)subref.hashCode() = (-1759114666)
SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
--------- (i)subref.hashCode() = (-1759114666)
FruitFactory: obj's class = (class javax.naming.Reference)
FruitFactory: obj's hashCode = -1759114666
FruitFactory: obj = (Reference Class Name: Fruit
Type: fruit
Content: Orange
FruitFactory: ( obj instanceof SubReference ) = false
FruitFactory: subref_class_name = (Fruit)
Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
ref1's class = (class SubReference)
fruit2.myRef's class = (class javax.naming.Reference)
( ref1 instanceof SubReference ) = true
( fruit2.myRef instanceof SubReference ) = false
ref1.hashCode = -1759114666, fruit2.myRef.hashCode = -1759114666
ref1.equals( fruit2.myRef ) = true
========================================================
I hightlight the critical codes and outputs related to the strangeness with bold texts.
Who can tell me what happens? Is it really possible that two objects belonging to different classes are equal? If so, why that?It can also depend on how you implement the equals method.
class Cat {
String name;
Cat(String n) {
name = n;
class Dog {
String name;
Dog(String n) {
name = n;
public boolean equals(Object o) {
return name.equals(o.name);
public static void main(String[] args) {
Dog d = new Dog("Fred");
Cat c = new Cat("Fred");
System.out.println(d.equals(c));
} -
Can't call or execute of different class files in a main program
Hi, I got a main program which can call 3 different classes. The main program have an implicit-choice List as a starting menu. If one of the file is selected, the files will call out and display it. However, i managed to call the 1st 2 files, and the 3rd files can't display anything after selected.
I enclosed my code as below:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Catalogues extends Form implements CommandListener {
private Displayable parent;
private Display display;
private List Cata;
private Boots bo;
private Higheels hHeels;
private Sandals sand;
private Slippers sp;
private Command backCommand = new Command("Back", Command.BACK, 1);
private Command viewCommand = new Command("View", Command.SCREEN, 1);
private String[] options = {"Boots", "High Heels","Sandals", "Slippers"};
public Catalogues(Display d, Displayable p) {
super("Welcome to Footwear World");
Cata = new List("Select Option", List.IMPLICIT, options, null);
display = d;
parent = p;
addCommand(backCommand);
addCommand(viewCommand);
setCommandListener(this);
public void commandAction(Command c, Displayable d) {
if(d==parent && c==List.SELECT_COMMAND){
switch(parent.getSelectedIndex()){
case 0:
if(bo==null){
bo = new Boots(display,parent);
display.setCurrent(bo);
break;
case 1:
if(hHeels==null){
hHeels = new Higheels(display,parent);
display.setCurrent(hHeels);
break;
case 2:
if(sand==null){
sand = new Sandals(display,parent);
display.setCurrent(sand);
break;
case 3:
if(sp==null){
sp = new Slippers(display,parent);
display.setCurrent(sp);
break;
default:
else if (c==backCommand) {
display.setCurrent(parent);
}If the 3rd option is selected, i'll display above mentioned layout which contain a list to select too.
After build this project on WToolkit. It shown an error message which is as below:
Project settings saved
Building "SelectCustest"
C:\WTK22\apps\SelectCustest\src\Catalogues.java:29: cannot resolve symbol
symbol : method getSelectedIndex ()
location: class javax.microedition.lcdui.Displayable
switch(parent.getSelectedIndex()){
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
May i know what is problem am i facing now? And how to solve it.
Thanks.Thanks to all for your thoughts and replies. I liked the xargs suggestion, so I tried that first. I would have (may still) try the stdin suggestion, followed by writing the grep output to a file.
xargs does work, in a way I didn't expect it to, but that could be due to my inexperience with the workings of the shell.
here's a line from my test script
cat file | grep foo | xargs java com.company.test.TEchoArghere's the contents of 'file'
123foo
abc
qafoozv
qaz
wsx
qwefoort
zxcfooh
sdfghhere's the output from the test class, which just echos any arguments
::number of args: 4
::args[0] 123foo
::args[1] qafoozv
::args[2] qwefoort
::args[3] zxcfoohso xargs appends all the values from grep into an argument list and call the java class once.
when I took xargs out of the script, nothing was passed to the class:
::number of args: 0this was really interesting and something to keep in my back pocket for future use.
Thanks again to all.
Tom -
How to use the different class for each screen as well as function.
Hi Experts,
How to use the different class for each screen as well as function.
With BestRegards,
M.Thippa Reddy.Hi ThippaReddy,
see this sample code
Public Class ClsMenInBlack
#Region "Declarations"
'Class objects
'UI and Di objects
Dim objForm As SAPbouiCOM.Form
'Variables
Dim strQuery As String
#End Region
#Region "Methods"
Private Function GeRate() As Double
Return Double
End Function
#End Region
Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
If pVal.BeforeAction = True Then
If pVal.MenuUID = "ENV_Menu_MIB" Then
End If
Else ' Before Action False
End If
End Sub
#End Region
End Class
End Class
Rgds
Micheal
Vasu Anna Regional Feeling a???? Just Kidding
Edited by: micheal willis on Jul 27, 2009 5:49 PM
Edited by: micheal willis on Jul 27, 2009 5:50 PM -
Page Attributes and Application Class Attributes
Hi, everyone,
I am quite new to BSP.
I have a question here:
what is the difference between page attributes and application class attributes of a bsp application? As they are both global attributes, there seems to be no big difference when we use them.
thanks a lot.
FanHi Fan,
a BSP application can be made up of many pages.
A page attribute is visible only in the page it is associated with.
Attributes of the application class are visible from every page in that application.
Cheers
Graham Robbo -
Reading global attributes from implementation class
Hi,
How to access
global attributes of implementation class
from getter method of context node class.
Thanks in advance,
Srinivas.Hi Srinivasa,
Access the view controller using attribute
owner
, Then you can access the global attributes.
Regards,
Masood Imrani S. -
How to define a Value for an Attribute of an Class
Hi,
How to define a Value for an Attribute of a Class ...
( I need to change the value of an Attribute of a class in standard program ....
Ex...
cl_hrce_masterswitches=>infotype_framework_is_active
Here infotype_framework_is_active is the attribute .. its value in standard program is 'X'... Now i need to change it as ' '.
How to define it and set value as ' '.Hello Surendar
The static attribute INFOTYPE_FRAMEWORK_IS_ACTIVE is read-only and there is not SETTER method to manipulate its value.
However, the attribute is filled in the CLASS_CONSTRUCTOR:
METHOD class_constructor.
IF ce_is_active = true OR
global_payroll_is_active = true OR
mngmt_global_empls_is_active = true.
infotype_framework_is_active = true.
perid_infotype_is_active = true.
ELSE.
infotype_framework_is_active = false.
perid_infotype_is_active = false.
ENDIF.
ENDMETHOD.
Thus, you need to analyze how attribute CE_IS_ACTIVE, GLOBAL_PAYROLL_IS_ACTIVE and MNGMT_GLOBAL_EMPLS_IS_ACTIVE are filled in the CLASS_CONSTRUCTOR.
For sure you will find customizing settings that are responsible for this.
Regards
Uwe -
Problem in importing two different classes with same name...
I have to import two different classes in my program with the same name....
import org.apache.lucene.document.Document;
import org.w3c.dom.Document;
// I AM USING THE DOCUMENT FROM W3C PACKAGE HERE....
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource( new StringReader( tempString ) );
d = builder.parse( is );
NodeList images = d.getElementsByTagName("img");
int length = images.getLength();
for(int i = 0;i<length;i++)
Node image = images.item(i);
String tempAltText = image.getAttributes().getNamedItem("alt").getNodeValue();
altText = altText.concat(" ").concat(tempAltText);
}and the error i am getting is
[javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
[javac] import org.w3c.dom.Document;
[javac] ^
[javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:132: incompatible types
[javac] found : org.w3c.dom.Document
[javac] required: org.apache.lucene.document.Document
[javac] d = builder.parse( is );
[javac] ^
[javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:133: cannot find symbol
[javac] symbol : method getElementsByTagName(java.lang.String)
[javac] location: class org.apache.lucene.document.Document
[javac] NodeList images = d.getElementsByTagName("img");
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errorsany idea ..how to resolve it
Edited by: ping.sumit on Jul 16, 2008 3:39 PM
Edited by: ping.sumit on Jul 16, 2008 3:40 PMnow i changed the code to
import org.apache.lucene.document.Document;
import org.w3c.dom.Document;
org.w3c.dom.Document d = null;
try{
System.out.println("in author");
URL url = new java.net.URL(urlString);
java.net.URLConnection conn = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while ((in.readLine()) != null)
//tempString = tempString.concat(in.readLine());
String temp = in.readLine();
tempString = tempString + " " + temp;
System.out.println("the string in author" + tempString);
in.close();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource( new StringReader( tempString ) );
d = builder.parse( is );
NodeList images = d.getElementsByTagName("img");and their is only one error i am getting ...and that is
[javac] C:\Documents and Settings\sumit-i\WolframWorkspaces\Base\WolframNutch\src\java\com\wolfram\nutch\indexer\InfoCenterFilter.java:20: org.apache.lucene.document.Document is already defined in a single-type import
[javac] import org.w3c.dom.Document;
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
Maybe you are looking for
-
Issues with windows 7 ram on a gd65 mobo
Hi all, i recently upgraded my pc after my old asus mobo died on me. I found a good deal with a gd65, i5 750, and 4 x2 gigs of ram on newegg as a package deal. I was looking around on windows and it says i have 8 gigs of ram but only 2.99 is availa
-
How to saw price for purticular sku in bcc
Hi all, I am setting price for pricelist level in particular sku, now i want to view particular sku's price. But i tried to see the "Content Administration-> Assert -> Repository: price list , Asset Type : price --> in Asset Picker am give skuId , th
-
/etc/postfix/virtual_users.db is older than source file /etc/postfix/virtual_users is the error I am getting. My server is working great, but my mailing lists are not working for my virtual domains. I tried deleting the entire mailing list, re-adding
-
Is a lasso tool use for a part of design?
i have need of the part of design to take away. but i cant do it . i tried for the lasso,but not possible . is there any tool work ?
-
Hide/Show Finder Window "Bars" Button?
Snow leopard had a really useful feature associated with Finder windows that allowed all of the various bars (Tool, Side, Path, Status) to be activated/deactivated at one time. Lion took this away (but allowed those features to be active/inactve inde