Examples of buildEntityManagerFactory()


Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

    osgiClassLoader.addClassLoader( info.getClassLoader() );

    Ejb3Configuration cfg = new Ejb3Configuration();
    Ejb3Configuration configured = cfg.configure( info, properties );
    return configured != null ? configured.buildEntityManagerFactory( getBuilder( cfg, properties ) ) : null;
  }

  private BootstrapServiceRegistryBuilder getBuilder(Ejb3Configuration cfg, Map properties) {
    BootstrapServiceRegistryBuilder builder = new BootstrapServiceRegistryBuilder();
   
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

        Ejb3Configuration cfg = new Ejb3Configuration();
        cfg.addAnnotatedClass(Thing.class);
        cfg.addProperties(props);

        emf = cfg.buildEntityManagerFactory();
        em = emf.createEntityManager();
    }

    @After
    public void tearDown() throws Exception {
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

            }
            if (Logger.isTraceEnabled()) {
                Logger.trace("Initializing JPA ...");
            }
            try {
                JPA.entityManagerFactory = cfg.buildEntityManagerFactory();
            } catch (PersistenceException e) {
                throw new JPAException(e.getMessage(), e.getCause() != null ? e.getCause() : e);
            }
            JPQL.instance = new JPQL();
        }
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

    Ejb3Configuration cfg = new Ejb3Configuration();
    if ( info.getTransactionType().equals( PersistenceUnitTransactionType.JTA ) ) {
      map.put( AvailableSettings.JTA_PLATFORM, new OsgiJtaPlatform( context ) );
    }
    Ejb3Configuration configured = cfg.configure( info, map );
    return configured != null ? configured.buildEntityManagerFactory() : null;
  }

}
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info,
            Map map) {
        Ejb3Configuration cfg = new Ejb3Configuration();
        Ejb3Configuration configured = cfg.configure(info, map);
        postprocessConfiguration(info, map, configured);
        return configured != null ? configured.buildEntityManagerFactory() : null;
    }

    @SuppressWarnings("unchecked")
    protected void postprocessConfiguration(PersistenceUnitInfo info, Map map,
            Ejb3Configuration configured) {
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

        configurator.setProperty("hibernate.connection.url", "jdbc:hsqldb:.");
        configurator.setProperty("hibernate.show_sql", "false");
        configurator.setProperty("hibernate.format_sql", "true");
        configurator.setProperty("hibernate.use_sql_comments", "true");
        configurator.setProperty("hibernate.hbm2ddl.auto", "create");
        factory = configurator.buildEntityManagerFactory();
        manager = factory.createEntityManager();

        // Always create a bunch of nodes in a workspace that is not used, so we're sure that these
        // tests work only on the workspace used in the test
        NamespaceEntity ns = NamespaceEntity.findByUri(manager, "http://www.example.com");
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

        configurator.setProperty("hibernate.connection.url", "jdbc:hsqldb:.");
        configurator.setProperty("hibernate.show_sql", "false");
        configurator.setProperty("hibernate.format_sql", "true");
        configurator.setProperty("hibernate.use_sql_comments", "true");
        configurator.setProperty("hibernate.hbm2ddl.auto", "create");
        factory = configurator.buildEntityManagerFactory();
        manager = factory.createEntityManager();
    }

    @Before
    public void beforeEach() throws Exception {
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

            configurator.setProperty("hibernate.connection.url", "jdbc:hsqldb:.");
            configurator.setProperty("hibernate.show_sql", "false");
            configurator.setProperty("hibernate.format_sql", "true");
            configurator.setProperty("hibernate.use_sql_comments", "true");
            configurator.setProperty("hibernate.hbm2ddl.auto", "create");
            factory = configurator.buildEntityManagerFactory();
            manager = factory.createEntityManager();
        }
        return manager;
    }
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

        configurator.setProperty("hibernate.connection.url", "jdbc:hsqldb:.");
        configurator.setProperty("hibernate.show_sql", "false");
        configurator.setProperty("hibernate.format_sql", "true");
        configurator.setProperty("hibernate.use_sql_comments", "true");
        configurator.setProperty("hibernate.hbm2ddl.auto", "create");
        factory = configurator.buildEntityManagerFactory();
        manager = factory.createEntityManager();
        namespaces = new Namespaces(manager);

        uuidByPathByWorkspace = new HashMap<Long, Map<Path, UUID>>();
View Full Code Here

Examples of org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()

  public void testProgrammaticAPI() throws Exception {
    Ejb3Configuration conf = new Ejb3Configuration();
    conf.addAnnotatedClass( Cat.class );
    conf.addAnnotatedClass( Kitten.class );
    conf.addProperties(getProperties());
    EntityManagerFactory emf = conf.buildEntityManagerFactory();
    EntityManager em = emf.createEntityManager();
    Cat cat = new Cat();
    cat.setAge( 23 );
    cat.setDateOfBirth( new Date() );
    cat.setLength( 32 );
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.