Open MiguelGL opened 12 years ago
Hi there Miguel,
First let me say, thank you for your interest in this project. I believe that this is the first pull-request for lombok-pg, so.. yay.
Now the bad news.. ;)
The issue with this patch is, that the lock Object[]'s would be null
after regular serialization and deserialization, which defeats the purpose of having them in the first place. Of cause one could argue, that the creation of the PropertyChangeSupport
and VetoableChangeSupport
doesn't have to be tread-safe in all cases, which would render the lock Object[]'s obsolete.
I will create a small example to see what can be done in this scenario.
Of cause, I you have a small example laying around, you could save me some time. ;)
I think it would be possible to look for the presence of the @Entitiy
annotation and add @Transient
to the lock fields.
Mhhh, yes, I did not check the (de-)serialization issues. I will try to build some test case for that.
Your suggestion on adding the @Transient annotation seems good, too. Though may turn out a little restrictive: similar issues could arise for other annotations, for example JAXB-related: in those cases @XmlTransient annotations are required (when using @XmlAccessorType(XmlAccessType.FIELD), not @XmlTransient. Have not tried this, though.
Hi, the lock Object[]'s used to synchronize the generation of property change and veto supports are not transient. This leads to problems when using, for example, JPA + Hibernate + field access: the ORM complains about having multiple mapped $propertyChange... etc. fields.
I made a tests-passing simple patch to add the transient keyword and hence request you honor me pulling it.
Of course, contact me for any issue, and thanks again for your great lombok extensions!!