use of org.hibernate.ejb.Ejb3Configuration in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newJpaConfiguration.
@Override
public IConfiguration newJpaConfiguration(String entityResolver, String persistenceUnit, Map<Object, Object> overrides) {
getUsageTracker().trackNewConfigurationEvent(HIBERNATE_VERSION);
Ejb3Configuration ejb3Configuration = new Ejb3Configuration();
if (StringHelper.isNotEmpty(entityResolver)) {
try {
Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
Object object = resolver.newInstance();
ejb3Configuration.setEntityResolver((EntityResolver) object);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new HibernateConsoleRuntimeException(e);
}
}
ejb3Configuration.configure(persistenceUnit, overrides);
Configuration configuration = ejb3Configuration.getHibernateConfiguration();
return facadeFactory.createConfiguration(configuration);
}
use of org.hibernate.ejb.Ejb3Configuration in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newJpaConfiguration.
@Override
public IConfiguration newJpaConfiguration(String entityResolver, String persistenceUnit, Map<Object, Object> overrides) {
getUsageTracker().trackNewConfigurationEvent(HIBERNATE_VERSION);
Ejb3Configuration ejb3Configuration = new Ejb3Configuration();
if (StringHelper.isNotEmpty(entityResolver)) {
try {
Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
Object object = resolver.newInstance();
ejb3Configuration.setEntityResolver((EntityResolver) object);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new HibernateException(e);
}
}
ejb3Configuration.configure(persistenceUnit, overrides);
Configuration configuration = ejb3Configuration.getHibernateConfiguration();
return facadeFactory.createConfiguration(configuration);
}
Aggregations