views:

29

answers:

1

Hey, I'm using OpenJPA as a JPA provider. Is there a way in which I can recreate the database tables (When an entity changes) without dropping the entire data? When an entity changes, I drop and create every table in the store, and obviously lose the data within. Is there a tool or product to keep the data somehow?

Thanks, Udi

+1  A: 

I think that the refresh action of the SchemaTool is what you're looking for and my understanding is that you use it like this in the persistence.xml:

<property name="openjpa.jdbc.SynchronizeMappings" 
          value="buildSchema(SchemaAction=refresh,ForeignKeys=true)" />
Pascal Thivent