org.apache.ojb.broker.query
Class LikeCriteria

java.lang.Object
  extended byorg.apache.ojb.broker.query.SelectionCriteria
      extended byorg.apache.ojb.broker.query.ValueCriteria
          extended byorg.apache.ojb.broker.query.LikeCriteria
All Implemented Interfaces:
java.io.Serializable

public class LikeCriteria
extends ValueCriteria

Model a Like Criteria
Escape Processing by Paul R. Nase

The pattern string is a simple pattern string using % or * as a wildcard. So Ander* would match Anderson and Anderton. The _ or ? character is used to match a single occurence of a character. The '\' is used to escape the wildcard characters so that we can search for strings containing * and ?.

To change the escape character use setEscapeCharacter.

Version:
$Id: LikeCriteria.java,v 1.6 2004/02/23 12:12:46 thma Exp $
Author:
Jakob Braeuchi , Paul Nase
See Also:
setEscapeCharacter(char), Serialized Form

Constructor Summary
LikeCriteria(java.lang.Object anAttribute, java.lang.Object aValue, java.lang.String aClause, java.lang.String anAlias)
           
 
Method Summary
static char getEscapeCharacter()
           
static void setEscapeCharacter(char escapeCharacter)
          Global change of the escapeCharacter
 
Methods inherited from class org.apache.ojb.broker.query.ValueCriteria
getClause
 
Methods inherited from class org.apache.ojb.broker.query.SelectionCriteria
bind, getAlias, getAttribute, getCriteria, getNumberOfExtentsToBind, getQuery, getValue, isBound, isTranslateAttribute, setAlias, setNumberOfExtentsToBind, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LikeCriteria

public LikeCriteria(java.lang.Object anAttribute,
                    java.lang.Object aValue,
                    java.lang.String aClause,
                    java.lang.String anAlias)
Parameters:
anAttribute -
aValue -
aClause -
anAlias -
Method Detail

getEscapeCharacter

public static char getEscapeCharacter()
Returns:
Returns the escapeCharacter.

setEscapeCharacter

public static void setEscapeCharacter(char escapeCharacter)
Global change of the escapeCharacter

Parameters:
escapeCharacter - The escapeCharacter to set.


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14