Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insertable, updatable, unique within ID?

 
nimo frey
Ranch Hand
Posts: 580
  • 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
  • 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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic