Hibernate version:
2.1.6
Mapping documents:
Request.hbm.xml
<set name="requestStatuses">
<key column="REQUESTID"/>
<one-to-many class="com.aol.ic.art.data.vo.RequestStatusVO"/>
</set>
RequestStatus.hbm.xml
<many-to-one name="requestId" class="com.aol.ic.art.data.vo.RequestVO" column="REQUESTID" cascade="all"/>
Class Code:
Code:
RequestStatusVO Constructor
public RequestStatusVO(Long requestId, String state, Calendar dateStateAttained) {
this.requestId = requestId;
this.state = state;
this.dateStateAttained = dateStateAttained;
}
TestCode:
RequestStatusVO requestStatusVO = new RequestStatusVO(requestVO.getId(), state, cal);
AssetRequestToolDAOUtils.create(requestStatusVO);
logger.info("Saving RequestStatusVO");
Set requestStatusSet = new HashSet();
requestStatusSet.add(requestStatusVO);
requestVO.setRequestStatuses(requestStatusSet);
logger.info("After creating requestVO");
AssetRequestToolDAOUtils.create(requestVO);
logger.info("Saving RequestVO");
Code between sessionFactory.openSession() and session.close():
HibernateUtil.beginTransaction();
HibernateUtil.currentSession().saveOrUpdate(requestVO);
HibernateUtil.commitTransaction();
HibernateUtil.closeSession();
HibernateUtil.beginTransaction();
HibernateUtil.currentSession().saveOrUpdate(requestStatusVO);
HibernateUtil.commitTransaction();
HibernateUtil.closeSession();
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 9.2.0
Debug level Hibernate log excerpt:
2004-08-16 13:49:03 DEBUG SessionImpl.initializeNonLazyCollections(3112) - initializing non-lazy collections
com.aol.ic.art.ARTException: Unsupported entry type
at com.aol.ic.art.data.dao.utils.AssetRequestToolDAOUtils.create(Unknown Source)
at com.aol.ic.art.data.dao.utils.TestRequestDAOUtils.testCreate(UnknownSource)
at com.aol.ic.art.data.dao.utils.TestRequestDAOUtils.testMain(Unknown Source)
at com.aol.ic.art.ARTInitServlet.init(Unknown Source)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)