I have parent - child relationship of one-to-one type
parent class hbm.xml Pipeline_Facility_Id_Seq
<many-to-one name="pipelineData" class="com.db.loud.dto.gctpipeline.PipelineData" column="LOAN_ID" not-null="true"/>
<one-to-one name="shippingFacilityAsset" class="xxx.ShippingFacilityAsset" cascade="all"/>
Child hbm.xml
<class name="com.db.loud.dto.gctpipeline.ShippingFacilityAsset" table="Shipping_Facility_Asset" >
<id name="facilityId" type="long">
<column name="FACILITY_ID" not-null="true" sql-type="NUMBER" />
<generator class="foreign">
<param name="property">pipelineFacility</param>
</generator>
</id>
<one-to-one name="pipelineFacility" class="com.db.loud.dto.gctpipeline.PipelineFacility" constrained="true"/>
Now while Updating it throwing error "BL error: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1"
as it does not find the row in child to update which is true. So the error is expected.
This is business case where we may be updating object where child object is not present in table?
How do I resolve it?
I need to Insert child entity + Update parent entity where parent record is already present in main table and child record is missing from child table.