Java Doc for Query.java in  » Report » datavision-1.1.0 » jimm » datavision » source » 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 » Report » datavision 1.1.0 » jimm.datavision.source 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jimm.datavision.source.Query

All known Subclasses:   jimm.datavision.source.sql.SQLQuery,  jimm.datavision.source.charsep.CharSepQuery,
Query
public class Query implements Writeable(Code)
A data source query.
author:
   Jim Menard, jimm@io.com


Field Summary
final public static  intSORT_ASCENDING
    
final public static  intSORT_DESCENDING
    
final public static  intSORT_UNDEFINED
    
protected  ArrayListjoins
    
protected  Reportreport
    
protected  ArrayListselectables
    
protected  ArrayListsortOrders
    
protected  ArrayListsortSelectables
    
protected  StringwhereClause
    

Constructor Summary
public  Query(Report r)
     Constructor.

Method Summary
public  voidaddAllJoins(Collection coll)
     Adds all joins in the collection to our list.
public  voidaddJoin(Join join)
     Adds a join to the list of joins used by this query.
public  voidaddSort(Selectable sel, int order)
     Adds a sort order for the specified selectable.
public  voidclearJoins()
     Removes all joins in the collection from our list.
public  voidclearSorts()
     Removes all sorts from our list.
public  booleancontainsReferenceTo(Parameter p)
     Returns true if the specified parameter exists within this query's where clause.
public  voidfindSelectablesUsed()
     Builds collections of the selectables actually used in the report.
public  StringgetEditableWhereClause()
     Returns the where clause fit for human consumption.
public  intgetNumSelectables()
     Returns the number of selectables in the query.
public  StringgetWhereClause()
     Returns the raw where clause string; may be null.
public  intindexOfSelectable(Selectable selectable)
     Returns the index of the specified selectable.
public  Iteratorjoins()
     Returns an iterator over all the joins used by this query.
public  voidreloadColumns(DataSource dataSource)
     Called from DataSource.reloadColumns, this method gives the query source a chance to tell its ancillary objects (such as joins and the sort) to reload selectable objects.

This is necessary, for example, after a SQL database data source has reloaded all of its table and column information.

public  voidremoveJoin(Join join)
     Removes a join from the list of joins used by this query.
public  voidremoveSort(Selectable sel)
     Removes a sorting from the list.
public  Iteratorselectables()
     Returns an iterator over all selectables.
public  voidsetEditableWhereClause(String newWhereClause)
     Sets the where clause (may be null).
public  voidsetWhereClause(String newWhereClause)
     Sets the where clause (may be null).
public  intsortOrderOf(Selectable sel)
     Returns the sort order (SORT_DESCENDING, SORT_ASCENDING, or SORT_UNDEFINED) of the specified selectable.
public  IteratorsortedSelectables()
     Returns an iterator over all the sorted selectables used by this query.
protected  voidwriteExtras(XMLWriter out)
     This method exists so subclasses can write out extra information.
public  voidwriteXML(XMLWriter out)
     Writes this query as an XML tag.

Field Detail
SORT_ASCENDING
final public static int SORT_ASCENDING(Code)



SORT_DESCENDING
final public static int SORT_DESCENDING(Code)



SORT_UNDEFINED
final public static int SORT_UNDEFINED(Code)



joins
protected ArrayList joins(Code)



report
protected Report report(Code)



selectables
protected ArrayList selectables(Code)



sortOrders
protected ArrayList sortOrders(Code)



sortSelectables
protected ArrayList sortSelectables(Code)



whereClause
protected String whereClause(Code)




Constructor Detail
Query
public Query(Report r)(Code)
Constructor.
Parameters:
  r - the report for which this query will retrieve data




Method Detail
addAllJoins
public void addAllJoins(Collection coll)(Code)
Adds all joins in the collection to our list.
Parameters:
  coll - a collection of joins



addJoin
public void addJoin(Join join)(Code)
Adds a join to the list of joins used by this query.
Parameters:
  join - a join



addSort
public void addSort(Selectable sel, int order)(Code)
Adds a sort order for the specified selectable. The first character of the order string is inspected. If it is a 'd' or 'D', then it's taken to mean "descending". Anything else will result in an "ascending" sort order.
Parameters:
  sel - a selectable
Parameters:
  order - either SORT_DESCENDING orSORT_ASCENDING



clearJoins
public void clearJoins()(Code)
Removes all joins in the collection from our list.



clearSorts
public void clearSorts()(Code)
Removes all sorts from our list.



containsReferenceTo
public boolean containsReferenceTo(Parameter p)(Code)
Returns true if the specified parameter exists within this query's where clause.
Parameters:
  p - a parameter true if the specified parameter exists withinthe where clause



findSelectablesUsed
public void findSelectablesUsed()(Code)
Builds collections of the selectables actually used in the report.



getEditableWhereClause
public String getEditableWhereClause()(Code)
Returns the where clause fit for human consumption. This mainly means that we substitute formula, parameter, and user column id numbers with names. Called from a where clause editor. This code assumes that curly braces are never nested. the eval string with formula, parameter, and user column idnumbers replaced with names
See Also:   jimm.datavision.gui.sql.WhereClauseWin



getNumSelectables
public int getNumSelectables()(Code)
Returns the number of selectables in the query. Does not recalculate the selectables used; we assume this is being called after the qurey has been run or Query.findSelectablesUsed has been called. the number of selectables (database and user columns) in the query



getWhereClause
public String getWhereClause()(Code)
Returns the raw where clause string; may be null. the where clause string; may be null



indexOfSelectable
public int indexOfSelectable(Selectable selectable)(Code)
Returns the index of the specified selectable.
Parameters:
  selectable - a database selectable



joins
public Iterator joins()(Code)
Returns an iterator over all the joins used by this query. an iterator over all the joins



reloadColumns
public void reloadColumns(DataSource dataSource)(Code)
Called from DataSource.reloadColumns, this method gives the query source a chance to tell its ancillary objects (such as joins and the sort) to reload selectable objects.

This is necessary, for example, after a SQL database data source has reloaded all of its table and column information. The old column objects no longer exist. New ones (with the same ids, we assume) have taken their place.
Parameters:
  dataSource - the data source




removeJoin
public void removeJoin(Join join)(Code)
Removes a join from the list of joins used by this query.
Parameters:
  join - a join



removeSort
public void removeSort(Selectable sel)(Code)
Removes a sorting from the list.
Parameters:
  sel - a selectable



selectables
public Iterator selectables()(Code)
Returns an iterator over all selectables. an iterator over all selectables



setEditableWhereClause
public void setEditableWhereClause(String newWhereClause)(Code)
Sets the where clause (may be null). The string passed to us contains parameter and formula display strings, not their "real" formulaString representations. Translate the latter into the former before saving this string.
Parameters:
  newWhereClause - a where clause string; may be null



setWhereClause
public void setWhereClause(String newWhereClause)(Code)
Sets the where clause (may be null).
Parameters:
  newWhereClause - a where clause string; may be null



sortOrderOf
public int sortOrderOf(Selectable sel)(Code)
Returns the sort order (SORT_DESCENDING, SORT_ASCENDING, or SORT_UNDEFINED) of the specified selectable.
Parameters:
  sel - a database selectable the sort order (SORT_DESCENDING,SORT_ASCENDING, or SORT_UNDEFINED) of thespecified selectable.



sortedSelectables
public Iterator sortedSelectables()(Code)
Returns an iterator over all the sorted selectables used by this query. an iterator



writeExtras
protected void writeExtras(XMLWriter out)(Code)
This method exists so subclasses can write out extra information.



writeXML
public void writeXML(XMLWriter out)(Code)
Writes this query as an XML tag. Writes all joins, where clauses, and sorts as well.
Parameters:
  out - a writer that knows how to write XML



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.