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: Mapping pour une arborescence
PostPosted: Thu May 18, 2006 11:48 am 
Newbie

Joined: Fri May 05, 2006 9:58 am
Posts: 9
Location: Rennes
Bonjour,

Je chercher à réaliser un fichier de mapping pour ma classe Dossier. Sachant qu'un dossier peut en contenir d'autres, il y a un Set de sous-dossiers.

Dans ma classe Dossier:

Code:
/**
     * @hibernate.set cascade="all"
     * @hibernate.collection-key column="ID_DOSSIER"
     * @hibernate.collection-one-to-many class="Dossier"
     */
    public Set getSousDossiers() {
        return sousDossiers;
    }


Avec ce code, j'ai une exception avec la cause suivante :

Code:
Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation message from server: "Duplicate entry '1' for key 1"


Comment ajouter un champ dans la table, qui correspondrait à la clé primaire du dossier parent ?

Merci d'avance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 18, 2006 12:05 pm 
Newbie

Joined: Fri May 05, 2006 9:58 am
Posts: 9
Location: Rennes
En écrivant

Code:
@hibernate.collection-key column="ID_DOSSIER_PARENT"


par exemple...


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.