List of usage examples for org.hibernate.engine.spi SessionFactoryImplementor getTypeHelper
TypeHelper getTypeHelper();
From source file:com.blazebit.persistence.impl.hibernate.function.HibernateJpqlFunctionAdapter.java
License:Apache License
@Override public Type getReturnType(Type firstArgumentType, Mapping mapping) throws QueryException { SessionFactoryImplementor sfi = (SessionFactoryImplementor) mapping; Class<?> argumentClass; if (firstArgumentType == null) { argumentClass = null;/*from w w w .ja v a2s . c om*/ } else { argumentClass = firstArgumentType.getReturnedClass(); } Class<?> returnType = function.getReturnType(argumentClass); if (returnType == null) { return null; } else if (argumentClass == returnType) { return firstArgumentType; } Type type = sfi.getTypeHelper().basic(returnType); if (type != null) { return type; } if (sfi.getClassMetadata(returnType) != null) { return sfi.getTypeHelper().entity(returnType); } return sfi.getTypeHelper().custom(returnType); }