ch.elca.el4j.services.search.criterias
Class LikeCriteria

java.lang.Object
  extended by ch.elca.el4j.services.search.criterias.AbstractCriteria
      extended by ch.elca.el4j.services.search.criterias.LikeCriteria
All Implemented Interfaces:
Criteria, Serializable

public class LikeCriteria
extends AbstractCriteria

Criteria for the like pattern.

Author:
Martin Zeltner (MZE)
See Also:
Serialized Form
File-location:
LikeCriteria
Last check-in date:
2009-08-04 15:17:52 +0200 (Di, 04. Aug 2009) by swismer for revision 3880

Constructor Summary
protected LikeCriteria()
          Default constructor for remoting protocols like hessian added.
protected LikeCriteria(String field, String value, boolean caseSensitive)
          Hidden constructor.
 
Method Summary
static LikeCriteria caseInsensitive(String field, String value)
           
static LikeCriteria caseSensitive(String field, String value)
           
 String getSqlWhereCondition()
          The full Criteria as SQL representation.
 String getType()
          
 Boolean isCaseSensitive()
           
 
Methods inherited from class ch.elca.el4j.services.search.criterias.AbstractCriteria
getBooleanValue, getByteValue, getDoubleValue, getField, getFloatValue, getIntegerValue, getLongValue, getShortValue, getStringValue, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LikeCriteria

protected LikeCriteria()
Default constructor for remoting protocols like hessian added.


LikeCriteria

protected LikeCriteria(String field,
                       String value,
                       boolean caseSensitive)
Hidden constructor.

Parameters:
field - Is the field the criteria is made for.
value - Is the value of this criteria.
caseSensitive - Marks if the pattern is case sensitive.
Method Detail

caseInsensitive

public static LikeCriteria caseInsensitive(String field,
                                           String value)
Parameters:
field - Is the field the criteria is made for.
value - Is the value of this criteria.
Returns:
Returns a case insensitive pattern criteria.

caseSensitive

public static LikeCriteria caseSensitive(String field,
                                         String value)
Parameters:
field - Is the field the criteria is made for.
value - Is the value of this criteria.
Returns:
Returns a case sensitive pattern criteria.

isCaseSensitive

public final Boolean isCaseSensitive()
Returns:
Returns true if it is case sensitive.

getType

public String getType()

Returns:
Returns the criteria type.

getSqlWhereCondition

public String getSqlWhereCondition()
The full Criteria as SQL representation. This does not mean that we want to break encapsulation (Criteria should be independent of the database) but SQL is a representation that is easy to understand.

Returns:
an SQL string as it could occur in a SQL WHERE clause


Copyright © 2005-2011 ELCA. All Rights Reserved.