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..