Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Java Unit Test re-create the Tables from Entities

Take a look at your persistence.xml.

In the properties section, there are probably some properties that start with "eclipselink.ddl-generation". Those are the properties that control whether EclipseLink tries to drop and create your tables.

-Tom

RogerV wrote:
Hi

I've created a new dynamic web-project in Eclipse Galileo and added
Persistence & EclipseLink to it - rather than create two projects - a JPA
Project and a Web Project and including the JPA project as a dependancy of
the Web project. I've defined some entities (persistence.xml ddl-generation
set to "drop-and-create-tables") and used the Dali tools to create Tables
from Entities - and written the code to pre-populate some control table
entries via EclipseLink.

However, when I try to run any unit test that accesses the persistence
layer, EclipseLink drops the tables and re-creates them and my unit tests
fail because the control data is obviously no longer present. Is this
because I haven't separated the projects - or have I missed something in the
setup?

Regards


Back to the top