File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: insertable, updatable, unique within ID?
It's not a secret anymore!