bonsoir,
J'utilise hibernateet j'ai besoin dans une fonction de modifier la clé primaire d'un enregistrement dans ma table.
mon fichierde mapping est le suivant:
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
| <?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.intendance.dao">
<class name="Reception"
table="reception">
<id
name="Id"
type="java.lang.Long"
column="id_reception"
>
<generator class="assigned"/>
</id>
<property
name="dateReception"
column="date_reception"
type="date"
not-null="true"
length="13"
/>
<many-to-one name="IdCommande"
column="id_commande"
not-null="true"
class="Commande"/>
<many-to-one name="IdResponsable"
column="id_responsable"
not-null="true"
class="Responsable"/>
</class>
</hibernate-mapping> |
sachant que lorsque je modifie directement la clé primaire d'un enregistrement dans la table (sous postgresql) tout marche bien.
Mais quand je le fais a partir d'hibernate j'obtiens l'exception suivante:
javax.faces.el.EvaluationException: net.sf.hibernate.HibernateException: identifier of an instance of com.intendance.dao.Reception altered from 2 to 1
Partager