This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
wood burning stoves
subject: insertable, updatable, unique within ID?
Similar Threads
OneToOne mapping with 2 composite keys using JPA
Saving database records problem
insertable = true in ID
No mapped data?
JPA2.0 CascadeType.ALL doesn't cascade persist