IlikeExpressionpublic class IlikeExpression extends Object implements CriterionA case-insensitive "like" |
Fields Summary |
---|
private final String | propertyName | private final Object | value |
Constructors Summary |
---|
protected IlikeExpression(String propertyName, Object value)
this.propertyName = propertyName;
this.value = value;
| protected IlikeExpression(String propertyName, String value, MatchMode matchMode)
this( propertyName, matchMode.toMatchString(value) );
|
Methods Summary |
---|
public org.hibernate.engine.TypedValue[] | getTypedValues(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)
return new TypedValue[] { criteriaQuery.getTypedValue( criteria, propertyName, value.toString().toLowerCase() ) };
| public java.lang.String | toSqlString(org.hibernate.Criteria criteria, CriteriaQuery criteriaQuery)
Dialect dialect = criteriaQuery.getFactory().getDialect();
String[] columns = criteriaQuery.getColumnsUsingProjection(criteria, propertyName);
if (columns.length!=1) throw new HibernateException("ilike may only be used with single-column properties");
if ( dialect instanceof PostgreSQLDialect ) {
return columns[0] + " ilike ?";
}
else {
return dialect.getLowercaseFunction() + '(" + columns[0] + ") like ?";
}
//TODO: get SQL rendering out of this package!
| public java.lang.String | toString()
return propertyName + " ilike " + value;
|
|