public interface Query extends SearchQuery, PublicCloneable<Query>, SearchQueryWrapper
QueriesDEFAULT_MAX_NUMBER, DEFAULT_OFFSET| Modifier and Type | Method and Description |
|---|---|
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.
|
equals, getConstraint, getFields, getMaxNumber, getOffset, getSortOrders, getSteps, hashCode, isAggregating, isDistinct, toStringgetCachePolicy, setCachePolicyunwrapCloud 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 relationIllegalArgumentException - 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 relationStepField addField(Step step, Field field)
step - step to add field tofield - field to addStepField addField(String field)
field - field to addvoid removeFields()
StepField createStepField(Step step, Field field)
step - step to create StepField fromfield - field to create StepField fromStepField createStepField(Step step, String fieldName)
step - step to create StepField fromfieldName - name of field to create StepField fromStepField createStepField(String fieldIdentifer)
fieldIdentifer - field identifier to create StepField fromAggregatedField addAggregatedField(Step step, Field field, int aggregationType)
step - step to add field tofield - field to addaggregationType - Type of aggregationQuery setDistinct(boolean distinct)
distinct - 'distinct' resultsBasicSearchQuery.setDistinct(boolean),
SearchQuery.isDistinct()Query setMaxNumber(int maxNumber)
maxNumber - max number of resultsBasicSearchQuery.setMaxNumber(int)Query setOffset(int offset)
offset - offset in resultsBasicSearchQuery.setOffset(int)Constraint getCleanConstraint()
LegacyConstraint createConstraint(String s)
s - String with LegacyConstraintCloud.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 - StepfieldFieldValueConstraint createConstraint(StepField f, Object v)
f - fieldv - valueFieldValueConstraint createConstraint(StepField f, int op, Object v)
f - fieldop - operatorv - valueFieldValueConstraint createConstraint(StepField f, int op, Object v, int part)
f - fieldop - operatorv - valuepart - part of the date valueCompareFieldsConstraint createConstraint(StepField f, int op, StepField v)
f - fieldop - operatorv - valueFieldValueBetweenConstraint createConstraint(StepField f, Object o1, Object o2)
f - fieldo1 - value oneo2 - value twoFieldValueInConstraint createConstraint(StepField f, SortedSet<? extends Object> v)
f - fieldv - valueFieldValueInQueryConstraint createConstraint(StepField f, Query q)
FieldConstraint setCaseSensitive(FieldConstraint constraint, boolean sensitive)
constraint - constraint to changesensitive - case sensitivityConstraint setInverse(Constraint c, boolean i)
c - constrainti - inverseCompositeConstraint createConstraint(Constraint c1, int op, Constraint c2)
c1 - constraint oneop - operator (CompositeConstraint.LOGICAL_AND, CompositeConstraint.LOGICAL_OR)c2 - constraint twovoid setConstraint(Constraint c)
c - constraintSortOrder 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 valueBasicSearchQuery.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 sensitivitySortOrder 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_DESCENDINGvoid addNode(Step s, Node node)
s - stepnode - node to addvoid 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()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}