public class DBCriteria extends java.lang.Object implements DBClause, java.lang.Cloneable
| Constructor and Description |
|---|
DBCriteria()
Creates new DBClause
|
DBCriteria(boolean andCriteria)
database clause
|
DBCriteria(boolean andCriteria,
boolean notMode)
database clause
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClause(DataSource ds,
DBClass baseClass,
java.lang.String path,
java.lang.String value)
add a clause
|
void |
addClause(DataSource ds,
DBClass baseClass,
java.lang.String path,
java.lang.String symbol,
java.lang.Object value)
add a clause
|
void |
addClause(DBClause qc)
add a clause
|
java.lang.Object |
clone()
clone the clause
|
DBClause |
cloneOpposite()
create a opposite a clause
|
int |
count()
The number of constraints for this criteria
|
void |
decode(DataSource ds,
DBClassConcrete dbClass,
java.lang.String clauses)
decode the criteria
|
DBClause |
doClone() |
DBClause |
getClause(int pos)
get a clause at a position
|
java.lang.String |
getDescription(int level)
get the description
|
boolean |
isAndCriteria()
is this an AND criteria
|
boolean |
isBottomLevel(VirtualDB vDB)
Is this the bottom possible level for this criteria ?
If this is an AND criteria then any positive clause that map to a field that is defined in this layer means this is the bottom layer. |
boolean |
isComplex()
Is this criteria complex ?
|
boolean |
isFinal()
is the clause marked as final ?
|
boolean |
isNotMode()
is NOT mode
|
DBClause[] |
listAndClauses()
Returns as many clauses as possible that are ANDed together
This is used to determine the clauses that can be used directly
in a select while not excluding data that could be valid by the
use of an OR criteria.
|
boolean |
matches(DBObject obj,
HintField hint)
does the object match ?
|
boolean |
omitsAll()
is this clause is marked as OMIT ALL
|
DBClause |
removeClause(int pos)
Removes a clause at a position
|
void |
setDescription(java.lang.String description)
The description
|
void |
setFinal()
make the clause final ( and remove blank clauses)
|
java.lang.String |
toString()
display the clause
|
java.lang.String |
toString(int level)
display the clause
|
java.lang.String |
where() |
public DBCriteria()
public DBCriteria(boolean andCriteria)
andCriteria - is an and criteriapublic DBCriteria(boolean andCriteria,
boolean notMode)
andCriteria - is an and criterianotMode - is not mode@CheckReturnValue public boolean isNotMode()
public void decode(DataSource ds, DBClassConcrete dbClass, java.lang.String clauses) throws java.lang.Exception
ds - the data sourcedbClass - The base classclauses - the clauses to decodejava.lang.Exception - a serious problempublic void addClause(DataSource ds, DBClass baseClass, java.lang.String path, java.lang.String symbol, java.lang.Object value) throws InvalidClauseException
ds - the datasourcebaseClass - The base classpath - the path of the clausesymbol - the symbolvalue - the value to matchInvalidClauseException - invalid clausepublic void addClause(DataSource ds, DBClass baseClass, java.lang.String path, java.lang.String value) throws java.lang.Exception
ds - the datasourcebaseClass - The base classpath - the path of the clausevalue - the value to matchjava.lang.Exception - a serious problempublic void addClause(@Nullable
DBClause qc)
qc - a clause@CheckReturnValue public final int count()
@CheckReturnValue @Nullable public final DBClause getClause(@Nonnegative int pos)
pos - the position@Nullable public final DBClause removeClause(@Nonnegative int pos)
pos - the position@CheckReturnValue public final boolean isComplex()
@CheckReturnValue public boolean matches(DBObject obj, @Nullable HintField hint)
@CheckReturnValue public boolean isAndCriteria()
public void setFinal()
@CheckReturnValue public final boolean isFinal()
@CheckReturnValue
public boolean omitsAll()
throws java.lang.Exception
java.lang.Exception - a serious problem@CheckReturnValue public boolean isBottomLevel(VirtualDB vDB)
isBottomLevel in interface DBClausevDB - the layer@Nonnull @CheckReturnValue public DBClause doClone()
@CheckReturnValue
@Nonnull
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - not thrown@CheckReturnValue public DBClause cloneOpposite() throws java.lang.CloneNotSupportedException
cloneOpposite in interface DBClausejava.lang.CloneNotSupportedException - not thrown@CheckReturnValue public DBClause[] listAndClauses()
public void setDescription(@Nullable
java.lang.String description)
description - a text description@CheckReturnValue @Nonnull public java.lang.String getDescription(int level)
level - the level@CheckReturnValue @Nonnull public java.lang.String where()
@CheckReturnValue @Nonnull public java.lang.String toString()
toString in class java.lang.Object@CheckReturnValue @Nonnull public java.lang.String toString(int level)
level - indent levelstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.