It's not a secret anymore!
The moose likes Object Relational Mapping and the fly likes insertable, updatable, unique within ID? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "insertable, updatable, unique within ID?" Watch "insertable, updatable, unique within ID?" New topic

insertable, updatable, unique within ID?

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580

Does the properties "insertable=false, updatable=false, unique=true" makes sense within the declaration of an ID-Property?

@Column(name = "ID_USER", nullable = false, insertable=false, updatable=false, unique=true)
public Integer getIdUser()...

Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
HIi nimo,

updatable dosen't make sense since hibernate by default dosen't allow you to change the value of the primary key

unique is the same thing since the basic idea of a primary key is that its unique

regarding insertable ... i don't know


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: insertable, updatable, unique within ID?
jQuery in Action, 3rd edition