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

@Basic or @Column

 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

What is the actual difference between @Basic.optional() and @Column.nullable()

is same as

So which one to use when?
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
optional refers to the object model, nullable refers to the data model. Normally you would use both, or neither.

optional may be used for object validation, or internal optimizations. nullable is only used for DDL generation.

 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou a lot James
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic