Hi folks!
I have a question regarding OpenJPA-2.0.1 AttachStrategy DETACH_LOADED.
I have an entity with a Date field. This field gets filled with the current
date and stored to the database. Afterwards it gets loaded from the database
and detached. In the next request the date will be reset to null. And here
comes the problem (around AttachStrategy#178):
case JavaTypes.OBJECT:
case JavaTypes.OID:
case JavaTypes.ENUM:
val = fetchObjectField(i);
---> if (val == null && !nullLoaded) <-- problem
return false;
sm.settingObjectField(into, i, sm.fetchObjectField(i), val,
set);
break;
This leads to not getting the date field reset to null in the database while
merging the entity.
Imo this should only be skipped if the field didn't got loaded previously from
the database. I bet this information is available, but where can I get this
information from?
Are some bells ringing, or should I try to craft a unit test?
txs and LieGrue,
strub