Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate : Empty Table recreated when spring starts

 
Frank VanOor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each time I'm starting Tomcat/Spring, hibernate recreates the mapped table (only one table is mapped).
Below the applicationcontext and the Entity Class.

Many thanks in advance.




 
Paul Clapham
Sheriff
Pie
Posts: 20750
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't that a Hibernate FAQ? Anyway it does that because you tell it to do so in line 42 of what you posted.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This 42

<prop key="hibernate.hbm2ddl.auto">create</prop>

Mark
 
Frank VanOor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I removed this property, and all works fine now.

Many thanks !!!

Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic