Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » how to create tables using persistence.xml (glassfish, oracle xe)
how to create tables using persistence.xml (glassfish, oracle xe) [message #607414] Fri, 07 March 2008 12:18
Eclipse UserFriend
Originally posted by: mateusz.blaz.e-surf.pl

Hi!

I'm quite new to Eclipse in JEE applications, but I've been using Netbeans
for some time. My problem is that I can't make Eclipse create tables
depending on my entities. I would like to have creating database schema
automated as it was in Netbeans. It seems to me, that it's possible in
Eclipse with Dali too.

I'm using Oracle 10g XE and the newest Eclipse Europe. My application server
is Glassfish v2.

I have created and tested connection pool and JDBS resource in glassfish.
There is one enabled on JNDI adress: "TEST".

In Elipse I have defined the connetion. I have tested it using ping. In Data
Source Explorer I can view database elements.

I am using JPA implementation provided by server and the generic platform.

I have created such a persistence.xml file:
<?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="TEST" transaction-type="JTA">

<jta-data-source>TEST</jta-data-source>

<class>test.ejb.JPATest</class>

<properties>

<property name="toplink.ddl-generation" value="create-tables"/>

<property name="toplink.logging.level" value="ALL"/>


</properties>

</persistence-unit>

</persistence>


My test.ejb.JPATest java class looks like this:

import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class JPATest {

@Id
Long id;

}

In the problems box i can see errors:
table JPATest doesn't exist
collumn Id doesn't exist

I have tried running my module on server, publishing it, restarting the
server in order to create this table on my database, but it didn't work..
There are no exceptions in Glassfish logs, I couldn't find any error in
Eclipse log either. It seems just like properties in persistence.xml were
ignored.

I cannot use Generate DDL as I'm using generic platform.

Can you help me please and give any suggestions, what am I doing wrong? Is
there any way I have to force interpreting the persistence.xml configuration
during deploy?

Thanks a lot for any help!

Sorry for my english.

Best wishes

Mateusz B
Previous Topic:Microsoft Sql Server 2005 datatype mapping issues
Next Topic:how to create tables using persistence.xml (glassfish, oracle xe)
Goto Forum:
  


Current Time: Sun Dec 21 15:51:36 GMT 2014

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

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