2

i defined some Entities and want to generate the tables now.

I use Eclipselink 2.5 (JPA 2.1) and Glassfish 4.0 and my Program uses JKD7.

When i build the application there are the following messages:

warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.7'

Note: Creating static metadata factory ...
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.

I don't know what i need to do now...

  • i have the latest EclipseLink version
  • latest version of glassfish
  • jkd 7
  • just the standard derby database (delivered with glassfish 4.0)

how can i solve this?

EDIT 1:

<properties>
  <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
  <property name="eclipselink.ddl-generation.output-mode" value="database"/>
</properties>
Laokoon
  • 1,241
  • 4
  • 24
  • 47
  • Does your persistence.xml contain `` in the persistence unit's properties? Because by default it won't create tables. – fvu Aug 28 '13 at 14:11
  • Yes. i added it in my post – Laokoon Aug 28 '13 at 14:12
  • EclipseLink should drop and create the tables based on your property when the context is deployed. Full deployment though occurs lazily, so it might only occur if you actually get an EntityManager and attempt to use it. To have it fully deployed and initialized upfront, try adding the eclipselink.deploy-on-startup property as well. – Chris Aug 28 '13 at 15:14
  • do you forgot to commit transaction? I mean like, EntityTransaction tx = em.getTransaction(); tx.begin(); em.persist(entity); tx.commit(); – Shahdat Sep 04 '13 at 22:37

2 Answers2

0

just put these lines in persistance.xml:

<property name="eclipselink.ddl-generation" value="create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.ddl-generation-mode" value="ddl_database_generation" />
Ali Abazari
  • 429
  • 4
  • 20
0

I had the same problem, found the solution here. Change this setting on netbeans:
[RUN>SET PROJECT CONFIGURATION>Customize>Build>Compiling> Disable Annotation Processing]