Java Doc for SqlQueryBuilder.java in  » J2EE » fleXive » com » flexive » shared » search » query » 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 » J2EE » fleXive » com.flexive.shared.search.query 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.shared.search.query.SqlQueryBuilder

SqlQueryBuilder
public class SqlQueryBuilder implements Serializable(Code)
Query Builder for flexive SQL queries. Supports incremental adding of conditions, filter and order by columns.
author:
   Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
version:
   $Rev: 181 $


Field Summary
final public static  intCOL_USERPROPS
    
final static  longserialVersionUID
    

Constructor Summary
public  SqlQueryBuilder()
     Instantiates an empty query builder.
public  SqlQueryBuilder(ResultLocation location, ResultViewType viewType)
     Instantiates an empty query builder for the specified result location and view type.
public  SqlQueryBuilder(SqlQueryBuilder other)
     Copy constructor.

Method Summary
public  SqlQueryBuilderandSub()
     Shorthand for SqlQueryBuilder.enterSub(Operator) with Operator.AND as the operator.
public  SqlQueryBuildercloseSub()
     Close a scope.
public  SqlQueryBuildercondition(FxAssignment assignment, PropertyValueComparator comparator, FxValue value)
     Render a condition for a common FxAssignment query.
public  SqlQueryBuildercondition(FxProperty property, PropertyValueComparator comparator, FxValue value)
     Render a condition for a common FxProperty query.
public  SqlQueryBuildercondition(String propertyName, PropertyValueComparator comparator, FxValue value)
     Render a condition for a FxProperty query.
public  SqlQueryBuildercondition(String propertyName, PropertyValueComparator comparator, Object value)
     Render a condition for a FxProperty query.
public  SqlQueryBuilderenterSub(Operator operator)
     Create a new subquery scope with the given operator.
public  SqlQueryBuilderfilterBriefcase(long briefcaseId)
     Return only objects of the given briefcase.
public  SqlQueryBuilderfilterType(String name)
     Uses a content type filter for the given content type name.
public  SqlQueryBuilderfilterType(long typeId)
     Uses a content type filter for the given content type.
public  SqlQueryBuilderfilterVersion(VersionFilter filter)
     Filter the result set using the given version filter mode (live, max, auto or all).
public  SqlQueryBuilderfulltext(String value)
     Performs a fulltext query over all indexed properties against the given text.
public  List<String>getColumnNames()
     Return the selected column names.
public  StringgetConditions()
     Return the conditional ("WHERE") statement(s) contained in this query.
public  StringgetFilters()
     Return the filters defined for this query (if any).
public  ResultLocationgetLocation()
     Return the result location used in this query builder.
public  intgetMaxRows()
    
public  StringgetOrderBy()
     Return the order by columns defined for this query.
public  StringgetQuery()
     Returns the complete query generated by the builder.
public  FxResultSetgetResult()
     Convenience method for executing a search query using this query builder.
public  intgetStartRow()
    
public  ResultViewTypegetViewType()
     Return the result view type used in this query builder.
public  SqlQueryBuilderisChild(long nodeId)
     Limits the (sub-)query to children of the given node.
public  SqlQueryBuilderisChild(String path)
     Limits the (sub-)query to children of the given node.
public  SqlQueryBuilderisDirectChild(long nodeId)
     Limits the (sub-)query to the direct children of the given node.
public  SqlQueryBuilderisDirectChild(String path)
     Limits the (sub-)query to the direct children of the given node.
public  booleanisFrozen()
     Return true if this query builder is frozen and cannot be further modified. A query builder freezes when the query or the query conditions are queried with the SqlQueryBuilder.getQuery() and SqlQueryBuilder.getConditions() methods. A frozen query builder does not guarantee, however, that the query itself is valid. true if this query builder is frozen and cannot be further modified.
public  booleanisIncludeBasicSelects()
     Returns true if the predefined columns are selected by the condition.
public  SqlQueryBuildermaxRows(int maxRows)
    
public  SqlQueryBuilderorSub()
     Shorthand for SqlQueryBuilder.enterSub(Operator) with Operator.OR as the operator.
public  SqlQueryBuilderorderBy(String column, SortDirection direction)
     Order the results by the given column.
public  SqlQueryBuilderorderBy(int columnIndex, SortDirection direction)
     Order the results by the given column (1-based).
public  SqlQueryBuilderselect(String... columns)
     Select one or more columns.
public  SqlQueryBuildersetIncludeBasicSelects(boolean includeBasicSelects)
     Enables or disables the default select columns.
public  SqlQueryBuilderstartRow(int startRow)
    
public  SqlQueryBuildertype(String typeName)
     Adds a condition that selects only objects of the given type.
public  SqlQueryBuildertype(long typeId)
     Adds a condition that selects only objects of the given type.
public  SqlQueryBuilderviewType(ResultViewType viewType)
    

Field Detail
COL_USERPROPS
final public static int COL_USERPROPS(Code)
Start column for user defined properties



serialVersionUID
final static long serialVersionUID(Code)




Constructor Detail
SqlQueryBuilder
public SqlQueryBuilder()(Code)
Instantiates an empty query builder.



SqlQueryBuilder
public SqlQueryBuilder(ResultLocation location, ResultViewType viewType)(Code)
Instantiates an empty query builder for the specified result location and view type.
Parameters:
  location - the result location
Parameters:
  viewType - the view type



SqlQueryBuilder
public SqlQueryBuilder(SqlQueryBuilder other)(Code)
Copy constructor. Creates an independent query builder based on the query builder other
Parameters:
  other - the query builder to be copied




Method Detail
andSub
public SqlQueryBuilder andSub()(Code)
Shorthand for SqlQueryBuilder.enterSub(Operator) with Operator.AND as the operator. this



closeSub
public SqlQueryBuilder closeSub()(Code)
Close a scope. this



condition
public SqlQueryBuilder condition(FxAssignment assignment, PropertyValueComparator comparator, FxValue value)(Code)
Render a condition for a common FxAssignment query.
Parameters:
  assignment - the assignment
Parameters:
  comparator - the comparator to be used
Parameters:
  value - the value to be compared against this



condition
public SqlQueryBuilder condition(FxProperty property, PropertyValueComparator comparator, FxValue value)(Code)
Render a condition for a common FxProperty query.
Parameters:
  property - the property
Parameters:
  comparator - the comparator to be used
Parameters:
  value - the value to be compared against this



condition
public SqlQueryBuilder condition(String propertyName, PropertyValueComparator comparator, FxValue value)(Code)
Render a condition for a FxProperty query.
Parameters:
  propertyName - the property name
Parameters:
  comparator - the comparator to be used
Parameters:
  value - the value to be compared against this



condition
public SqlQueryBuilder condition(String propertyName, PropertyValueComparator comparator, Object value)(Code)
Render a condition for a FxProperty query.
Parameters:
  propertyName - the property name
Parameters:
  comparator - the comparator to be used
Parameters:
  value - the value to be compared against this



enterSub
public SqlQueryBuilder enterSub(Operator operator)(Code)
Create a new subquery scope with the given operator. Subsequent conditions will be added to that scope. Not that all subscopes (except the first one) must be closed before the query can be generated.
Parameters:
  operator - the operator to be used inside the new scope this



filterBriefcase
public SqlQueryBuilder filterBriefcase(long briefcaseId)(Code)
Return only objects of the given briefcase.
Parameters:
  briefcaseId - the briefcase ID this



filterType
public SqlQueryBuilder filterType(String name)(Code)
Uses a content type filter for the given content type name.
Parameters:
  name - the content type name this



filterType
public SqlQueryBuilder filterType(long typeId)(Code)
Uses a content type filter for the given content type.
Parameters:
  typeId - the content type ID, or -1 to disable the content type filter this



filterVersion
public SqlQueryBuilder filterVersion(VersionFilter filter)(Code)
Filter the result set using the given version filter mode (live, max, auto or all).
Parameters:
  filter - the version filter to be applied this



fulltext
public SqlQueryBuilder fulltext(String value)(Code)
Performs a fulltext query over all indexed properties against the given text.
Parameters:
  value - the fulltext query this



getColumnNames
public List<String> getColumnNames()(Code)
Return the selected column names. the selected column names.



getConditions
public String getConditions()(Code)
Return the conditional ("WHERE") statement(s) contained in this query. If the initial subquery scope is still open, it will be closed. the conditional statement(s)



getFilters
public String getFilters()(Code)
Return the filters defined for this query (if any). the filters defined for this query



getLocation
public ResultLocation getLocation()(Code)
Return the result location used in this query builder. the result location used in this query builder.



getMaxRows
public int getMaxRows()(Code)



getOrderBy
public String getOrderBy()(Code)
Return the order by columns defined for this query. the order by columns defined for this query.



getQuery
public String getQuery()(Code)
Returns the complete query generated by the builder. the SQL search query



getResult
public FxResultSet getResult() throws FxApplicationException(Code)
Convenience method for executing a search query using this query builder. the search result for the current query
throws:
  FxApplicationException - if the search failed



getStartRow
public int getStartRow()(Code)



getViewType
public ResultViewType getViewType()(Code)
Return the result view type used in this query builder. the result view type used in this query builder.



isChild
public SqlQueryBuilder isChild(long nodeId)(Code)
Limits the (sub-)query to children of the given node.
Parameters:
  nodeId - the root node for the (sub-)query this



isChild
public SqlQueryBuilder isChild(String path)(Code)
Limits the (sub-)query to children of the given node.
Parameters:
  path - the tree path of the node this



isDirectChild
public SqlQueryBuilder isDirectChild(long nodeId)(Code)
Limits the (sub-)query to the direct children of the given node.
Parameters:
  nodeId - the root node for the (sub-)query this



isDirectChild
public SqlQueryBuilder isDirectChild(String path)(Code)
Limits the (sub-)query to the direct children of the given node.
Parameters:
  path - the tree path of the node this



isFrozen
public boolean isFrozen()(Code)
Return true if this query builder is frozen and cannot be further modified. A query builder freezes when the query or the query conditions are queried with the SqlQueryBuilder.getQuery() and SqlQueryBuilder.getConditions() methods. A frozen query builder does not guarantee, however, that the query itself is valid. true if this query builder is frozen and cannot be further modified.



isIncludeBasicSelects
public boolean isIncludeBasicSelects()(Code)
Returns true if the predefined columns are selected by the condition. true if the predefined columns are selected by the condition.



maxRows
public SqlQueryBuilder maxRows(int maxRows)(Code)



orSub
public SqlQueryBuilder orSub()(Code)
Shorthand for SqlQueryBuilder.enterSub(Operator) with Operator.OR as the operator. this



orderBy
public SqlQueryBuilder orderBy(String column, SortDirection direction)(Code)
Order the results by the given column. Any previously set order by columns are removed.
Parameters:
  column - the column to be sorted
Parameters:
  direction - the sort direction this



orderBy
public SqlQueryBuilder orderBy(int columnIndex, SortDirection direction)(Code)
Order the results by the given column (1-based). Any previously set order by columns are removed.
Parameters:
  columnIndex - the 1-based index of the column to be sorted
Parameters:
  direction - the sort direction this



select
public SqlQueryBuilder select(String... columns)(Code)
Select one or more columns.
Parameters:
  columns - columns to be selected this



setIncludeBasicSelects
public SqlQueryBuilder setIncludeBasicSelects(boolean includeBasicSelects)(Code)
Enables or disables the default select columns. By default they are included only if no select clause was specified by SqlQueryBuilder.select(String[]) .
Parameters:
  includeBasicSelects - true if the pre-defined selects should be included this



startRow
public SqlQueryBuilder startRow(int startRow)(Code)



type
public SqlQueryBuilder type(String typeName)(Code)
Adds a condition that selects only objects of the given type. Note that this is different to SqlQueryBuilder.filterType(String) , since filtering is applied on the result that also may contain other types, but this is a standard search condition that restrains the search result.
Parameters:
  typeName - the type name to be selected this



type
public SqlQueryBuilder type(long typeId)(Code)
Adds a condition that selects only objects of the given type. Note that this is different to SqlQueryBuilder.filterType(long) , since filtering is applied on the result that also may contain other types, but this is a standard search condition that restrains the search result.
Parameters:
  typeId - the type id to be selected this



viewType
public SqlQueryBuilder viewType(ResultViewType viewType)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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