-->
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: JpaSchemaGenerator define delimiter
PostPosted: Wed Mar 19, 2014 4:58 am 
Newbie

Joined: Wed Mar 19, 2014 4:44 am
Posts: 1
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?


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.