java - Hibernate List returns same object reference for same values in table -


  • a has many-to-one relationship b.
  • b kind of type/category table.

i storing b primary keys in table. when query list of following

   sqlquery query = session.createsqlquery("select * a");    query.addentity(a.class);    list list  = query.list();     a.hbm.xml    <many-to-one         class="b"          fetch="select" name="b" lazy="no-proxy">         <column name="b_id" />     </many-to-one> 

this list has same object references of b same primary keys. has 4 records out of 2 records have same b value. have same object reference of b here though 2 different records of a. need different object reference of b here.

any appreciated. thanks!


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -