Example usage for org.hibernate.criterion Restrictions ilike

List of usage examples for org.hibernate.criterion Restrictions ilike

Introduction

In this page you can find the example usage for org.hibernate.criterion Restrictions ilike.

Prototype

public static Criterion ilike(String propertyName, String value, MatchMode matchMode) 

Source Link

Document

A case-insensitive "like" (similar to Postgres ilike operator) using the provided match mode

Usage

From source file:de.forsthaus.backend.dao.impl.OfficeDAOImpl.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override//  w  w  w  . j av a 2 s  .  c  om
public List<Office> getOfficesLikeNo(String string) {

    DetachedCriteria criteria = DetachedCriteria.forClass(Office.class);
    criteria.add(Restrictions.ilike("filNr", string, MatchMode.ANYWHERE));

    return getHibernateTemplate().findByCriteria(criteria);
}

From source file:de.forsthaus.backend.dao.impl.SecGroupDAOImpl.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override//from  w w  w .  j av a  2  s .  c o m
public List<SecGroup> getGroupsLikeGroupName(String aGroupName) {
    DetachedCriteria criteria = DetachedCriteria.forClass(SecGroup.class);
    criteria.add(Restrictions.ilike("grpShortdescription", aGroupName, MatchMode.ANYWHERE));

    return getHibernateTemplate().findByCriteria(criteria);
}

From source file:de.forsthaus.backend.dao.impl.SecRightDAOImpl.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override/*from  w w w  . j  a v  a2 s  . co m*/
public List<SecRight> getRightsLikeRightName(String aRightName) {

    final DetachedCriteria criteria = DetachedCriteria.forClass(SecRight.class);
    criteria.add(Restrictions.ilike("rigName", aRightName, MatchMode.ANYWHERE));

    return getHibernateTemplate().findByCriteria(criteria);
}

From source file:de.forsthaus.backend.dao.impl.SecRightDAOImpl.java

License:Open Source License

@SuppressWarnings("unchecked")
@Override//  ww  w  .j  a  va  2s. co m
public List<SecRight> getRightsLikeRightNameAndType(String aRightName, int aRightType) {

    // check if the empty right is selected. This right is only for visual
    // behavior.
    if (aRightType == -1) {
        return getRightsLikeRightName(aRightName);
    }

    final DetachedCriteria criteria = DetachedCriteria.forClass(SecRight.class);
    criteria.add(Restrictions.and(Restrictions.ilike("rigName", aRightName, MatchMode.ANYWHERE),
            Restrictions.eq("rigType", Integer.valueOf(aRightType))));

    return getHibernateTemplate().findByCriteria(criteria);
}