I setup the JpaSchemaGenerator in order to generate the schema while building my project with maven.
Code:
try (FileWriter out = new FileWriter(exportConfiguration.outputFile)) {
Map<String, Object> props = new HashMap<>();
props.put("javax.persistence.schema-generation.database.action", "none"); props.put("javax.persistence.schema-generation-target", "scripts");
props.put("javax.persistence.schema-generation.scripts.action", "create");
props.put("javax.persistence.schema-generation.scripts.create-target", out);
props.put("javax.persistence.jdbc.driver", "oracle.jdbc.driver.OracleDriver"); props.put("javax.persistence.jdbc.url", exportConfiguration.url);
props.put("javax.persistence.jdbc.user", exportConfiguration.username);
props.put("javax.persistence.jdbc.password", exportConfiguration.password);
props.put("hibernate.ejb.naming_strategy", "org.hibernate.cfg.ImprovedNamingStrategy");
props.put("hibernate.dialect", "org.hibernate.dialect.Oracle10gDialect");
Persistence.generateSchema(exportConfiguration.persistenceUnitName, props);
} catch (Exception e)
The sql commands are created but i missing the possibility to define a command delimiter.
Code:
create table user (user_id number(10,0) not null, name varchar2(255 char) not null)
create table role(role_id number(10,0) not null, name varchar2(255 char) not null)
Because if i run the statments with
Flyway then the following sql statements are expected
Code:
create table user (user_id number(10,0) not null, name varchar2(255 char) not null);
create table role(role_id number(10,0) not null, name varchar2(255 char) not null);
Can someone provide a solution how i can define a delimiter with hibernate 4.3.1 and JPASchemaGenerator?