-->
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.  [ 6 posts ] 
Author Message
 Post subject: hibernate can treat that situation?,i think it for 3 days..
PostPosted: Tue Mar 02, 2004 11:51 am 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
my dear friends:
i think it for 3 days,but i can't solve it,please help me!
person-->author(one-to-one)
id of person is manually assigned by code of java
id of author is auto assigned by id of person (because:id of person is primary key,id of author is a foreign key)

OK,one-to-one is over next,i show my many-to-many

author<-->work(many-to-many)
▆◣attend to the author is the same entity to the above author
also,id of the author is auto assigned by id of person,but id of work is manually assigned by code of java

I Don't know did hibernate can treat this situation,i write code ,i ran ok in one-to-one,one-to-many,but in many-to-many,i got the error code:ids for this class must be manually assigned before calling save() work.....,but i realy did manually assigned the id of work!!
i think it for 3 days,but i can't solve it,please help me!

the whole code is in the link:
http://forum.hibernate.org/viewtopic.ph ... 10#2192810

thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
have you tried author extends person mapping it with joined subclass ?


Top
 Profile  
 
 Post subject: sorry
PostPosted: Tue Mar 02, 2004 12:06 pm 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
i am a new to hibernate,could you tell me more infomation?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 1:53 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
read the doc, it is very well explained


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 5:00 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It is out of topic, but why people use one to one mappings, Is it not more performant and clear to put things to the same table ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 5:01 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Well, it's a proper relational design if you have two associated entities.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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

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.