Hello,
I am getting this exception “org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update”
when I am trying to delete the row from db CHICKEN table.
My Java code is –
Chicken c = (Chicken) session.load(Chicken.class, id);
session.delete(c);
and this is my chicken.hbm.xml file –
<?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>
<!–
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
–>
<class name=”com.test.bus.domain.Chicken” table=”CHICKEN”>
<id name=”ID” column=”CHICKEN_ID”>
<generator class=”native”/>
</id>
<property name=”chickenName” type=”java.lang.String”>
<column name=”CHICKEN_NAME”/>
</property>
<bag name=”chickenEggAssoc” inverse=”true” cascade=”all-delete-orphan” lazy=”false”>
<key column=”CHICKEN_ID” />
<one-to-many class=”com.test.bus.domain.ChickenEggAssoc”/>
</bag>
</class>
</hibernate-mapping>