Package de.businesscode.bcdui.binding
Class BindingUtils
- java.lang.Object
-
- de.businesscode.bcdui.binding.BindingUtils
-
public class BindingUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BindingUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
addTableAlias(java.lang.String sCE, boolean columnQuoting, java.lang.String tableAlias, BindingSet bs)
Convenience methodstatic java.lang.String
addTableAlias(java.util.List<java.lang.String> sCE, java.lang.String tableAlias)
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(java.lang.String typeName)
static java.util.List<java.lang.String>
splitColumnExpression(java.lang.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
-
-
-
Method Detail
-
splitColumnExpression
public static java.util.List<java.lang.String> splitColumnExpression(java.lang.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 java.lang.String addTableAlias(java.util.List<java.lang.String> sCE, java.lang.String tableAlias)
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 java.lang.String addTableAlias(java.lang.String sCE, boolean columnQuoting, java.lang.String tableAlias, BindingSet bs)
Convenience method- Parameters:
sCE
-columnQuoting
-tableAlias
-- Returns:
-
isNumeric
public static boolean isNumeric(java.lang.String typeName)
- Returns:
- true typeName represents a numeric type
-
isNumeric
public static boolean isNumeric(int jdbcType)
- Returns:
- true if jdbcType represents a numeric type
-
-