Package org.hibernate.ejb

Examples of org.hibernate.ejb.HibernatePersistence


    MetaDataScanner scanner = ScannerSingleton.getOrCreateInstance();
    List<String> managedTypeNames = new ArrayList<String>();
    for (Class<?> entity : scanner.getTypesAnnotatedWith(Entity.class, RebindUtils.findTranslatablePackages(context))) {
      managedTypeNames.add(entity.getName());
    }
    return new HibernatePersistence().createContainerEntityManagerFactory(
        new ErraiPersistenceUnitInfo(managedTypeNames), properties);
  }
View Full Code Here


    MetaDataScanner scanner = ScannerSingleton.getOrCreateInstance();
    List<String> managedTypeNames = new ArrayList<String>();
    for (Class<?> entity : scanner.getTypesAnnotatedWith(Entity.class, RebindUtils.findTranslatablePackages(context))) {
      managedTypeNames.add(entity.getName());
    }
    return new HibernatePersistence().createContainerEntityManagerFactory(new ErraiPersistenceUnitInfo(managedTypeNames), properties);
  }
View Full Code Here

    Map<String, String> properties = new HashMap<String, String>();
    properties.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    properties.put("javax.persistence.validation.mode", "none");

    return new HibernatePersistence().createEntityManagerFactory(persistenceUnits.iterator().next(), properties);
  }
View Full Code Here

*/
public class DataSourceInjectionTest extends TestCase {
  public void testDatasourceInjection() {
    PersistenceUnitInfoImpl info = new PersistenceUnitInfoImpl( new String[]{} );
    try {
      EntityManagerFactory emf = ( new HibernatePersistence() ).createContainerEntityManagerFactory( info, null );
      fail( "FakeDatasource should have been used" );
    }
    catch (FakeDataSourceException fde) {
      //success
    }
View Full Code Here

  public TestCase(String name) {
    super( name );
  }

  public void setUp() {
    factory = new HibernatePersistence().createEntityManagerFactory( getConfig() );
  }
View Full Code Here

  public JPATestCase(String name) {
    super( name );
  }

  public void setUp() {
    factory = new HibernatePersistence().createEntityManagerFactory( getConfig() );
  }
View Full Code Here

  public TestCase(String name) {
    super( name );
  }

  public void setUp() {
    factory = new HibernatePersistence().createEntityManagerFactory( getConfig() );
  }
View Full Code Here

    MetaDataScanner scanner = ScannerSingleton.getOrCreateInstance();
    List<String> managedTypeNames = new ArrayList<String>();
    for (Class<?> entity : scanner.getTypesAnnotatedWith(Entity.class, RebindUtils.findTranslatablePackages(context))) {
      managedTypeNames.add(entity.getName());
    }
    return new HibernatePersistence().createContainerEntityManagerFactory(
        new ErraiPersistenceUnitInfo(managedTypeNames), properties);
  }
View Full Code Here

  public JPATestCase(String name) {
    super( name );
  }

  public void setUp() {
    factory = new HibernatePersistence().createEntityManagerFactory( getConfig() );
  }
View Full Code Here

*/
public class OrmVersionTest extends TestCase {
  public void testOrm1() {
    PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( "orm1-test", "1.0" )
        .addMappingFileName( "org/hibernate/ejb/test/jee/valid-orm-1.xml" );
    HibernatePersistence hp = new HibernatePersistence();
    EntityManagerFactory emf = hp.createContainerEntityManagerFactory( pui, Collections.EMPTY_MAP );
    emf.getMetamodel().entity( org.hibernate.ejb.test.pack.defaultpar_1_0.Lighter1.class ); // exception if not entity
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.HibernatePersistence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.