Java Doc for Query.java in  » Database-ORM » ODAL » com » completex » objective » components » persistency » 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 » ODAL » com.completex.objective.components.persistency 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.completex.objective.components.persistency.Query

Query
public interface Query extends BasicQuery,BasicQueryFactory,Cloneable,ResultableQuery(Code)
Represents SQL SELECT statement
author:
   Gennady Krizhevsky


Field Summary
final public static  OrderDirectionDIR_ASC
    
final public static  OrderDirectionDIR_DESC
    


Method Summary
 QueryaddAllParameters(Parameters parameters)
    
 QueryaddAllParameters(int index, Parameters parameters)
    
 QueryaddAllParameters(Object[] values)
    
 voidaddChild(Link link)
    
 JoinaddJoin(String firstTableName)
    
 QueryaddParameter(Object parameter)
    
 QueryaddParameter(ColumnType type, Object parameter)
    
 QueryaddParametersArray(Parameters[] parameters)
    
 QueryaddToChainedColumns(int columnIndex, String tableName, String columnName)
    
 QueryaddToFrom(String tableExpression)
    
 QueryaddToGroupBy(String columnExpression)
    
 QueryaddToHaving(String sql)
    
 QueryaddToOrderBy(String columnExpression, OrderDirection direction)
    
 QueryaddToOrderBy(String columnExpression)
    
 QueryaddToSelect(String columnExpression)
    
 QueryaddToSelect(PersistentObjectFactory persistentObject)
    
 QueryaddToWhere(String sql)
    
 QueryaddToWhere(PersistentObject persistentObject)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND". Only placeholders are added to the query statement.
 QueryaddToWhere(PersistentObject persistentObject, boolean addParameters)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set.
 QueryaddToWhere(Parameter parameter)
     Adds parameter placeholder to WHERE clause and adds parameter to the query.
 QueryandToHaving(String sql)
    
 QueryandToWhere(String sql)
    
 QueryandToWhere(PersistentObject persistentObject)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " AND ". Only placeholders are added to the query statement.
 QueryandToWhere(PersistentObject persistentObject, boolean addParameters)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " AND ".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set.
 Stringbetween(String value1, String value2)
    
 Linkchild(String name)
     Returns child link by name.
 voidclearChainedColumns()
    
 Objectclone()
    
 Parameters[]collectInnerUnionParameters()
     Returns array of UNION sub-query parameters.
 Querycompile(DatabasePolicy databasePolicy)
    
 Querycompile()
    
 voiddecompile()
    
 QueryDefinition.ChainedColumn[]getChainedColumns()
    
 LinkgetChild(String name)
    
 QuerygetChildQuery(String childName)
    
 String[]getForUpdateOf()
    
 String[]getFrom()
     Represents SQL FROM clause.
 ListgetFromAsList()
     Represents SQL FROM clause.
 String[]getGroupBy()
    
 StringgetHaving()
    
 JoingetJoin()
    
 intgetLimitMin()
    
 String[]getOrderBy()
    
 ParametersgetParameters()
    
 StringgetResolvedSql()
    
 String[]getSelect()
    
 longgetTimeout()
     Gets lock timeout.
 StringgetWhere()
    
 booleanhasChainedColumns()
    
 booleanhasChildren()
    
 booleanisCompiled()
    
 booleanisDistinct()
    
 booleanisLocked()
    
 booleanisUseSelectStar()
    
 booleanisWait()
    
 LinkIteratorlinkIterator()
    
 Stringlower(String value)
    
 JoinnewJoin(String firstTableName)
    
 QuerynewNonCompiledQuery()
    
 QueryorToHaving(String sql)
    
 QueryorToWhere(String sql)
    
 QueryorToWhere(PersistentObject persistentObject)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " OR ". Only placeholders are added to the query statement.
 QueryorToWhere(PersistentObject persistentObject, boolean addParameters)
     Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " OR ".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set.
 Stringrlike(String expression, String pattern, boolean matches)
    
 QuerysetDistinct(boolean distinct)
    
 QuerysetFrom(String[] from)
     Represents SQL FROM clause.
 QuerysetGroupBy(String[] groupBy)
     Represents SQL GROUP BY clause.
 QuerysetHaving(String sql)
    
 voidsetInlineMode(String childName, Link.InlineMode joinMode)
    
 QuerysetJoin(Join join)
    
 QuerysetLimit(int min, int max)
    
 QuerysetLimit(int max)
    
 QuerysetLocked(LockType lockType)
    
 QuerysetLocked(LockType lockType, String[] forUpdateOf)
    
 QuerysetOrderBy(String[] orderBy)
     Represents SQL ORDER BY clause.
 QuerysetParameters(Object[] parameters)
    
 QuerysetParameters(Parameters parameters)
    
 QuerysetSelect(String[] select)
     Represents SQL SELECT clause.
 voidsetTimeout(long timeout)
     Sets lock timeout.
 voidsetUseSelectStar(boolean useSelectStar)
     Sets mode of select.
 QuerysetWhere(String sql)
    
 StringsingleQuote(String value)
    
 ObjecttoKey()
    
 Unionunion(Query query)
     Creates and adds Union - representation of UNION clause - to this query.
 Unionunion(Query query, UnionMode mode)
     Creates and adds Union - representation of UNION clause - to this query.
 UnionunionAll(Query query)
     Creates and adds Union - representation of UNION clause - to this query.
 voidunuseStarAndColumnNames()
     Unsets use of star in select clauses and names of PersistentObject columns when retrieving from ResultSet.
 Stringupper(String value)
    
 voiduseStarAndColumnNames()
     Sets query to use star in select clauses and names of PersistentObject columns when retrieving from ResultSet.

Field Detail
DIR_ASC
final public static OrderDirection DIR_ASC(Code)



DIR_DESC
final public static OrderDirection DIR_DESC(Code)





Method Detail
addAllParameters
Query addAllParameters(Parameters parameters)(Code)
Add parameters to the end of parameter list
Parameters:
  parameters - itself



addAllParameters
Query addAllParameters(int index, Parameters parameters)(Code)
Add parameters starting from certain index
Parameters:
  index - 0-based Offset index
Parameters:
  parameters - itself



addAllParameters
Query addAllParameters(Object[] values)(Code)
Add parameters to the end of parameter list itself



addChild
void addChild(Link link)(Code)
Add child link with specific name
Parameters:
  link -
throws:
  NullPointerException - if link has no name set
See Also:   Link



addJoin
Join addJoin(String firstTableName)(Code)
Addes new Join object to this query
Parameters:
  firstTableName - new Join object
See Also:   Join



addParameter
Query addParameter(Object parameter)(Code)
Add query parameter of type that will be determined by Persistency
Parameters:
  parameter - itself



addParameter
Query addParameter(ColumnType type, Object parameter)(Code)
Add query parameter of ColumnType type
Parameters:
  type -
Parameters:
  parameter - - value or instance of Parameter class itself
throws:
  OdalRuntimePersistencyException - if the value is already of Parameter type and type != null



addParametersArray
Query addParametersArray(Parameters[] parameters)(Code)
Adds array of Parameters objects
Parameters:
  parameters - itself



addToChainedColumns
Query addToChainedColumns(int columnIndex, String tableName, String columnName)(Code)



addToFrom
Query addToFrom(String tableExpression)(Code)
Adds tableExpression SQL fragment to SQL FROM tables
Parameters:
  tableExpression - itself



addToGroupBy
Query addToGroupBy(String columnExpression)(Code)
Adds columnExpression SQL fragment to SQL GROUP BY columns
Parameters:
  columnExpression - itself



addToHaving
Query addToHaving(String sql)(Code)
Adds SQL fragment to HAVING clause
Parameters:
  sql - itself



addToOrderBy
Query addToOrderBy(String columnExpression, OrderDirection direction)(Code)
Adds columnExpression SQL fragment to SQL ORDER BY columns
Parameters:
  columnExpression -
Parameters:
  direction - Ascending or descending itself



addToOrderBy
Query addToOrderBy(String columnExpression)(Code)
Adds columnExpression SQL fragment to SQL ORDER BY columns with default direction
Parameters:
  columnExpression - itself



addToSelect
Query addToSelect(String columnExpression)(Code)
Adds columnExpression SQL fragment to SQL SELECT columns
Parameters:
  columnExpression - itself



addToSelect
Query addToSelect(PersistentObjectFactory persistentObject)(Code)
Adds columnExpression SQL fragment to SQL SELECT columns
Parameters:
  persistentObject - persistentObject which MetaTable is used to get columns itself



addToWhere
Query addToWhere(String sql)(Code)
Adds SQL fragment to WHERE clause
Parameters:
  sql - itself



addToWhere
Query addToWhere(PersistentObject persistentObject)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND". Only placeholders are added to the query statement. Use Query.addAllParameters(persistentObject.toParameters()) to add the parameters.
Parameters:
  persistentObject - itself



addToWhere
Query addToWhere(PersistentObject persistentObject, boolean addParameters)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set. itself



addToWhere
Query addToWhere(Parameter parameter)(Code)
Adds parameter placeholder to WHERE clause and adds parameter to the query. Make sure that all the paramters that are supposed to go before this paramter are set.
Parameters:
  parameter - itself



andToHaving
Query andToHaving(String sql)(Code)
Adds SQL fragment to HAVING clause prepended with " AND "
Parameters:
  sql - itself



andToWhere
Query andToWhere(String sql)(Code)
Adds SQL fragment to WHERE clause prepended with " AND "
Parameters:
  sql - itself



andToWhere
Query andToWhere(PersistentObject persistentObject)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " AND ". Only placeholders are added to the query statement. Use Query.addAllParameters(persistentObject.toParameters()) to add the parameters.
Parameters:
  persistentObject - itself



andToWhere
Query andToWhere(PersistentObject persistentObject, boolean addParameters)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " AND ".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set. itself



between
String between(String value1, String value2)(Code)
Returns between clause
Parameters:
  value1 -
Parameters:
  value2 - between clause



child
Link child(String name)(Code)
Returns child link by name. If child is not found - retruns null child link by name



clearChainedColumns
void clearChainedColumns()(Code)



clone
Object clone() throws CloneNotSupportedException(Code)
deep copy of this query
throws:
  CloneNotSupportedException -



collectInnerUnionParameters
Parameters[] collectInnerUnionParameters()(Code)
Returns array of UNION sub-query parameters. If this is not a UNION query array will have 0-length Parameters[] array of UNION sub-query parameters
See Also:   Parameters
See Also:   Union



compile
Query compile(DatabasePolicy databasePolicy)(Code)
Compiles query which makes it immutable
Parameters:
  databasePolicy - compiled query (itself)



compile
Query compile()(Code)
Compiles query which makes it immutable compiled query (itself)
throws:
  OdalRuntimePersistencyException - if DatabasePolicy is not set but is required for compillation



decompile
void decompile()(Code)
Decompiles query which makes it mutable



getChainedColumns
QueryDefinition.ChainedColumn[] getChainedColumns()(Code)



getChild
Link getChild(String name)(Code)
Get child link with specific name
Parameters:
  name - child link



getChildQuery
Query getChildQuery(String childName)(Code)
Returns child query by name
Parameters:
  childName - child query name child query



getForUpdateOf
String[] getForUpdateOf()(Code)
Returns set of columns of lock clause set of columns of lock clause



getFrom
String[] getFrom()(Code)
Represents SQL FROM clause. set of SQL FROM columns



getFromAsList
List getFromAsList()(Code)
Represents SQL FROM clause. set of SQL FROM columns



getGroupBy
String[] getGroupBy()(Code)
Returns set of SQL GROUP BY columns set of SQL GROUP BY columns



getHaving
String getHaving()(Code)
SQL HAVING clause



getJoin
Join getJoin()(Code)
Join object or null if not set or added



getLimitMin
int getLimitMin()(Code)
min value in LIMIT clause



getOrderBy
String[] getOrderBy()(Code)
Returns set of SQL ORDER BY columns set of SQL ORDER BY columns



getParameters
Parameters getParameters()(Code)
Returns Parameters set for this query Parameters Parameters set for this query



getResolvedSql
String getResolvedSql()(Code)
Returns SQL string including inlined queries SQL string including inlined queries



getSelect
String[] getSelect()(Code)
set of SQL SELECT columns



getTimeout
long getTimeout()(Code)
Gets lock timeout. In future may be used as query timeout as well timeout



getWhere
String getWhere()(Code)
Returns SQL WHERE clause w/o 'WHERE' keyword SQL WHERE clause



hasChainedColumns
boolean hasChainedColumns()(Code)



hasChildren
boolean hasChildren()(Code)
true if this query has children



isCompiled
boolean isCompiled()(Code)
Returns true if query is copiled true if query is copiled



isDistinct
boolean isDistinct()(Code)
true if query is to return unique values



isLocked
boolean isLocked()(Code)
Returns true if query has lock clause true if query has lock clause



isUseSelectStar
boolean isUseSelectStar()(Code)
true then select clause will look like:"SELECT * ..."



isWait
boolean isWait()(Code)
Returns true if lock clause of type that will wait untinl another process will free resource true if lock clause of type that will wait untinl another process will free resource



linkIterator
LinkIterator linkIterator()(Code)
Returns LinkIterator of child queries LinkIterator
See Also:   LinkIterator



lower
String lower(String value)(Code)
Returns lower clause
Parameters:
  value - lower clause



newJoin
Join newJoin(String firstTableName)(Code)
Creates new Join object
Parameters:
  firstTableName - new Join object
See Also:   Join



newNonCompiledQuery
Query newNonCompiledQuery()(Code)
copy of this query which is non-compiled even if the original is



orToHaving
Query orToHaving(String sql)(Code)
Adds SQL fragment to HAVING clause prepended with " OR "
Parameters:
  sql - itself



orToWhere
Query orToWhere(String sql)(Code)
Adds SQL fragment to WHERE clause prepended with " OR "
Parameters:
  sql - itself



orToWhere
Query orToWhere(PersistentObject persistentObject)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " OR ". Only placeholders are added to the query statement. Use Query.addAllParameters(persistentObject.toParameters()) to add the parameters.
Parameters:
  persistentObject - itself



orToWhere
Query orToWhere(PersistentObject persistentObject, boolean addParameters)(Code)
Adds SQL fragment to WHERE clause based on PersistentObject values which are joined by "AND" and prepended with " OR ".
Parameters:
  persistentObject -
Parameters:
  addParameters - if true then not only placeholders are added to the query statement butQuery.addAllParameters(persistentObject.toParameters()) is issued internallyto add the parameters.Make sure that all the paramters that are supposed to go before these paramters are set. itself



rlike
String rlike(String expression, String pattern, boolean matches)(Code)
Returns 'REGULAR EXPRESSION LIKE' SQL fragment
Parameters:
  expression -
Parameters:
  pattern -
Parameters:
  matches - regular expression like SQL fragment



setDistinct
Query setDistinct(boolean distinct)(Code)

Parameters:
  distinct - true if query is to return unique values itself



setFrom
Query setFrom(String[] from)(Code)
Represents SQL FROM clause. Each element of from parameter will be joined by comma when compiling.
Parameters:
  from - set of SQL FROM columns (No 'SELECT' keyword necessary) itself



setGroupBy
Query setGroupBy(String[] groupBy)(Code)
Represents SQL GROUP BY clause. Each element of groupBy parameter will be joined by comma when compiling.
Parameters:
  groupBy - set of SQL GROUP BY columns (No 'GROUP BY' keyword necessary) itself



setHaving
Query setHaving(String sql)(Code)
Sets SQL HAVING clause
Parameters:
  sql - itself



setInlineMode
void setInlineMode(String childName, Link.InlineMode joinMode)(Code)
Sets inline mode
See Also:   Link.InlineMode
Parameters:
  childName - child link name
Parameters:
  joinMode - join mode



setJoin
Query setJoin(Join join)(Code)

Parameters:
  join - Join object itself



setLimit
Query setLimit(int min, int max)(Code)
Set min and max values in LIMIT clause
Parameters:
  min -
Parameters:
  max - itself



setLimit
Query setLimit(int max)(Code)
Set max value in LIMIT clause
Parameters:
  max - itself



setLocked
Query setLocked(LockType lockType)(Code)
Sets query lock
Parameters:
  lockType - LockType itself
See Also:   LockType



setLocked
Query setLocked(LockType lockType, String[] forUpdateOf)(Code)
Sets query lock
Parameters:
  lockType - LockType
Parameters:
  forUpdateOf - array of fields used in "for update of" SQL fragment itself
See Also:   LockType



setOrderBy
Query setOrderBy(String[] orderBy)(Code)
Represents SQL ORDER BY clause. Each element of orderBy parameter will be joined by comma when compiling.
Parameters:
  orderBy - set of SQL ORDER BY columns (No 'ORDER BY' keyword necessary) itself



setParameters
Query setParameters(Object[] parameters)(Code)
Set query parameters
Parameters:
  parameters - itself



setParameters
Query setParameters(Parameters parameters)(Code)
Set query parameters
Parameters:
  parameters - itself



setSelect
Query setSelect(String[] select)(Code)
Represents SQL SELECT clause. Each element of select parameter will be joined by comma when compiling.
Parameters:
  select - set of SQL SELECT columns (No 'SELECT' keyword necessary) itself



setTimeout
void setTimeout(long timeout)(Code)
Sets lock timeout. In future may be used as query timeout as well
Parameters:
  timeout -



setUseSelectStar
void setUseSelectStar(boolean useSelectStar)(Code)
Sets mode of select. If useSelectStar set true then select clause will look like: "SELECT * ...". Should be used carefully since if SQL has column that does not exist in the object used as data container then execution will fail
Parameters:
  useSelectStar -



setWhere
Query setWhere(String sql)(Code)
Set SQL WHERE clause w/o 'WHERE' keyword
Parameters:
  sql - itself



singleQuote
String singleQuote(String value)(Code)
Returns singleQuoted string
Parameters:
  value - singleQuoted string



toKey
Object toKey()(Code)



union
Union union(Query query)(Code)
Creates and adds Union - representation of UNION clause - to this query.
Parameters:
  query - Query to be added with UNION clause created Union
See Also:   Union



union
Union union(Query query, UnionMode mode)(Code)
Creates and adds Union - representation of UNION clause - to this query.
Parameters:
  query - Query to be added with UNION or UNION ALL clause
Parameters:
  mode - Parameter to control if this is UNION or UNION ALL clause created Union
See Also:   Union



unionAll
Union unionAll(Query query)(Code)
Creates and adds Union - representation of UNION clause - to this query.
Parameters:
  query - Query to be added with UNION ALL clause created Union
See Also:   Union



unuseStarAndColumnNames
void unuseStarAndColumnNames()(Code)
Unsets use of star in select clauses and names of PersistentObject columns when retrieving from ResultSet.



upper
String upper(String value)(Code)
Returns upper clause
Parameters:
  value - upper clause



useStarAndColumnNames
void useStarAndColumnNames()(Code)
Sets query to use star in select clauses and names of PersistentObject columns when retrieving from ResultSet. It should be used carefully since if there are repetitive SQL names it can cause incorrect results



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