|
|
Re: Delete operation calling update statement to make foreign key field to null [message #1863295 is a reply to message #1863288] |
Wed, 24 January 2024 11:16 |
Sanjana C Messages: 31 Registered: December 2022 |
Member |
|
|
Hi Chris,
Thanks for the response.
Iam using eclipselink 2.7.6 version and mapping are as below . We are using descriptor to define the mapping.
<attribute-mapping xsi:type="one-to-one-mapping">
<attribute-name>kursplanungen</attribute-name>
<reference-class>de.bund.bamf.InGe.bo.impl.KursplanungenImpl</reference-class>
<foreign-key>
<field-reference>
<source-field table="KPN_ENT" name="KPN_ID" xsi:type="column"/>
<target-field table="Kursplanungen" name="ID" xsi:type="column"/>
</field-reference>
</foreign-key>
<foreign-key-fields>
<field table="KPN_ENT" name="KPN_ID" xsi:type="column"/>
</foreign-key-fields>
<indirection xsi:type="value-holder-indirection-policy"/>
<selection-query xsi:type="read-object-query"/>
</attribute-mapping>
And it is unidirectional one-to-one mapping.
I get below error while deleting the object .
Internal Exception: java.sql.SQLException: ORA-01407: Unable to update ("KPN_ENT"."KPN_ID") to NULL
Error Code: 1407
Call: UPDATE KPN_ENT SET KPN_ID = ?, LOCKING_TIMESTAMP = ? WHERE ((ID = ?) AND (LOCKING_TIMESTAMP = ?))
bind => [null, 2024-01-22 11:42:08.853117, 200011, 2024-01-22 11:41:57.923187]
Query: UpdateObjectQuery(KPN_Ent@6a16ee0d)
But how to make eclipselink know about the null constraint ? We do not have nullable element in eclipselink_persistence_map.xsd but when i tried with @JoinColumn(nullable= false ) but it doesnot work .
I found below link where it says as bug but not sure whether it is resolved or not
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341709
[Updated on: Wed, 24 January 2024 11:36] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04586 seconds