-->
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: Associations many to many with informations
PostPosted: Wed Apr 21, 2004 9:37 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Hi all,

I need some help, in my application I have some tables with many to many relationship.
Afetr many hours of work and research all works well, hibernate run as a mbean service in JBoss, I generate all xml and java files for my POJO's.

But now I have another problem...
I have a table CANDIDATES, another LANGUAGES and a relationship many to many LANGUAGE_CANDIDATE with the FK but in this table I have a field level and when I generate my POJOS I use the many to many and I don't generate the files for the table LANGUAGE_CANDIDATE so in my classes model I lose my field level.
I don't know which convention is used to implement this case.
So if someone can help me...

Thanks in advance.

If you need more detail ask me.

J


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 9:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/hib_docs/reference/html/components.html#components-s2-2


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 10:10 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
I'm sorry but I don't see how I can map my data in a component element...
If you have more details.
Thanks in advance

J


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 21, 2004 10:19 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Salut Jerome, c'est Anthony

<hibernate-mapping>
<class name="A" table="A">
<id column="xx" name="xx"><generator class="assigned"/></id>.
<bag name="bs" table="AB">
<key column="ID_A"/>
<composite-element class="AB">
<property name="extraInfoInAssociationTable" /> <many-to-one column="FK column" name="b" class="B"/>
</composite-element>
</bag>
</class>
</hibernate-mapping>

you need to map your association table since it holds extra data.


Anthony


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.