Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] NullPointerException in sequence of persistent property mutations

Hi Laird,

  The line from the spec is here:

"If X is an entity merged to X', with a reference to another entity Y, where cascade=MERGE
or cascade=ALL is not specified, then navigation of the same association from X' yields a
reference to a managed object Y' with the same persistent identity as Y."

  The spec asks us to create a Y' and we need a way to do it.  I suspect what other providers do comes down to a combination of how they have interpreted the spec, and what is tested in the TCK.

  Having said that, I think there is an argument that there should be a way to indicate that an object should not be touched by a merge and perhaps the lack of CASCADING combined with a read-only setting would be a good way to determine that.  Please feel free to enter an enhancement request for this behavior.

-Tom

On 06/09/2013 9:41 AM, Laird Nelson wrote:
On Fri, Sep 6, 2013 at 6:28 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
I am not sure what the intention of the spec is, however, as noted in the bug we do have to merge the association itself (but not the object).

Would this be true even if the relevant join column were marked insertable=false/updatable=false?

To fully understand, I assume the reason you have to merge the association itself is so that if--after persisting the root object--I set something new "into" that relationship, the entity manager is aware of the change.  Is that right?  If this is so clear, why is it that no other JPA provider does this?  Not pointing fingers, just trying to understand.

Best,
Laird

--
http://about.me/lairdnelson


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top