-1

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: My Class

The persistence xml file

The test file

Here is the error: enter image description here

Does anyone know what I am doing wrong?

wogsland
  • 9,106
  • 19
  • 57
  • 93
compt
  • 82
  • 2
  • 6

2 Answers2

0

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

Community
  • 1
  • 1
Orest
  • 6,548
  • 10
  • 54
  • 84
0

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.

compt
  • 82
  • 2
  • 6