wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt on updattable and insertable params Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt on updattable and insertable params" Watch "Doubt on updattable and insertable params" New topic

Doubt on updattable and insertable params

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243

Is is mandatory to specify updatable and insertable parameters for Primary key fields?

@Column(name="USER_ID", insertable=false, updatable=false)
protected Long userId;

SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Hi Jothi,

They are optional and their default value is true. Take a look at section 9.1.5 of the java persistence specification (table 7).

SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
I agree. Here's the link: http://aspose.com/file-tools
subject: Doubt on updattable and insertable params
Similar Threads
insertable, updatable, unique within ID?
Composite Key
JPA: is @PrimaryKeyJoinColumn(…) the same as @JoinColumn(…, insertable = ?, updatable = ?)?
JPA MappingException: Repeated column in mapping for entity
Hibernate generate timestamp on create and update