|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Query
Representation of a (database) query. It is modifiable for use by bridge-users.
Queries| Field Summary |
|---|
| Fields inherited from interface org.mmbase.storage.search.SearchQuery |
|---|
DEFAULT_MAX_NUMBER, DEFAULT_OFFSET |
| Method Summary | |
|---|---|
AggregatedField |
addAggregatedField(Step step,
Field field,
int aggregationType)
Add an aggregated field to a step |
StepField |
addField(Step step,
Field field)
Adds a field to a step. |
StepField |
addField(String field)
Adds a field by string |
void |
addNode(Step s,
int number)
|
void |
addNode(Step s,
Node node)
Adds a node to a step. |
RelationStep |
addRelationStep(NodeManager otherManager)
If you need to add a 'related' NodeManager without specifying a role/searchDir simply use these addRelationStep. |
RelationStep |
addRelationStep(NodeManager nodeManager,
String role,
String searchDir)
Adds new Relation step to the query. |
SortOrder |
addSortOrder(StepField f,
int direction)
Defaulting version of addSortOrder(StepField, int, boolean, int) (sorting case
insensitively, and no date parts). |
SortOrder |
addSortOrder(StepField f,
int direction,
boolean caseSensitive)
Defaulting version of addSortOrder(StepField, int, boolean, int) (no date parts) |
SortOrder |
addSortOrder(StepField f,
int direction,
boolean caseSensitive,
int part)
Adds an order on a certain field. |
Step |
addStep(NodeManager nodeManager)
Adds a NodeManager to this Query. |
Query |
aggregatingClone()
Creates an unused aggregate clone of this query. |
Query |
clone()
Create an (unused) clone |
Query |
cloneWithoutFields()
Clones this object, only without the fields |
CompositeConstraint |
createConstraint(Constraint c1,
int op,
Constraint c2)
Combines two Constraints to one new one, using a boolean operator (AND or OR). |
FieldNullConstraint |
createConstraint(StepField f)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
int op,
Object v)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
int op,
Object v,
int part)
Create a constraint (for use with this Query object). |
CompareFieldsConstraint |
createConstraint(StepField f,
int op,
StepField v)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
Object v)
Create a constraint (for use with this Query object). |
FieldValueBetweenConstraint |
createConstraint(StepField f,
Object o1,
Object o2)
Create a constraint (for use with this Query object). |
FieldValueInQueryConstraint |
createConstraint(StepField f,
Query q)
|
FieldValueInConstraint |
createConstraint(StepField f,
SortedSet<? extends Object> v)
Create a constraint (for use with this Query object). |
LegacyConstraint |
createConstraint(String s)
Create a constraint (for use with this Query object). |
StepField |
createStepField(Step step,
Field field)
Creates a StepField object withouth adding it (needed for aggregated queries). |
StepField |
createStepField(Step step,
String fieldName)
Creates a StepField object withouth adding it (needed for aggregated queries). |
StepField |
createStepField(String fieldIdentifer)
Creates the step field for the given name. |
Constraint |
getCleanConstraint()
Gets the 'clean' constraint on this query. |
Cloud |
getCloud()
Returns the Cloud for which this Query was defined. |
NodeList |
getList()
Executes the query and returns the resulting node list. |
Step |
getStep(String stepAlias)
Returns the step with given alias, or null if it is not present |
boolean |
isUsed()
Whether this query was used or not. |
boolean |
markUsed()
Mark this query 'used'. |
void |
removeFields()
Removes all fields from the Query object. |
void |
removeImplicitFields()
|
void |
setAlias(Step step,
String alias)
Sets the alias to the given step. |
FieldConstraint |
setCaseSensitive(FieldConstraint constraint,
boolean sensitive)
Changes the given constraint's 'case sensitivity' (if applicable). |
void |
setConstraint(Constraint c)
The (composite) constraint can actually be set into the query with this method. |
Query |
setDistinct(boolean distinct)
Specifies wether the query result must contain only 'distinct' results. |
Constraint |
setInverse(Constraint c,
boolean i)
Changes the given constraint's 'inverse' (if applicable). |
Query |
setMaxNumber(int maxNumber)
Limits the query-result to maxNumber records. |
Query |
setOffset(int offset)
Offsets the query-result with offset records. |
String |
toSql()
Shows the query in a human-readable SQL form. |
| Methods inherited from interface org.mmbase.storage.search.SearchQuery |
|---|
equals, getConstraint, getFields, getMaxNumber, getOffset, getSortOrders, getSteps, hashCode, isAggregating, isDistinct, toString |
| Methods inherited from interface org.mmbase.cache.Cacheable |
|---|
getCachePolicy, setCachePolicy |
| Methods inherited from interface org.mmbase.storage.search.SearchQueryWrapper |
|---|
unwrap |
| Method Detail |
|---|
Cloud getCloud()
Step addStep(NodeManager nodeManager)
nodeManager - The nodeManager associated with the step.
IllegalArgumentException - when an invalid argument is supplied.addRelationStep(NodeManager)
void setAlias(Step step,
String alias)
step - step to add the alias foralias - The alias which must be given to the step. If it is "" an alias should be
generated. 'null' removes the alias.Step getStep(String stepAlias)
stepAlias - Alias for the step (may also be tableName, in which case the first step for this table is returned)
RelationStep addRelationStep(NodeManager nodeManager,
String role,
String searchDir)
getNext() on
the relationstep, and cast to Step.
nodeManager - node manager on the other side of the relationrole - role of a relationsearchDir - the direction of the relation
IllegalArgumentException - when an invalid argument is supplied.
IllegalStateException - when there is no previous step.RelationStep addRelationStep(NodeManager otherManager)
otherManager - node manager on the other side of the relation
StepField addField(Step step,
Field field)
step - step to add field tofield - field to add
StepField addField(String field)
field - field to add
void removeFields()
StepField createStepField(Step step,
Field field)
step - step to create StepField fromfield - field to create StepField from
StepField createStepField(Step step,
String fieldName)
step - step to create StepField fromfieldName - name of field to create StepField from
StepField createStepField(String fieldIdentifer)
fieldIdentifer - field identifier to create StepField from
AggregatedField addAggregatedField(Step step,
Field field,
int aggregationType)
step - step to add field tofield - field to addaggregationType - Type of aggregation
Query setDistinct(boolean distinct)
distinct - 'distinct' results
BasicSearchQuery.setDistinct(boolean),
SearchQuery.isDistinct()Query setMaxNumber(int maxNumber)
maxNumber - max number of results
BasicSearchQuery.setMaxNumber(int)Query setOffset(int offset)
offset - offset in results
BasicSearchQuery.setOffset(int)Constraint getCleanConstraint()
LegacyConstraint createConstraint(String s)
s - String with LegacyConstraint
Cloud.getList(String startNodes, String nodePath, String fields, String constraints, String orderby, String directions, String searchDir, boolean distinct),
NodeManager.getList(String constraints, String orderby, String directions)FieldNullConstraint createConstraint(StepField f)
f - Stepfield
FieldValueConstraint createConstraint(StepField f,
Object v)
f - fieldv - value
FieldValueConstraint createConstraint(StepField f,
int op,
Object v)
f - fieldop - operatorv - value
FieldValueConstraint createConstraint(StepField f,
int op,
Object v,
int part)
f - fieldop - operatorv - valuepart - part of the date value
CompareFieldsConstraint createConstraint(StepField f,
int op,
StepField v)
f - fieldop - operatorv - value
FieldValueBetweenConstraint createConstraint(StepField f,
Object o1,
Object o2)
f - fieldo1 - value oneo2 - value two
FieldValueInConstraint createConstraint(StepField f,
SortedSet<? extends Object> v)
f - fieldv - value
FieldValueInQueryConstraint createConstraint(StepField f,
Query q)
FieldConstraint setCaseSensitive(FieldConstraint constraint,
boolean sensitive)
constraint - constraint to changesensitive - case sensitivity
Constraint setInverse(Constraint c,
boolean i)
c - constrainti - inverse
CompositeConstraint createConstraint(Constraint c1,
int op,
Constraint c2)
c1 - constraint oneop - operator (CompositeConstraint.LOGICAL_AND, CompositeConstraint.LOGICAL_OR)c2 - constraint two
void setConstraint(Constraint c)
c - constraint
SortOrder addSortOrder(StepField f,
int direction,
boolean caseSensitive,
int part)
f - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDINGcaseSensitive - case sensitivitypart - part to sort on for a date value
BasicSearchQuery.addSortOrder(org.mmbase.storage.search.StepField)
SortOrder addSortOrder(StepField f,
int direction,
boolean caseSensitive)
addSortOrder(StepField, int, boolean, int) (no date parts)
f - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDINGcaseSensitive - case sensitivity
SortOrder addSortOrder(StepField f,
int direction)
addSortOrder(StepField, int, boolean, int) (sorting case
insensitively, and no date parts).
f - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDING
void addNode(Step s,
Node node)
s - stepnode - node to add
void addNode(Step s,
int number)
s - query stepnumber - node numberboolean isUsed()
boolean markUsed()
markUsed in interface SearchQueryQuery clone()
clone in interface PublicCloneable<Query>Query cloneWithoutFields()
Query aggregatingClone()
NodeList getList()
String toSql()
void removeImplicitFields()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||