Salut,
en faite j arrive pas a comprendre pourquoi ma sauvgarde en cascade se passe bien quand l objet a sauvgarder à comme attribut un Set dont le type est un objet mapper avec une table a cle premiere unique
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
 
<?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.sbpm.modele">
	<class name="Clients" table="CLIENTS">
		<id
			column="NUMCLIENT"
			name="NUMCLIENT"
			type="integer"
		>
			<generator class="vm" />
		</id>
		<property
			column="NOMCLIENT"
			length="60"
			name="NOMCLIENT"
			not-null="false"
			type="string"
		 />
 
		<set inverse="true" name="CONTACTSSet" cascade="all-delete-orphan">
			<key column="NUMENTREPRISE" />
			<one-to-many class="Contacts" />
		</set>
 
	</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
25
26
27
28
29
30
31
32
 
<?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.sbpm.modele">
	<class name="Contacts" table="CONTACTS">
		<id
			column="NUMCONTACT"
			name="Numcontact"
			type="integer"
		>
			<generator class="vm" />
		</id>
		<property
			column="NOMCONTACT"
			length="40"
			name="Nomcontact"
			not-null="false"
			type="string"
		 />
		<many-to-one
			class="Clients"
			name="NUMCLIENT"
			not-null="true"
		>
			<column name="NUMCLIENT" />
		</many-to-one>
 
	</class>
</hibernate-mapping>
et se passe mal l objet a sauvgarder à comme attribut un Set dont le type est un objet mapper avec une table a cle premiere compose

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
 
<?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.sbpm.modele">
	<class name="Collaborateurs" table="COLLABORATEURS">
		<id
			column="NUMCOLLABO"
			name="Numcollabo"
			type="integer"
		>
			<generator class="vm" />
		</id>
		<property
			column="NOM"
			length="40"
			name="Nom"
			not-null="false"
			type="string"
		 />
		<set inverse="true" name="COLLABOLANGUESet" cascade="all-delete-orphan">
			<key column="NUMCOLLABO" />
			<one-to-many class="Collabolangue" />
		</set>
	</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
25
26
27
28
 
<?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.sbpm.modele">
	<class name="Langues" table="LANGUES">
		<id
			column="NUMLANGUE"
			name="Numlangue"
			type="integer"
		>
			<generator class="vm" />
		</id>
		<property
			column="NOMLANGUE"
			length="50"
			name="Nomlangue"
			not-null="false"
			type="string"
		 />
		<set inverse="true" name="COLLABOLANGUESet">
			<key column="NUMLANGUE" />
			<one-to-many class="Collabolangue" />
		</set>
	</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
 
public abstract class Collabolangue  implements Serializable {
 
	public static String PROP_ID = "Id";
	public static String PROP_NIVEAU = "Niveau";
 
 
	private int hashCode = Integer.MIN_VALUE;
 
	// primary key
	private com.sbpm.modele.COLLABOLANGUEPK _id;
 
	// fields
	private java.lang.String _niveau;
 
     //CONSTRUCTOR
}
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
 
public class COLLABOLANGUEPK extends BaseCOLLABOLANGUEPK {
 
/*[CONSTRUCTOR MARKER BEGIN]*/
	public COLLABOLANGUEPK () {}
 
	public COLLABOLANGUEPK (
		com.sbpm.modele.Langues _numlangue,
		com.sbpm.modele.Collaborateurs _numcollabo) {
 
		super (
		_numlangue,
		_numcollabo);
	}
/*[CONSTRUCTOR MARKER END]*/
}