-->
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: Association bidirectionnelle récursive ???
PostPosted: Thu Apr 10, 2008 3:38 am 
Newbie

Joined: Wed Apr 09, 2008 10:12 am
Posts: 1
Bonjour tout le monde! J'ai un petit soucis de compréhension sur l'établissement d'association récursives bidirectionnelles.

Tables:
Entite (id_entite, champ1, champ2)
Liaisons (id_liaison, id_entite1, id_entite2)

Je lie des entités entres elles sachant qu'une entité peut être connectée à plusieurs entités.

J'ai du mal à comprendre comment récupérer une collection d'entité dans le bean correspondant à la table entité. Voici un premier jet qui ne fonctionne pas:

Hibernate version: 3

Mapping documents:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="com.inetpsa.kor.hibernate.test.bean.mapping">
   <class name="Entite" table="ENTITE">
      <meta attribute="sync-DAO">false</meta>
      
      <id name="id" type="integer" column="ID_ENTITE">
         <generator class="increment"/>
      </id>

      <property name="champ1" column="CHAMP1" type="string" not-null="true" length="50"/>
      <property name="champ2" column="CHAMP2" type="string" not-null="true" length="50"/>
      <list name="liaisons" table="LIAISONS">
         <key column="ID_ENTITE1"/>
         <list-index column="ID_LIAISON"/>
                   <many-to-many column="ID_ENTITE2" class="Entite"/>
      </list>
   </class>   
</hibernate-mapping>


Comme vous l'avez remarqué j'ai rien compris dans la doc à comment faire un association bidirectionnelle récursive... Need Help!

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 4:20 pm 
Beginner
Beginner

Joined: Thu Jan 31, 2008 6:35 am
Posts: 27
Salut,

Juste une question, c'est bien une relation N-N bidirectionnelles que tu veux faire ? Elle est ordonnée ou non ?


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.