|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.repository.query.Query
public class Query
The Query
class represents a query against the Repository, which offers basic query capabilities.
Queries contain one or more statements, joined together with conditions
(either Query.CONDITION_AND
or Query.CONDITION_OR
representing logical AND
and OR
, respectively).
The default condition is AND
. Statements consist of a left operand, an operator, and a right operand.
The left operand contains a metadata name (for example, "name"
).
The right operand contains the query value (for example, "foobar"
).
The operators are listed in Query.Statement
.
The Query
class does not support grouping of statements.
Query.Statement
,
Serialized FormNested Class Summary | |
---|---|
static class |
Query.Statement
This is the query statement class. |
Field Summary | |
---|---|
static java.lang.Short |
CONDITION_AND
A logical AND . |
static java.lang.Short |
CONDITION_OR
A logical OR . |
Constructor Summary | |
---|---|
Query()
|
Method Summary | |
---|---|
void |
addStatement(Query.Statement statement)
Add a statement to the query. |
void |
addStatement(Query.Statement statement,
java.lang.Short condition)
Adds a statement to the query. |
java.lang.Object[] |
getQueryTokens()
Returns an array of query tokens. |
java.util.List |
getStatements()
|
void |
setStatements(java.util.List statements)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.Short CONDITION_AND
AND
.
public static java.lang.Short CONDITION_OR
OR
.
Constructor Detail |
---|
public Query()
Method Detail |
---|
public void setStatements(java.util.List statements)
public java.util.List getStatements()
public void addStatement(Query.Statement statement)
AND
will be prepended to the query statement.
For example, given the query:
select * from Resources where name="foo"
and the addition of a new statement
version = "1.0"
the AND
operator is prepended to the version statement; not to the query:
select * from Resources where name="foo" AND version = "1.0"
statement
- The statement to add.public void addStatement(Query.Statement statement, java.lang.Short condition)
statement
- The statement to add.condition
- The condition to use.public java.lang.Object[] getQueryTokens()
[Statement,Short,Statement]
.
Read through the array using instanceof
. Each token will either be a Query.Statement
or
a value representing a condition joining two statements.
Query.Statement
objects as well as condition values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |