Java Doc for BasicSqlHandler.java in  » Database-ORM » MMBase » org » mmbase » storage » search » implementation » database » 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 » MMBase » org.mmbase.storage.search.implementation.database 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.storage.search.implementation.database.BasicSqlHandler

All known Subclasses:   org.mmbase.storage.search.implementation.database.PostgreSqlSqlHandler,  org.mmbase.storage.search.implementation.database.InformixSqlHandler,  org.mmbase.storage.search.implementation.database.MySqlSqlHandler,  org.mmbase.storage.search.implementation.database.MSSqlSqlHandler,  org.mmbase.storage.search.implementation.database.HSqlSqlHandler,
BasicSqlHandler
public class BasicSqlHandler implements SqlHandler(Code)
Basic implementation.
author:
   Rob van Maris
version:
   $Id: BasicSqlHandler.java,v 1.74 2007/09/05 08:12:13 michiel Exp $
since:
   MMBase-1.7



Constructor Summary
public  BasicSqlHandler()
     Constructor.

Method Summary
protected  voidappendCompositeConstraintToSql(StringBuilder sb, CompositeConstraint compositeConstraint, SearchQuery query, boolean inverse, boolean inComposite, SqlHandler firstInChain)
     Represents a CompositeConstraint object as a constraint in SQL format, appending the result to a stringbuffer.
public  voidappendConstraintToSql(StringBuilder sb, Constraint constraint, SearchQuery query, boolean inverse, boolean inComposite)
    
protected  voidappendDateField(StringBuilder sb, Step step, String fieldName, boolean multipleSteps, int datePart)
    
protected  voidappendDateValue(StringBuilder sb, Date value)
    
protected  voidappendField(StringBuilder sb, SortOrder sortOrder, boolean includeTablePrefix)
     Creates an identifier for a field absed on adate from a sortorder, and appends it to a stringbuffer. The identifier is constructed from the fieldname, optionally prefixed by the tablename or the tablealias - when available.
Parameters:
  sb - The stringbuffer to append to.
Parameters:
  sortOrder - The sortOrder object containing the field data.
Parameters:
  includeTablePrefix - true when the fieldname must beprefixed with the tablename or tablealias (e.g.
protected  voidappendField(StringBuilder sb, Step step, String fieldName, boolean includeTablePrefix)
     Creates an identifier for a field, and appends it to a stringbuffer. The identifier is constructed from the fieldname, optionally prefixed by the tablename or the tablealias - when available.
Parameters:
  sb - The stringbuffer to append to.
Parameters:
  step - The Step the field belongs to.
Parameters:
  fieldName - The fields fieldname.
Parameters:
  includeTablePrefix - true when the fieldname must beprefixed with the tablename or tablealias (e.g.
public  voidappendFieldValue(StringBuilder sb, Object value, boolean toLowerCase, int fieldType)
     Represents field value as a string, appending the result to a stringbuffer.
protected  StringBuilderappendLikeOperator(StringBuilder sb, boolean caseSensitive)
     Appends the 'LIKE' operator for the given case sensitiviy.
protected  voidappendLowerField(StringBuilder sb, Step step, String fieldName, boolean includeTablePrefix)
    
public  voidappendQueryBodyToSql(StringBuilder sb, SearchQuery query, SqlHandler firstInChain)
    
protected  voidappendRelationConstraints(StringBuilder sbRelations, RelationStep relationStep, boolean multipleSteps)
    
protected  StringBuilderappendSortOrderDirection(StringBuilder sb, SortOrder sortOrder)
    
protected  StringBuilderappendSortOrderField(StringBuilder sb, SortOrder sortOrder, boolean multipleSteps)
    
protected  StringBuilderappendSortOrderField(StringBuilder sb, SortOrder sortOrder, boolean multipleSteps, SearchQuery query)
    
protected  StringBuilderappendSortOrders(StringBuilder sb, SearchQuery query)
    
protected  voidappendTableAlias(StringBuilder sb, Step step)
    
protected  voidappendTableName(StringBuilder sb, Step step)
    
public static  StringforceEncode(String st)
    
public  StringgetAllowedValue(String value)
    
public  intgetSupportLevel(int feature, SearchQuery query)
    
public  intgetSupportLevel(Constraint constraint, SearchQuery query)
    
public  StringtoSql(SearchQuery query, SqlHandler firstInChain)
    
protected  StringtoSqlString(String str)
     Utility method, modifies strings for use in SQL statements. This amounts to replacing all single quotes by two single quotes.
Parameters:
  str - The input string.
protected  booleanuseLower(FieldCompareConstraint constraint)
     Wether the 'LOWER' function needs to be used to implement case insensitivity.


Constructor Detail
BasicSqlHandler
public BasicSqlHandler()(Code)
Constructor.




Method Detail
appendCompositeConstraintToSql
protected void appendCompositeConstraintToSql(StringBuilder sb, CompositeConstraint compositeConstraint, SearchQuery query, boolean inverse, boolean inComposite, SqlHandler firstInChain) throws SearchQueryException(Code)
Represents a CompositeConstraint object as a constraint in SQL format, appending the result to a stringbuffer. When it is part of a composite expression, it will be surrounded by parenthesis when needed.
Parameters:
  sb - The stringbuffer to append to.
Parameters:
  compositeConstraint - The composite constraint.
Parameters:
  query - The searchquery containing the constraint.
Parameters:
  inverse - True when the inverse constraint must be represented,false otherwise.
Parameters:
  inComposite - True when the constraint is part ofa composite expression.
Parameters:
  firstInChain - The first element in the chain of handlers.At some point appendConstraintToSql() will haveto be called on this handler, to generate the constraints inthe composite.



appendConstraintToSql
public void appendConstraintToSql(StringBuilder sb, Constraint constraint, SearchQuery query, boolean inverse, boolean inComposite)(Code)



appendDateField
protected void appendDateField(StringBuilder sb, Step step, String fieldName, boolean multipleSteps, int datePart)(Code)



appendDateValue
protected void appendDateValue(StringBuilder sb, Date value)(Code)



appendField
protected void appendField(StringBuilder sb, SortOrder sortOrder, boolean includeTablePrefix)(Code)
Creates an identifier for a field absed on adate from a sortorder, and appends it to a stringbuffer. The identifier is constructed from the fieldname, optionally prefixed by the tablename or the tablealias - when available.
Parameters:
  sb - The stringbuffer to append to.
Parameters:
  sortOrder - The sortOrder object containing the field data.
Parameters:
  includeTablePrefix - true when the fieldname must beprefixed with the tablename or tablealias (e.g. like in "images.number"),false otherwise.



appendField
protected void appendField(StringBuilder sb, Step step, String fieldName, boolean includeTablePrefix)(Code)
Creates an identifier for a field, and appends it to a stringbuffer. The identifier is constructed from the fieldname, optionally prefixed by the tablename or the tablealias - when available.
Parameters:
  sb - The stringbuffer to append to.
Parameters:
  step - The Step the field belongs to.
Parameters:
  fieldName - The fields fieldname.
Parameters:
  includeTablePrefix - true when the fieldname must beprefixed with the tablename or tablealias (e.g. like in "images.number"),false otherwise.



appendFieldValue
public void appendFieldValue(StringBuilder sb, Object value, boolean toLowerCase, int fieldType)(Code)
Represents field value as a string, appending the result to a stringbuffer.

Depending on the fieldType:

  • String values are converted to SQL-formatted string, surrounded by single quotes,
  • Numerical values are represented as integer (integral values) or floating point.

Parameters:
  sb - The stringbuffer to append to.
Parameters:
  value - The field value.
Parameters:
  toLowerCase - True when String must be converted tolower case.
Parameters:
  fieldType - The field type.



appendLikeOperator
protected StringBuilder appendLikeOperator(StringBuilder sb, boolean caseSensitive)(Code)
Appends the 'LIKE' operator for the given case sensitiviy. Some databases support a case insensitive LIKE ('ILIKE'). Implementations for those database can override this method. The string buffer.



appendLowerField
protected void appendLowerField(StringBuilder sb, Step step, String fieldName, boolean includeTablePrefix)(Code)

since:
   MMBase-1.8.5



appendQueryBodyToSql
public void appendQueryBodyToSql(StringBuilder sb, SearchQuery query, SqlHandler firstInChain) throws SearchQueryException(Code)



appendRelationConstraints
protected void appendRelationConstraints(StringBuilder sbRelations, RelationStep relationStep, boolean multipleSteps)(Code)

since:
   MMBase-1.8



appendSortOrderDirection
protected StringBuilder appendSortOrderDirection(StringBuilder sb, SortOrder sortOrder) throws IllegalStateException(Code)

since:
   MMBase-1.8



appendSortOrderField
protected StringBuilder appendSortOrderField(StringBuilder sb, SortOrder sortOrder, boolean multipleSteps)(Code)

since:
   MMBase-1.8



appendSortOrderField
protected StringBuilder appendSortOrderField(StringBuilder sb, SortOrder sortOrder, boolean multipleSteps, SearchQuery query)(Code)

since:
   MMBase-1.8.2



appendSortOrders
protected StringBuilder appendSortOrders(StringBuilder sb, SearchQuery query)(Code)

since:
   MMBase-1.8



appendTableAlias
protected void appendTableAlias(StringBuilder sb, Step step)(Code)

since:
   MMBase-1.8



appendTableName
protected void appendTableName(StringBuilder sb, Step step)(Code)

Parameters:
  sb -
Parameters:
  step -
since:
   MMBase-1.8



forceEncode
public static String forceEncode(String st)(Code)



getAllowedValue
public String getAllowedValue(String value)(Code)



getSupportLevel
public int getSupportLevel(int feature, SearchQuery query) throws SearchQueryException(Code)



getSupportLevel
public int getSupportLevel(Constraint constraint, SearchQuery query) throws SearchQueryException(Code)



toSql
public String toSql(SearchQuery query, SqlHandler firstInChain) throws SearchQueryException(Code)



toSqlString
protected String toSqlString(String str)(Code)
Utility method, modifies strings for use in SQL statements. This amounts to replacing all single quotes by two single quotes.
Parameters:
  str - The input string. The modified string.



useLower
protected boolean useLower(FieldCompareConstraint constraint)(Code)
Wether the 'LOWER' function needs to be used to implement case insensitivity. This is not always the case, because some database only match case insensitively, in which case it does not make sense to lowercase.



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.