Examples of buildEntityManagerFactory()


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


  private void initHibernate() {
    Ejb3Configuration config = new Ejb3Configuration();
    config.configure( "hibernate-search-example", new HashMap() );
    emf = config.buildEntityManagerFactory();
    em = emf.createEntityManager();
  }

  private void index() {
    FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession( ( Session ) em.getDelegate() );
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.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

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

  public void testProgrammaticCfg() throws Exception {
    Ejb3Configuration conf = new Ejb3Configuration();
    conf.configure( "org/hibernate/ejb/test/ejb3configuration/hibernate.cfg.xml" );
    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

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


    private void initHibernate() {
        Ejb3Configuration config = new Ejb3Configuration();
        config.configure("hibernate-search-${packageInPathFormat}", new HashMap());
        emf = config.buildEntityManagerFactory();
        em = emf.createEntityManager();
    }

    private void index() {
        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
View Full Code Here

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


  private void initHibernate() {
    Ejb3Configuration config = new Ejb3Configuration();
    config.configure( "hibernate-search-example", new HashMap() );
    emf = config.buildEntityManagerFactory();
    em = emf.createEntityManager();
  }

  private void index() {
    FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession( (Session) em.getDelegate() );
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() : super.createContainerEntityManagerFactory(info, map);
    }
   
    private void postProcessConfiguration(PersistenceUnitInfo info, Map map, Ejb3Configuration configured) {
        _configuration = configured;
       
View Full Code Here

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

        log.debug("Creating entity manager with the following configuration:");
        log.debug(properties);

        Ejb3Configuration configuration = new Ejb3Configuration();
        configuration.setProperties(properties);
        EntityManagerFactory factory = configuration.buildEntityManagerFactory();
        return factory;
    }


    /**
 
View Full Code Here

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

        }
        properties.put("hibernate.driver_class", driverClassName);
        properties.put("hibernate.connection.url", "jdbc:postgresql://localhost:5432/rhq");
        Ejb3Configuration configuration = new Ejb3Configuration();
        configuration.setProperties(properties);
        return configuration.buildEntityManagerFactory();
    }

    //ExistingDataJPABulkExportSource

    public static void main2(String[] args) throws Exception {
View Full Code Here

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

        }
        properties.put("hibernate.driver_class", driverClassName);
        properties.put("hibernate.connection.url", "jdbc:postgresql://localhost:5432/rhqdev");
        Ejb3Configuration configuration = new Ejb3Configuration();
        configuration.setProperties(properties);
        return configuration.buildEntityManagerFactory();
    }

}
View Full Code Here

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

    public void testSessionFactoryObserverProperty() {
        Ejb3Configuration conf = new Ejb3Configuration();
        conf.setProperty( AvailableSettings.SESSION_FACTORY_OBSERVER, GoofySessionFactoryObserver.class.getName() );
        conf.addAnnotatedClass( Bell.class );
        try {
            final EntityManagerFactory entityManagerFactory = conf.buildEntityManagerFactory();
            entityManagerFactory.close();
            fail("GoofyException should have been thrown");
        }
        catch ( GoofyException e ) {
            //success
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.