Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HIbernate, hbm2ddl schema export: script error

 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, i am running hibernate 3.

i am using Ant to export my schema to my MySQL database.

first i exported my schema without generating a sql-script file. all went fine.

when i am setting output=foo.sql to write a ddl-script to a file and want to run it manually on mysql command-line, mysql reports an error.

the error is that hbm2ddl did not put an ';' at the end of 'drop table if exists any_table'. after adding ';' to this command the script works fine.

two questions:
1)any similar problems?
2)why does the on-the-fly export work? through setting quite="no" i can see the run ddl-code and it is the same as in the failed output sql-script.

thank you.
 
andy tom
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
www.gov.cn
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that supposed to be spam or did you forget to write text??
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found my answer .

while exporting (for MySQL) you have to set the hbm2ddl attribute delimiter=";".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic