-->
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: An association from the table refers to an unmapped class
PostPosted: Tue Jan 17, 2006 9:28 am 
Beginner
Beginner

Joined: Fri Jan 13, 2006 8:07 am
Posts: 29
Hi,

Now am trying with many-to-many mapping. I am getting an exception

org.hibernate.MappingException: An association from the table PERSON_EVENT refers to an unmapped class: events.EVENT

Here is my 3 xml files :

<hibernate-mapping>
<class name="events.Person" table="PERSON">
<id name="id" column="PERSON_ID" >
<generator class="increment"/>
</id>
<property name="age"/>
<property name="firstName"/>
<property name="lastName"/>

<set name="events" table="PERSON_EVENT">
<key column="PERSON_ID"/>
<many-to-many column="EVENT_ID" class="events.EVENT">
</many-to-many>
</set>
</class>
</hibernate-mapping>
-------------------------------------------------------------------------------
<hibernate-mapping>
<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID" >
<generator class="increment"/>
</id>
<property name="dt" type="timestamp" column="EVENT_DATE"/>
<property name="title" column="TITLE"/>
</class>
</hibernate-mapping>
-----------------------------------------------------------------------------------
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.17.8.52:1521:IFHT03</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<!--property name="hibernate.connection.datasource"> java:comp/env/jdbc/HibAppDS</property-->
<property name="hibernate.connection.username">daweb_user</property>
<property name="hibernate.connection.password">daweb_user</property>
<property name="hibernate.connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<!--property name="hibernate.hbm2ddl.auto">select</property-->
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="current_session_context_class">thread</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory
</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider
</property>

<mapping resource="events/Event.hbm.xml"/>
<mapping resource="events/Person.hbm.xml"/>

</session-factory>
</hibernate-configuration>
-------------------------------------------------------------------------------

Anybody see an error on these ? Please


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 9:36 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:52 am
Posts: 52
Location: Zurich
Quote:
<many-to-many column="EVENT_ID" class="events.EVENT">

should say
<many-to-many column="EVENT_ID" class="events.Event"

Urs


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 11:51 am 
Beginner
Beginner

Joined: Fri Jan 13, 2006 8:07 am
Posts: 29
Yes, that worked. Thank you very much.

Silly me !!


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.