com.ontimize.db

Class SQLStatementBuilder.ExtendedSQLConditionValuesProcessor

    • Constructor Detail

      • SQLStatementBuilder.ExtendedSQLConditionValuesProcessor

        public SQLStatementBuilder.ExtendedSQLConditionValuesProcessor()
      • SQLStatementBuilder.ExtendedSQLConditionValuesProcessor

        public SQLStatementBuilder.ExtendedSQLConditionValuesProcessor(boolean upperLike)
        Creates a ExtendedSQLConditionValuesProcessor 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.ExtendedSQLConditionValuesProcessor

        public SQLStatementBuilder.ExtendedSQLConditionValuesProcessor(boolean upperStrings,
                                                               boolean upperLike)
        Creates a ExtendedSQLConditionValuesProcessor 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

      • getColumnName

        protected String getColumnName(String name)
        Returns the column name in square bracket if the name contains a special characters
        Parameters:
        name - column name to checks
        Returns:
        the column name in square bracket if it's necessary
      • createQueryConditionsExpress

        public static String createQueryConditionsExpress(SQLStatementBuilder.Expression expression)
        Creates the condition string from a expression. This condition string be used after WHERE clause in the SQL Statement.
        Parameters:
        expression - a class that implements Expression interface
        Returns:
        a String where is stored a condition in text format
      • createQueryConditionsExpress

        public static void createQueryConditionsExpress(SQLStatementBuilder.Expression expression,
                                        StringBuffer sb)
        Creates the condition string from a expression.
        Parameters:
        expression - a class that implements Expression interface
        sb - StringBuffer where the condition string is stored.
      • createQueryConditionsFromExpression

        protected String createQueryConditionsFromExpression(SQLStatementBuilder.Expression expression,
                                                 Vector values)
        Creates the condition string from a expression and stores required values in a vector.
        Parameters:
        expression - a class that implements Expression interface
        values - a list where the required values for the condition are stored
        Returns:
        a String where is stored a condition in text format
      • createQueryConditionsFromExpression

        protected String createQueryConditionsFromExpression(SQLStatementBuilder.Expression expression,
                                                 Vector values,
                                                 boolean upper)
        Creates the condition string from a expression and stores required values in a vector.
        Parameters:
        expression - a class that implements Expression interface
        values - a list where the required values for the condition are stored
        Returns:
        a String where is stored a condition in text format
      • createQueryConditionsFromExpression

        protected void createQueryConditionsFromExpression(SQLStatementBuilder.Expression expression,
                                               Vector values,
                                               StringBuffer sb)
        Creates the condition string from a expression. The condition string is stored in the StringBuffer param and the required values in a Vector param
        Parameters:
        expression - a class that implements Expression interface
        values - a list where the required values for the condition are stored
        sb - a StringBuffer where the condition string is stored
      • createQueryConditionsFromExpression

        protected void createQueryConditionsFromExpression(SQLStatementBuilder.Expression expression,
                                               Vector values,
                                               StringBuffer sb,
                                               boolean upper)
        Creates the condition string from a expression. The condition string is stored in the StringBuffer param and the required values in a Vector param
        Parameters:
        expression - a class that implements Expression interface
        values - a list where the required values for the condition are stored
        sb - a StringBuffer where the condition string is stored
        upper - Boolean that enable the String compare in upper case, i.e., for non case-sensitive.

Copyright © 2016 Imatia Innovation S.L.. All rights reserved.