Hi,
I'm try to do a simple query when i run the query the hibernate show me the error :
Was altered from 1 to 0
Caused by: org.hibernate.HibernateException: identifier of an instance of br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl was altered from 1 to 0
Some one know what happend and can help me ?
[]s
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3
Mapping documents:
Code:
<?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>
<!--
Created by the Middlegen Hibernate plugin 2.2
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl"
table="tbusuario"
lazy="false"
schema="dbteste"
>
<id
name="cdUsuario"
type="java.lang.Integer"
column="CdUsuario"
>
<generator class="increment" />
</id>
<property
name="nmUsuario"
type="java.lang.String"
column="NmUsuario"
length="100"
/>
<!-- Associations -->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
Query query = session.createQuery("from VUsuarioImpl o");
return query.list();
Full stack trace of any exception that occurs:Code:
org.hibernate.HibernateException: identifier of an instance of br.com.bvsistemas.servicoteste.integracao.impl.VUsuarioImpl was altered from 1 to 0
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:58)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
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:993)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
... 28 more
Name and version of the database you are using:MySql 3
The generated SQL (show_sql=true):Code:
16:49:50,921 INFO [STDOUT] Hibernate: select vusuarioim0_.CdUsuario as CdUsuario64_, vusuarioim0_.NmUsuario as NmUsuario64_ from dbteste.tbusuario vusuarioim0_
[/code]