I have mapped a componenet as
Code:
<component name="coverSheet" class="com.lab.model.quote.CoverSheet">
<parent name="quoteRequest"/>
<component name="statusCode" class="com.lab.model.StatusCode">
<property name="code" column="status_code"/>
</component>
<property name="notes" column="notes"/>
<property name="lastStatusChangeTime" type="timestamp" column="last_status_change_time"/>
<property name="lastStatusCheckTime" type="timestamp" column="last_status_check_time"/>
<map name="actions" table="coversheets" lazy="true">
<key column="request_id"/>
<index column="action_id" type="com.lab.model.coversheet.actions.CoverSheetAction"/>
<composite-element class="com.lab.model.Change">
<many-to-one name="initiator" class="com.lab.model.employee.Employee" column="employee_id"/>
<property name="timeStamp" column="timestamp" type="timestamp"/>
</composite-element>
</map>
</component>
Initially the map actions has no entries in the table so hibernate sets it to null. When I create a new action, I check whether the map is null and if it is create a new HashMap. When hibenate persists the change it issues a delete before inserting the new entries. After that it works as expected.
My question - is there any way to stop the initial delete. It can't do any harm as there are no entries to delete but it still bothers me.
thank you