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:
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
Post a Comment