Hi does anyone know what the preferred way to do programmatically create a JPA EntityManagerFactory impl from Hibernate in Hibernate 4+?
I used hsql to do this, but its depricated;
Properties props = new Properties();
props.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLInnoDBDialect");
props.setProperty("hibernate.connection.driver_class", "org.hsqldb.jdbcDriver");
props.setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:aname");
props.setProperty("hibernate.connection.username", "sa" );
props.setProperty("hibernate.connection.password", "" );
Ejb3Configuration config3 = new Ejb3Configuration();
config3.setProperties(props);
config3.addFile("src/org/adligo/i/storage/entities/keyValue.xml");
impl = config3.buildEntityManagerFactory();
This seems to be the new way, but I keep getting NPEs;
impl = new EntityManagerFactoryImpl(transactionType, false,
clazz, config, serviceRegistry, "i_storage_tests_persistence_unit");
TIA, Scott