Example usage for org.hibernate.internal SessionFactoryImpl getSqlFunctionRegistry

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

Introduction

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

Prototype

public SQLFunctionRegistry getSqlFunctionRegistry() 

Source Link

Usage

From source file:org.ligoj.app.dao.SecuritySpringDataListener.java

License:MIT License

/**
 * Listener with EMF as context.//from ww  w . j  a  va 2 s  .  co m
 * 
 * @param emf The current EMF.
 */
@SuppressWarnings("unchecked")
@Autowired
public SecuritySpringDataListener(final LocalContainerEntityManagerFactoryBean emf) {
    final SessionFactoryImpl sessionFactory = (SessionFactoryImpl) emf.getNativeEntityManagerFactory();
    this.sqlFunctions = (Map<String, SQLFunction>) FieldUtils.getProtectedFieldValue("functionMap",
            sessionFactory.getSqlFunctionRegistry());
    this.dialect = sessionFactory.getJdbcServices().getJdbcEnvironment().getDialect();
}