-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: many-to-one mapping - Unsupported Entry Type error
PostPosted: Mon Aug 16, 2004 2:00 pm 
Beginner
Beginner

Joined: Wed Aug 04, 2004 9:01 pm
Posts: 21
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)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 2:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
There is no Hibernate class involved in the exception stacktrace


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.