-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbm2java issue
PostPosted: Mon Apr 10, 2006 12:51 pm 
Newbie

Joined: Mon Apr 10, 2006 12:45 pm
Posts: 4
Hibernate version: 3

Mapping documents:

I am getting the following message when I try to generate my java using my mapping documents:

org.hibernate.MappingException: An association from the table EMAIL_REROUTE_EMPLOYEES refers to an unmapped class: com.encana.admin.common.model.mcdas.McDasPerson

Here is my mapping document:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="com.encana.admin.courierlog.model.EmailRerouteEmployee"
table="EMAIL_REROUTE_EMPLOYEES">
<meta attribute="class-description">
Upon the receipt of a package from a courier, the consignee is
normally notify. In the case that they have requested not to
be notified at all, or to have another individual notified on their
behalf, a/numerous records will be returned from this table.
@author Graham Heath
</meta>

<id
name="id"
type="java.lang.Integer"
column="EMAIL_REROUTE_ID"
length="6">
<meta attribute="scope-set">protected</meta>
<generator class="native"></generator>
</id>

<property
name="consigneeEmplId"
type="java.lang.String"
column="CONSIGNEE_EMPLID"
not-null="true"
length="12">
<meta attribute="field-description">EnCana employee id of the person to whom
a package is addressed.
</meta>
</property>

<property
name="routingType"
type="java.lang.String">
<meta attribute="field-description">Courier's name.</meta>
<column name="ROUTING_TYPE" length="20" not-null="true"/>
</property>

<property
name="reroutedEmplId"
type="java.lang.String"
column="REROUTED_EMPLID"
not-null="false"
length="12">
<meta attribute="field-description">EnCana employee id of the person to whom
a package notification is sent.
</meta>
</property>

<many-to-one
name="consignee"
class="com.encana.admin.common.model.mcdas.McDasPerson"
cascade="none"
outer-join="auto"
column="CONSIGNEE_EMPLID" />

<many-to-one
name="reroutedEmployee"
class="com.encana.admin.common.model.mcdas.McDasPerson"
cascade="none"
outer-join="auto"
column="REROUTED_EMPLID" />

</class>
</hibernate-mapping>


Here is my hibernate.cfg.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>

<property name="connection.provider_class">com.encana.admin.common.db.hib3.HibernateConnectionProvider</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>

<mapping resource="com/encana/admin/common/model/mcdas/McDasPerson.hbm.xml"/>
<mapping resource="com/encana/admin/courierlog/model/IncomingLog.hbm.xml"/>

</session-factory >

</hibernate-configuration>

Not sure what the issue is. Help would be deeply appreciated.

Thanks,

Graham


Top
 Profile  
 
 Post subject: Couple of questions:
PostPosted: Mon Apr 10, 2006 3:25 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Does McDasPerson.hbm.xml file is available at runtime in the specified location?
Does the McDasPerson.hbm.xml file contains mapping for the class:com.encana.admin.common.model.mcdas.McDasPerson ?

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 4:29 pm 
Newbie

Joined: Mon Apr 10, 2006 12:45 pm
Posts: 4
The McDasPerson.hbm.xml file is sitting inside of a jar on my class path.

Would that effect it?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 5:08 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
No it should not if it is in the specified path: com/encana/admin/common/model/mcdas/
within that jar and no other empty com/encana/admin/common/model/mcdas/McDasPerson.hbm.xml resource can be found in that classpath before entry in your jar.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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