Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Yes I have the database called cube running on my computer. The "products" table before launching the code is not supposed to exist because I want to create it with hibernate, but somehow it gives me this error. I compared the code with the ones appearing on different tutorials on the net and it works fine for them. Commented Jan 3, 2021 at 23:32
  • Yeah so in your Product class, when you use the annotation @Table(name="products") that implies that you already have a table that exist. So you should try to 1st run your code to create the table first,2nd run the project with hibernate. Commented Jan 4, 2021 at 0:35
  • I'm sorry man, but look at hibernate.cfg.xml file, you'll see that there is this line : <property name="hibernate.hbm2ddl.auto">create</property>. Well that line is supposed to creates tables according to the mapped entity classes. Check out this article, which contains the code i'm testing: codejava.net/frameworks/hibernate/… Commented Jan 4, 2021 at 8:02