Nullable Date Column Merge Error

I am using JPA with the openjpa implementation below on the Geronimo application server. I also use the MySQL database. I have a problem updating an object with a null Date property. When I try to combine an entity with a Date property set to null, an sql script update is not created (or when other fields change, an sql update script is generated, but a date field is excluded from it). If the date field is set to some other value other than zero, the script update will be correctly generated.

Has anyone had a problem?

+3
source share
1 answer

OpenJPA , ( ) .

, - , OpenJPA StateManager, , . , , OpenJPA , , .

:

OpenJPA StateManager - , . persistence.xml.

<property name="openjpa.DetachState" value="loaded(DetachedStateField=true)"/>

OpenJPA . OpenJPA , , . - ( OpenJPA, , LAZY), ( ).

- , persistence.xml.

<property name="openjpa.DetachState" value="fetch-groups"/>

, . OpenJPA http://openjpa.apache.org/builds/1.2.2/apache-openjpa-1.2.2/docs/manual/manual.html#ref_guide_detach_graph

+5

Source: https://habr.com/ru/post/1737124/


All Articles