Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Create DB DDL scripts instead of building database

Hi Roger,

I am still having trouble recreating your issue. I am running an Eclipse Galileo version which contains the eclipselink 1.1.2 library.

  Here is what I did:

1. Create a simple JPA project using Dali with a single Entity
2. Configure it to use EclipseLink as the platform
3. Set the database connection information and ddl generation settings using the Dali UI
4. Run some simple code that access the entity manager.

I see the ddl generated to my file system and not to my database.

I am attaching my Eclipse project. Can you see anything different about what you are doing? Does this project generate DDL as expected for you?

-Tom

RogerV wrote:


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


Back to the top