-->
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: get problem with many-to-one
PostPosted: Fri Jul 08, 2005 10:17 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:07 am
Posts: 33
I try to get a Set from many-to-one and I get an empty set. What is wrong?
Class A{

Set classB = new HashSet


* @hibernate.set
* cascade="all"
* lazy="true"
* @hibernate.collection-key
* column="A_ID
* @hibernate.collection-one-to-many
class="A_B"

getClassB(){
return classB
}

}

Class B{

Set classA = new HashSet

* @hibernate.set
* cascade="all"
* lazy="true"
* @hibernate.collection-key
* column="B_ID
* @hibernate.collection-one-to-many
class="A_B"

getClassA(){
return classA
}
}


Class A_B{

ClassA a;
ClassB b;
String str;

* @hibernate.many-to-one
* column="A_ID"
ClassA getA(){
return a;
}


* @hibernate.many-to-one
* column="B_ID"
ClassB getB(){
return b;
}


}



When I try to get the Set of ClassB from ClassA in ClassC I get an empty Set

ClassA a1 = new ClassA();
a1.getClassB()

What is wrong?


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.