Don't use toplevel collections because we have removed them from 2.0. (Your use case is correct, however.)
"Toni Charlot" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent by: cc: [EMAIL PROTECTED] Subject: [Hibernate] Top level collection but need long transaction eforge.net 23/01/03 10:19 AM Please respond to developer Top level collections are what I thought of using at first but I have a need for long transactions. I read in the doc that sess.update(obj) can not be called on objects with top level collection elements Person contains a Collection of Address objects Customer contains a collection of Address objects Vendor contains only one Address object Address contains a collection of Phone objects All three classes would refer to the same table instead of PERSON_ADDRESS, PERSON_ADDRESS_PHONE , CUSTOMER_ADDRESS, CUSTOMER_ADDRESS_PHONE, put all the Address fields in the VENDOR table VENDOR_PHONE. The database itself does not implement referential integrity for portability issues, all referential integrity checking will be left to the application's persistence layer. Instead of the bunch of tables above the database would contains the following tables: PERSON CUSTOMER VENDOR ADDRESS PHONE In the mapping file, I'm looking at doing something like the following: (will if fly?) Person & Customer class mappings <set role="addresses" cascade="all" lazy="true"> <key column="PARENT_KEY"/> <one-to-many column="pkg.Address"/> </set> ------------------------------------------------------------------------ - Vendor class mapping <many-to-one name="address" class="pkg.Address" column="ADDRESS_KEY"/> ------------------------------------------------------------------------ - Address class mapping <set role="phones" table="phone" lazy="true"> <key column="PARENT_KEY"/> <one-to-many class="pkg.Phone"/> </set> ------------------------------------------------------------------------ - Thank you. ------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel ********************************************************************** Any personal or sensitive information contained in this email and attachments must be handled in accordance with the Victorian Information Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988 (Commonwealth), as applicable. This email, including all attachments, is confidential. If you are not the intended recipient, you must not disclose, distribute, copy or use the information contained in this email or attachments. Any confidentiality or privilege is not waived or lost because this email has been sent to you in error. If you have received it in error, please let us know by reply email, delete it from your system and destroy any copies. ********************************************************************** ------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel