Bonjour à tous,

avez déjà rencontré l'exception :
org.hibernate.HibernateException: identifier of an instance of dao.type_activite.TypeActivite was altered from ac3 to ac7
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:58)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:164)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at dao.type_activite.ITypeActiviteImpl.updateTypeToTypeU(ITypeActiviteImpl.java:57)
at dao.test.TestJUnit.testUpdateTypeToTypeU(TestJUnit.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
Si c'est le cas, alors il se peut que vous ayez une solution pour mon problème.

J'obtiens cette exception quand j'essaie d'effectuer une mofif sur un objet dont voici l emapping :

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="dao.type_activite.TypeActivite" table="TYPE_ACTIVITE">
<id name="typeAct" column="TYPEACT">
<generator class="assigned"/>
</id>

<property name="libelleTypeAct" column="LIBELLE"/>

</class>

</hibernate-mapping>
et dont voici le pojo :

package dao.type_activite;

import dao.type_activite_unilog.*;

public class TypeActivite {

private String typeAct;
private String libelleTypeAct;



public TypeActivite(){

}

public TypeActivite(String typeAct, String libelleTypeAct) {
super();
this.typeAct = typeAct;
this.libelleTypeAct = libelleTypeAct;
}


public String getTypeAct() {
return typeAct;
}
public void setTypeAct(String typeAct) {
this.typeAct = typeAct;
}
public String getLibelleTypeAct() {
return libelleTypeAct;
}
public void setLibelleTypeAct(String libelleTypeAct) {
this.libelleTypeAct = libelleTypeAct;
}


}
Le dode de la modif contient simplement un set pour modifier le champ "TypeAct' ...

Je n'arrive pas à resoudre ce prob qui pourtant parait si simple...

Toute aide sera la bienvenu

Merci d'avance !