@Override
public boolean beforeConfigurationLoad(Configuration c) {
if (!(c instanceof OpenJPAConfigurationImpl))
return false;
OpenJPAConfigurationImpl conf = (OpenJPAConfigurationImpl) c;
conf.metaFactoryPlugin.setAlias(ALIAS_EJB.getName(), PersistenceMetaDataFactory.class.getName());
conf.metaFactoryPlugin.setAlias(SPEC_JPA.getName(), PersistenceMetaDataFactory.class.getName());
conf.addValue(new EntityManagerFactoryValue());
conf.readLockLevel.setAlias("optimistic", String.valueOf(MixedLockLevels.LOCK_OPTIMISTIC));
conf.readLockLevel.setAlias("optimistic-force-increment", String
.valueOf(MixedLockLevels.LOCK_OPTIMISTIC_FORCE_INCREMENT));
conf.readLockLevel.setAlias("pessimistic-read", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_READ));
conf.readLockLevel.setAlias("pessimistic-write", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_WRITE));
conf.readLockLevel.setAlias("pessimistic-force-increment", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT));
conf.writeLockLevel.setAlias("optimistic", String
.valueOf(MixedLockLevels.LOCK_OPTIMISTIC));
conf.writeLockLevel.setAlias("optimistic-force-increment", String
.valueOf(MixedLockLevels.LOCK_OPTIMISTIC_FORCE_INCREMENT));
conf.writeLockLevel.setAlias("pessimistic-read", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_READ));
conf.writeLockLevel.setAlias("pessimistic-write", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_WRITE));
conf.writeLockLevel.setAlias("pessimistic-force-increment", String
.valueOf(MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT));
conf.lockManagerPlugin.setAlias("mixed", "org.apache.openjpa.jdbc.kernel.MixedLockManager");
configureBeanValidation(conf);
conf.dataCacheMode = conf.addString(JPAProperties.CACHE_MODE);
conf.dataCacheMode.setDefault(DataCacheMode.UNSPECIFIED.toString());
conf.dataCacheMode.set(DataCacheMode.UNSPECIFIED.toString());
return true;
}