Java Doc for Query.java in  » Database-ORM » MMBase » org » mmbase » bridge » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.bridge 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.mmbase.bridge.Query

All known Subclasses:   org.mmbase.bridge.implementation.BasicQuery,
Query
public interface Query extends SearchQuery,Cloneable(Code)
Representation of a (database) query. It is modifiable for use by bridge-users.
author:
   Michiel Meeuwissen
author:
   Pierre van Rooden
version:
   $Id: Query.java,v 1.45 2008/02/16 22:13:53 nklasens Exp $
since:
   MMBase-1.7
See Also:   org.mmbase.bridge.util.Queries




Method Summary
 AggregatedFieldaddAggregatedField(Step step, Field field, int aggregationType)
    
 StepFieldaddField(Step step, Field field)
     Adds a field to a step.
 StepFieldaddField(String field)
    
 voidaddNode(Step s, Node node)
     Adds a node to a step.
 voidaddNode(Step s, int number)
    
 RelationStepaddRelationStep(NodeManager nodeManager, String role, String searchDir)
     Adds new Relation step to the query.
 RelationStepaddRelationStep(NodeManager otherManager)
     If you need to add a 'related' NodeManager without specifying a role/searchDir simply use these addRelationStep.
 SortOrderaddSortOrder(StepField f, int direction, boolean caseSensitive, int part)
     Adds an order on a certain field.
 SortOrderaddSortOrder(StepField f, int direction, boolean caseSensitive)
    
 SortOrderaddSortOrder(StepField f, int direction)
     Defaulting version of Query.addSortOrder(StepField,int,boolean,int) (sorting case insensitively, and no date parts).
 StepaddStep(NodeManager nodeManager)
     Adds a NodeManager to this Query.
 QueryaggregatingClone()
     Creates an unused aggregate clone of this query.
 Objectclone()
    
 QuerycloneWithoutFields()
    
 LegacyConstraintcreateConstraint(String s)
     Create a contraint (for use with this Query object).
 FieldNullConstraintcreateConstraint(StepField f)
     Create a contraint (for use with this Query object).
 FieldValueConstraintcreateConstraint(StepField f, Object v)
     Create a contraint (for use with this Query object).
 FieldValueConstraintcreateConstraint(StepField f, int op, Object v)
     Create a contraint (for use with this Query object).
 FieldValueConstraintcreateConstraint(StepField f, int op, Object v, int part)
     Create a contraint (for use with this Query object).
 CompareFieldsConstraintcreateConstraint(StepField f, int op, StepField v)
     Create a contraint (for use with this Query object).
 FieldValueBetweenConstraintcreateConstraint(StepField f, Object o1, Object o2)
     Create a contraint (for use with this Query object).
 FieldValueInConstraintcreateConstraint(StepField f, SortedSet<? extends Object> v)
     Create a contraint (for use with this Query object).
 CompositeConstraintcreateConstraint(Constraint c1, int op, Constraint c2)
     Combines two Constraints to one new one, using a boolean operator (AND or OR).
 StepFieldcreateStepField(Step step, Field field)
     Creates a StepField object withouth adding it (needed for aggregated queries).
 StepFieldcreateStepField(Step step, String fieldName)
     Creates a StepField object withouth adding it (needed for aggregated queries).
 StepFieldcreateStepField(String fieldIdentifer)
     Creates the step field for the given name.
 ConstraintgetCleanConstraint()
     Gets the 'clean' constraint on this query.
 CloudgetCloud()
     Returns the Cloud for which this Query was defined.
 NodeListgetList()
     Executes the query and returns the resulting node list.
 StepgetStep(String stepAlias)
    
 booleanisAggregating()
     Whether this query is 'aggregating'.
 booleanisDistinct()
    
 booleanisUsed()
     Whether this query was used or not.
 booleanmarkUsed()
     Mark this query 'used'.
 voidremoveFields()
     Removes all fields from the Query object.
 voidsetAlias(Step step, String alias)
     Sets the alias to the given step.
Parameters:
  step - step to add the alias for
Parameters:
  alias - The alias which must be given to the step.
 FieldConstraintsetCaseSensitive(FieldConstraint constraint, boolean sensitive)
     Changes the given constraint's 'case sensitivity' (if applicable).
 voidsetConstraint(Constraint c)
     The (composite) constraint can actually be set into the query with this method.
 QuerysetDistinct(boolean distinct)
     Specifies wether the query result must contain only 'distinct' results.
 ConstraintsetInverse(Constraint c, boolean i)
     Changes the given constraint's 'inverse' (if applicable).
 QuerysetMaxNumber(int maxNumber)
     Limits the query-result to maxNumber records.
 QuerysetOffset(int offset)
     Offsets the query-result with offset records.
 StringtoSql()
     Shows the query in a human-readable SQL form.



Method Detail
addAggregatedField
AggregatedField addAggregatedField(Step step, Field field, int aggregationType)(Code)
Add an aggregated field to a step
Parameters:
  step - step to add field to
Parameters:
  field - field to add
Parameters:
  aggregationType - Type of aggregation new AggregatedField



addField
StepField addField(Step step, Field field)(Code)
Adds a field to a step.
Parameters:
  step - step to add field to
Parameters:
  field - field to add new StepField



addField
StepField addField(String field)(Code)
Adds a field by string
Parameters:
  field - field to add new StepField



addNode
void addNode(Step s, Node node)(Code)
Adds a node to a step.
Parameters:
  s - step
Parameters:
  node - node to add



addNode
void addNode(Step s, int number)(Code)

Parameters:
  s - query step
Parameters:
  number - node number
since:
   MMBase-1.8



addRelationStep
RelationStep addRelationStep(NodeManager nodeManager, String role, String searchDir)(Code)
Adds new Relation step to the query. Adds the next step as well, it can be retrieved by calling org.mmbase.storage.search.RelationStep.getNext getNext() on the relationstep, and cast to Step Step .
Parameters:
  nodeManager - node manager on the other side of the relation
Parameters:
  role - role of a relation
Parameters:
  searchDir - the direction of the relation new Relation step
throws:
  IllegalArgumentException - when an invalid argument is supplied.
throws:
  IllegalStateException - when there is no previous step.



addRelationStep
RelationStep addRelationStep(NodeManager otherManager)(Code)
If you need to add a 'related' NodeManager without specifying a role/searchDir simply use these addRelationStep.
Parameters:
  otherManager - node manager on the other side of the relation new Relation step



addSortOrder
SortOrder addSortOrder(StepField f, int direction, boolean caseSensitive, int part)(Code)
Adds an order on a certain field.
Parameters:
  f - field
Parameters:
  direction - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDING
Parameters:
  caseSensitive - case sensitivity
Parameters:
  part - part to sort on for a date value new SortOrder
See Also:   org.mmbase.storage.search.implementation.BasicSearchQuery.addSortOrder
since:
   MMBase-1.9



addSortOrder
SortOrder addSortOrder(StepField f, int direction, boolean caseSensitive)(Code)
Defaulting version of Query.addSortOrder(StepField,int,boolean,int) (no date parts)
Parameters:
  f - field
Parameters:
  direction - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDING
Parameters:
  caseSensitive - case sensitivity new SortOrder
since:
   MMBase-1.8



addSortOrder
SortOrder addSortOrder(StepField f, int direction)(Code)
Defaulting version of Query.addSortOrder(StepField,int,boolean,int) (sorting case insensitively, and no date parts).
Parameters:
  f - field
Parameters:
  direction - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDING new SortOrder



addStep
Step addStep(NodeManager nodeManager)(Code)
Adds a NodeManager to this Query. This can normally be done only once. After that you need to use (one of the) 'addRelationStep'.
Parameters:
  nodeManager - The nodeManager associated with the step. The 'step' wrapping the NodeManager.
throws:
  IllegalArgumentException - when an invalid argument is supplied.
See Also:   Query.addRelationStep(NodeManager)



aggregatingClone
Query aggregatingClone()(Code)
Creates an unused aggregate clone of this query. If this query is not itself aggregated, all fields are removed (but the contraints on them remain), and you can add aggregated fields then. Cloned Query



clone
Object clone()(Code)
Create an (unused) clone Cloned Query



cloneWithoutFields
Query cloneWithoutFields()(Code)
Clones this object, only without the fields Cloned Query



createConstraint
LegacyConstraint createConstraint(String s)(Code)
Create a contraint (for use with this Query object). The argument is a string, as also can be used as an argument of the 'non-query' getList. This should be considered legacy.
Parameters:
  s - String with LegacyConstraint LegacyConstraint
See Also:   Cloud.getList(String startNodesString nodePathString fieldsString constraintsString orderbyString directionsString searchDirboolean distinct)
See Also:   NodeManager.getList(String constraintsString orderbyString directions)



createConstraint
FieldNullConstraint createConstraint(StepField f)(Code)
Create a contraint (for use with this Query object). The given field must be 'null'.
Parameters:
  f - Stepfield FieldNullConstraint



createConstraint
FieldValueConstraint createConstraint(StepField f, Object v)(Code)
Create a contraint (for use with this Query object). The given field must equal the given value 'v'.
Parameters:
  f - field
Parameters:
  v - value FieldValueConstraint



createConstraint
FieldValueConstraint createConstraint(StepField f, int op, Object v)(Code)
Create a contraint (for use with this Query object). The given field and the given value 'v', combined with given operator must evaluate to true.
Parameters:
  f - field
Parameters:
  op - operator
Parameters:
  v - value FieldValueConstraint



createConstraint
FieldValueConstraint createConstraint(StepField f, int op, Object v, int part)(Code)
Create a contraint (for use with this Query object). The given date field and the given value 'v', combined with given operator must evaluate to true for the specified date part.
Parameters:
  f - field
Parameters:
  op - operator
Parameters:
  v - value
Parameters:
  part - part of the date value FieldValueConstraint



createConstraint
CompareFieldsConstraint createConstraint(StepField f, int op, StepField v)(Code)
Create a contraint (for use with this Query object). The two given fields , combined with given operator must evaluate to true.
Parameters:
  f - field
Parameters:
  op - operator
Parameters:
  v - value CompareFieldsConstraint



createConstraint
FieldValueBetweenConstraint createConstraint(StepField f, Object o1, Object o2)(Code)
Create a contraint (for use with this Query object). The given field must lie between the two given values.
Parameters:
  f - field
Parameters:
  o1 - value one
Parameters:
  o2 - value two FieldValueBetweenConstraint



createConstraint
FieldValueInConstraint createConstraint(StepField f, SortedSet<? extends Object> v)(Code)
Create a contraint (for use with this Query object). The given field value must be contained by the given set of values. If the given set is empty, a FieldValueInConstraint will be constructed for the number field in stead ('number IN (-1)'), which ensures that also in that case the logical thing will happen. (' IN ()' fails in most databases).
Parameters:
  f - field
Parameters:
  v - value the new Constraint.



createConstraint
CompositeConstraint createConstraint(Constraint c1, int op, Constraint c2)(Code)
Combines two Constraints to one new one, using a boolean operator (AND or OR). Every new constraint must be combined with the ones you already have with such a new CompositeConstraint. If the first constraint is a composite constraint (with the same logical operator), then the second one will simply be added.
Parameters:
  c1 - constraint one
Parameters:
  op - operator (CompositeConstraint.LOGICAL_AND, CompositeConstraint.LOGICAL_OR)
Parameters:
  c2 - constraint two a Composite constraint (might not be a new one)



createStepField
StepField createStepField(Step step, Field field)(Code)
Creates a StepField object withouth adding it (needed for aggregated queries).
Parameters:
  step - step to create StepField from
Parameters:
  field - field to create StepField from new StepField



createStepField
StepField createStepField(Step step, String fieldName)(Code)
Creates a StepField object withouth adding it (needed for aggregated queries).
Parameters:
  step - step to create StepField from
Parameters:
  fieldName - name of field to create StepField from new StepField



createStepField
StepField createStepField(String fieldIdentifer)(Code)
Creates the step field for the given name. For a NodeQuery the arguments is simply the name of the field. For a 'normal' query, it should be prefixed by the (automatic) alias of the Step.
Parameters:
  fieldIdentifer - field identifier to create StepField from new StepField



getCleanConstraint
Constraint getCleanConstraint()(Code)
Gets the 'clean' constraint on this query. I.e. the constraint which were automaticly added because of security are stripped away, and it is garanteed that you get back what you put in. It is adviced that you use this in stead of SearchQuery#getConstraint, because that function is used by the Query handlers, which do need the security constraints. But otherwise you don't want to see those. Constraint
since:
   MMBase-1.7.1



getCloud
Cloud getCloud()(Code)
Returns the Cloud for which this Query was defined. Cloud



getList
NodeList getList()(Code)
Executes the query and returns the resulting node list. resulting node list
since:
   MMBase-1.8



getStep
Step getStep(String stepAlias)(Code)
Returns the step with given alias, or null if it is not present
Parameters:
  stepAlias - Alias for the step (may also be tableName, in which case the first step for this table is returned) step with given alias



isAggregating
boolean isAggregating()(Code)
Whether this query is 'aggregating'. You can only use 'addAggregatedField' on aggregating querys. true if the query is aggregating



isDistinct
boolean isDistinct()(Code)

See Also:   org.mmbase.storage.search.SearchQuery.isDistinct



isUsed
boolean isUsed()(Code)
Whether this query was used or not. If is was used, then you cannot modify it anymore (would kill caches, and references to 'original query' would get invalid) query already used or not



markUsed
boolean markUsed()(Code)
Mark this query 'used'. It has to be copied first, if you want to add things to it. if this query is was used before this method call



removeFields
void removeFields()(Code)
Removes all fields from the Query object.



setAlias
void setAlias(Step step, String alias)(Code)
Sets the alias to the given step.
Parameters:
  step - step to add the alias for
Parameters:
  alias - The alias which must be given to the step. If it is "" an alias should begenerated. 'null' removes the alias.



setCaseSensitive
FieldConstraint setCaseSensitive(FieldConstraint constraint, boolean sensitive)(Code)
Changes the given constraint's 'case sensitivity' (if applicable). Default it is true.
Parameters:
  constraint - constraint to change
Parameters:
  sensitive - case sensitivity modified FieldConstraint



setConstraint
void setConstraint(Constraint c)(Code)
The (composite) constraint can actually be set into the query with this method.
Parameters:
  c - constraint



setDistinct
Query setDistinct(boolean distinct)(Code)
Specifies wether the query result must contain only 'distinct' results.
Parameters:
  distinct - 'distinct' results Query
See Also:   org.mmbase.storage.search.implementation.BasicSearchQuery.setDistinct
See Also:   Query.isDistinct



setInverse
Constraint setInverse(Constraint c, boolean i)(Code)
Changes the given constraint's 'inverse' (if applicable). Default it is (of course) false.
Parameters:
  c - constraint
Parameters:
  i - inverse Inversed contraint



setMaxNumber
Query setMaxNumber(int maxNumber)(Code)
Limits the query-result to maxNumber records.
Parameters:
  maxNumber - max number of results Query
See Also:   org.mmbase.storage.search.implementation.BasicSearchQuery.setMaxNumber



setOffset
Query setOffset(int offset)(Code)
Offsets the query-result with offset records.
Parameters:
  offset - offset in results Query
See Also:   org.mmbase.storage.search.implementation.BasicSearchQuery.setOffset



toSql
String toSql()(Code)
Shows the query in a human-readable SQL form. This is probably not the query which will actually be sent to the database. This method is provided because 'toString' on a Query object is pretty complete, but pretty undigestable for mere mortals too. human-readable SQL
since:
   MMBase-1.8



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.