-->
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: Aide sur les mappins
PostPosted: Wed Jun 28, 2006 11:37 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Bonjour à tous, j'ai besoin de conseils sur la manière de mapper deux classes, celà ressemble à l'exemple père fils mais avec en plus la notions de grand père :)

Voici mes tables
T_NOTIFICATION_CASE(CASE_ID en PK)
T_LINKED_CASE(ID en PK, PARENT_ID FK sur CASE_ID, CHILD_ID FK sur CASE_ID).
Je me retourne un peu le cerveau pour mapper celà de manière naturelle mais j'ai toujours le même soucis je récupère pourun cas précis sa liste de LINKED_CASE correspondant au child soit au cas courant mais pas les cas parents.
Merci d avance pour votre aide.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 30, 2006 11:04 am 
Newbie

Joined: Wed Jun 28, 2006 5:29 pm
Posts: 8
Est-ce que tu as essayé de modéliser ainsi (attention il ne s'agit pas d'un mapping testé juste pour donner l'idée générale?

Code:
<class name="Notification>
<id column="case_id" >
   <generator class="native"/>
</id>

<set name="childs" table="T_LINKED_CASE">
   <key column="CHILD_ID"/>
   <many-to-many column="PARENT_ID" unique="true" class="Notification"/>
</set>

<set name="parents" table="T_LINKED_CASE">
  <key column="PARENT_ID"/>
   <many-to-many column="CHILD_ID" unique="true" class="Notification"/>
</set>

</class>


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.