openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Issue saving entities with fields that reference read only data
Date Tue, 11 Mar 2014 16:42:54 GMT
If you are trying to persist an Entity that has a relationship to an
(readonly) Entity that already exists in your DB, you should ensure that
the existing Entity is a part of your persistence context (ie managed).
OpenJPA is most likely complaining because we encountered an unmanaged
field when persisting your non readonly Entity to the DB.

So :

ReadOnlyEntity e = em.find(...); // I assume this is different than what
you are currently doing.
NewEntity ne = new NewEntity();



On Tue, Mar 11, 2014 at 11:26 AM, Alice <> wrote:

> Hello,
> We are running into issues with saving entities with fields that reference
> read only data. If the entity has a field mapped with 'insertable = false'
> and/or 'updatable = false' for @Column or @JoinColumn,
> OpenJPA still tries to do an insert into the read only entity. It also
> complains that
> CascadeType.PERSIST has not been specified on the relationship.
> Is there a way to fix this issue?
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

*Rick Curtis*

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message