Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insertable, updatable, unique within ID?

 
nimo frey
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 357
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic