java - How to stop persistence from altering database, JPA -


i using camel , open jpa persistent provider, don't want alter statements run on prduction. snapshot of persistence.xml

<persistence-unit name="camel-openjpa-oracle-alert" transaction-type="resource_local">               . . <provider>             org.apache.openjpa.persistence.persistenceproviderimpl         </provider>    <properties>  <property name="openjpa.jdbc.synchronizemappings" value="buildschema(foreignkeys=false)" /> </properties> . .     </persistence-unit> 

what value have put openjpa.jdbc.synchronizemappings, alter command not executed.

i searched unable find such value.

it nice know little more doing , why need use synchronizemappings. fact use foreignkeys=true tells me want openjpa read schema , determine if have database fks defined (i.e. openjpa knows these fks can order sql honor parent/child fk constraints). valid use of synchmappings. however, using 'buildschema', telling openjpa make "the database schema match existing mappings"....this comment lifted openjpa doc:

http://openjpa.apache.org/builds/1.2.3/apache-openjpa/docs/ref_guide_mapping.html#ref_guide_mapping_synch

therefore, telling openjpa update database schema. can remove 'buildschema' if don't want openjpa update schema match domain model. is, try:

or use 'validate' in place of 'buildschema'....however, above doc states, openjpa throw exception if finds schema/domain mismatch may not want. suggest read above doc, , @ available options you.

thanks,

heath thomann


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -