I am trying to use hibernate framework with eclipse in order to build a simple web application and connect it with PostgreSQL. Here is my code:
Does anyone know what I am doing wrong?
You should change property hibernate.hbmddl.auto
value to create-drop
or create
to force hibernate create schema, because userclass
table is not exists.
More information about hibernate.hbmddl.auto
is here: https://stackoverflow.com/a/24417561/2055854
Just for those whom might encounter the same problem...
I just found the answer for it. Because of the database I am using is postgresql, I had to change the property "hibernate.dialect" in the persistence file. So, the result after the change was:
After that, the table was created!
Thank you.