Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Re: How to prevent OpenJPA from updating immutable entities?

Timothy Fanelli

2008-08-13

Replies: Find Java Web Hosting

Author LoginPost Reply
I'd like to see the code for your TblPdtcde entity. I suspect that you
could simply set the "updateable=false" property on your column
attribute (or element, if xml) to achieve the same results without
having to impact your object model in this manner.

-Tim

On Wed, 2008-08-13 at 06:36 -0700, egoosen wrote:
> I've found a solution to my problem...
>
> tblScmpdt.setTblPdtcde(null); //immutable, don't merge
> The foreign key is still set (tblScmpdt.pdtcdeId), so by setting the related
> entity to null, it prevents OpenJPA from trying to merge it.

Attachment: signature.asc (zipped)
©2008 gg3721.com - Jax Systems, LLC, U.S.A.