openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: openjpa.jdbc.SynchronizeMappings Values...
Date Thu, 14 Feb 2013 20:49:53 GMT
Hi James,
I agree with your approach.  The synchronizeMappings property is great for
initial development, but once you have figured out the proper schema, you
don't want to be messing with it.  The easiest mechanism is to just remove
the property.

If you want to validate your schema against your entity mappings and throw
exceptions on mismatches, you could just use the "validate" option instead
of "buildSchema".  All of the MappingTool options are available for the
SynchronizeMappings property [1].

<property name="openjpa.jdbc.SynchronizeMappings" value="validate"/>

Another option is to use the SchemaFactory property [2].  To do the
validation processing, I'd suggest using the "native" option:

<property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>

Either of these approaches should do the trick for you.

Kevin

[1]
http://people.apache.org/~mikedd/nightly.builds/apache-openjpa-2.3.0-SNAPSHOT/docs/docbook/manual.html#ref_guide_mapping_mappingtool
[2]
http://people.apache.org/~mikedd/nightly.builds/apache-openjpa-2.3.0-SNAPSHOT/docs/docbook/manual.html#ref_guide_schema_info_factory

On Thu, Feb 14, 2013 at 2:29 PM, James Carman
<jcarman@carmanconsulting.com>wrote:

> Currently, during development, I use this value:
>
> buildSchema(ForeignKeys=true)
>
> However, when we go to production, we don't want to use that.  The way
> I've got it set up is using Spring and PropertyPlaceholderConfigurer (we
> put "buildSchema(ForeignKeys=true)" in a properties file).  Now, is there
> another value I can use for that setting that just validates the schema?
>  Or, is there a value that will just do nothing?
>
> Thanks,
>
> James

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message