java - What is the difference between @ManyToOne(optional=false) vs. @Column(nullable=false) -


in jpa, confused when use attribute optional=false , annotation @column(nullable=false). difference?

@column(nullable=false) instruction generating schema. database column generated off class marked not nullable in actual database.

optional=false runtime instruction. primary functional thing related lazy loading. can't lazy load non-collection mapped entity unless remember set optional=false (because hibernate doesn't know if there should proxy there or null, unless tell nulls impossible, can generate proxy.)


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -