i have a Class A and Class B,relation between these two are ONE(Class A)-To-MANY(Class B)
1)Class A is having
private Long identityId private Long userId private Set<Class B> setb = new HashSet<Class B>();
below is the content of classa.hbm.xml
<class name="ClassA" table="table_a"> <id name="identityId" column="identify_id"></id> <property name="userId" column="user_id"></property> <set name="setb" lazy="false" inverse="false"> <key column="user_id"></key> <one-to-many class="ClassB"/> </set> </class>
2)Class B is having
private Long userId; private Long respId;
below is the content of classb.hbm.xml
<class name="ClassB" table="table_b"> <id name="userId" column="user_id"></id> <property name="respId" column="resp_id"></property> </class>
I am trying to pull Class B data but its coming as NULL , Can some one let me know if there is any wrong with above mappings ?
|