-->
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.  [ 3 posts ] 
Author Message
 Post subject: join-subclass + key-many-to-one problem
PostPosted: Wed Mar 10, 2004 4:40 am 
Beginner
Beginner

Joined: Mon Sep 22, 2003 7:16 am
Posts: 25
Hi, I'm using Hibernate 2.0 and tried something like foloowing ...
Code:
...
   <class name="airhk.valueobject.transport.ScheduleVO" table="Schedule">
      <composite-id>
         <key-many-to-one name="voyage" column="voyageId" class="airhk.valueobject.transport.VoyageVO"/>
         <key-many-to-one name="pol" column="polId" class="airhk.valueobject.geog.PortVO"/>
      </composite-id>
      <property name="status" column="status" type="string"/>
<!-- append joined-subclass here -->
   </class>
...

It's working.

But if I append a joined-subclass to this class with:
Code:
      <joined-subclass name="airhk.valueobject.transport.air.AirScheduleVO" table="AirSchedule">
         <key>
            <column name="voyageId"/>
            <column name="polId"/>
         </key>
      </joined-subclass>

The hibernate raise exception as:
Code:
4704 [10-Mar-2004 16:35:36] ERROR airhk.core.util.HibernatePlugIn  - Exception while initializing Hibernate.
4712 [10-Mar-2004 16:35:36] ERROR airhk.core.util.HibernatePlugIn  - Rethrowing exception...
net.sf.hibernate.MappingException: No persister for: airhk.valueobject.transport.VoyageVO
        at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:426)
        at net.sf.hibernate.impl.SessionFactoryImpl.getIdentifierType(SessionFactoryImpl.java:592)
        at net.sf.hibernate.type.ManyToOneType.getColumnSpan(ManyToOneType.java:21)
        at net.sf.hibernate.type.ComponentType.getColumnSpan(ComponentType.java:60)
        at net.sf.hibernate.persister.NormalizedEntityPersister.<init>(NormalizedEntityPersister.java:702)
        at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:206)
        at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:594)
        at airhk.core.util.HibernatePlugIn.initHibernate(Unknown Source)
        at airhk.core.util.HibernatePlugIn.init(Unknown Source)
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1105)
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
        at javax.servlet.GenericServlet.init(GenericServlet.java)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:934)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2567)
        at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1382)
        at java.lang.Thread.run(Thread.java:536)

I think it might not related to the VoyageVO as the exception complain at PortVO if I change the key-many-to-one to key-property.

Any clue?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 10, 2004 4:51 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And do you have persister for those VO ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Yeap
PostPosted: Wed Mar 10, 2004 9:39 pm 
Beginner
Beginner

Joined: Mon Sep 22, 2003 7:16 am
Posts: 25
And I believe the persistent classes mapping and declaration are correct as the application works before I added the <joined-subclass>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.