Example usage for org.hibernate Session getTypeHelper

List of usage examples for org.hibernate Session getTypeHelper

Introduction

In this page you can find the example usage for org.hibernate Session getTypeHelper.

Prototype

TypeHelper getTypeHelper();

Source Link

Document

Convenience access to the TypeHelper associated with this session's SessionFactory .

Usage

From source file:fi.vm.sade.eperusteet.repository.custom.TekstiPalanenRepositoryCustomImpl.java

License:EUPL

protected <E extends Enum<E>> Type enumType(Session session, Class<E> e) {
    Properties params = new Properties();
    params.put("enumClass", e.getCanonicalName());
    params.put("type", "12");/*type 12 instructs to use the String representation of enum value*/
    return session.getTypeHelper().custom(EnumType.class, params);
}