Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » ddl-generation separator
ddl-generation separator [message #384365] Mon, 29 December 2008 06:24 Go to next message
Eclipse UserFriend
Hi again,

Is it possible to specify a separator for the ddl file generation? (for
both output files: drop.sql and create.sql)

EclipseLink generates files like:
DROP TABLE A
DROP SEQUENCE A

Personally i expected that it should be like:
DROP TABLE A;
DROP SEQUENCE A;

I hoped that the ddl generator would add such separators depending on
the chosen targetDatabase. Is there a way to convince eclipseLink to add
; at the end of every sql statement?

regards,
Bernhard
Re: ddl-generation separator [message #384366 is a reply to message #384365] Mon, 29 December 2008 07:47 Go to previous messageGo to next message
Eclipse UserFriend
You can extend the database class that is being used, and adapt its behavior to your needs.
Re: ddl-generation separator [message #385167 is a reply to message #384365] Mon, 29 December 2008 09:22 Go to previous messageGo to next message
Eclipse UserFriend
There should be a property for this but there is not, please file an
enhancement.

You can cause the ddl to be generated in the same manner as EclipseLink
using the native SchemaManager.

DatabaseSession session = entityManagerFactory.getServerSession();
SchemaManager mgr = new SchemaManager(session)
mgr.outputCreateDDLToFile(createDDLFilePath); // set create ddl file name
mgr.outputDropDDLToFile(dropDDLFilePath);// sets drop ddl file name
mgr.setCreateSQLFiles(true); // writes statement terminator
mgr.replaceDefaultTables(true, true); // generates both drop and create ddl
mgr.closeDDLWriter();

--Gordon
Re: ddl-generation separator [message #385177 is a reply to message #384365] Sun, 11 January 2009 07:44 Go to previous message
Eclipse UserFriend
There is already an enhancement request for this feature:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=227145

If you use apache-ant, you might consider adding these lines to your build
script
<fixcrlf srcdir="${basedir}/build/sql" />
<replace dir="${basedir}/build/sql" token="${line.separator}"
value=";${line.separator}" summary="true" />

-- Frank
Previous Topic:EclipseLink vs Hibernate
Next Topic:Source code for javax.persistence
Goto Forum:
  


Current Time: Wed Jul 23 06:07:37 EDT 2025

Powered by FUDForum. Page generated in 0.05017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top