Class BindingUtils

java.lang.Object
de.businesscode.bcdui.binding.BindingUtils

public class BindingUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    addTableAlias(String sCE, boolean columnQuoting, List<String> tableAliases, BindingSet bs)
    Convenience method
    static String
    addTableAlias(List<String> sCE, List<String> tableAliases)
    Use output of splitColumnExpression to prepend table alias to column expressions Column expressions prefixed with SimpleBindingItem.BCD_NO_TABLE_ALIAS by the user are excluded from this the user has to assure that this is only used in an unambiguous statement when using this in a join.
    static boolean
    isNumeric(int jdbcType)
     
    static boolean
    isNumeric(String typeName)
     
    static List<String>
    splitColumnExpression(String colExpr, boolean columnQuoting, BindingSet bs)
    Used to identify column reference parts in a SQL Column expressions to allow for for example prepending table alias Each post 0,2,4,6 will be a non-column-expression, 1,3,5 will be a column expression Sample: CASE WHEN col=1 then 'ONE' else SUM(col2) END -> "CASE WHEN ","col","=1 then 'ONE' else SUM(","col2",") END" If the expression does not start with a column reference, the list will start with a "": col1+col2+3 -> "","col1","+","col2","+2" cCEBase is the columnExpression which was split into cCE to allows caching the split even though our column expression is read/write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BindingUtils

      public BindingUtils()
  • Method Details

    • splitColumnExpression

      public static List<String> splitColumnExpression(String colExpr, boolean columnQuoting, BindingSet bs)
      Used to identify column reference parts in a SQL Column expressions to allow for for example prepending table alias Each post 0,2,4,6 will be a non-column-expression, 1,3,5 will be a column expression Sample: CASE WHEN col=1 then 'ONE' else SUM(col2) END -> "CASE WHEN ","col","=1 then 'ONE' else SUM(","col2",") END" If the expression does not start with a column reference, the list will start with a "": col1+col2+3 -> "","col1","+","col2","+2" cCEBase is the columnExpression which was split into cCE to allows caching the split even though our column expression is read/write
    • addTableAlias

      public static String addTableAlias(List<String> sCE, List<String> tableAliases)
      Use output of splitColumnExpression to prepend table alias to column expressions Column expressions prefixed with SimpleBindingItem.BCD_NO_TABLE_ALIAS by the user are excluded from this the user has to assure that this is only used in an unambiguous statement when using this in a join. This is the case for example if the column refers to another table than the one assigned to this BindingSet or for mySequence.nextval expressions (this, referring to a global name, needs to be prefixed with BCD_NO_TABLE_ALIAS.)
    • addTableAlias

      public static String addTableAlias(String sCE, boolean columnQuoting, List<String> tableAliases, BindingSet bs)
      Convenience method
      Parameters:
      sCE -
      columnQuoting -
      tableAliases -
      Returns:
    • isNumeric

      public static boolean isNumeric(String typeName)
      Returns:
      true typeName represents a numeric type
    • isNumeric

      public static boolean isNumeric(int jdbcType)
      Returns:
      true if jdbcType represents a numeric type