These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate SchemaExport problem with import file
PostPosted: Mon Jul 11, 2011 8:54 pm 
Newbie

Joined: Mon Jul 11, 2011 8:46 pm
Posts: 1
I am trying to export the SQL schema from hibernate mapping (.hbm.xml) files.
I have managed to export it successfully and all the tables, views etc.. are created in the database.
But the problem is that i haven't been able to import initial data from the specified SQL file.

Here is my code

Code:
Configuration configuration = new Configuration();

configuration.addJar("path to JAR file which contains hbm files..");
configuration.setProperty(Environment.USER, "db username");
configuration.setProperty(Environment.PASS, "db user password");
configuration.setProperty(Environment.URL, "db url");
configuration.setProperty(Environment.DIALECT, "org.hibernate.dialect.MySQL5InnoDBDialect")
configuration.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");

SchemaExport schema = new SchemaExport(configuration);
schema.setOutputFile("E:\\schema.sql");
schema.setImportFile("E:\\init-db.sql");
schema.export(true, true, false, true);


i am not getting any exceptions either but the insert statements inside my init-db.sql file are not getting executed.
any ideas on what i am missing.. really appreciate your help..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.