Bonjour à tous,
j'utilise JSF, Spring, hibernate, richfaces ...
Je pense que mon probleme est au niveau du mapping des tables:
J'ai trois tables (tbl_Outillage, tbl_Automobile, tbl_Accessoire) qui sont mappés de la manniere suivante:
tbl_Outillage:
tbl_Automobile:
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 name="Outillage" table="TBL_OUTILLAGE" dynamic-update="false" dynamic-insert ="false"> <id name="numeroNomenclature" column="NUMERO_NOMENCLATURE" type="java.lang.String"/> <property name="designation" column="DESIGNATION" type="java.lang.String"/> <property name="numeroSerie" column="NUMERO_SERIE" type="java.lang.String"/> <property name="type" column="TYPE" type="java.lang.String"/> <property name="classificationTechnique" column="CLASSIFICATION_TECHNIQUE" type="java.lang.String"/> <property name="statut" column="STATUT" type="java.lang.String"/> <property name="dateFabrication" column="DATE_FABRICATION" type="java.util.Calendar"/> <property name="dateReception" column="DATE_RECEPTION" type="java.util.Calendar"/> <many-to-one name="paysFabrication" class="winservices.dirmat.sidmat.model.administration.Pays" column="PAYS_CODE" /> <many-to-one name="model" class="winservices.dirmat.sidmat.model.administration.Model" column="REFERENCE_MODEL" /> <bag name="accessoires" cascade="persist,save-update" lazy ="true"> <key column="NUMERO_NOMENCLATURE_OUTIL" /> <one-to-many class="Accessoire" /> </bag> <bag name="elementsOutillage" cascade="persist,save-update" lazy ="true"> <key column="NUMERO_NOMENCLATURE_OUTIL" /> <one-to-many class="Accessoire" /> </bag> </class>
tbl_Accessoire:
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 <class name="Automobile" table="TBL_AUTOMOBILE" dynamic-update="false" dynamic-insert ="false"> <id name="numeroNomenclature" column="NUMERO_NOMENCLATURE" type="java.lang.String"/> <property name="numeroChassis" column="NUMERO_CHASSIS" type="java.lang.String"/> <property name="numeroImmatriculation" column="NUMERO_IMMATRICULATION" type="java.lang.String"/> <property name="typeCarosserie" column="TYPE_CAROSSERIE" type="java.lang.String"/> <property name="energie" column="ENERGIE" type="java.lang.String"/> <property name="nombreCylindre" column="NOMBRE_CYLINDRE" type="java.lang.Integer"/> <property name="puissance" column="PUISSANCE" type="java.lang.String"/> <property name="dateMiseEnCirculation" column="DATE_MISE_CIRCULATION" type="java.util.Calendar"/> <property name="statut" column="STATUT" type="java.lang.String"/> <property name="classificationTechnique" column="CLASSIFICATION_TECHNIQUE" type="java.lang.String"/> <property name="dateFabrication" column="DATE_FABRICATION" type="java.util.Calendar"/> <property name="dateReception" column="DATE_RECEPTION" type="java.util.Calendar"/> <many-to-one name="paysFabrication" class="winservices.dirmat.sidmat.model.administration.Pays" column="PAYS_CODE" /> <many-to-one name="model" class="winservices.dirmat.sidmat.model.administration.Model" column="REFERENCE_MODEL" /> <many-to-one name="formation" class="winservices.dirmat.sidmat.model.materiel.FormationMilitaire" column="FORMATION_ID" /> <bag name="accessoires" cascade="persist,save-update" lazy ="true"> <key column="NUMERO_NOMENCLATURE_AUTO" /> <one-to-many class="Accessoire" /> </bag> </class>
maintenant quand je fais une insertion d'objet Automobile, l'operation marche bien avec ces accessoires référencés par le NUMERO_NOMENCLATURE_AUTO (la reference de l'objet Automobile dans la table tbl_Accessoire)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <class name="Accessoire" table="TBL_ACCESSOIRE" dynamic-update="false" dynamic-insert ="false"> <id name="numeroNomenclature" column="NUMERO_NOMENCLATURE" type="java.lang.String"/> <property name="designation" column="DESIGNATION" type="java.lang.String"/> <property name="quantite" column="QUANTITE" /> <property name="especeUnite" column="ESPECE_UNITE" type="java.lang.String"/> </class>
Par contre, quant je fais une insertion d'objet Outillage, je tombe sur cette erreur:
Est ce quelqu'un peut me débloquer la situation, please
Merci d'avance,




Répondre avec citation






Partager