use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.
the class BeanValidationTest method persistence.
@Module
public Persistence persistence() {
final PersistenceUnit unit = new PersistenceUnit("foo-unit");
unit.addClass(EntityToValidate.class);
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
unit.setExcludeUnlistedClasses(true);
final Persistence persistence = new Persistence(unit);
persistence.setVersion("2.0");
return persistence;
}
use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.
the class ProducedExtendedEmTest method persistence.
@Module
public Persistence persistence() throws Exception {
final PersistenceUnit unit = new PersistenceUnit("cdi-em-extended");
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
unit.getProperties().setProperty("openjpa.DatCache", "false");
unit.setExcludeUnlistedClasses(true);
final Persistence persistence = new org.apache.openejb.jee.jpa.unit.Persistence(unit);
persistence.setVersion("2.0");
return persistence;
}
use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.
the class JPACMDIntegrationTest method persistence.
@Module
public Persistence persistence() throws Exception {
final PersistenceUnit unit = new PersistenceUnit("foo-unit");
unit.addClass(User.class);
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
unit.getProperties().setProperty("openjpa.DatCache", "false");
unit.setExcludeUnlistedClasses(true);
final Persistence persistence = new org.apache.openejb.jee.jpa.unit.Persistence(unit);
persistence.setVersion("2.0");
return persistence;
}
use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.
the class JTAPuAndBmtTest method persistence.
@Module
public Persistence persistence() {
final PersistenceUnit unit = new PersistenceUnit("foo-unit");
unit.addClass(TheEntity.class);
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
unit.setExcludeUnlistedClasses(true);
final Persistence persistence = new Persistence(unit);
persistence.setVersion("2.0");
return persistence;
}
use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.
the class AppComposerAsJUnitRuleTest method persistence.
@Module
public Persistence persistence() {
final PersistenceUnit unit = new PersistenceUnit("foo-unit");
unit.addClass(EntityToValidate.class);
unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
unit.getProperties().setProperty("openjpa.RuntimeUnenhancedClasses", "supported");
unit.setExcludeUnlistedClasses(true);
final Persistence persistence = new Persistence(unit);
persistence.setVersion("2.0");
return persistence;
}
Aggregations