i have the error of :
ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
the mapping file is as below:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="model.MCode" table="m_code">
<id name="id" type="long" unsaved-value="null">
<column name= "ID"/>
<generator class="native" />
</id>
<property name="model" type="string">
<column name="MODEL" />
</property>
<property name="pattern" type="integer">
<column name="PATTERN" />
</property>
<property name="preLabel1" type="string">
<column name="PRELABEL1" />
</property>
<property name="preLabel2" type="string">
<column name="PRELABEL2" />
</property>
<property name="trailingZero" type="integer">
<column name="TRAILING_ZERO" />
</property>
<property name="sequenceNo" type="long">
<column name="SEQUENCE_NO" />
</property>
</class>
</hibernate-mapping>
part of the persistent class is as below:
Code:
public class MCode implements java.io.Serializable,TableData{
public long id;
public String model;
public int pattern;
public String preLabel1;
public String preLabel2;
public int trailingZero;
public long sequenceNo;
the DDL file is as below:
Code:
CREATE TABLE `m_code` (
`ID` bigint(20) NOT NULL auto_increment,
`MODEL` varchar(255) default NULL,
`PATTERN` int(11) default NULL,
`PRELABEL1` varchar(255) default NULL,
`PRELABEL2` varchar(255) default NULL,
`TRAILING_ZERO` int(11) default NULL,
`SEQUENCE_NO` bigint(20) default NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
;
can anyone help? thanks!!