I know this has been asked many times before but there doesn't seem to be
any answers that work in the archives. I spent the whole day trying to get
it to work. When I retrive the object, the referenced object (user) is set
to null, any ideas? Also is it possible to insert a new 1:1 association
object?, i.e. will it insert the referenced object first get the PK for it
and then insert the main object upating the FK?
Thx in adv.
Mark
repository.xml:
<class-descriptor class="ie.dkit.careers.models.form.User" table="users">
<field-descriptor autoincrement="true" column="u_id" id="0"
jdbc-type="INTEGER" name="id" primarykey="true"/>
...
</class-descriptor>
<class-descriptor class="ie.dkit.careers.models.form.Interaction"
table="interactions">
<field-descriptor autoincrement="true" name="id" column="i_id" id="0"
jdbc-type="INTEGER" primarykey="true"/>
<field-descriptor name="userId" column="i_userId" id="1"
jdbc-type="INTEGER"/>
...
<reference-descriptor name="user"
class-ref="ie.dkit.careers.models.form.User" auto-retrieve="true">
<foreignkey field-id-ref="1"/>
</reference-descriptor>
</class-descriptor>
public class BaseFormModel {
private int id;
public int getId(){
return id;
}
public void setId(int aId){
id=aId;
}
}
User class:
public class User extends BaseFormModel {
...
}
Interaction class:
public class Interaction extends BaseFormModel {
private int userId;
private User user;
public User getUser(){
return user;
}
public void setUser(User aUser){
user=aUser;
}
public int getUserId(){
return userId;
}
public void setUserId(int aUserId){
userId=aUserId;
}
...
}
Using version 9.8
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]