Examples of createContainerEntityManagerFactory()


Examples of org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory()

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
  }

  public void testOrm2() {
    PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( "orm2-test", "2.0" )
View Full Code Here

Examples of org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory()

  public void testOrm2() {
    PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( "orm2-test", "2.0" )
        .addMappingFileName( "org/hibernate/ejb/test/jee/valid-orm-2.xml" );
    HibernatePersistence hp = new HibernatePersistence();
    EntityManagerFactory emf = hp.createContainerEntityManagerFactory( pui, Collections.EMPTY_MAP );
    emf.getMetamodel().entity( org.hibernate.ejb.test.pack.defaultpar.Lighter.class ); // exception if not entity
  }

  public void testInvalidOrm1() {
    PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( "invalid-orm1-test", "1.0" )
View Full Code Here

Examples of org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory()

  public void testInvalidOrm1() {
    PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( "invalid-orm1-test", "1.0" )
        .addMappingFileName( "org/hibernate/ejb/test/jee/invalid-orm-1.xml" );
    HibernatePersistence hp = new HibernatePersistence();
    try {
      hp.createContainerEntityManagerFactory( pui, Collections.EMPTY_MAP );
      fail( "expecting 'invalid content' error" );
    }
    catch ( InvalidMappingException expected ) {
      // expected condition
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.