Java Doc for WhereBuilder.java in  » GIS » deegree » org » deegree » io » datastore » sql » wherebuilder » 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 » deegree » org.deegree.io.datastore.sql.wherebuilder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.deegree.io.datastore.sql.wherebuilder.WhereBuilder

All known Subclasses:   org.deegree.io.datastore.sql.postgis.PostGISWhereBuilder,  org.deegree.io.datastore.sql.generic.GenericSQLWhereBuilder,  org.deegree.io.datastore.sql.oracle.OracleSpatialWhereBuilder,
WhereBuilder
public class WhereBuilder (Code)
Creates SQL-WHERE clauses from OGC filter expressions (to restrict SQL statements to all stored features that match a given filter).

Also handles the creation of ORDER-BY clauses.
author:
   Torsten Friebe
author:
   Markus Schneider
author:
   last edited by: $Author: aschmitz $
version:
   $Revision: 10506 $, $Date: 2008-03-06 08:50:33 -0800 (Thu, 06 Mar 2008) $



Field Summary
final protected static  ILoggerLOG
    
final protected static  intSRS_UNDEFINED
    
protected  Filterfilter
    Filter for which the corresponding WHERE-clause will be generated.
protected  List<PropertyPath>filterPropertyPaths
    
protected  QueryTableTreequeryTableTree
    
protected  MappedFeatureType[]rootFts
     Targeted feature types.
protected  SortProperty[]sortProperties
    
protected  List<PropertyPath>sortPropertyPaths
    
protected  VirtualContentProvidervcProvider
    

Constructor Summary
public  WhereBuilder(MappedFeatureType[] rootFts, String[] aliases, Filter filter, SortProperty[] sortProperties, TableAliasGenerator aliasGenerator, VirtualContentProvider vcProvider)
     Creates a new WhereBuilder instance.

Method Summary
protected  voidappendArithmeticExpressionAsSQL(StatementBuffer query, ArithmeticExpression expression, int targetSqlType)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendComparisonOperationAsSQL(StatementBuffer query, ComparisonOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendComplexFilterAsSQL(StatementBuffer query, ComplexFilter filter)
     Appends an SQL fragment for the given object.
protected  voidappendExpressionAsSQL(StatementBuffer query, Expression expression, int targetSqlType)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendFeatureFilterAsSQL(StatementBuffer query, FeatureFilter filter)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendFunctionAsSQL(StatementBuffer query, Function function, int targetSqlType)
     Appends an SQL fragment for the given object to the given sql statement.
public  voidappendJoinTableList(StatementBuffer query)
     Appends the alias-qualified, comma separated list of all tables to be joined in order to represent the associated filter expression (and possibly feature type joins).
protected  voidappendLiteralAsSQL(StatementBuffer query, Literal literal, int targetSqlType)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendLogicalOperationAsSQL(StatementBuffer query, LogicalOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendOperationAsSQL(StatementBuffer query, Operation operation)
     Appends an SQL fragment for the given object to the given sql statement.
public  voidappendOrderByCondition(StatementBuffer query)
     Appends an SQL "ORDER BY"-condition that corresponds to the sort properties of the query to the given SQL statement.
protected  voidappendPropertyIsBetweenOperationAsSQL(StatementBuffer query, PropertyIsBetweenOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendPropertyIsCOMPOperationAsSQL(StatementBuffer query, PropertyIsCOMPOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendPropertyIsLikeOperationAsSQL(StatementBuffer query, PropertyIsLikeOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendPropertyIsNullOperationAsSQL(StatementBuffer query, PropertyIsNullOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendPropertyNameAsSQL(StatementBuffer query, PropertyName propertyName)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendPropertyPathAsSQL(StatementBuffer query, PropertyPath propertyPath)
     Appends an SQL fragment for the given object to the given sql statement.
protected  voidappendSpatialOperationAsSQL(StatementBuffer query, SpatialOperation operation)
     Appends an SQL fragment for the given object to the given sql statement.
final public  voidappendWhereCondition(StatementBuffer query)
     Appends an SQL WHERE-condition corresponding to the Filter to the given SQL statement.
protected  voidbuildFilterPropertyNameMap()
    
protected  voidfillFunctionNameMap()
     Prepares the function map for functions with implementation specific names, e.g.
public  FiltergetFilter()
     Returns the associated Filter instance.
protected  StringgetFunctionName(String name)
     Get the function with the specified name.
protected  MappedGeometryPropertyTypegetGeometryProperty(PropertyName propName)
    
protected  intgetPropertyNameSQLType(PropertyName propertyName)
    
public  StringgetRootTableAlias(int i)
     Returns the table alias used for the specified root feature type.

Field Detail
LOG
final protected static ILogger LOG(Code)



SRS_UNDEFINED
final protected static int SRS_UNDEFINED(Code)



filter
protected Filter filter(Code)
Filter for which the corresponding WHERE-clause will be generated.



filterPropertyPaths
protected List<PropertyPath> filterPropertyPaths(Code)



queryTableTree
protected QueryTableTree queryTableTree(Code)



rootFts
protected MappedFeatureType[] rootFts(Code)
Targeted feature types.



sortProperties
protected SortProperty[] sortProperties(Code)



sortPropertyPaths
protected List<PropertyPath> sortPropertyPaths(Code)



vcProvider
protected VirtualContentProvider vcProvider(Code)




Constructor Detail
WhereBuilder
public WhereBuilder(MappedFeatureType[] rootFts, String[] aliases, Filter filter, SortProperty[] sortProperties, TableAliasGenerator aliasGenerator, VirtualContentProvider vcProvider) throws DatastoreException(Code)
Creates a new WhereBuilder instance.
Parameters:
  rootFts - selected feature types, more than one type means that the types are joined
Parameters:
  aliases - aliases for the feature types, may be null (must have same length as rootFtsotherwise)
Parameters:
  filter -
Parameters:
  sortProperties -
Parameters:
  aliasGenerator - aliasGenerator to be used to generate table aliases, may be null
Parameters:
  vcProvider -
throws:
  DatastoreException -




Method Detail
appendArithmeticExpressionAsSQL
protected void appendArithmeticExpressionAsSQL(StatementBuffer query, ArithmeticExpression expression, int targetSqlType) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  expression -
Parameters:
  targetSqlType -
throws:
  FilterEvaluationException -



appendComparisonOperationAsSQL
protected void appendComparisonOperationAsSQL(StatementBuffer query, ComparisonOperation operation) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  FilterEvaluationException -



appendComplexFilterAsSQL
protected void appendComplexFilterAsSQL(StatementBuffer query, ComplexFilter filter) throws DatastoreException(Code)
Appends an SQL fragment for the given object.
Parameters:
  query -
Parameters:
  filter -
throws:
  DatastoreException -



appendExpressionAsSQL
protected void appendExpressionAsSQL(StatementBuffer query, Expression expression, int targetSqlType) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  expression -
Parameters:
  targetSqlType - sql type code to be used for literals at the bottom of the expression tree
throws:
  FilterEvaluationException -



appendFeatureFilterAsSQL
protected void appendFeatureFilterAsSQL(StatementBuffer query, FeatureFilter filter) throws DatastoreException(Code)
Appends an SQL fragment for the given object to the given sql statement. TODO Handle compound primary keys correctly.
Parameters:
  query -
Parameters:
  filter -
throws:
  DatastoreException -



appendFunctionAsSQL
protected void appendFunctionAsSQL(StatementBuffer query, Function function, int targetSqlType) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  function -
Parameters:
  targetSqlType -
throws:
  FilterEvaluationException -



appendJoinTableList
public void appendJoinTableList(StatementBuffer query)(Code)
Appends the alias-qualified, comma separated list of all tables to be joined in order to represent the associated filter expression (and possibly feature type joins).

The list consist of left outer joins ("x LEFT OUTER JOIN y") and cross-product joins ("x,y"):

  • left outer joins are generated for each join that is necessary, because of filter expressions that target properties stored in related tables (condition joins)
  • cross-product joins are generated for all feature type root tables (feature type joins) that have not joined by filter expression joins before

Parameters:
  query - the list is appended to this SQLStatement



appendLiteralAsSQL
protected void appendLiteralAsSQL(StatementBuffer query, Literal literal, int targetSqlType)(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  literal -
Parameters:
  targetSqlType -



appendLogicalOperationAsSQL
protected void appendLogicalOperationAsSQL(StatementBuffer query, LogicalOperation operation) throws DatastoreException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  DatastoreException -



appendOperationAsSQL
protected void appendOperationAsSQL(StatementBuffer query, Operation operation) throws DatastoreException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  DatastoreException -



appendOrderByCondition
public void appendOrderByCondition(StatementBuffer query) throws DatastoreException(Code)
Appends an SQL "ORDER BY"-condition that corresponds to the sort properties of the query to the given SQL statement.
Parameters:
  query -
throws:
  DatastoreException -



appendPropertyIsBetweenOperationAsSQL
protected void appendPropertyIsBetweenOperationAsSQL(StatementBuffer query, PropertyIsBetweenOperation operation) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  FilterEvaluationException -



appendPropertyIsCOMPOperationAsSQL
protected void appendPropertyIsCOMPOperationAsSQL(StatementBuffer query, PropertyIsCOMPOperation operation) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  FilterEvaluationException -



appendPropertyIsLikeOperationAsSQL
protected void appendPropertyIsLikeOperationAsSQL(StatementBuffer query, PropertyIsLikeOperation operation) throws FilterEvaluationException(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -
throws:
  FilterEvaluationException -



appendPropertyIsNullOperationAsSQL
protected void appendPropertyIsNullOperationAsSQL(StatementBuffer query, PropertyIsNullOperation operation)(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  operation -



appendPropertyNameAsSQL
protected void appendPropertyNameAsSQL(StatementBuffer query, PropertyName propertyName)(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  propertyName -



appendPropertyPathAsSQL
protected void appendPropertyPathAsSQL(StatementBuffer query, PropertyPath propertyPath)(Code)
Appends an SQL fragment for the given object to the given sql statement.
Parameters:
  query -
Parameters:
  propertyPath -



appendSpatialOperationAsSQL
protected void appendSpatialOperationAsSQL(StatementBuffer query, SpatialOperation operation) throws DatastoreException(Code)
Appends an SQL fragment for the given object to the given sql statement. As this depends on the handling of geometry data by the concrete database in use, this method must be overwritten by any datastore implementation that has spatial capabilities.
Parameters:
  query -
Parameters:
  operation -
throws:
  DatastoreException -



appendWhereCondition
final public void appendWhereCondition(StatementBuffer query) throws DatastoreException(Code)
Appends an SQL WHERE-condition corresponding to the Filter to the given SQL statement.
Parameters:
  query -
throws:
  DatastoreException -



buildFilterPropertyNameMap
protected void buildFilterPropertyNameMap() throws PropertyPathResolvingException(Code)



fillFunctionNameMap
protected void fillFunctionNameMap()(Code)
Prepares the function map for functions with implementation specific names, e.g. upper case conversion in ORACLE = UPPER(string); POSTGRES = UPPER(string), and MS Access = UCase(string). Default SQL-function name map function 'UPPER' is 'UPPER'. If this function shall be used with user databases e.g. SQLServer a specialized WhereBuilder must override this method.



getFilter
public Filter getFilter()(Code)
Returns the associated Filter instance. the associated Filter instance



getFunctionName
protected String getFunctionName(String name)(Code)
Get the function with the specified name.
Parameters:
  name - the function name the mapped function name



getGeometryProperty
protected MappedGeometryPropertyType getGeometryProperty(PropertyName propName)(Code)



getPropertyNameSQLType
protected int getPropertyNameSQLType(PropertyName propertyName)(Code)



getRootTableAlias
public String getRootTableAlias(int i)(Code)
Returns the table alias used for the specified root feature type.
Parameters:
  i - index of the requested root feature type the alias used for the root table



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.