-->
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.  [ 1 post ] 
Author Message
 Post subject: Many-to-Many association mapping fails
PostPosted: Fri Nov 17, 2006 5:39 am 
Newbie

Joined: Tue Nov 07, 2006 7:13 am
Posts: 9
Location: Barcelona
Hi there,

I have two classes in java that have a relation of many-to-many. These two classes correspond to two tables in a MySQL database and I'm using what I regard as a join table that keeps pairs of the primary keys of these tables:

create join_table( int tableone,
int tabletwo,
foreign key stuff,
primary key(tableone,tabletwo);


Thing is that I follow the example from the hibernate documentation (section 7.5.3 many to many) but it keeps reporting :

Association references unmapped class

The names of these tables are RegistreEvents and DadesPersonals and EventsComunicats as the join table. The following is the stuff I added to RegistreEvents and DadesPersonals mapping files:

RegistreEvents:
<set name="toWhom" table="EventsComunicats">
<key column="eventId" />
<many-to-many column="toPersona" class="DadesPersonals" />
</set>
DadesPersonals:
<set name="repEvent" table="EventsComunicats" inverse="true">
<key column="toPersona" />
<many-to-many column="eventId" class="RegistreEvents" />
</set>

Helping to understand me:

name = class attribute
key column = join table attribute
many-to-many column = join table attribute


Does anyone know what is what I'm doing wrong?

Many thanks to all of you in advance,

Blai[/u]

_________________
Veles e vents han mos desig complir faent camins dubtosos per la mar.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.