aspose file tools*
The moose likes Object Relational Mapping and the fly likes HIbernate, hbm2ddl schema export: script error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HIbernate, hbm2ddl schema export: script error " Watch "HIbernate, hbm2ddl schema export: script error " New topic
Author

HIbernate, hbm2ddl schema export: script error

manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
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.


aldana software engineering blog & .more
andy tom
Greenhorn

Joined: Mar 19, 2006
Posts: 1
www.gov.cn
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
is that supposed to be spam or did you forget to write text??
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
i found my answer .

while exporting (for MySQL) you have to set the hbm2ddl attribute delimiter=";".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HIbernate, hbm2ddl schema export: script error
 
Similar Threads
hibernate-tools.jar
Where to see output of hbm2ddl?
Hibernate: Generate the DDl to a output file using the update=true in hbm2ddl tool
how to set the charset of tables using hbm2ddl?
HSQLDB - user lacks privilege or object not found