I have expected Hibernate to be able to instantiate class using protected no-args constructor, however, we got: org.hibernate.HibernateException: Could not instantiate resultclass: com.xxx.Installment
.
After changing from:
@VisibleForHibernate
protected Installment() {
}
to:
@VisibleForHibernate
public Installment() {
}
the problem has been fixed. Hibernate version we use: 3.6.10.Final.
Are there any rules as to when the no-args constructor must be public
as opposed to protected
in order for Hibernate to work?