Thanks, guys!  I can't remove the property because it's in my spring XML
file.  I'll use validate.  That seems reasonable.  I'd want to validate
things at startup in prod so that I fail fast if there's an issue.

On Thursday, February 14, 2013, Kevin Sutter wrote:

> 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
> <[email protected] <javascript:;>>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
>

Reply via email to