Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi I am trying to delete all the records of Region. The mapping file is attached an also the Query through which I want to delet the records.
But Violation Exception is coming.
Read this:
http://hibernate.org/42.html
[<?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="kh.doc.ejb.impl.Region" table="REGION">
<composite-id>
<key-property name="id" column="REGION_ID"/>
<key-property name ="jobId" column ="J_ID"/>
</composite-id>
<property name ="entityState" column = "E_STATE"/>
<list name = "multiLanguageName" cascade="all">
<key>
<column name="REGION_ID"/>
<column name="J_ID"/>
</key>
<index column = "IND_COLUMN" type = "integer"/>
<composite-element class="kh.doc.ejb.impl.MultiLanguageName">
<property name ="longName" column ="LONG_NAME"/>
<property name ="shortName" column = "SHORT_NAME"/>
<property name ="languageId" column ="Language_ID"/>
</composite-element>
</list>
</class>
</hibernate-mapping>][ String deleteRegion = "delete Region b where b.jobId = :yentityState";
int x = mSession.createQuery(deleteRegion).setString("yentityState",jobId).executeUpdate();
][/code]