-
Notifications
You must be signed in to change notification settings - Fork 1k
hibernate error, can't find solution #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
It is very strange. The tests pass, but hibernate doesn't create the table when I run Main. Table countries created manually by cmd line in MySQL. Stack:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
If you have questions, please ask in chat
src/main/java/mate/academy/hibernate/relations/exception/DataProcessingException.java
Outdated
Show resolved
Hide resolved
src/main/java/mate/academy/hibernate/relations/service/impl/ActorServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/mate/academy/hibernate/relations/service/impl/CountryServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/mate/academy/hibernate/relations/service/impl/MovieServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/resources/hibernate.cfg.xml
Outdated
<property name="connection.password">rootroot</property> | ||
<property name="show_sql">true</property> | ||
<property name="format_sql">true</property> | ||
<property name="hibernate.hbm2dd1.auto">update</property> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<property name="hibernate.hbm2dd1.auto">update</property> | |
<property name="hibernate.hbm2dd1.auto">create-drop</property> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking for a way to solve the problem described above, this was one of the types of its solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use create-drop, it's not related to your exception
src/main/java/mate/academy/hibernate/relations/service/impl/MovieServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/mate/academy/hibernate/relations/util/HibernateUtil.java
Outdated
Show resolved
Hide resolved
What is the difference where to ask here or in the chat, if I described the problem in detail here? Anyway, you are initially in the context of the task |
You named your database (movies) the same as one of the table (movies). That's why you've got an exception. |
src/main/java/mate/academy/hibernate/relations/service/impl/MovieServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/resources/hibernate.cfg.xml
Outdated
<property name="connection.password">rootroot</property> | ||
<property name="show_sql">true</property> | ||
<property name="format_sql">true</property> | ||
<property name="hibernate.hbm2dd1.auto">update</property> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use create-drop, it's not related to your exception
I've already tried something like that, it did not helped:
|
Hibernate doesn't create tables automatically. If create tables manually, it works and fails at next table 'actors'.
Here is the stack of the problem:
It would be great if you can help me, because I did not find the solution on StackOverflow. Theese articles did not helped me:
https://coderanch.com/t/636771/frameworks/Table-mydb-temp-doesn-exist
spring-projects/spring-data-commons#2761
https://discourse.hibernate.org/t/hibernate-couldnt-find-table/1888/4
https://stackoverflow.com/questions/438146/what-are-the-possible-values-of-the-hibernate-hbm2ddl-auto-configuration-and-wha
https://stackoverflow.com/questions/4490981/hibernate-table-does-not-exist-error