| Re: [eclipselink-users] Create DB DDL scripts instead of building database |
Hi Roger,
Here is what I did:
I see the ddl generated to my file system and not to my database.
-Tom
tware wrote:Hi Roger,
I just ran a quick test and I seem to get the expected behavior.
How is your persistence unit configured? Where are the classes? Where
is the persistence.xml? Is it possible to post the full persistence.xml? Is
your application OSGi?
-Tom
Hi Tom
Persistence.xml is attached below. It's in the META-INF directory which is in the root of my source directory. It's in the right place as I invalidated the xml by removing an end tag and tried to re-run the DDL generation and it failed because of the missing end tag so it's reading the right file. The entity classes are in sub-directories of the source root. The application is not OSGi.
Regards
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="ids2_develop" transaction-type="RESOURCE_LOCAL">
<description>Eclipse</description>
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.blackbox.entities.db.Vw_Ecu</class> <class>com.blackbox.entities.db.SwimPart</class>
<class>com.blackbox.entities.db.SoftwarePK</class>
<class>com.blackbox.entities.db.Software</class>
<class>com.blackbox.entities.db.Platform</class>
<class>com.blackbox.entities.db.PEcuTextPK</class>
<class>com.blackbox.entities.db.PEcuText</class>
<class>com.blackbox.entities.db.PEcuAcronymPK</class>
<class>com.blackbox.entities.db.PEcuAcronym</class>
<class>com.blackbox.entities.db.PEcu</class>
<class>com.blackbox.entities.db.PBusPK</class>
<class>com.blackbox.entities.db.PBus</class>
<class>com.blackbox.entities.db.HardwarePK</class>
<class>com.blackbox.entities.db.Hardware</class>
<class>com.blackbox.entities.db.CusCom</class>
<class>com.blackbox.entities.db.CCFParameter</class>
<class>com.blackbox.entities.db.CCFGroup</class>
<class>com.blackbox.entities.db.Bus</class>
<class>com.blackbox.entities.db.BBoxCom</class>
<class>com.blackbox.entities.db.AssemblyPK</class>
<class>com.blackbox.entities.db.Assembly</class>
<properties> <property name="eclipselink.jdbc.password" value="linux4me"/> <property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/> <property name="eclipselink.jdbc.user" value="root"/> <property name="eclipselink.jdbc.url" value="jdbc:mysql://192.168.0.65:3306/ids2_develop"/> <property name="eclipselink.logging.level" value="FINE"/> <property name="eclipselink.jdbc.cache-statements" value="true"/> <property name="eclipselink.jdbc.native-sql" value="false"/> <property name="eclipselink.cache.type.Vw_Ecu" value="NONE"/> <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> <property name="eclipselink.ddl-generation.output-mode" value="sql-script"/> <property name="eclipselink.application-location" value="H:\new_workspace\ids2_databaseBuilder\schema\"/> <property name="eclipselink.create-ddl-jdbc-file-name" value="create_ddl.sql"/> <property name="eclipselink.drop-ddl-jdbc-file-name" value="drop_ddl.sql" /> </properties> </persistence-unit> </persistence>
Attachment:
TestDDL.jar
Description: Binary data