• 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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!