Ontimize 5.2072EN

com.ontimize.db
Class SQLStatementBuilder.DefaultSQLConditionValuesProcessor

java.lang.Object
  extended bycom.ontimize.db.SQLStatementBuilder.DefaultSQLConditionValuesProcessor
All Implemented Interfaces:
SQLStatementBuilder.SQLConditionValuesProcessor
Direct Known Subclasses:
SQLStatementBuilder.ExtendedSQLConditionValuesProcessor
Enclosing class:
SQLStatementBuilder

public static class SQLStatementBuilder.DefaultSQLConditionValuesProcessor
extends java.lang.Object
implements SQLStatementBuilder.SQLConditionValuesProcessor

This class provides default implementations for the SQLConditionValuesProcessor interface.

Author:
Imatia Innovation S.L.

Field Summary
protected  SQLStatementHandler handler
           
static java.lang.String upperFunction
           
protected  boolean upperLike
           
protected  boolean upperStrings
           
 
Constructor Summary
SQLStatementBuilder.DefaultSQLConditionValuesProcessor()
           
SQLStatementBuilder.DefaultSQLConditionValuesProcessor(boolean upperLike)
          Creates a DefaultSQLConditionValuesProcessor where every condition that uses LIKE is case-insensitive.
SQLStatementBuilder.DefaultSQLConditionValuesProcessor(boolean upperStrings, boolean upperLike)
          Creates a DefaultSQLConditionValuesProcessor where every condition that uses LIKE or is a column of String type is case-insensitive.
 
Method Summary
 java.lang.String createQueryConditions(java.util.Hashtable conditions, java.util.Vector wildcards, java.util.Vector values)
          Creates the condition string for a SQL Statement.
protected  SQLStatementHandler getSQLStatementHandler()
           
protected static boolean hasParenthesis(java.lang.String sqlquery)
          Checks if the string contains a parenthesis
 void setSQLStatementHandler(SQLStatementHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upperLike

protected boolean upperLike

upperStrings

protected boolean upperStrings

upperFunction

public static java.lang.String upperFunction

handler

protected SQLStatementHandler handler
Constructor Detail

SQLStatementBuilder.DefaultSQLConditionValuesProcessor

public SQLStatementBuilder.DefaultSQLConditionValuesProcessor()

SQLStatementBuilder.DefaultSQLConditionValuesProcessor

public SQLStatementBuilder.DefaultSQLConditionValuesProcessor(boolean upperLike)
Creates a DefaultSQLConditionValuesProcessor where every condition that uses LIKE is case-insensitive.

Inserts a upper function in both sides of LIKE conditions (UPPER(Field) LIKE UPPER(Value))

Parameters:
upperLike - true if the LIKE condition should be case-insensitive

SQLStatementBuilder.DefaultSQLConditionValuesProcessor

public SQLStatementBuilder.DefaultSQLConditionValuesProcessor(boolean upperStrings,
                                                              boolean upperLike)
Creates a DefaultSQLConditionValuesProcessor where every condition that uses LIKE or is a column of String type is case-insensitive.

Inserts a upper function in both sides of LIKE conditions (UPPER(Field) LIKE UPPER(Value)) Inserts a upper function in both sides if column type is a String (UPPER(Field) LIKE UPPER(String))

Parameters:
upperStrings - true if the String column type should be case-insensitive
upperLike - true if the LIKE condition should be case-insensitive
Method Detail

getSQLStatementHandler

protected SQLStatementHandler getSQLStatementHandler()

setSQLStatementHandler

public void setSQLStatementHandler(SQLStatementHandler handler)
Specified by:
setSQLStatementHandler in interface SQLStatementBuilder.SQLConditionValuesProcessor

hasParenthesis

protected static boolean hasParenthesis(java.lang.String sqlquery)
Checks if the string contains a parenthesis

Parameters:
sqlquery - string to check
Returns:
true if the string contains a parenthesis

createQueryConditions

public java.lang.String createQueryConditions(java.util.Hashtable conditions,
                                              java.util.Vector wildcards,
                                              java.util.Vector values)
Creates the condition string for a SQL Statement.

Specified by:
createQueryConditions in interface SQLStatementBuilder.SQLConditionValuesProcessor
Parameters:
conditions - a Hashtable specifying pairs of key-value corresponding to the attribute (or column of a table in a database) and the value that is formed by the condition.
wildcards - column list that can use wildcards
values - vector where the value of each processed conditions is stored
Returns:

Ontimize