Java Doc for SQLBuilder.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.SQLBuilder

All known Subclasses:   org.geotools.data.jdbc.DefaultSQLBuilder,  org.geotools.data.jdbc.GeoAPISQLBuilder,
SQLBuilder
public class SQLBuilder implements ExpressionVisitor,FilterVisitor(Code)
Builds raw sql statements.

This class should be subclasses to accomodate different dialects of sql.

This class maintains state and is not thread safe.


author:
   Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org


Field Summary
 JDBCDataStoredataStore
    
 FeatureTypefeatureType
    
 FilterFactoryfilterFactory
    
 FilterpostFilter
    
 StringBuffersql
    

Constructor Summary
public  SQLBuilder(JDBCDataStore dataStore)
    

Method Summary
public  Stringbounds(FeatureType featureType)
     Builds a query which selects the envelope or bounding box of every feature / row in a table.
public  Stringbounds(FeatureType featureType, Filter filter)
     Builds a query which selects the envelope or bounding box of a subset of features / rows in a table.
public  Stringcount(FeatureType featureType)
     Builds a query which selects the bound of all rows / features in a table.
public  Stringcount(FeatureType featureType, Filter filter)
     Builds a query which selects the count of a subset of rows / features in a table.

The filter argument can be used to filter those rows / features included in the count, or null to include all rows.

A statement of the form "SELECT count(*) FROM ...
public  StringcreateTable(FeatureType featureType)
     Builds a "CREATE TABLE" statement.
public  voiddelete(FeatureType featureType, Filter filter)
     Builds a statement of the form "DELETE FROM ...
public  StringdropTable(FeatureType featureType)
     Builds a "DROP TABLE" statement.
 Stringencode(CoordinateReferenceSystem crs)
     Helper method to encode a crs.
protected  voidfrom(FeatureType featureType)
     Encodes "FROM ".
protected  voidgeometry(FeatureType featureType)
     Encodes the name of the default geometry in a statement.
protected  voidgeometry(Geometry geometry, String srid, StringBuffer sql)
     Encodes a geometry with a known srid to be used in an sql statement.
public  FilterFactorygetFilterFactory()
    
protected  StringBuffergetSQL()
    
protected  voidinit()
     Initializes the state of the builder.
protected  voidinit(FeatureType featureType)
     Initializes the state of the builder setting the feature type being worked on.
protected  voidname(String raw)
     Encodes a name to be used in an sql statement.
protected  voidnil(StringBuffer sql)
     Encodes nulL to be used in an sql statement.
public  Stringselect(FeatureType featureType, Filter filter)
     Builds a statement of the form "SELECT att1,att2,...,attN FROM ...
protected  voidselect(FeatureType featureType, String[] propertyNames)
     Encodes the select clause of a query.
public  voidsetFilterFactory(FilterFactory filterFactory)
    
protected  voidsrid(String raw, StringBuffer sql)
    
protected  voidstring(String raw, StringBuffer sql)
     Encodes a string to be used in an sql statement.
protected  voidtable(String name)
     Encodes the table name of a query qualifying it with the database schema name if set.
public  Objectvisit(PropertyName propertyName, Object data)
     Encodes a PropertyName in an sql statement.
public  Objectvisit(Add add, Object data)
    
public  Objectvisit(Subtract subtract, Object data)
    
public  Objectvisit(Multiply multiply, Object data)
    
public  Objectvisit(Divide divide, Object data)
    
protected  Objectvisit(BinaryExpression expression, Object data, String operator)
    
public  Objectvisit(Literal literal, Object data)
    
public  Objectvisit(NilExpression expression, Object extraData)
    
public  Objectvisit(Function expression, Object extraData)
    
public  Objectvisit(ExcludeFilter exclude, Object data)
    
public  Objectvisit(IncludeFilter include, Object data)
    
public  Objectvisit(Not not, Object data)
    
public  Objectvisit(And and, Object data)
    
public  Objectvisit(Or or, Object data)
    
protected  Objectvisit(BinaryLogicOperator logic, Object data, String operator)
    
public  Objectvisit(Id id, Object data)
    
public  Objectvisit(PropertyIsBetween between, Object data)
    
public  Objectvisit(PropertyIsEqualTo equalTo, Object data)
    
public  Objectvisit(PropertyIsNotEqualTo notEqualTo, Object data)
    
public  Objectvisit(PropertyIsGreaterThan greaterThan, Object data)
    
public  Objectvisit(PropertyIsGreaterThanOrEqualTo greaterThanOrEqualTo, Object data)
    
public  Objectvisit(PropertyIsLessThan lessThan, Object data)
    
public  Objectvisit(PropertyIsLessThanOrEqualTo lessThanOrEqualTo, Object data)
    
protected  Objectvisit(BinaryComparisonOperator comparison, Object data, String operator)
    
public  Objectvisit(PropertyIsLike like, Object data)
    
public  Objectvisit(PropertyIsNull isNull, Object data)
    
public  Objectvisit(BBOX bbox, Object data)
    
protected  Objectvisit(PropertyName name, Geometry geometry, Object data)
    
public  Objectvisit(Beyond beyond, Object data)
    
public  Objectvisit(DWithin dwithin, Object data)
    
protected  Objectvisit(DistanceBufferOperator distance, Object data, String operator, boolean index)
    
public  Objectvisit(Disjoint disjoint, Object data)
    
public  Objectvisit(Contains contains, Object data)
    
public  Objectvisit(Crosses crosses, Object data)
    
public  Objectvisit(Equals equals, Object data)
    
public  Objectvisit(Intersects intersects, Object data)
    
public  Objectvisit(Overlaps overlaps, Object data)
    
public  Objectvisit(Touches touches, Object data)
    
public  Objectvisit(Within within, Object data)
    
protected  Objectvisit(BinarySpatialOperator comparison, Object data, String operator, boolean index)
    
public  ObjectvisitNullFilter(Object data)
    
protected  voidwhere(Filter filter)
     Encodes the WHERE clause of a query.

Field Detail
dataStore
JDBCDataStore dataStore(Code)
The data store



featureType
FeatureType featureType(Code)
Feature type being worked on



filterFactory
FilterFactory filterFactory(Code)
Filter factory used to create filters



postFilter
Filter postFilter(Code)
Post-processing filter



sql
StringBuffer sql(Code)
SQL statement buffer




Constructor Detail
SQLBuilder
public SQLBuilder(JDBCDataStore dataStore)(Code)




Method Detail
bounds
public String bounds(FeatureType featureType)(Code)
Builds a query which selects the envelope or bounding box of every feature / row in a table.

Convenience for bounds(featureType,null).

A statement of the form "SELECT envelope(...) FROM ..."



bounds
public String bounds(FeatureType featureType, Filter filter)(Code)
Builds a query which selects the envelope or bounding box of a subset of features / rows in a table.

The filter argument can be used to filter those rows / features returned or can be null to return all rows.

A statement of the form "SELECT envelope(...) FROM ... WHERE ..."



count
public String count(FeatureType featureType)(Code)
Builds a query which selects the bound of all rows / features in a table.

Convenience for count(null)

A statement of the form "SELECT count(*) FROM ..."



count
public String count(FeatureType featureType, Filter filter)(Code)
Builds a query which selects the count of a subset of rows / features in a table.

The filter argument can be used to filter those rows / features included in the count, or null to include all rows.

A statement of the form "SELECT count(*) FROM ... WHERE ..."



createTable
public String createTable(FeatureType featureType)(Code)
Builds a "CREATE TABLE" statement.

A statement of the form "CREATE TABLE ...".



delete
public void delete(FeatureType featureType, Filter filter)(Code)
Builds a statement of the form "DELETE FROM ... WHERE ...";

The filter parameter may be null to omit the where clause.




dropTable
public String dropTable(FeatureType featureType)(Code)
Builds a "DROP TABLE" statement. A statement of the form "DROP TABLE ...".



encode
String encode(CoordinateReferenceSystem crs)(Code)
Helper method to encode a crs. Can we have this on CRS?



from
protected void from(FeatureType featureType)(Code)
Encodes "FROM ".



geometry
protected void geometry(FeatureType featureType)(Code)
Encodes the name of the default geometry in a statement.




geometry
protected void geometry(Geometry geometry, String srid, StringBuffer sql)(Code)
Encodes a geometry with a known srid to be used in an sql statement.
Parameters:
  geometry - The geometry to encode.
Parameters:
  srid - The spatial reference id of the geometry
Parameters:
  sql - HTe sql statement buffer



getFilterFactory
public FilterFactory getFilterFactory()(Code)



getSQL
protected StringBuffer getSQL()(Code)
The current sql buffer.



init
protected void init()(Code)
Initializes the state of the builder.



init
protected void init(FeatureType featureType)(Code)
Initializes the state of the builder setting the feature type being worked on.



name
protected void name(String raw)(Code)
Encodes a name to be used in an sql statement.

This implementation wraps the name in double quotes.


Parameters:
  raw - The raw name.




nil
protected void nil(StringBuffer sql)(Code)
Encodes nulL to be used in an sql statement.
Parameters:
  sql - The sql statement buffer



select
public String select(FeatureType featureType, Filter filter)(Code)
Builds a statement of the form "SELECT att1,att2,...,attN FROM ... WHERE ...";

The filter parameter may be null to omit the where clause.




select
protected void select(FeatureType featureType, String[] propertyNames)(Code)
Encodes the select clause of a query.

If propertyNames is null or empty then "*" is used.


Parameters:
  propertyNames - The array of properties / columns in the select.



setFilterFactory
public void setFilterFactory(FilterFactory filterFactory)(Code)



srid
protected void srid(String raw, StringBuffer sql)(Code)
Encodes a srid to be used in an sql statement
Parameters:
  srid - The raw spatial reference id of the geometry
Parameters:
  sql - HTe sql statement buffer



string
protected void string(String raw, StringBuffer sql)(Code)
Encodes a string to be used in an sql statement.
Parameters:
  raw - The raw string.
Parameters:
  sql - The sql statement buffer



table
protected void table(String name)(Code)
Encodes the table name of a query qualifying it with the database schema name if set.
Parameters:
  name - The name of the table.



visit
public Object visit(PropertyName propertyName, Object data)(Code)
Encodes a PropertyName in an sql statement.

If the AttributeType can be infered from SQLBuilder.featureType then its name is used directly.

The class binding of the attribute type, or null if unknown.



visit
public Object visit(Add add, Object data)(Code)



visit
public Object visit(Subtract subtract, Object data)(Code)



visit
public Object visit(Multiply multiply, Object data)(Code)



visit
public Object visit(Divide divide, Object data)(Code)



visit
protected Object visit(BinaryExpression expression, Object data, String operator)(Code)



visit
public Object visit(Literal literal, Object data)(Code)



visit
public Object visit(NilExpression expression, Object extraData)(Code)



visit
public Object visit(Function expression, Object extraData)(Code)



visit
public Object visit(ExcludeFilter exclude, Object data)(Code)



visit
public Object visit(IncludeFilter include, Object data)(Code)



visit
public Object visit(Not not, Object data)(Code)



visit
public Object visit(And and, Object data)(Code)



visit
public Object visit(Or or, Object data)(Code)



visit
protected Object visit(BinaryLogicOperator logic, Object data, String operator)(Code)



visit
public Object visit(Id id, Object data)(Code)



visit
public Object visit(PropertyIsBetween between, Object data)(Code)



visit
public Object visit(PropertyIsEqualTo equalTo, Object data)(Code)



visit
public Object visit(PropertyIsNotEqualTo notEqualTo, Object data)(Code)



visit
public Object visit(PropertyIsGreaterThan greaterThan, Object data)(Code)



visit
public Object visit(PropertyIsGreaterThanOrEqualTo greaterThanOrEqualTo, Object data)(Code)



visit
public Object visit(PropertyIsLessThan lessThan, Object data)(Code)



visit
public Object visit(PropertyIsLessThanOrEqualTo lessThanOrEqualTo, Object data)(Code)



visit
protected Object visit(BinaryComparisonOperator comparison, Object data, String operator)(Code)



visit
public Object visit(PropertyIsLike like, Object data)(Code)



visit
public Object visit(PropertyIsNull isNull, Object data)(Code)



visit
public Object visit(BBOX bbox, Object data)(Code)



visit
protected Object visit(PropertyName name, Geometry geometry, Object data)(Code)



visit
public Object visit(Beyond beyond, Object data)(Code)



visit
public Object visit(DWithin dwithin, Object data)(Code)



visit
protected Object visit(DistanceBufferOperator distance, Object data, String operator, boolean index)(Code)



visit
public Object visit(Disjoint disjoint, Object data)(Code)



visit
public Object visit(Contains contains, Object data)(Code)



visit
public Object visit(Crosses crosses, Object data)(Code)



visit
public Object visit(Equals equals, Object data)(Code)



visit
public Object visit(Intersects intersects, Object data)(Code)



visit
public Object visit(Overlaps overlaps, Object data)(Code)



visit
public Object visit(Touches touches, Object data)(Code)



visit
public Object visit(Within within, Object data)(Code)



visit
protected Object visit(BinarySpatialOperator comparison, Object data, String operator, boolean index)(Code)



visitNullFilter
public Object visitNullFilter(Object data)(Code)



where
protected void where(Filter filter)(Code)
Encodes the WHERE clause of a query.
Parameters:
  filter - The filter defining the where clause, non-null.



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.