Re: Null field not persisted for Dates

2016-10-17 Thread Vincenzo D'Aniello
Ok it was what I wanted, an example of the most comprehensive jpa enhancement applied to OpenJPA. I missed the part of the plug-in OpenJPA in maven, and so everything is clear. Now for reasons of time, I settled with the java reflections, but when I have some time I'll try with this solution, and

Re: Null field not persisted for Dates

2016-10-16 Thread Mark Struberg
Hi Vincenzo! No worries, your english is fine. The writeExternal is invoked to serialize away the entity. Whether the receiver side gets just the normal entity fields (unenhanced so to say) or also the _loaded and _dirty fields is a question of the configuration. I usually use the following

Re: Null field not persisted for Dates

2016-10-15 Thread Vincenzo D'Aniello
Hi, i've set this property in the persistence unit: but when the entity object try to be detached, an exception NoSuchMethodException is thrown because openjpa try to execute the writeExternal method on the entity class object. I have not understand abaut enhancer, Enhancement. There is a comp

Re: Null field not persisted for Dates

2014-05-13 Thread Adil
Hi, I have tried and it worked fine. but the problem is if i want to update on field, for that in persistenceObject i populate one field, rest are null. it will cause problem. Do we have any solution to apply this behavior on specific field instead of complete JPA entities. I have tried below c

Re: Null field not persisted for Dates

2011-05-11 Thread bp_maggie
I tested with this piece of code and it works: //modified is the instance client had changed Record modified = (Record) processClientRequest(); EntityManager em = emf.createEntityManager(); Record merged = (Record) em.merge(modified); //assume begin is a date and client set the date to null, updat

Re: Null field not persisted for Dates

2011-02-06 Thread Mark Struberg
_dirty and _loaded bits should be set. LieGrue, strub --- On Sun, 2/6/11, No1UNo wrote: > From: No1UNo > Subject: Re: Null field not persisted for Dates > To: users@openjpa.apache.org > Date: Sunday, February 6, 2011, 4:42 AM > > > On Feb 4, 2011, at 2:13 PM, Jerry Carter

Re: Null field not persisted for Dates

2011-02-05 Thread No1UNo
On Feb 4, 2011, at 2:13 PM, Jerry Carter wrote: > Am I right is assuming that null values should be copies on merge? I've > reviewed the JPA 2.0 specification. I see that 3.2.7.1 does not disadvantage > null values >> If X is a detached entity, the state of X is copied onto a pre-existing >>

Re: Null field not persisted for Dates

2011-02-04 Thread Mark Struberg
se @Inheritance. See OPENJPA-1912 for more info [1]. LieGrue, strub [1] https://issues.apache.org/jira/browse/OPENJPA-1912 --- On Fri, 2/4/11, Rick Curtis wrote: > From: Rick Curtis > Subject: Re: Null field not persisted for Dates > To: users@openjpa.apache.org > Date: Friday, F

Re: Null field not persisted for Dates

2011-02-04 Thread No1UNo
Rick: First of all, thank you very much for the quick response and definitive answer. Am I right is assuming that null values should be copies on merge? I've reviewed the JPA 2.0 specification. I see that 3.2.7.1 does not disadvantage null values > If X is a detached entity, the state of X i

Re: Null field not persisted for Dates

2011-02-04 Thread Rick Curtis
Jerry - That would be the problem then. We lost track of the fact that you set this field to null, and assume that it wasn't loaded. Please review the openjpa.DetachState [1] docs for more info. You could set the property listed below so that we will stream our DetachedStateManager around. [1]

Re: Null field not persisted for Dates

2011-02-04 Thread No1UNo
Yes, it is. The object is changed remotely and then merged. The data on the wire is fine. On Feb 4, 2011, at 1:47 PM, Rick Curtis [via OpenJPA] wrote: > Jerry - > > Is the Entity which you are trying to update being serialized/deserialized? > > Thanks, > Rick > > On Fri, Feb 4, 2011 at

Re: Null field not persisted for Dates

2011-02-04 Thread Rick Curtis
Jerry - Is the Entity which you are trying to update being serialized/deserialized? Thanks, Rick On Fri, Feb 4, 2011 at 12:25 PM, Jerry Carter wrote: > Using OpenJPA 2.0.1, I have a date field in my entity. Setting the field > to a non-null value causes the data to be persisted as one would e