-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Unidirectional onetomany
PostPosted: Wed Apr 23, 2008 5:25 am 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.