Hello, does anyone have a working example of 1->n association?
Let's say I have a A class that holds several reference of B objects.
Thus I have A->*B
In my java source code I got:
A {
int id;
Vector listOfB = new Vector();
public void addB(B BObject) {
listOfB.add(BObject);
}
getter and setter methods...
}
B {
int id;
int AId;
getter and setter methods...
}
in my reference_user.xml file I have :
<class-descriptor name="A" table="TABLE_A">
<field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>
<collection-descriptor name="listOfB" element-class-ref="B">
<inverse-foreignkey field-id-ref="2"/>
<collection-descriptor/>
<class-descriptor/>
<class-descriptor name="B" table="TABLE_B">
<field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="true"/>
<field-descriptor id="2" name="AId" column="A_ID"
jdbc-type="INTEGER"/>
</class-descriptor>
When executing, I get exceptions :
Error in operation [set] of object [PersistentFieldPropertyImpl],
java.lang.IllegalAccessException
Declaring class [B]
Property Name [AId]
Property Type [int]
anObject was class [B]
aValue was class [java.lang.Integer]
Can anyone help, please? I just want a working java source code with the
repository_user.xml.
Thanks
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>