Search in sources :

Example 46 with PersistenceUnit

use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.

the class AliasesTest method persistence1.

@Module
public Persistence persistence1() throws Exception {
    final PersistenceUnit unit = new PersistenceUnit("AliasesTest-unit-1");
    unit.setJtaDataSource("aliased-1");
    return new Persistence(unit);
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 47 with PersistenceUnit

use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.

the class AliasesTest method persistence0.

@Module
public Persistence persistence0() throws Exception {
    final PersistenceUnit unit = new PersistenceUnit("AliasesTest-unit-0");
    unit.setJtaDataSource("aliased-2");
    return new Persistence(unit);
}
Also used : Persistence(org.apache.openejb.jee.jpa.unit.Persistence) PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Example 48 with PersistenceUnit

use of org.apache.openejb.jee.jpa.unit.PersistenceUnit in project tomee by apache.

the class MoviesTest method persistence.

@Module
public PersistenceUnit persistence() {
    PersistenceUnit unit = new PersistenceUnit("movie-unit");
    unit.setJtaDataSource("movieDatabase");
    unit.setNonJtaDataSource("movieDatabaseUnmanaged");
    unit.getClazz().add(Movie.class.getName());
    unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
    return unit;
}
Also used : PersistenceUnit(org.apache.openejb.jee.jpa.unit.PersistenceUnit) Module(org.apache.openejb.testing.Module)

Aggregations

PersistenceUnit (org.apache.openejb.jee.jpa.unit.PersistenceUnit)48 Persistence (org.apache.openejb.jee.jpa.unit.Persistence)36 Module (org.apache.openejb.testing.Module)19 AppModule (org.apache.openejb.config.AppModule)10 EjbJar (org.apache.openejb.jee.EjbJar)10 AppInfo (org.apache.openejb.assembler.classic.AppInfo)9 ResourceInfo (org.apache.openejb.assembler.classic.ResourceInfo)9 EjbModule (org.apache.openejb.config.EjbModule)9 PersistenceModule (org.apache.openejb.config.PersistenceModule)8 WebApp (org.apache.openejb.jee.WebApp)7 ArrayList (java.util.ArrayList)5 StatelessBean (org.apache.openejb.jee.StatelessBean)5 File (java.io.File)4 Properties (java.util.Properties)4 URL (java.net.URL)3 Collection (java.util.Collection)3 List (java.util.List)3 OpenEJBException (org.apache.openejb.OpenEJBException)3 Assembler (org.apache.openejb.assembler.classic.Assembler)3 PersistenceUnitInfo (org.apache.openejb.assembler.classic.PersistenceUnitInfo)3