Hi
Does anyone have the example which uses bag in mapping file. I am facing this problem with the query. following is the code. Which always prints 0 for the size but in table there are 10 messages Session session=factory.openSession(); InBox inbox=(InBox) session.find("from InBox inbox where inbox=?", "86c4ef27-1eea-442e-a81b-9acf808076a5", Hibernate.STRING).get(0); List lst=inbox.getMessage(); System.out.println(lst.size()); session.connection().commit(); session.close(); following is the xml mapping
file:-
<bag name="message" inverse="true" lazy="true" cascade="all"> <key column="id"/> <one-to-many class="com.webify.eligibility.MyInbox.Message"/> </bag> can anybody help me with this I am stuck over here. Am I missing something over here. thanks
|
- Re: [Hibernate] Bag example Prasad Iyer
- Re: [Hibernate] Bag example Konstantin Priblouda