Hi ,
I have problem with Master--Child tables.
Whenever I search for something every time hibernate validate from master table whether records exists or not.
What is procedure to skip the validation for my specific page .... let this validation exist for other pages.
For example ASSOCIATE_CATEGORY table is the child for DOC_MASTER table.
whenever I search records for ASSOCIATE_CATEGORY it always validate from DOC_MASTER .This is very tedious and taking more time . can any one help me .
Below are the hbm.xml s
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>
<class name="com.reflexis.dr.beans.data.AssociateCategoryBean" table="ASSOCIATE_CATEGORY" >
<id name="serial" column="SERIAL" type="long">
<generator class="org.hibernate.id.MultipleHiLoPerTableGenerator">
<param name="table">uid_table</param>
<param name="primary_key_column">idkey_column</param>
<param name="value_column">next_value</param>
<param name="primary_key_value">SERIALASSOC_IDS</param>
<param name="primary_key_length">40</param>
<param name="max_lo">0</param>
</generator>
</id>
<property
name="ownerId"
column="OWNER_ID"
type="long"
length="10"
/>
<property
name="clientId"
column="CLIENT_ID"
type="string"
length="16"
/>
<many-to-one name="document" column="DOC_ID"
class="com.reflexis.dr.beans.data.DocumentBean"/>
<many-to-one name="category" column="DOC_CATEGORY"
class="com.reflexis.dr.beans.data.CategoryBean"/>
<!-- <property
name="docId"
column="DOC_ID"
type="java.lang.long"
length="38"
/>
<property
name="docCategory"
column="DOC_CATEGORY"
type="java.lang.long"
length="38"
/> -->
<property
name="userFld1"
column="USER_FLD1"
type="string"
length="1"
/>
<property
name="userFld2"
column="USER_FLD2"
type="string"
length="1"
/>
<property
name="userFld3"
column="USER_FLD3"
type="string"
length="1"
/>
<property
name="userFld4"
column="USER_FLD4"
type="string"
length="1"
/>
<property
name="userFld5"
column="USER_FLD5"
type="string"
length="1"
/>
<property
name="lastUser"
column="LAST_USER"
type="string"
length="20"
/>
<property
name="lastUpdateTime"
column="LAST_UPDATE_TIME"
type="timestamp"
/>
</class>
</hibernate-mapping>
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>
<class name="com.reflexis.dr.beans.data.DocumentBean" optimistic-lock="version"
table="DOC_MASTER" lazy="false">
<id name="docId" column="DOC_ID" type="long">
<generator class="org.hibernate.id.MultipleHiLoPerTableGenerator">
<param name="table">uid_table</param>
<param name="primary_key_column">idkey_column</param>
<param name="value_column">next_value</param>
<param name="primary_key_value">DOCUMENT_IDS</param>
<param name="primary_key_length">40</param>
<param name="max_lo">0</param>
</generator>
</id>
<!-- Column used for Optimistic locking -->
<version name="version" column="REC_VERSION" type="long"/>
<property name="ownerId" column="OWNER_ID" type="long" not-null="true"/>
<property name="clientId" column="CLIENT_ID" type="string" length="16" />
<property name="title" column="DOC_TITLE" type="string" length="80" />
<property name="reference" column="DOC_REFERENCE" type="string" length="30" />
<property name="excerpt" column="DOC_DESCRIPTION" type="string" length="255"/>
<property name="author" column="DOC_AUTHOR" type="string" length="40"/>
<property name="authorPhone" column="DOC_AUTHOR_PHONE" type="string" length="50"/>
<property name="keywords" column="DOC_KEYWORDS" type="string" length="257"/>
<many-to-one name="category" column="DOC_CATEGORY"
class="com.reflexis.dr.beans.data.CategoryBean"/>
<property name="revision" column="DOC_REVISION" type="integer" not-null="true"/>
<property name="size" column="DOC_SIZE" type="long"/>
<many-to-one name="sensitivity" column="DOC_SENSITIVITY"
class="com.reflexis.dr.beans.data.SensitivityBean"/>
<property name="docVersion" column="DOC_VERSION" type="string" length="50"/>
<property name="extension" column="DOC_EXTENSION" type="string" length="10"/>
<property name="fileName" column="ORIGINAL_FILE" type="string" length="255"/>
<property name="checkedOut" column="IS_CHECKEDOUT" type="character" length="1" />
<property name="freezed" column="IS_FREEZED" type="character" length="1" />
<property name="notes" column="DOC_NOTES" type="string" length="255"/>
<property name="updatedOn" column="DOC_UPDATED_ON" type="date"/>
<property name="UploadedBy" column="UPLOADED_BY" type="string" length="20"/>
<property name="UploadedOn" column="UPLOADED_ON" type="timestamp"/>
<property name="lastUser" column="LAST_USER" type="string" length="20" />
<property name="lastUpdated" column="LAST_UPDATED" type="timestamp"/>
<property name="checkOutNotes" column="CHECKOUT_NOTES" type="string" length="255"/>
<property name="status" column="STATUS" type="string" length="1"/>
<!-- Associations -->
<set name="history" inverse="true" lazy="false" cascade="all,delete-orphan"
order-by="DOC_REVISION desc">
<key column="DOC_ID"/>
<one-to-many class="com.reflexis.dr.beans.data.DocumentHistoryBean"/>
</set>
<set name="stores" inverse="true" lazy="false" cascade="all,delete-orphan" order-by="UNIT_SKEY asc">
<key column="DOCUMENT_ID"/>
<one-to-many class="com.reflexis.dr.beans.data.DocStoresBean"/>
</set>
</class>
</hibernate-mapping>
Regards,
Lakshmikanth.