-->
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: Complex relations with "inverse", "lazy"
PostPosted: Mon Apr 12, 2004 5:37 am 
Newbie

Joined: Mon Nov 10, 2003 7:39 pm
Posts: 8
I have 3 tables and 2 relations:
1. One to Many from T1 to T2
2. Many to One from T2 to T3

Actually T2 is like many-to-many relationship table with specified role field. So i have 3 java classes for each table with lazy and inverse realations between them.

Next i tried this kind of code indise C1 class:
Code:
add(C3 c3) {
  C2 c2 = new C2();        // create new intermediate class
  c2.setC3(c3);               // set both ends of the relationship, T3
  c2.setC1(this);             // set both ends of the relationship, T1
  c2s.add(inheritance);    // add to collection in the c1
  c3.addC2(c2);              // add to collection in the c3
}


So, all fields and collections are filled out.
Then i tried to store object c1 and c3 and i can't cause hibernate says that either c1 or c3 is "not-null property references a null or transient".
What do i have to do? Remove inverse, lazy or something else?


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.