• Post Reply Bookmark Topic Watch Topic
  • New Topic

[Hibernate]key constructor rule

Saber Seddik
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate does require at least a package visibility constructor for entities

4.1.1. Implement a no-argument constructor
Cat has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using Constructor.newInstance(). It is recommended that you have a default constructor with at least package visibility for runtime proxy generation in Hibernate.

But do we have the some constraint for Embeddables?
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!