From: Gavin K. <Gav...@ex...> - 2003-01-03 03:33:04
|
Sorry, thats nowhere near enough information. You should show the code that uses the Hibernate Session and also the full stack trace. A Hibernate TRACE-level log is also sometimes useful. -----Original Message----- From: Laurent Fleuriot [mailto:lfl...@co...]=20 Sent: Friday, 3 January 2003 1:52 AM To: hib...@li... Subject: [Hibernate] sorted collection I have 2 classes.=20 The first class contains a collection of the second class. I want the collection is sorted but, when I return the collection, I have a= n error "Failed to lazily initialize a collection" My mapping is : <class name=3D"Class1" table=3D"table1"> ... <set role=3D"child" lazy=3D"true" cascade=3D"save-update" sort=3D"natur= al" > <key type=3D"int" column=3D"columnName"/> <one-to-many class=3D"Class2"/> </set> .... </class> .... and My java code is : public Class1() { .... child =3D new java.util.TreeSet(); ... } Laurent FLEURIOT | Ing=E9nieur =C9tudes et D=E9veloppement=20 =20 Chemin de Saint Lambert - Actiburo 1 B=E2timent A - 13400 Aubagne=20 T=E9l : +33 4 91 87 84 03 - Fax : +33 4 91 87 81 09 - Mobile : +33 6 22 05 = 82 74=20 www.cosmosbay.com=20 ********** CAUTION - Disclaimer ********** This message may contain privileged and confidential information. If you are not the intended recipient of this message (or responsible for delivery of the message to such person) you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. If you have received this message in error, you should destroy it and kindly notify the sender by reply e-mail. Please advise immediately if you or your employer do not consent to Internet e-mail for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Expert Information Services Pty Ltd ("The Company") shall be understood as neither given nor endorsed by it. The Company advises that this e-mail and any attached files should be scanned to detect viruses. The Company accepts no liability for loss or damage (whether caused by negligence or not) resulting from the use of any attached files. **EIS******** End of Disclaimer ********** |