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?