jsr338-experts@jpa-spec.java.net

[jsr338-experts] Re: Standardization of additional persistence.xml properties

From: Adam Bien <abien_at_adam-bien.com>
Date: Fri, 1 Jul 2011 22:01:23 +0200

Hi Emanuel,


On 01.07.2011, at 19:39, Emmanuel Bernard wrote:

> Standardizing such an option makes sense, it's very useful esp. at development time. Which JPA provider here have such a feature? I'd bet most of us.

Absolutely openJPA, EclipseLink and Hibernate come with this feature already.
>
> By the way the name is not right, it's not simply about table generation but involves other type of objects.
> - javax.persistence.database.schema_generation
> - javax.persistence.database.ddl_generation

+1 -> even better. DDL-Generation is even more important.
>
> MIGRATE (alternative name UPDATE): note that implementing that for all possible case is not practical and should not be considered a production feature in many products.
I would not consider any of these settings for production. But it is important to have them for development / testing.

The output of database.ddl_generation could be a base for production scripts...
>
> On 30 juin 2011, at 11:50, Adam Bien wrote:
>
>> Hi all,
>>
>> proposal for standardization of table generation strategy:
>>
>> <property name="javax.persistence.table-generation-strategy" value="CREATE | DROP-AND-CREATE | MIGRATION | NONE /> Default should be NONE.
>>
>> I would like to propose MIGRATION as an optional parameter. In this case the JPA provider is expected to alter the tables, instead of drop and recreate them,
>>
>> any thoughts?
>>
>> thanks!,
>>
>> adam
>>
>>
>>
>>
>