Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to create DB2 tables from entitys
How to create DB2 tables from entitys [message #1746279] Wed, 26 October 2016 12:07 Go to next message
Matias Panasci is currently offline Matias PanasciFriend
Messages: 7
Registered: March 2015
Junior Member
Hello I'm trying to create tables in DB2 from the entities that I have in my project, but I can not and do not see error messages in the log.

I am using tomcat 7 and this is my persist.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    <persistence-unit name="GestionArchivoPU" transaction-type="JTA">
            <property name="javax.persistence.schema-generation.database.action" value="create"/>
            <property name="javax.persistence.jdbc.driver" value="" />
            <property name="javax.persistence.jdbc.url"  value="jdbc:db2:" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="root" />
            <property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)" />
            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> 
            <property name="eclipselink.ddl-generation.output-mode" value="both"/> 
            <property name="eclipselink.logging.level" value="FINEST"/>            

The database connection is made, but doesn't create the tables...

any advice ?
Re: How to create DB2 tables from entitys [message #1746301 is a reply to message #1746279] Wed, 26 October 2016 15:40 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1342
Registered: July 2009
Senior Member
Have you tried executing something in an EntityManager? EclipseLink will lazily deploy the persistence unit by default, so it could be that tables just aren't created yet. You can try changing the lazy deployment so that tables are dropped/created when you obtain an EntityManagerFactory using the eclipselink.deploy-on-startup property:

Since you have logging on finest though, does the logging say if it is finding your entities? It can't create tables for entities it can't find.

[Updated on: Wed, 26 October 2016 15:42]

Report message to a moderator

Previous Topic:Moxy - supported xPath version?
Next Topic:Lazy loaded relation after detach with cascade detach not detached.
Goto Forum:

Current Time: Tue Mar 31 03:06:17 GMT 2020

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

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

Back to the top