Java Doc for DefaultSQLBuilder.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » jdbc » 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 » GIS » GeoTools 2.4.1 » org.geotools.data.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.geotools.data.jdbc.DefaultSQLBuilder

All known Subclasses:   org.geotools.data.mysql.MySQLSQLBuilder,  org.geotools.data.postgis.PostgisSQLBuilder,  org.geotools.data.hsql.HsqlSQLBuilder,
DefaultSQLBuilder
public class DefaultSQLBuilder implements SQLBuilder(Code)
Builds a complete SQL query to select the specified attributes for the specified feature type, using a specified filter to generate a WHERE clause.

The actual WHERE clause is generated by the SQLEncoder class or appropriate subclass for a particular database. If a specific encoder is to be used, it must be specified to the constructor for this class.

In order to implement the functionality of the application-specified Filter, this is split into a 'preQueryFilter' which can be incorporated into the SQL query itself and a 'postQueryFilter. The encoder capabilities are used to determine how much of the function can be performed by the database directly and how much has to be performed on the result set.


author:
   Sean Geoghegan, Defence Science and Technology Organisation.


Field Summary
protected  ClientTransactionAccessoraccessor
    
protected  SQLEncoderencoder
    
protected  FeatureTypeft
    

Constructor Summary
public  DefaultSQLBuilder()
    
public  DefaultSQLBuilder(SQLEncoder encoder)
     Constructs an instance of this class using the encoder class specified.
public  DefaultSQLBuilder(SQLEncoder encoder, FeatureType featureType, ClientTransactionAccessor accessor)
     Constructs an instance of this class using the encoder class specified.

Method Summary
public  StringbuildSQLQuery(String typeName, FIDMapper mapper, AttributeType[] attrTypes, org.opengis.filter.Filter filter)
     Constructs the full SQL SELECT statement for the supplied Filter.
public  FiltergetPostQueryFilter(Filter filter)
     Return the postQueryFilter that must be applied to the database query result set.
public  FiltergetPreQueryFilter(Filter filter)
     Return the preQueryFilter that can be used to generate the WHERE clause.
public synchronized  booleanisForce2D()
    
public  voidsetHints(Hints hints)
    
protected  voidsplitFilter(Filter filter)
    
public  voidsqlColumns(StringBuffer sql, FIDMapper mapper, AttributeType[] attributes)
     Appends the names of the columns to be selected.
public  voidsqlFrom(StringBuffer sql, String typeName)
    
public  voidsqlGeometryColumn(StringBuffer sql, AttributeType geomAttribute)
     Generates the select column specification for a geometry column.
public  voidsqlOrderBy(StringBuffer sql, SortBy[] sortBy)
     Generates the order by clause.
public  voidsqlWhere(StringBuffer sql, Filter preFilter)
     Constructs WHERE clause, if needed, for FILTER.

Field Detail
accessor
protected ClientTransactionAccessor accessor(Code)



encoder
protected SQLEncoder encoder(Code)



ft
protected FeatureType ft(Code)




Constructor Detail
DefaultSQLBuilder
public DefaultSQLBuilder()(Code)
Constructs an instance of this class with a default SQLEncoder



DefaultSQLBuilder
public DefaultSQLBuilder(SQLEncoder encoder)(Code)
Constructs an instance of this class using the encoder class specified. This will typically be from the getSqlBuilder method of a JDBCDataStore subclass.

This constructor should not be used to obtain Pre/Post filters, as these methods require a FeatureType to function properly.
Parameters:
  encoder - the specific encoder to be used.




DefaultSQLBuilder
public DefaultSQLBuilder(SQLEncoder encoder, FeatureType featureType, ClientTransactionAccessor accessor)(Code)
Constructs an instance of this class using the encoder class specified. This will typically be from the getSqlBuilder method of a JDBCDataStore subclass.
Parameters:
  encoder - the specific encoder to be used.
Parameters:
  featureType -
Parameters:
  accessor - client-side transaction handler; may be null.




Method Detail
buildSQLQuery
public String buildSQLQuery(String typeName, FIDMapper mapper, AttributeType[] attrTypes, org.opengis.filter.Filter filter) throws SQLEncoderException(Code)
Constructs the full SQL SELECT statement for the supplied Filter.

The statement is constructed by concatenating the SELECT column list, FROM table specification and WHERE clause appropriate to the supplied Filter.


Parameters:
  typeName - The name of the table (feature type) to be queried
Parameters:
  mapper - FIDMapper to identify the FID columns in the table
Parameters:
  attrTypes - The specific attribute columns to be selected
Parameters:
  filter - The Filter that will be used by the encoder to constructthe WHERE clause The fully formed SQL SELECT statement
throws:
  SQLEncoderException - Not thrown by this method but may be thrownby the encoder class



getPostQueryFilter
public Filter getPostQueryFilter(Filter filter)(Code)
Return the postQueryFilter that must be applied to the database query result set.
Parameters:
  filter - the application filter which must be applied the filter representing the functionality that must be performedon the result set.



getPreQueryFilter
public Filter getPreQueryFilter(Filter filter)(Code)
Return the preQueryFilter that can be used to generate the WHERE clause.
Parameters:
  filter - the application filter which must be applied the filter representing the functionality that can be performedby the database.



isForce2D
public synchronized boolean isForce2D()(Code)
Check the hints to see if we are forced into 2D



setHints
public void setHints(Hints hints)(Code)



splitFilter
protected void splitFilter(Filter filter)(Code)



sqlColumns
public void sqlColumns(StringBuffer sql, FIDMapper mapper, AttributeType[] attributes)(Code)
Appends the names of the columns to be selected.

sqlGeometryColumn is invoked for any special handling for geometry columns.


Parameters:
  sql - StringBuffer to be appended to
Parameters:
  mapper - FIDMapper to provide the name(s) of the FID columns
Parameters:
  attributes - Array of columns to be selected
See Also:   postgisDataStore.SQLBuilder.sqlColumns(java.lang.StringBufferpostgisDataStore.FIDMapper.FIDMapperorg.geotools.feature.AttributeType[])



sqlFrom
public void sqlFrom(StringBuffer sql, String typeName)(Code)
Constructs the FROM clause for a featureType

sql: FROM typeName


Parameters:
  sql - the StringBuffer that the WHERE clause should be appended to
Parameters:
  typeName - the name of the table (feature type) to be queried



sqlGeometryColumn
public void sqlGeometryColumn(StringBuffer sql, AttributeType geomAttribute)(Code)
Generates the select column specification for a geometry column.

This should typically be overridden in the subclass to return a meaningful value that the attribute i/o handler can process.


Parameters:
  sql - A StringBuffer that the column specification can be appendedto
Parameters:
  geomAttribute - An AttributeType for a geometry attribute



sqlOrderBy
public void sqlOrderBy(StringBuffer sql, SortBy[] sortBy) throws SQLEncoderException(Code)
Generates the order by clause.

This uses the standard ASC,DESC sql keywords to denote ascending,descending sort respectivley.




sqlWhere
public void sqlWhere(StringBuffer sql, Filter preFilter) throws SQLEncoderException(Code)
Constructs WHERE clause, if needed, for FILTER.

sql: WHERE filter encoding


Parameters:
  sql - The StringBuffer that the WHERE clause should be appended to
Parameters:
  preFilter - The filter to be used by the encoder class to generatethe WHERE clause
throws:
  SQLEncoderException - Not thrown here but may be thrown by theencoder



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.