-->
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.  [ 5 posts ] 
Author Message
 Post subject: An association from the table...refers to an unmapped class:
PostPosted: Fri Apr 23, 2004 1:56 am 
Beginner
Beginner

Joined: Thu Mar 25, 2004 9:13 am
Posts: 20
I am using Hibernate 2.1, MS-SQL and many-to-many mapping.
This is one XML file
Code:
<hibernate-mapping>
    <class name="com.snap.businessobjects.network.Network" table="SSN_NETWORKS">
...
        <set name="members" table="SSN_NETWORK_MEMBERS">
            <key column="NME_NET_ID"/>
            <many-to-many column="MEM_ID" class="com.snap.businessobjects.member.Member"/>
        </set>
    </class>
</hibernate-mapping>

This is the one that the former refers to...
Code:
<hibernate-mapping>
    <class name="com.snap.businessobjects.member.Member" table="SSN_MEMBERS">
...
    </class>
</hibernate-mapping>

When I try to instanciate an instance of com.snap.businessobjects.network.Network (the first) get the following exception:
Code:
net.sf.hibernate.MappingException: An association from the table SSN_NETWORK_MEMBERS refers to an unmapped class: com.snap.businessobjects.member.Member
   at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:643)
   at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:743)


Please help, I am tried to deal with this for too long now...
TIA Oren

_________________
Oren Gross


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 4:28 am 
Beginner
Beginner

Joined: Tue Apr 20, 2004 12:07 pm
Posts: 21
Did you include the mapping resource of the Member class in hibernate.cfg.xml?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 4:51 am 
Beginner
Beginner

Joined: Thu Mar 25, 2004 9:13 am
Posts: 20
No, since I was using a property file. Than going through the documentation I saw that in the XML version you might do tah:
Code:
        <mapping resource="eg/Edge.hbm.xml"/>
        <mapping resource="eg/Vertex.hbm.xml"/>

So, I decided to swith to the XML file only I can't seem to have it working... I am using Jboss, hence my application has a 'war' file, and so I had tried to put the XML in WEB-INF.... the Hibernate doesn't find it.

1. Any idea?
2. Can I specify mapping in propeties file?

TIA Oren

_________________
Oren Gross


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 7:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
put it where you had your properties file before.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 2:28 pm 
Beginner
Beginner

Joined: Thu Mar 25, 2004 9:13 am
Posts: 20
So to wrap this up, in order to solve this I had to do two things (I don't know if this is the only way but it definitely worked):
Use hibernate.cfg.xml instead of

_________________
Oren Gross


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