Bonjour, après avoir passé deux jours a chercher je n'ai trouver aucune explication a mon problème :

J'ai un ensemble de tables... le problème viens des association je présume :

voila mes fichiers de mapping mais qui ne marchent pas :

mapping A.hbm.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
<!--  CLASS CATEGORISATION ENTREPRISE -->
    <class name="package.name.Categorisationentreprise" table="categorisationentreprise" schema="public">
<!--  PK  -->
        <id name="categorisationentrepriseId" type="int">
            <column name="categorisationentreprise_id" />
            <generator class="assigned" />
        </id>
<!--  REFERENCES  -->
        <many-to-one name="entreprise" class="package.name.Entreprise" fetch="select" >
			<column name="entreprisedonneesgestion_id" not-null="true" /> 
        </many-to-one>
 
 
<!--simple properties-->
        <property name="nom" type="short">
            <column name="nom" not-null="true" />
        </property>
        <property name="sigle" type="short">
            <column name="sigle" not-null="true" />
        </property>
    </class>
</hibernate-mapping>

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
<!-- CLASS ENTREPRISE   -->
    <class name="package.name.Entreprise" table="entreprise" schema="public">
<!-- PK  -->
        <composite-id name="id" class="package.name.EntrepriseId">
            <key-property name="acteurObjetId" type="int">
                <column name="acteur_objet_id" />
            </key-property>
            <key-property name="objetId" type="int">
                <column name="objet_id" />
            </key-property>
        </composite-id>
 
<!-- REFERENCES  -->
 
....
        <set name="categorisationentreprises" inverse="true">
            <key>
                <column name="entreprisedonneesgestion_id" not-null="true" />
            </key>
            <one-to-many class="package.name.Categorisationentreprise" /> 
        </set>
....
    </class>
J'ai toujours ce message :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
Caused by: org.hibernate.MappingException: Foreign key (FKC2D2CE6B2A3B6F15:categorisationentreprise [entreprisedonneesgestion_id])) must have same number of columns as the referenced primary key (entreprise [acteur_objet_id,objet_id])
Je cherche l'erreur mais j'ai aucune idée sachant que je suis nouveau dans le monde Hibernate

Merci