-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapper une classe composite.
PostPosted: Mon Mar 17, 2008 5:56 pm 
Newbie

Joined: Mon Mar 17, 2008 4:47 pm
Posts: 1
Bonjour,

Je souhaiterais savoir comment mapper au mieux le cas suivant:

J'ai une classe "Article", qui est possède une association "un à un" vers l'article qui le précède (d'un point de vue métier) et une autre vers l'article qui le suit.

Autrement dit, il s'agit d'un objet ayant 2 références vers 2 autres objets de même type, et donc de la même table (Composite).

Comment mapper ces 2 relations sans avoir un StackOverFlowError?

Merci pour votre aide.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 5:54 am 
Beginner
Beginner

Joined: Thu Jan 31, 2008 6:35 am
Posts: 27
C'est tres simple, tu ajoutes une relation vers toi meme avec une foreignKey
Code:
<bag name="prev">
<key>
<column name="ARTICLE_PREV_KEY"/>
</key>
<one-to-many class="Article"/>
</bag>

Attention aux relations 1-1 en hibernate, utilises le one-to-many.


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