Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Re: How to prevent OpenJPA from updating immutable entities?

Enrico Goosen

2008-08-13

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi Tim,

I set the "updateable=false" property, but that didn't have any effect.

Here it is:
//  Mapped Fields

@TableGenerator(name="tblPdtcdeGenerator",schema="EBSTATUS",table="TBL_KEYGEN",pkColumnName="PRIMARY_KEY_COLUMN"
 
,valueColumnName="LAST_USED_ID",pkColumnValue="TBL_PDTCDE_ID",allocationSize=1)
   @Id
 
@GeneratedValue(strategy=GenerationType.TABLE,generator="tblPdtcdeGenerator")
   @Column(name = "PDTCDE_ID",nullable=false)
   private Integer pdtcdeId;  

 @Basic
 @Column(name = "PDTTYP_CDE",nullable=false,updatable=false)
 private String pdttypCde;

 @Basic
 @Column(name = "PDT_CDE",nullable=false,updatable=false)
 private String pdtCde;

 @Version
 @Column(name = "VRS_NBR")
 private Integer vrsNbr;


//  Mapped Relationships
 @OneToMany(mappedBy="tblPdtcde",fetch = FetchType.LAZY)
 private Collection<TblPdtbnfcde> tblPdtbnfcdes = new
ArrayList<TblPdtbnfcde>();

 @OneToMany(mappedBy="tblPdtcde",fetch = FetchType.LAZY)
 private Collection<TblScmpdt> tblScmpdts = new ArrayList<TblScmpdt>();
--
Sent from the OpenJPA Users mailing list archive at Nabble.com.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.