org.mmbase.storage.search.implementation.database
Class MySqlSqlHandler

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.database.BasicSqlHandler
      extended byorg.mmbase.storage.search.implementation.database.MySqlSqlHandler
All Implemented Interfaces:
SqlHandler

public class MySqlSqlHandler
extends BasicSqlHandler
implements SqlHandler

The MySQL query handler, implements SqlHandler for standard MySQL functionality.
Derived from BasicSqlHandler, overrides

Since:
MMBase-1.7
Version:
$Id: MySqlSqlHandler.java,v 1.15 2005/12/28 16:07:49 michiel Exp $
Author:
Rob van Maris

Constructor Summary
MySqlSqlHandler()
          Constructor.
 
Method Summary
protected  void appendDateField(StringBuffer sb, Step step, String fieldName, boolean multipleSteps, int datePart)
           
protected  StringBuffer appendLikeOperator(StringBuffer sb, boolean caseSensitive)
          Appends the 'LIKE' operator for the given case sensitiviy.
protected  StringBuffer appendSortOrderField(StringBuffer sb, SortOrder sortOrder, boolean multipleSteps)
           
 int getSupportLevel(int feature, SearchQuery query)
          Gets the level at which a feature is supported for a query by this handler.
 String toSql(SearchQuery query, SqlHandler firstInChain)
          Represents a SearchQuery object as a string in SQL format, using the database configuration.
protected  boolean useLower(FieldCompareConstraint constraint)
          Wether the 'LOWER' function needs to be used to implement case insensitivity.
 
Methods inherited from class org.mmbase.storage.search.implementation.database.BasicSqlHandler
appendCompositeConstraintToSql, appendConstraintToSql, appendDateValue, appendField, appendFieldValue, appendQueryBodyToSql, appendRelationConstraints, appendSortOrderDirection, appendSortOrders, appendTableAlias, appendTableName, getAllowedValue, getSupportLevel, toSqlString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.implementation.database.SqlHandler
appendConstraintToSql, appendQueryBodyToSql, getAllowedValue, getSupportLevel
 

Constructor Detail

MySqlSqlHandler

public MySqlSqlHandler()
Constructor.

Method Detail

getSupportLevel

public int getSupportLevel(int feature,
                           SearchQuery query)
                    throws SearchQueryException
Description copied from interface: SqlHandler
Gets the level at which a feature is supported for a query by this handler. This is one of either: Given the choice, the query handler with the highest level of support is prefered.

Specified by:
getSupportLevel in interface SqlHandler
Overrides:
getSupportLevel in class BasicSqlHandler
Throws:
SearchQueryException

useLower

protected boolean useLower(FieldCompareConstraint constraint)
Description copied from class: BasicSqlHandler
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.

Overrides:
useLower in class BasicSqlHandler

appendLikeOperator

protected StringBuffer appendLikeOperator(StringBuffer sb,
                                          boolean caseSensitive)
Description copied from class: BasicSqlHandler
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.

Overrides:
appendLikeOperator in class BasicSqlHandler
Returns:
The string buffer.

appendDateField

protected void appendDateField(StringBuffer sb,
                               Step step,
                               String fieldName,
                               boolean multipleSteps,
                               int datePart)
Overrides:
appendDateField in class BasicSqlHandler
Warning: No Java Documentation Available.

appendSortOrderField

protected StringBuffer appendSortOrderField(StringBuffer sb,
                                            SortOrder sortOrder,
                                            boolean multipleSteps)
Overrides:
appendSortOrderField in class BasicSqlHandler

toSql

public String toSql(SearchQuery query,
                    SqlHandler firstInChain)
             throws SearchQueryException
Description copied from interface: SqlHandler
Represents a SearchQuery object as a string in SQL format, using the database configuration.

Specified by:
toSql in interface SqlHandler
Overrides:
toSql in class BasicSqlHandler
Throws:
SearchQueryException


MMBase build 1.8.1.20060716