aspose file tools*
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "insertable, updatable, unique within ID?" Watch "insertable, updatable, unique within ID?" New topic
Author

insertable, updatable, unique within ID?

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Hello,

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

@Id
@GeneratedValue(....)
@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


(peace)


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: insertable, updatable, unique within ID?
 
Similar Threads
insertable = true in ID
Saving database records problem
No mapped data?
JPA2.0 CascadeType.ALL doesn't cascade persist
OneToOne mapping with 2 composite keys using JPA