org.apache.ojb.broker.query
Class LikeCriteria
java.lang.Object
org.apache.ojb.broker.query.SelectionCriteria
org.apache.ojb.broker.query.ValueCriteria
org.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 365232 2005-12-21 22:36:07Z tomdz $
- 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)
|
LikeCriteria(java.lang.Object anAttribute,
java.lang.Object aValue,
java.lang.String aClause,
UserAlias anAlias)
|
Method Summary |
void |
bind(java.lang.Object newValue)
sets the value of the criteria to newValue. |
static char |
getEscapeCharacter()
|
static void |
setEscapeCharacter(char escChar)
Global change of the escapeCharacter |
Methods inherited from class org.apache.ojb.broker.query.SelectionCriteria |
getAlias, getAttribute, getClassesForPath, getCriteria, getNumberOfExtentsToBind, getPathClasses, getQuery, getUserAlias, getValue, isBound, isTranslateAttribute, setAlias, setAlias, setAlias, setNumberOfExtentsToBind, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_ESCPAPE_CHARACTER
public static final char DEFAULT_ESCPAPE_CHARACTER
- The Dfault-Character used for Escaping Wildcards
- See Also:
- Constant Field Values
LikeCriteria
public LikeCriteria(java.lang.Object anAttribute,
java.lang.Object aValue,
java.lang.String aClause,
java.lang.String anAlias)
- Parameters:
anAttribute
- aValue
- aClause
- anAlias
-
LikeCriteria
public LikeCriteria(java.lang.Object anAttribute,
java.lang.Object aValue,
java.lang.String aClause,
UserAlias anAlias)
- Parameters:
anAttribute
- aValue
- aClause
- anAlias
-
bind
public void bind(java.lang.Object newValue)
- Description copied from class:
SelectionCriteria
- sets the value of the criteria to newValue. Used by the ODMG OQLQuery.bind() operation
- Overrides:
bind
in class SelectionCriteria
- See Also:
SelectionCriteria.bind(java.lang.Object)
getEscapeCharacter
public static char getEscapeCharacter()
- Returns:
- Returns the escapeCharacter.
setEscapeCharacter
public static void setEscapeCharacter(char escChar)
- Global change of the escapeCharacter
- Parameters:
escChar
- The escapeCharacter to set.
(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30