You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Dain Sundstrom <da...@iq80.com> on 2007/08/11 02:21:41 UTC

Drop and recreate tables or clear tables?

Reading the archives it sounds like drop and recreate table support  
was added along with support for clear tables.  Unfortunately, I  
can't find any definitive docs on how I turn this on.  Can anyone  
tell me the exact property settings to turn either of these two  
features on?

Thanks,

-dain

Re: Drop and recreate tables or clear tables?

Posted by Marina Vatkina <Ma...@Sun.COM>.
Be careful though, as these settings do not drop tables that are no longer 
mapped, and they add columns to the existing tables without checking of existing 
columns (even PKs) are also mapped to an entity.

regards,
-marina

Dain Sundstrom wrote:
> Thanks.  That is exactly what I needed.  Is there a dropTables schema  
> option?
> 
> For anyone reading the archives, this is the value I'm using:
> 
>   buildSchema(SchemaAction='add,deleteTableContents',ForeignKeys=true)
> 
> -dain
> 
> On Aug 10, 2007, at 6:02 PM, Patrick Linskey wrote:
> 
>> To add any schema elements that don't exist and then delete all rows
>> from all mapped tables, do:
>>
>> openjpa.jdbc.SynchronizeMappings:
>> buildSchema(SchemaAction='add,deleteTableContents')
>>
>> -Patrick
>>
>> On 8/10/07, Dain Sundstrom <da...@iq80.com> wrote:
>>
>>> Reading the archives it sounds like drop and recreate table support
>>> was added along with support for clear tables.  Unfortunately, I
>>> can't find any definitive docs on how I turn this on.  Can anyone
>>> tell me the exact property settings to turn either of these two
>>> features on?
>>>
>>> Thanks,
>>>
>>> -dain
>>>
>>
>>
>> -- 
>> Patrick Linskey
>> 202 669 5907
> 
> 


Re: Drop and recreate tables or clear tables?

Posted by Dain Sundstrom <da...@iq80.com>.
Thanks.  That is exactly what I needed.  Is there a dropTables schema  
option?

For anyone reading the archives, this is the value I'm using:

   buildSchema(SchemaAction='add,deleteTableContents',ForeignKeys=true)

-dain

On Aug 10, 2007, at 6:02 PM, Patrick Linskey wrote:

> To add any schema elements that don't exist and then delete all rows
> from all mapped tables, do:
>
> openjpa.jdbc.SynchronizeMappings:
> buildSchema(SchemaAction='add,deleteTableContents')
>
> -Patrick
>
> On 8/10/07, Dain Sundstrom <da...@iq80.com> wrote:
>> Reading the archives it sounds like drop and recreate table support
>> was added along with support for clear tables.  Unfortunately, I
>> can't find any definitive docs on how I turn this on.  Can anyone
>> tell me the exact property settings to turn either of these two
>> features on?
>>
>> Thanks,
>>
>> -dain
>>
>
>
> -- 
> Patrick Linskey
> 202 669 5907


Re: Drop and recreate tables or clear tables?

Posted by Patrick Linskey <pl...@gmail.com>.
To add any schema elements that don't exist and then delete all rows
from all mapped tables, do:

openjpa.jdbc.SynchronizeMappings:
buildSchema(SchemaAction='add,deleteTableContents')

-Patrick

On 8/10/07, Dain Sundstrom <da...@iq80.com> wrote:
> Reading the archives it sounds like drop and recreate table support
> was added along with support for clear tables.  Unfortunately, I
> can't find any definitive docs on how I turn this on.  Can anyone
> tell me the exact property settings to turn either of these two
> features on?
>
> Thanks,
>
> -dain
>


-- 
Patrick Linskey
202 669 5907