• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructor in Hibernate persistent class.

 
Gundum Hoi
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to understand the Hibernate Reference Doc :

In the doc, Section 4.1.1 (Hibernate Reference Documentation Version: 3.1.3 link : http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#persistent-classes-pojo ), there are these sentences/statements :

There are four main rules to follow here...
4.1.1. Implement a no-argument constructor
Cat has a no-argument constructor. All persistent classes must have a default constructor (which may be nonpublic) so that Hibernate can instantiate them using Constructor.newInstance().


But I can't find the fore-mentioned constructor in the whole of the Cat.java class code.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a class does not explicitly declare any constructors, the Java compiler automatically provides a no-argument constructor, called the default constructor, that calls the parent's no-argument constructor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic