You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Sherry Shen (JIRA)" <ji...@apache.org> on 2007/02/22 21:13:05 UTC

[jira] Commented: (OPENJPA-94) Allow MappingTool and persistence.xml to support drop-create for database schema

    [ https://issues.apache.org/jira/browse/OPENJPA-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475149 ] 

Sherry Shen commented on OPENJPA-94:
------------------------------------

With openjpa-0.9.6-incubating,  it doesn't drop tabel when I used 
        <property name="openjpa.jdbc.SynchronizeMappings"
                         value="buildSchema"/>
in persistence.xml.   Hence, the test data in the pervious run 
are shown in the later run.

When I changed the property to
        <property name="openjpa.jdbc.SynchronizeMappings"
                      value="buildSchema(SchemaAction=refresh,DropTables=true)"/>
the test failed with error,
Exception in thread "main" <0|false|0.9.6-incubating> org.apache.openjpa.persist
ence.PersistenceException: There was an error while setting up the configuration
 plugin option "SynchronizeMappings". The plugin was of type "org.apache.openjpa
.jdbc.meta.MappingTool". Setter methods for the following plugin properties were
 not available in that type: [DropTables]. Possible plugin properties are: [ACTI
ONS, ACTION_ADD, ACTION_BUILD_SCHEMA, ACTION_DROP, ACTION_EXPORT, ACTION_IMPORT,
 ACTION_REFRESH, ACTION_VALIDATE, DropUnusedComponents, ForeignKeys, IgnoreError
s, Indexes, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY, M
appingWriter, MetaDataFile, PrimaryKeys, ReadSchema, Repository, SCHEMA_ACTION_N
ONE, SchemaAction, SchemaGroup, SchemaTool, SchemaWriter, Sequences].
Ensure that your plugin configuration string uses key values that correspond to 
setter methods in the plugin class.
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBro
kerFactory.java:183)

> Allow MappingTool and persistence.xml to support drop-create for database schema
> --------------------------------------------------------------------------------
>
>                 Key: OPENJPA-94
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-94
>             Project: OpenJPA
>          Issue Type: New Feature
>            Reporter: Shay Banon
>
> Currently, in the persistence context, one can define:
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
> Which causes OpenJPA to build the database schema based on the mapping defined. Currently, there is no way to define it to drop tables if they exists before creating the database schema. This is very useful for tests that drop (if exists) and creates new tables for each test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.