Just another site

hibernate Instantiation Exception: No default constructor for entity

In Java, the compiler will always supply a default constructor unless you define the constructor yourself. If your POJO has a constructor that takes arguments, then you don’t have a default constructor, and how can Hibernate instantiate this? Where does it get the values for the constructor from?

All your Hibernate classes must have a constructor that doesn’t take any parameters.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: