No default constructor for entity for inner class in Hibernate
If the class is not static
, it requires an instance of the outer class in order to be instantiated - so there will be no default constructor. You'd have to use syntax similar to:
new Supply().new Id();
If the Id
class is static
, you can just call:
new Id();
I always add an empty protected constructor to the class to solve this issue like so:
protected Classname(){}
In your case it would look like this:
protected Id(){}