Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Confused: JPA Tools >generate tables from entities
Confused: JPA Tools >generate tables from entities [message #613723] Mon, 12 January 2009 18:12
Wolfgang  is currently offline Wolfgang Friend
Messages: 10
Registered: July 2009
Junior Member
Hi, the Dali "JPA tools>generate tables..." is not working for me. Perhaps
I am just missing a small thing:

in a new Eclipse (3.4.1) JPA-project I created one TestEntity and a
connection to an Oracle database. After I completed the TestEntity's
mapping I had error messages regarding the missing table and its two
missing attributes. So I tried to generate the table but this failed with
Internal Exception: java.sql.SQLException: [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified

so I added properties to the persistence.xml which created a different
error message.

I defined the project for a glassfish server which is shut down since I
prefer to create my tables directly with the database connection.

The database connection itself is ok because I can generate an entity from
a table with the JPA-tools entry in the context menu.

When I try to generate a table from the entity I see

a) an error message in the console:
Exception in thread "main" javax.persistence.PersistenceException: No
Persistence provider for EntityManager named JPATestVF: The following
providers:
oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
Returned null to createEntityManagerFactory.

at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:154)
at org.eclipse.jpt.eclipselink.core.ddlgen.Main.execute(Main.ja va:77)
at org.eclipse.jpt.eclipselink.core.ddlgen.Main.main(Main.java: 65)

b) a status dialogue about a connection and refresh but the dialogue is
closed immediately, no more log entries created, still no table.

Just in case it adds value the persistence.xml is listed below, some
values replaced with <generics>

regards
Wolfgang

<?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="JPATestVF">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database" value="Oracle"/>
<property name="eclipselink.jdbc.driver"
value="oracle.jdbc.OracleDriver"/>
<property name="eclipselink.jdbc.platform"
value=" org.eclipse.persistence.platform.database.oracle.OraclePlatf orm "/>
<property name="eclipselink.jdbc.url"
value="jdbc:oracle:thin:@<theserverip>:1521:<thesid>"/>
<property name="eclipselink.jdbc.user" value="<myuser>"/>
<property name="eclipselink.jdbc.password" value="<mypassword>"/>

<property name="eclipselink.logging.level" value="ALL"/>
<property name="eclipselink.logging.timestamp" value="true"/>
<property name="eclipselink.logging.exceptions" value="true"/>
<property name="eclipselink.logging.session" value="true"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="eclipselink.ddl-generation.output-mode"
value="database"/>
</properties>
</persistence-unit>
</persistence>
Previous Topic:Dali 2.1 is now available!
Next Topic:Dali reports that some fields cannot be resolved
Goto Forum:
  


Current Time: Wed Oct 17 16:54:07 GMT 2018

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

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

Back to the top