• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

HIbernate, hbm2ddl schema export: script error  RSS feed

 
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.
 
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=";".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!