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

@ManyToOne optional or @Column nullable?

 
Karsten Wutzke
Ranch Hand
Posts: 106
Hibernate MySQL Database Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the difference between

@ManyToOne(optional=?) and
@Column(nullable=?)

?

Karsten
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The nullable column annotation only applies to the database and DDL generation (if your JPA provider supports DDL generation). The optional relationship annotation applies to the relationship, and may be used or validated by the JPA provider.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic