Example usage for org.hibernate.type ObjectType INSTANCE

List of usage examples for org.hibernate.type ObjectType INSTANCE

Introduction

In this page you can find the example usage for org.hibernate.type ObjectType INSTANCE.

Prototype

ObjectType INSTANCE

To view the source code for org.hibernate.type ObjectType INSTANCE.

Click Source Link

Document

Singleton access

Usage

From source file:kr.debop4j.data.hibernate.tools.EntityTool.java

License:Apache License

/**
 * Contains locale.//from  w  ww  . j  a v a  2  s.  c  o  m
 *
 * @param entityClass  the entity class
 * @param propertyName the property name
 * @param value        the value
 * @param type         the type
 * @return the list
 */
public static <T extends ILocaleEntity<TLocaleValue>, TLocaleValue extends ILocaleValue> List<T> containsLocale(
        final Class<T> entityClass, final String propertyName, final Object value,
        final org.hibernate.type.Type type) {

    final String hql = String.format(GET_LIST_BY_LOCALE_PROPERTY, entityClass.getName(), propertyName,
            propertyName);
    if (log.isDebugEnabled())
        log.debug(
                "IEntity [{}] ? Locale ?[{}]? ? [{}] ?  . hql=[{}]",
                entityClass.getName(), propertyName, value, hql);

    IHibernateDao dao = new HibernateDao();
    return dao.find(entityClass, hql, new HibernateParameter(propertyName, value, ObjectType.INSTANCE));
}