Example usage for org.hibernate.internal SessionFactoryImpl getEntityPersister

List of usage examples for org.hibernate.internal SessionFactoryImpl getEntityPersister

Introduction

In this page you can find the example usage for org.hibernate.internal SessionFactoryImpl getEntityPersister.

Prototype

@Deprecated
default EntityPersister getEntityPersister(String entityName) throws MappingException 

Source Link

Usage

From source file:ch.algotrader.util.HibernateUtil.java

License:Open Source License

private static AbstractEntityPersister getEntityPersister(SessionFactory sessionFactory, Class<?> type) {

    String className = StringUtils.removeEnd(type.getName(), "Impl") + "Impl";
    SessionFactoryImpl sessionFactoryImpl = (SessionFactoryImpl) sessionFactory;
    return (AbstractEntityPersister) sessionFactoryImpl.getEntityPersister(className);
}