Bonjour,
J'ai un soucis concernant mes fichiers de mapping (reprise d'une application).
J'ai 3 tables : Utilisateur, Profil et CFA.
Un utilisateur n'a qu'un seul profil et CFA, et un profil et un CFA ont n utilisateur.
Dans mon fichier de mapping, je déclare en property mes champs CODE_PROFIL et CODE_CFA, mais aussi à la fin en many to one.
Le fichier de mapping d'utilisateur
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
 
<hibernate-mapping package="com.bull.crnpc.hibernate">
	<class name="TeUtilisateur" table="TE_UTILISATEUR">
		<id
			column="CODE_UTILISATEUR"
			name="CodeUtilisateur"
			type="string"
		>
			<generator class="assigned" />
		</id>
		<property
			column="CODE_CFA"
			length="11"
			name="CodeCfa"
			not-null="true"
			type="integer"
		 />
		<property
			column="MOT_PASSE"
			length="15"
			name="MotPasse"
			not-null="false"
			type="string"
		 />
		<property
			column="TEL_UTIL"
			length="14"
			name="TelUtil"
			not-null="false"
			type="string"
		 />
		<property
			column="E_MAIL_UTIL"
			length="200"
			name="EMailUtil"
			not-null="false"
			type="string"
		 />
		<property
			column="PRENOM_UTIL"
			length="30"
			name="PrenomUtil"
			not-null="false"
			type="string"
		 />
		<property
			column="CODE_ANTENNE"
			length="11"
			name="CodeAntenne"
			not-null="true"
			type="integer"
		 />
		<property
			column="CODE_PROFIL"
			length="10"
			name="CodeProfil"
			not-null="false"
			type="string"
		 />
		<property
			column="TITRE_UTIL"
			length="6"
			name="TitreUtil"
			not-null="false"
			type="java.lang.Short"
		 />
		<property
			column="LOGIN"
			length="15"
			name="Login"
			not-null="false"
			type="string"
		 />
		<property
			column="NOM_UTILISATEUR"
			length="30"
			name="NomUtilisateur"
			not-null="false"
			type="string"
		 />
 
	<many-to-one name="utilisateurProfil" insert="false" update="false" class="com.bull.crnpc.hibernate.TeProfilUtil" column="CODE_PROFIL"/>
 
	<many-to-one name="utilisateurCfa" insert="false" update="false" class="com.bull.crnpc.hibernate.TeCfa" column="CODE_CFA" not-null="false"/>
 
	</class>
</hibernate-mapping>
Je me demande si l'un n'est pas en trop, en l'occurence le property.

Merci de vos réponses.