Joined: Sat Feb 09, 2008 6:25 pm Posts: 3
|
Hi ,
i'm having some problem defining a jpa relationship as follows :
@entity
document {
@id @generatedvalue Integer id;
@onetomany collection<item>
}
@entity
item {
@id @generatedvalue Integer id;
@column(nullable=false) Integer documentId;
}
i basicly want a unidirectional onetomany but allso to hold the documentid on the item class but i can't seem to get it to work i've tried with a jointable and a workaround and with a joincolumn on the onetomany side but it doesn't populate the documentid field when persisting and throws a : "not-null property references a null or transient value" using entitymanager and hibernate (latest) as an impl. and i mapping this wrong or is this not possible under jpa ?
thanks.
|
|