Problem:
I've upgraded from Hibernate 3.0 to 3.2.
I have an object that has a list of of other objects (java.util.list).
The tagRecords are persisted in the DB, but when I retreive the parent object it does not contain any children (tag does not have any tagRecords).
Can anyone suggest why?
Can someone please point me in the direction of the migration docuement?
Thanks
Jeff Porter
Hibernate version:
3.2
Mapping documents:
Xdoclet used on TAG class...
/**
* @hibernate.list cascade="all-delete-orphan" lazy="false"
* @hibernate.collection-one-to-many class="com.kbtflawt.model.savi.TagRecord"
* @hibernate.collection-index column="tagrecord_index"
* @hibernate.collection-key column="fk_tagrecord_link"
*/
public List getListOfTagRecords() {
return listOfTagRecords;
}
Xdoclet used on TAGRecord class...
/**
* @hibernate.many-to-one cascade="none" column="fk_tagrecord_link"
*/
public Tag getTag() {
return tag;
}
Code between sessionFactory.openSession() and session.close():
Code:
hsession = factory.openSession();
trans = hsession.beginTransaction();
trans.begin();
tag.addRecord(tagRecord);// this is a list.
hsession.saveOrUpdate(tag);
trans.commit();
hsession.close();
Name and version of the database you are using:
MySQL 4.2
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
How do I turn this on?