81: Allow the creation and use of expressions on multi column in TDM portlet
Task-Url: https://support.d4science.org/issues/81 Increased speed of creating expressions client side and added Label to ColumnReferencePlaceHolder git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@114916 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b359825701
commit
04c91ad225
|
@ -777,7 +777,7 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
secondArg == null ? null : secondArg.getCurrentValue(),
|
secondArg == null ? null : secondArg.getCurrentValue(),
|
||||||
comboThreshold.getCurrentValue()==null?null:comboThreshold.getCurrentValue());
|
comboThreshold.getCurrentValue()==null?null:comboThreshold.getCurrentValue());
|
||||||
}
|
}
|
||||||
readableExpressionList.add(mapOp.getReadableExpression());
|
readableExpressionList.add(expression.getReadableExpression());
|
||||||
Log.debug(expression.toString());
|
Log.debug(expression.toString());
|
||||||
arguments.add(expression);
|
arguments.add(expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1086,7 +1086,7 @@ public class ReplaceWidget extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readableExpLeaf = mapReplace.getReadableExpression();
|
readableExpLeaf = expLeaf.getReadableExpression();
|
||||||
}
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
|
@ -1139,7 +1139,7 @@ public class ReplaceWidget extends SimpleContainer {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
readableExp = mapReplace.getReadableExpression();
|
readableExp = exp.getReadableExpression();
|
||||||
expressionContainer = new ExpressionContainer(exp,
|
expressionContainer = new ExpressionContainer(exp,
|
||||||
readableExp);
|
readableExp);
|
||||||
}
|
}
|
||||||
|
@ -1206,7 +1206,7 @@ public class ReplaceWidget extends SimpleContainer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readableExpLeaf = mapReplace.getReadableExpression();
|
readableExpLeaf = expLeaf.getReadableExpression();
|
||||||
}
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
|
@ -1261,7 +1261,7 @@ public class ReplaceWidget extends SimpleContainer {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
readableExp = mapReplace.getReadableExpression();
|
readableExp = exp.getReadableExpression();
|
||||||
expressionContainer = new ExpressionContainer(exp,
|
expressionContainer = new ExpressionContainer(exp,
|
||||||
readableExp);
|
readableExp);
|
||||||
}
|
}
|
||||||
|
@ -1304,7 +1304,7 @@ public class ReplaceWidget extends SimpleContainer {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
readableExp = mapReplace.getReadableExpression();
|
readableExp = exp.getReadableExpression();
|
||||||
expressionContainer = new ExpressionContainer(exp,
|
expressionContainer = new ExpressionContainer(exp,
|
||||||
readableExp);
|
readableExp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,7 +683,7 @@ public class C_ExpressionParser {
|
||||||
private C_Expression getColumnReferencePlaceholder(Expression exp) {
|
private C_Expression getColumnReferencePlaceholder(Expression exp) {
|
||||||
ColumnReferencePlaceholder c = (ColumnReferencePlaceholder) exp;
|
ColumnReferencePlaceholder c = (ColumnReferencePlaceholder) exp;
|
||||||
C_ColumnReferencePlaceholder col = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder col = new C_ColumnReferencePlaceholder(
|
||||||
mapColumnDataType(c.getDatatype()), c.getId());
|
mapColumnDataType(c.getDatatype()), c.getId(), c.getLabel());
|
||||||
|
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
@ -1375,7 +1375,7 @@ public class C_ExpressionParser {
|
||||||
private Expression getColumnReferencePlaceholder(C_Expression exp) {
|
private Expression getColumnReferencePlaceholder(C_Expression exp) {
|
||||||
C_ColumnReferencePlaceholder c = (C_ColumnReferencePlaceholder) exp;
|
C_ColumnReferencePlaceholder c = (C_ColumnReferencePlaceholder) exp;
|
||||||
ColumnReferencePlaceholder col = new ColumnReferencePlaceholder(
|
ColumnReferencePlaceholder col = new ColumnReferencePlaceholder(
|
||||||
mapColumnDataType(c.getDataType()), c.getColumnId());
|
mapColumnDataType(c.getDataType()), c.getColumnId(), c.getLabel());
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), column.getLabel());
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
// TD_Value fArg;
|
// TD_Value fArg;
|
||||||
|
@ -307,7 +307,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_NotLess(placeHolder, firstArgPlaceHolder);
|
exp = new C_NotLess(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -334,7 +334,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_NotGreater(placeHolder, firstArgPlaceHolder);
|
exp = new C_NotGreater(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -360,7 +360,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_NotEquals(placeHolder, firstArgPlaceHolder);
|
exp = new C_NotEquals(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -387,7 +387,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_TextMatchSQLRegexp(placeHolder, firstArgPlaceHolder);
|
exp = new C_TextMatchSQLRegexp(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -414,7 +414,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_LessOrEquals(placeHolder, firstArgPlaceHolder);
|
exp = new C_LessOrEquals(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -441,7 +441,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_LessThan(placeHolder, firstArgPlaceHolder);
|
exp = new C_LessThan(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -475,7 +475,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
* .getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
* .getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
* C_ColumnReferencePlaceholder firstArgPlaceHolder = new
|
* C_ColumnReferencePlaceholder firstArgPlaceHolder = new
|
||||||
* C_ColumnReferencePlaceholder( firstArgDataType,
|
* C_ColumnReferencePlaceholder( firstArgDataType,
|
||||||
* firstArgColumn.getColumnId()); exp = new
|
* firstArgColumn.getColumnId(), firstArgColumn.getLabel()); exp = new
|
||||||
* C_ValueIsIn(placeHolder,firstArgPlaceHolder);
|
* C_ValueIsIn(placeHolder,firstArgPlaceHolder);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_GreaterOrEquals(placeHolder, firstArgPlaceHolder);
|
exp = new C_GreaterOrEquals(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -554,7 +554,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_GreaterThan(placeHolder, firstArgPlaceHolder);
|
exp = new C_GreaterThan(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -581,7 +581,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_Equals(placeHolder, firstArgPlaceHolder);
|
exp = new C_Equals(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -609,7 +609,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_TextEndsWith(placeHolder, firstArgPlaceHolder);
|
exp = new C_TextEndsWith(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -637,7 +637,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
exp = new C_TextContains(placeHolder, firstArgPlaceHolder);
|
exp = new C_TextContains(placeHolder, firstArgPlaceHolder);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -670,7 +670,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
ColumnDataType firstArgDataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
fArg = new C_ColumnReferencePlaceholder(firstArgDataType,
|
fArg = new C_ColumnReferencePlaceholder(firstArgDataType,
|
||||||
firstArgColumn.getColumnId());
|
firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
if(firstArg==null|| firstArg.isEmpty()){
|
if(firstArg==null|| firstArg.isEmpty()){
|
||||||
|
@ -692,7 +692,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
.getColumnDataTypeFromId(secondArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(secondArgColumn.getDataTypeName());
|
||||||
Log.debug("Second Arg Data Type:" + secondArgDataType);
|
Log.debug("Second Arg Data Type:" + secondArgDataType);
|
||||||
sArg = new C_ColumnReferencePlaceholder(secondArgDataType,
|
sArg = new C_ColumnReferencePlaceholder(secondArgDataType,
|
||||||
secondArgColumn.getColumnId());
|
secondArgColumn.getColumnId(), secondArgColumn.getLabel());
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
if(secondArg==null|| secondArg.isEmpty()){
|
if(secondArg==null|| secondArg.isEmpty()){
|
||||||
|
@ -724,7 +724,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
||||||
Log.debug("First Arg Data Type:" + firstArgDataType);
|
Log.debug("First Arg Data Type:" + firstArgDataType);
|
||||||
C_ColumnReferencePlaceholder firstArgColumnPlaceHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder firstArgColumnPlaceHolder = new C_ColumnReferencePlaceholder(
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
firstArgDataType, firstArgColumn.getColumnId(), firstArgColumn.getLabel());
|
||||||
Log.debug("FirstArgColumnPlaceHolder:" + firstArgColumnPlaceHolder);
|
Log.debug("FirstArgColumnPlaceHolder:" + firstArgColumnPlaceHolder);
|
||||||
exp = new C_TextBeginsWith(placeHolder, firstArgColumnPlaceHolder);
|
exp = new C_TextBeginsWith(placeHolder, firstArgColumnPlaceHolder);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -47,8 +47,6 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ConditionTypeMap {
|
public class ConditionTypeMap {
|
||||||
private String readableExpression;
|
|
||||||
|
|
||||||
public ConditionTypeMap() {
|
public ConditionTypeMap() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +55,7 @@ public class ConditionTypeMap {
|
||||||
String firstArg, String secondArg, Threshold threshold) throws ConditionTypeMapException {
|
String firstArg, String secondArg, Threshold threshold) throws ConditionTypeMapException {
|
||||||
Log.debug("ConditionTypeMap Map");
|
Log.debug("ConditionTypeMap Map");
|
||||||
C_Expression exp = null;
|
C_Expression exp = null;
|
||||||
readableExpression = new String();
|
new String();
|
||||||
if (column.getTrId() == null) {
|
if (column.getTrId() == null) {
|
||||||
exp = mapPlaceHolder(column, operatorType, firstArg, secondArg, threshold);
|
exp = mapPlaceHolder(column, operatorType, firstArg, secondArg, threshold);
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,9 +76,8 @@ public class ConditionTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), column.getLabel());
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
String readablePlaceHolder = column.getLabel();
|
|
||||||
|
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
TD_Value sArg;
|
TD_Value sArg;
|
||||||
|
@ -101,8 +98,6 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextBeginsWith(placeHolder, new TD_Value(dataType,
|
exp = new C_TextBeginsWith(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "Begins(" + readablePlaceHolder + ", "
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case BETWEEN:
|
case BETWEEN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -110,15 +105,11 @@ public class ConditionTypeMap {
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
sArg = new TD_Value(dataType, secondArg);
|
sArg = new TD_Value(dataType, secondArg);
|
||||||
exp = new C_Between(placeHolder, fArg, sArg);
|
exp = new C_Between(placeHolder, fArg, sArg);
|
||||||
readableExpression = "Between(" + readablePlaceHolder + ", Range("
|
|
||||||
+ firstArg + ", " + secondArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case CONTAINS:
|
case CONTAINS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
exp = new C_TextContains(placeHolder, fArg);
|
exp = new C_TextContains(placeHolder, fArg);
|
||||||
readableExpression = "Contains(" + readablePlaceHolder + ", "
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case DIVISION:
|
case DIVISION:
|
||||||
break;
|
break;
|
||||||
|
@ -126,14 +117,10 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextEndsWith(placeHolder, new TD_Value(dataType,
|
exp = new C_TextEndsWith(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "TextEndsWith(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case EQUALS:
|
case EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_Equals(placeHolder, new TD_Value(dataType, firstArg));
|
exp = new C_Equals(placeHolder, new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "Equals(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case EXISTS:
|
case EXISTS:
|
||||||
// exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
// exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
||||||
|
@ -142,15 +129,11 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_GreaterThan(placeHolder, new TD_Value(dataType,
|
exp = new C_GreaterThan(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "GreaterThan(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case GREATER_OR_EQUALS:
|
case GREATER_OR_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_GreaterOrEquals(placeHolder, new TD_Value(dataType,
|
exp = new C_GreaterOrEquals(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "GreaterOrEquals(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case IN:
|
case IN:
|
||||||
separator = firstArg.indexOf(",");
|
separator = firstArg.indexOf(",");
|
||||||
|
@ -180,32 +163,21 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exp = new C_ValueIsIn(placeHolder, new C_ConstantList(arguments));
|
exp = new C_ValueIsIn(placeHolder, new C_ConstantList(arguments));
|
||||||
readableExpression = "ValueIsIn(" + readablePlaceHolder;
|
|
||||||
for (TD_Value v : arguments) {
|
|
||||||
readableExpression += ", " + v.getValue();
|
|
||||||
}
|
|
||||||
readableExpression += ")";
|
|
||||||
break;
|
break;
|
||||||
case IS_NOT_NULL:
|
case IS_NOT_NULL:
|
||||||
exp = new C_IsNotNull(placeHolder);
|
exp = new C_IsNotNull(placeHolder);
|
||||||
readableExpression = "IsNotNull(" + readablePlaceHolder + ")";
|
|
||||||
break;
|
break;
|
||||||
case IS_NULL:
|
case IS_NULL:
|
||||||
exp = new C_IsNull(placeHolder);
|
exp = new C_IsNull(placeHolder);
|
||||||
readableExpression = "IsNull(" + readablePlaceHolder + ")";
|
|
||||||
break;
|
break;
|
||||||
case LESSER:
|
case LESSER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_LessThan(placeHolder, new TD_Value(dataType, firstArg));
|
exp = new C_LessThan(placeHolder, new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "LessThan(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case LESSER_OR_EQUALS:
|
case LESSER_OR_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_LessOrEquals(placeHolder, new TD_Value(dataType,
|
exp = new C_LessOrEquals(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "LessOrEquals(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case LIKE:
|
case LIKE:
|
||||||
break;
|
break;
|
||||||
|
@ -213,8 +185,6 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextMatchSQLRegexp(placeHolder, new TD_Value(dataType,
|
exp = new C_TextMatchSQLRegexp(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "TextMatchSQLRegexp(" + readablePlaceHolder
|
|
||||||
+ "," + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case MODULUS:
|
case MODULUS:
|
||||||
break;
|
break;
|
||||||
|
@ -227,8 +197,6 @@ public class ConditionTypeMap {
|
||||||
exp = new C_TextBeginsWith(placeHolder, new TD_Value(dataType,
|
exp = new C_TextBeginsWith(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextBeginsWith(" + readablePlaceHolder
|
|
||||||
+ "," + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_BETWEEN:
|
case NOT_BETWEEN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -238,37 +206,27 @@ public class ConditionTypeMap {
|
||||||
sArg = new TD_Value(dataType, secondArg);
|
sArg = new TD_Value(dataType, secondArg);
|
||||||
exp = new C_Between(placeHolder, fArg, sArg);
|
exp = new C_Between(placeHolder, fArg, sArg);
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(Between(" + readablePlaceHolder
|
|
||||||
+ ", Range(" + firstArg + ", " + secondArg + ")))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_CONTAINS:
|
case NOT_CONTAINS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
exp = new C_TextContains(placeHolder, fArg);
|
exp = new C_TextContains(placeHolder, fArg);
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(Contains(" + readablePlaceHolder + ", "
|
|
||||||
+ firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_ENDS_WITH:
|
case NOT_ENDS_WITH:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextEndsWith(placeHolder, new TD_Value(dataType,
|
exp = new C_TextEndsWith(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextEndsWith(" + readablePlaceHolder
|
|
||||||
+ "," + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_EQUALS:
|
case NOT_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotEquals(placeHolder, new TD_Value(dataType, firstArg));
|
exp = new C_NotEquals(placeHolder, new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "NotEquals(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_GREATER:
|
case NOT_GREATER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotGreater(placeHolder,
|
exp = new C_NotGreater(placeHolder,
|
||||||
new TD_Value(dataType, firstArg));
|
new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "NotGreater(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_IN:
|
case NOT_IN:
|
||||||
separator = firstArg.indexOf(",");
|
separator = firstArg.indexOf(",");
|
||||||
|
@ -299,17 +257,10 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
exp = new C_ValueIsIn(placeHolder, new C_ConstantList(arguments));
|
exp = new C_ValueIsIn(placeHolder, new C_ConstantList(arguments));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(ValueIsIn(" + readablePlaceHolder;
|
|
||||||
for (TD_Value v : arguments) {
|
|
||||||
readableExpression += ", " + v.getValue();
|
|
||||||
}
|
|
||||||
readableExpression += "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_LESSER:
|
case NOT_LESSER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotLess(placeHolder, new TD_Value(dataType, firstArg));
|
exp = new C_NotLess(placeHolder, new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "NotLess(" + readablePlaceHolder + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_LIKE:
|
case NOT_LIKE:
|
||||||
break;
|
break;
|
||||||
|
@ -318,8 +269,6 @@ public class ConditionTypeMap {
|
||||||
exp = new C_TextMatchSQLRegexp(placeHolder, new TD_Value(dataType,
|
exp = new C_TextMatchSQLRegexp(placeHolder, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextMatchSQLRegexp("
|
|
||||||
+ readablePlaceHolder + "," + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case OR:
|
case OR:
|
||||||
break;
|
break;
|
||||||
|
@ -334,8 +283,6 @@ public class ConditionTypeMap {
|
||||||
C_Soundex soundexPlaceHolder=new C_Soundex(placeHolder);
|
C_Soundex soundexPlaceHolder=new C_Soundex(placeHolder);
|
||||||
C_Soundex soundexValue=new C_Soundex(new TD_Value(dataType, firstArg));
|
C_Soundex soundexValue=new C_Soundex(new TD_Value(dataType, firstArg));
|
||||||
exp = new C_Equals(soundexPlaceHolder, soundexValue);
|
exp = new C_Equals(soundexPlaceHolder, soundexValue);
|
||||||
readableExpression = "Equals(Soundex(" + readablePlaceHolder + "),Soundex("
|
|
||||||
+ firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case LEVENSHTEIN:
|
case LEVENSHTEIN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -349,8 +296,6 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
exp= new C_LessOrEquals(levenshstein,new TD_Value(ColumnDataType.Integer,
|
exp= new C_LessOrEquals(levenshstein,new TD_Value(ColumnDataType.Integer,
|
||||||
thresholdLev.getIntegerValue().toString()));
|
thresholdLev.getIntegerValue().toString()));
|
||||||
readableExpression = "LessOrEquals(Levenshtein(" + readablePlaceHolder + ","+firstArg+"),"
|
|
||||||
+ thresholdLev.getIntegerValue().toString() + ")";
|
|
||||||
break;
|
break;
|
||||||
case SIMILARITY:
|
case SIMILARITY:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -364,8 +309,6 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
exp= new C_GreaterOrEquals(similarity,new TD_Value(ColumnDataType.Numeric,
|
exp= new C_GreaterOrEquals(similarity,new TD_Value(ColumnDataType.Numeric,
|
||||||
thresholdSim.getLabel()));
|
thresholdSim.getLabel()));
|
||||||
readableExpression = "GreaterOrEquals(Similarity(" + readablePlaceHolder + ","+firstArg+"),"
|
|
||||||
+ thresholdSim.getLabel() + ")";
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -389,8 +332,7 @@ public class ConditionTypeMap {
|
||||||
C_ColumnReference columnReference = new C_ColumnReference(
|
C_ColumnReference columnReference = new C_ColumnReference(
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
String readableColumnReference = column.getLabel();
|
|
||||||
|
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
TD_Value sArg;
|
TD_Value sArg;
|
||||||
|
|
||||||
|
@ -410,8 +352,6 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextBeginsWith(columnReference, new TD_Value(dataType,
|
exp = new C_TextBeginsWith(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "TextBeginsWith(" + readableColumnReference
|
|
||||||
+ "," + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case BETWEEN:
|
case BETWEEN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -419,15 +359,11 @@ public class ConditionTypeMap {
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
sArg = new TD_Value(dataType, secondArg);
|
sArg = new TD_Value(dataType, secondArg);
|
||||||
exp = new C_Between(columnReference, fArg, sArg);
|
exp = new C_Between(columnReference, fArg, sArg);
|
||||||
readableExpression = "Between(" + readableColumnReference
|
|
||||||
+ ", Range(" + firstArg + ", " + secondArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case CONTAINS:
|
case CONTAINS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
exp = new C_TextContains(columnReference, fArg);
|
exp = new C_TextContains(columnReference, fArg);
|
||||||
readableExpression = "Contains(" + columnReference + ", "
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case DIVISION:
|
case DIVISION:
|
||||||
break;
|
break;
|
||||||
|
@ -435,15 +371,11 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextEndsWith(columnReference, new TD_Value(dataType,
|
exp = new C_TextEndsWith(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "TextEndsWith(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case EQUALS:
|
case EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_Equals(columnReference,
|
exp = new C_Equals(columnReference,
|
||||||
new TD_Value(dataType, firstArg));
|
new TD_Value(dataType, firstArg));
|
||||||
readableExpression = "Equals(" + readableColumnReference + ", "
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case EXISTS:
|
case EXISTS:
|
||||||
// exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
// exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
||||||
|
@ -452,15 +384,11 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_GreaterThan(columnReference, new TD_Value(dataType,
|
exp = new C_GreaterThan(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "GreaterThan(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case GREATER_OR_EQUALS:
|
case GREATER_OR_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_GreaterOrEquals(columnReference, new TD_Value(dataType,
|
exp = new C_GreaterOrEquals(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "GreaterOrEquals(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case IN:
|
case IN:
|
||||||
separator = firstArg.indexOf(",");
|
separator = firstArg.indexOf(",");
|
||||||
|
@ -491,33 +419,22 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
exp = new C_ValueIsIn(columnReference,
|
exp = new C_ValueIsIn(columnReference,
|
||||||
new C_ConstantList(arguments));
|
new C_ConstantList(arguments));
|
||||||
readableExpression = "ValueIsIn(" + readableColumnReference;
|
|
||||||
for (TD_Value v : arguments) {
|
|
||||||
readableExpression += ", " + v.getValue();
|
|
||||||
}
|
|
||||||
readableExpression += ")";
|
|
||||||
break;
|
break;
|
||||||
case IS_NOT_NULL:
|
case IS_NOT_NULL:
|
||||||
exp = new C_IsNotNull(columnReference);
|
exp = new C_IsNotNull(columnReference);
|
||||||
readableExpression = "IsNotNull(" + readableColumnReference + ")";
|
|
||||||
break;
|
break;
|
||||||
case IS_NULL:
|
case IS_NULL:
|
||||||
exp = new C_IsNull(columnReference);
|
exp = new C_IsNull(columnReference);
|
||||||
readableExpression = "IsNull(" + readableColumnReference + ")";
|
|
||||||
break;
|
break;
|
||||||
case LESSER:
|
case LESSER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_LessThan(columnReference, new TD_Value(dataType,
|
exp = new C_LessThan(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "LessThan(" + readableColumnReference + ", "
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case LESSER_OR_EQUALS:
|
case LESSER_OR_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_LessOrEquals(columnReference, new TD_Value(dataType,
|
exp = new C_LessOrEquals(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "LessOrEquals(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case LIKE:
|
case LIKE:
|
||||||
break;
|
break;
|
||||||
|
@ -525,8 +442,6 @@ public class ConditionTypeMap {
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextMatchSQLRegexp(columnReference, new TD_Value(
|
exp = new C_TextMatchSQLRegexp(columnReference, new TD_Value(
|
||||||
dataType, firstArg));
|
dataType, firstArg));
|
||||||
readableExpression = "TextMatchSQLRegexp("
|
|
||||||
+ readableColumnReference + ", " + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case MODULUS:
|
case MODULUS:
|
||||||
break;
|
break;
|
||||||
|
@ -539,8 +454,6 @@ public class ConditionTypeMap {
|
||||||
exp = new C_TextBeginsWith(columnReference, new TD_Value(dataType,
|
exp = new C_TextBeginsWith(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextBeginsWith("
|
|
||||||
+ readableColumnReference + ", " + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_BETWEEN:
|
case NOT_BETWEEN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -549,38 +462,28 @@ public class ConditionTypeMap {
|
||||||
sArg = new TD_Value(dataType, secondArg);
|
sArg = new TD_Value(dataType, secondArg);
|
||||||
exp = new C_Between(columnReference, fArg, sArg);
|
exp = new C_Between(columnReference, fArg, sArg);
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(Between(" + readableColumnReference
|
|
||||||
+ ", Range(" + firstArg + ", " + secondArg + ")))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_CONTAINS:
|
case NOT_CONTAINS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
fArg = new TD_Value(dataType, firstArg);
|
fArg = new TD_Value(dataType, firstArg);
|
||||||
exp = new C_TextContains(columnReference, fArg);
|
exp = new C_TextContains(columnReference, fArg);
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(Contains(" + columnReference + ", "
|
|
||||||
+ firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_ENDS_WITH:
|
case NOT_ENDS_WITH:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_TextEndsWith(columnReference, new TD_Value(dataType,
|
exp = new C_TextEndsWith(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextEndsWith(" + readableColumnReference
|
|
||||||
+ "," + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_EQUALS:
|
case NOT_EQUALS:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotEquals(columnReference, new TD_Value(dataType,
|
exp = new C_NotEquals(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "NotEquals(" + readableColumnReference + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_GREATER:
|
case NOT_GREATER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotGreater(columnReference, new TD_Value(dataType,
|
exp = new C_NotGreater(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "NotGreater(" + readableColumnReference + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_IN:
|
case NOT_IN:
|
||||||
separator = firstArg.indexOf(",");
|
separator = firstArg.indexOf(",");
|
||||||
|
@ -612,18 +515,11 @@ public class ConditionTypeMap {
|
||||||
exp = new C_ValueIsIn(columnReference,
|
exp = new C_ValueIsIn(columnReference,
|
||||||
new C_ConstantList(arguments));
|
new C_ConstantList(arguments));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(ValueIsIn(" + readableColumnReference;
|
|
||||||
for (TD_Value v : arguments) {
|
|
||||||
readableExpression += ", " + v.getValue();
|
|
||||||
}
|
|
||||||
readableExpression += "))";
|
|
||||||
break;
|
break;
|
||||||
case NOT_LESSER:
|
case NOT_LESSER:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
exp = new C_NotLess(columnReference, new TD_Value(dataType,
|
exp = new C_NotLess(columnReference, new TD_Value(dataType,
|
||||||
firstArg));
|
firstArg));
|
||||||
readableExpression = "NotLess(" + readableColumnReference + ","
|
|
||||||
+ firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case NOT_LIKE:
|
case NOT_LIKE:
|
||||||
break;
|
break;
|
||||||
|
@ -632,8 +528,6 @@ public class ConditionTypeMap {
|
||||||
exp = new C_TextMatchSQLRegexp(columnReference, new TD_Value(
|
exp = new C_TextMatchSQLRegexp(columnReference, new TD_Value(
|
||||||
dataType, firstArg));
|
dataType, firstArg));
|
||||||
exp = new C_Not(exp);
|
exp = new C_Not(exp);
|
||||||
readableExpression = "Not(TextMatchSQLRegexp("
|
|
||||||
+ readableColumnReference + "," + firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case OR:
|
case OR:
|
||||||
break;
|
break;
|
||||||
|
@ -648,8 +542,6 @@ public class ConditionTypeMap {
|
||||||
C_Soundex soundexPlaceHolder=new C_Soundex(columnReference);
|
C_Soundex soundexPlaceHolder=new C_Soundex(columnReference);
|
||||||
C_Soundex soundexValue=new C_Soundex(new TD_Value(dataType, firstArg));
|
C_Soundex soundexValue=new C_Soundex(new TD_Value(dataType, firstArg));
|
||||||
exp = new C_Equals(soundexPlaceHolder, soundexValue);
|
exp = new C_Equals(soundexPlaceHolder, soundexValue);
|
||||||
readableExpression = "Equals(Soundex(" + columnReference + "),Soundex("
|
|
||||||
+ firstArg + "))";
|
|
||||||
break;
|
break;
|
||||||
case LEVENSHTEIN:
|
case LEVENSHTEIN:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -663,8 +555,6 @@ public class ConditionTypeMap {
|
||||||
}
|
}
|
||||||
exp= new C_LessOrEquals(levenshstein,new TD_Value(ColumnDataType.Integer,
|
exp= new C_LessOrEquals(levenshstein,new TD_Value(ColumnDataType.Integer,
|
||||||
thresholdLev.getIntegerValue().toString()));
|
thresholdLev.getIntegerValue().toString()));
|
||||||
readableExpression = "LessOrEquals(Levenshtein(" + readableColumnReference + ","+firstArg+"),"
|
|
||||||
+ thresholdLev.getIntegerValue().toString() + ")";
|
|
||||||
break;
|
break;
|
||||||
case SIMILARITY:
|
case SIMILARITY:
|
||||||
checkTypeArgument(column, firstArg);
|
checkTypeArgument(column, firstArg);
|
||||||
|
@ -677,9 +567,7 @@ public class ConditionTypeMap {
|
||||||
thresholdSim=threshold;
|
thresholdSim=threshold;
|
||||||
}
|
}
|
||||||
exp= new C_GreaterOrEquals(similarity,new TD_Value(ColumnDataType.Numeric,
|
exp= new C_GreaterOrEquals(similarity,new TD_Value(ColumnDataType.Numeric,
|
||||||
thresholdSim.getLabel()));
|
thresholdSim.getLabel()));
|
||||||
readableExpression = "GreaterOrEquals(Similarity(" + readableColumnReference + ","+firstArg+"),"
|
|
||||||
+ thresholdSim.getLabel() + ")";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -698,9 +586,6 @@ public class ConditionTypeMap {
|
||||||
return or;
|
return or;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getReadableExpression() {
|
|
||||||
return readableExpression;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void checkTypeArgument(ColumnData column, String arg)
|
protected void checkTypeArgument(ColumnData column, String arg)
|
||||||
throws ConditionTypeMapException {
|
throws ConditionTypeMapException {
|
||||||
|
|
|
@ -7,18 +7,20 @@ public class C_ColumnReferencePlaceholder extends C_Leaf {
|
||||||
private static final long serialVersionUID = 275747262118236529L;
|
private static final long serialVersionUID = 275747262118236529L;
|
||||||
protected String id = "ColumnReferencePlaceholder";
|
protected String id = "ColumnReferencePlaceholder";
|
||||||
protected String columnId;
|
protected String columnId;
|
||||||
|
protected String label;
|
||||||
protected ColumnDataType dataType;
|
protected ColumnDataType dataType;
|
||||||
|
|
||||||
public C_ColumnReferencePlaceholder() {
|
public C_ColumnReferencePlaceholder() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public C_ColumnReferencePlaceholder(ColumnDataType dataType, String columnId) {
|
public C_ColumnReferencePlaceholder(ColumnDataType dataType,
|
||||||
|
String columnId, String label) {
|
||||||
this.dataType = dataType;
|
this.dataType = dataType;
|
||||||
this.columnId = columnId;
|
this.columnId = columnId;
|
||||||
if (dataType != null && columnId != null) {
|
if (dataType != null && columnId != null && label != null) {
|
||||||
this.readableExpression = "$"+columnId+"["
|
this.readableExpression = "$" + label + "[" + dataType.getLabel()
|
||||||
+ dataType.getLabel() + "]";
|
+ "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +38,14 @@ public class C_ColumnReferencePlaceholder extends C_Leaf {
|
||||||
this.columnId = columnId;
|
this.columnId = columnId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
public ColumnDataType getDataType() {
|
public ColumnDataType getDataType() {
|
||||||
return dataType;
|
return dataType;
|
||||||
}
|
}
|
||||||
|
@ -46,8 +56,9 @@ public class C_ColumnReferencePlaceholder extends C_Leaf {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ColumnReferencePlaceholder [id=" + id + ", columnId="
|
return "C_ColumnReferencePlaceholder [id=" + id + ", columnId="
|
||||||
+ columnId + ", dataType=" + dataType + "]";
|
+ columnId + ", label=" + label + ", dataType=" + dataType
|
||||||
|
+ "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,6 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ReplaceTypeMap {
|
public class ReplaceTypeMap {
|
||||||
private String readableExpression;
|
|
||||||
|
|
||||||
public ReplaceTypeMap() {
|
public ReplaceTypeMap() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -49,7 +47,7 @@ public class ReplaceTypeMap {
|
||||||
C_Expression secondE, String readableFirstE, String readableSecondE) throws ReplaceTypeMapException {
|
C_Expression secondE, String readableFirstE, String readableSecondE) throws ReplaceTypeMapException {
|
||||||
Log.debug("ReplaceTypeMap Map");
|
Log.debug("ReplaceTypeMap Map");
|
||||||
C_Expression exp = null;
|
C_Expression exp = null;
|
||||||
readableExpression = new String();
|
new String();
|
||||||
if (template) {
|
if (template) {
|
||||||
exp = mapPlaceHolder(column, targetType, replaceType, firstArg, secondArg,
|
exp = mapPlaceHolder(column, targetType, replaceType, firstArg, secondArg,
|
||||||
firstE, secondE, readableFirstE,readableSecondE);
|
firstE, secondE, readableFirstE,readableSecondE);
|
||||||
|
@ -71,44 +69,31 @@ public class ReplaceTypeMap {
|
||||||
case Value:
|
case Value:
|
||||||
checkTypeArgument(targetType,firstArg);
|
checkTypeArgument(targetType,firstArg);
|
||||||
exp = new TD_Value(targetType, firstArg);
|
exp = new TD_Value(targetType, firstArg);
|
||||||
readableExpression = "Value(" + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case Concat:
|
case Concat:
|
||||||
C_Concat concat = new C_Concat(firstE, secondE);
|
C_Concat concat = new C_Concat(firstE, secondE);
|
||||||
exp= new C_Cast(concat,targetType);
|
exp= new C_Cast(concat,targetType);
|
||||||
readableExpression = "Cast(Concat(" + readableFirstE
|
|
||||||
+ ", " + readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Addition:
|
case Addition:
|
||||||
C_Addition add = new C_Addition(firstE, secondE);
|
C_Addition add = new C_Addition(firstE, secondE);
|
||||||
exp= new C_Cast(add, targetType);
|
exp= new C_Cast(add, targetType);
|
||||||
readableExpression = "Cast(Addition(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Subtraction:
|
case Subtraction:
|
||||||
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
||||||
exp= new C_Cast(sub,targetType);
|
exp= new C_Cast(sub,targetType);
|
||||||
readableExpression = "Cast(Subtraction(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Modulus:
|
case Modulus:
|
||||||
C_Modulus modu = new C_Modulus(firstE, secondE);
|
C_Modulus modu = new C_Modulus(firstE, secondE);
|
||||||
exp=new C_Cast(modu,targetType);
|
exp=new C_Cast(modu,targetType);
|
||||||
readableExpression = "Cast(Modulus(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Multiplication:
|
case Multiplication:
|
||||||
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
||||||
exp=new C_Cast(multi,targetType);
|
exp=new C_Cast(multi,targetType);
|
||||||
|
|
||||||
readableExpression = "Cast(Multiplication(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Division:
|
case Division:
|
||||||
C_Division divi = new C_Division(firstE, secondE);
|
C_Division divi = new C_Division(firstE, secondE);
|
||||||
exp=new C_Cast(divi,targetType);
|
exp=new C_Cast(divi,targetType);
|
||||||
readableExpression = "Cast(Division(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ReplaceTypeMapException("No valid column selected");
|
throw new ReplaceTypeMapException("No valid column selected");
|
||||||
|
@ -120,7 +105,6 @@ public class ReplaceTypeMap {
|
||||||
case Value:
|
case Value:
|
||||||
checkTypeArgument(targetType,firstArg);
|
checkTypeArgument(targetType,firstArg);
|
||||||
exp = new TD_Value(targetType, firstArg);
|
exp = new TD_Value(targetType, firstArg);
|
||||||
readableExpression = "Value(" + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case ColumnValue:
|
case ColumnValue:
|
||||||
exp = columnValuePlaceHolder(column, targetType);
|
exp = columnValuePlaceHolder(column, targetType);
|
||||||
|
@ -140,39 +124,27 @@ public class ReplaceTypeMap {
|
||||||
case Concat:
|
case Concat:
|
||||||
C_Concat concat = new C_Concat(firstE, secondE);
|
C_Concat concat = new C_Concat(firstE, secondE);
|
||||||
exp= new C_Cast(concat,targetType);
|
exp= new C_Cast(concat,targetType);
|
||||||
readableExpression = "Cast(Concat(" + readableFirstE
|
|
||||||
+ ", " + readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Addition:
|
case Addition:
|
||||||
C_Addition add = new C_Addition(firstE, secondE);
|
C_Addition add = new C_Addition(firstE, secondE);
|
||||||
exp= new C_Cast(add, targetType);
|
exp= new C_Cast(add, targetType);
|
||||||
readableExpression = "Cast(Addition(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Subtraction:
|
case Subtraction:
|
||||||
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
||||||
exp= new C_Cast(sub,targetType);
|
exp= new C_Cast(sub,targetType);
|
||||||
readableExpression = "Cast(Subtraction(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Modulus:
|
case Modulus:
|
||||||
C_Modulus modu = new C_Modulus(firstE, secondE);
|
C_Modulus modu = new C_Modulus(firstE, secondE);
|
||||||
exp=new C_Cast(modu,targetType);
|
exp=new C_Cast(modu,targetType);
|
||||||
readableExpression = "Cast(Modulus(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Multiplication:
|
case Multiplication:
|
||||||
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
||||||
exp=new C_Cast(multi,targetType);
|
exp=new C_Cast(multi,targetType);
|
||||||
|
|
||||||
readableExpression = "Cast(Multiplication(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Division:
|
case Division:
|
||||||
C_Division divi = new C_Division(firstE, secondE);
|
C_Division divi = new C_Division(firstE, secondE);
|
||||||
exp=new C_Cast(divi,targetType);
|
exp=new C_Cast(divi,targetType);
|
||||||
readableExpression = "Cast(Division(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case SubstringByRegex:
|
case SubstringByRegex:
|
||||||
exp = substringByRegexPlaceHolder(column, targetType, firstArg);
|
exp = substringByRegexPlaceHolder(column, targetType, firstArg);
|
||||||
|
@ -207,15 +179,12 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), column.getLabel());
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
@ -226,8 +195,6 @@ public class ReplaceTypeMap {
|
||||||
sArg = new TD_Value(ColumnDataType.Text, secondArg);
|
sArg = new TD_Value(ColumnDataType.Text, secondArg);
|
||||||
C_TextReplaceMatchingRegex substring = new C_TextReplaceMatchingRegex(placeHolder, fArg, sArg);
|
C_TextReplaceMatchingRegex substring = new C_TextReplaceMatchingRegex(placeHolder, fArg, sArg);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(TextReplaceMatchingRegex(" + readablePlaceHolder
|
|
||||||
+ ", " + firstArg + ", " + secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,15 +212,12 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
@ -267,8 +231,6 @@ public class ReplaceTypeMap {
|
||||||
posTo = new C_SubstringPosition(placeHolder, fArg);
|
posTo = new C_SubstringPosition(placeHolder, fArg);
|
||||||
C_SubstringByIndex substring = new C_SubstringByIndex(placeHolder, posFrom, posTo);
|
C_SubstringByIndex substring = new C_SubstringByIndex(placeHolder, posFrom, posTo);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(SubstringByCharSeq(" + readablePlaceHolder
|
|
||||||
+ ", " + firstArg + ", " + secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,15 +246,12 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
@ -304,8 +263,6 @@ public class ReplaceTypeMap {
|
||||||
sArg = new TD_Value(ColumnDataType.Integer, secondArg);
|
sArg = new TD_Value(ColumnDataType.Integer, secondArg);
|
||||||
C_SubstringByIndex substring = new C_SubstringByIndex(placeHolder, fArg, sArg);
|
C_SubstringByIndex substring = new C_SubstringByIndex(placeHolder, fArg, sArg);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(SubstringByIndex(" + readablePlaceHolder
|
|
||||||
+ ", " + firstArg + ", " + secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,15 +277,12 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
@ -337,8 +291,6 @@ public class ReplaceTypeMap {
|
||||||
fArg = new TD_Value(ColumnDataType.Text, firstArg);
|
fArg = new TD_Value(ColumnDataType.Text, firstArg);
|
||||||
C_SubstringByRegex substring = new C_SubstringByRegex(placeHolder, fArg);
|
C_SubstringByRegex substring = new C_SubstringByRegex(placeHolder, fArg);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(SubStringByRegex(" + readablePlaceHolder
|
|
||||||
+ ", " + firstArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,22 +304,18 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=targetType){
|
if(dataType!=targetType){
|
||||||
placeHolder=new C_Cast(placeH, targetType);
|
placeHolder=new C_Cast(placeH, targetType);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+targetType+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
|
|
||||||
exp = placeHolder;
|
exp = placeHolder;
|
||||||
readableExpression = "ColumnValue(" + readablePlaceHolder + ")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,23 +328,18 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
C_Upper upper = new C_Upper(placeHolder);
|
C_Upper upper = new C_Upper(placeHolder);
|
||||||
exp=new C_Cast(upper, targetType);
|
exp=new C_Cast(upper, targetType);
|
||||||
readableExpression = "Cast(Upper(" + readablePlaceHolder
|
|
||||||
+"),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,23 +353,18 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
C_Lower lower = new C_Lower(placeHolder);
|
C_Lower lower = new C_Lower(placeHolder);
|
||||||
exp=new C_Cast(lower, targetType);
|
exp=new C_Cast(lower, targetType);
|
||||||
readableExpression = "Cast(Lower(" + readablePlaceHolder
|
|
||||||
+"),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,23 +377,18 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
C_Trim trim = new C_Trim(placeHolder);
|
C_Trim trim = new C_Trim(placeHolder);
|
||||||
exp=new C_Cast(trim, targetType);
|
exp=new C_Cast(trim, targetType);
|
||||||
readableExpression = "Cast(Trim(" + readablePlaceHolder
|
|
||||||
+"),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,23 +402,18 @@ public class ReplaceTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
C_ColumnReferencePlaceholder placeH = new C_ColumnReferencePlaceholder(
|
||||||
dataType, column.getColumnId());
|
dataType, column.getColumnId(), null);
|
||||||
C_Expression placeHolder;
|
C_Expression placeHolder;
|
||||||
String readablePlaceHolder;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
placeHolder=new C_Cast(placeH, ColumnDataType.Text);
|
||||||
readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
placeHolder=placeH;
|
placeHolder=placeH;
|
||||||
readablePlaceHolder= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("placeHolder:" + placeHolder);
|
Log.debug("placeHolder:" + placeHolder);
|
||||||
|
|
||||||
C_MD5 md5 = new C_MD5(placeHolder);
|
C_MD5 md5 = new C_MD5(placeHolder);
|
||||||
exp=new C_Cast(md5, targetType);
|
exp=new C_Cast(md5, targetType);
|
||||||
readableExpression = "Cast(MD5(" + readablePlaceHolder
|
|
||||||
+"),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,44 +431,31 @@ public class ReplaceTypeMap {
|
||||||
case Value:
|
case Value:
|
||||||
checkTypeArgument(targetType,firstArg);
|
checkTypeArgument(targetType,firstArg);
|
||||||
exp = new TD_Value(targetType, firstArg);
|
exp = new TD_Value(targetType, firstArg);
|
||||||
readableExpression = "Value(" + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case Concat:
|
case Concat:
|
||||||
C_Concat concat = new C_Concat(firstE, secondE);
|
C_Concat concat = new C_Concat(firstE, secondE);
|
||||||
exp= new C_Cast(concat,targetType);
|
exp= new C_Cast(concat,targetType);
|
||||||
readableExpression = "Cast(Concat(" + readableFirstE
|
|
||||||
+ ", " + readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Addition:
|
case Addition:
|
||||||
C_Addition add = new C_Addition(firstE, secondE);
|
C_Addition add = new C_Addition(firstE, secondE);
|
||||||
exp= new C_Cast(add, targetType);
|
exp= new C_Cast(add, targetType);
|
||||||
readableExpression = "Cast(Addition(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Subtraction:
|
case Subtraction:
|
||||||
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
||||||
exp= new C_Cast(sub,targetType);
|
exp= new C_Cast(sub,targetType);
|
||||||
readableExpression = "Cast(Subtraction(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Modulus:
|
case Modulus:
|
||||||
C_Modulus modu = new C_Modulus(firstE, secondE);
|
C_Modulus modu = new C_Modulus(firstE, secondE);
|
||||||
exp=new C_Cast(modu,targetType);
|
exp=new C_Cast(modu,targetType);
|
||||||
readableExpression = "Cast(Modulus(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Multiplication:
|
case Multiplication:
|
||||||
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
||||||
exp=new C_Cast(multi,targetType);
|
exp=new C_Cast(multi,targetType);
|
||||||
|
|
||||||
readableExpression = "Cast(Multiplication(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Division:
|
case Division:
|
||||||
C_Division divi = new C_Division(firstE, secondE);
|
C_Division divi = new C_Division(firstE, secondE);
|
||||||
exp=new C_Cast(divi,targetType);
|
exp=new C_Cast(divi,targetType);
|
||||||
readableExpression = "Cast(Division(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ReplaceTypeMapException("No valid column selected");
|
throw new ReplaceTypeMapException("No valid column selected");
|
||||||
|
@ -553,7 +468,6 @@ public class ReplaceTypeMap {
|
||||||
case Value:
|
case Value:
|
||||||
checkTypeArgument(targetType, firstArg);
|
checkTypeArgument(targetType, firstArg);
|
||||||
exp = new TD_Value(targetType, firstArg);
|
exp = new TD_Value(targetType, firstArg);
|
||||||
readableExpression = "Value(" + firstArg + ")";
|
|
||||||
break;
|
break;
|
||||||
case ColumnValue:
|
case ColumnValue:
|
||||||
exp = columnValueReference(column, targetType);
|
exp = columnValueReference(column, targetType);
|
||||||
|
@ -573,39 +487,27 @@ public class ReplaceTypeMap {
|
||||||
case Concat:
|
case Concat:
|
||||||
C_Concat concat = new C_Concat(firstE, secondE);
|
C_Concat concat = new C_Concat(firstE, secondE);
|
||||||
exp= new C_Cast(concat,targetType);
|
exp= new C_Cast(concat,targetType);
|
||||||
readableExpression = "Cast(Concat(" + readableFirstE
|
|
||||||
+ ", " + readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Addition:
|
case Addition:
|
||||||
C_Addition add = new C_Addition(firstE, secondE);
|
C_Addition add = new C_Addition(firstE, secondE);
|
||||||
exp= new C_Cast(add, targetType);
|
exp= new C_Cast(add, targetType);
|
||||||
readableExpression = "Cast(Addition(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Subtraction:
|
case Subtraction:
|
||||||
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
C_Subtraction sub = new C_Subtraction(firstE, secondE);
|
||||||
exp= new C_Cast(sub,targetType);
|
exp= new C_Cast(sub,targetType);
|
||||||
readableExpression = "Cast(Subtraction(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Modulus:
|
case Modulus:
|
||||||
C_Modulus modu = new C_Modulus(firstE, secondE);
|
C_Modulus modu = new C_Modulus(firstE, secondE);
|
||||||
exp=new C_Cast(modu,targetType);
|
exp=new C_Cast(modu,targetType);
|
||||||
readableExpression = "Cast(Modulus(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Multiplication:
|
case Multiplication:
|
||||||
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
C_Multiplication multi = new C_Multiplication(firstE, secondE);
|
||||||
exp=new C_Cast(multi,targetType);
|
exp=new C_Cast(multi,targetType);
|
||||||
|
|
||||||
readableExpression = "Cast(Multiplication(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case Division:
|
case Division:
|
||||||
C_Division divi = new C_Division(firstE, secondE);
|
C_Division divi = new C_Division(firstE, secondE);
|
||||||
exp=new C_Cast(divi,targetType);
|
exp=new C_Cast(divi,targetType);
|
||||||
readableExpression = "Cast(Division(" + readableFirstE + ", "
|
|
||||||
+ readableSecondE + "),"+targetType+")";
|
|
||||||
break;
|
break;
|
||||||
case SubstringByRegex:
|
case SubstringByRegex:
|
||||||
exp = SubstringByRegexReference(column, targetType, firstArg);
|
exp = SubstringByRegexReference(column, targetType, firstArg);
|
||||||
|
@ -644,13 +546,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -661,8 +560,6 @@ public class ReplaceTypeMap {
|
||||||
sArg = new TD_Value(ColumnDataType.Text, secondArg);
|
sArg = new TD_Value(ColumnDataType.Text, secondArg);
|
||||||
C_TextReplaceMatchingRegex substring = new C_TextReplaceMatchingRegex(columnReference, fArg, sArg);
|
C_TextReplaceMatchingRegex substring = new C_TextReplaceMatchingRegex(columnReference, fArg, sArg);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(TextReplaceMatchingRegex(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ", " + secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,13 +580,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -702,9 +596,6 @@ public class ReplaceTypeMap {
|
||||||
posTo = new C_SubstringPosition(columnReference, fArg);
|
posTo = new C_SubstringPosition(columnReference, fArg);
|
||||||
C_SubstringByIndex substring = new C_SubstringByIndex(columnReference, posFrom, posTo);
|
C_SubstringByIndex substring = new C_SubstringByIndex(columnReference, posFrom, posTo);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(SubstringByCharSeq("
|
|
||||||
+ readableColumnReference + ", " + firstArg + ", "
|
|
||||||
+ secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,13 +615,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -741,8 +629,6 @@ public class ReplaceTypeMap {
|
||||||
sArg = new TD_Value(ColumnDataType.Integer, secondArg);
|
sArg = new TD_Value(ColumnDataType.Integer, secondArg);
|
||||||
C_SubstringByIndex substring = new C_SubstringByIndex(columnReference, fArg, sArg);
|
C_SubstringByIndex substring = new C_SubstringByIndex(columnReference, fArg, sArg);
|
||||||
exp=new C_Cast(substring,targetType);
|
exp=new C_Cast(substring,targetType);
|
||||||
readableExpression = "Cast(SubstringByIndex(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + ", " + secondArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -761,13 +647,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -777,8 +660,6 @@ public class ReplaceTypeMap {
|
||||||
fArg = new TD_Value(ColumnDataType.Text, firstArg);
|
fArg = new TD_Value(ColumnDataType.Text, firstArg);
|
||||||
C_SubstringByRegex substring= new C_SubstringByRegex(columnReference, fArg);
|
C_SubstringByRegex substring= new C_SubstringByRegex(columnReference, fArg);
|
||||||
exp=new C_Cast(substring, targetType);
|
exp=new C_Cast(substring, targetType);
|
||||||
readableExpression = "Cast(SubStringByRegex(" + readableColumnReference
|
|
||||||
+ ", " + firstArg + "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -795,18 +676,14 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=targetType){
|
if(dataType!=targetType){
|
||||||
columnReference=new C_Cast(columnRef,targetType);
|
columnReference=new C_Cast(columnRef,targetType);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+targetType+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
exp = columnReference;
|
exp = columnReference;
|
||||||
readableExpression = "ColumnValue(" + readableColumnReference + ")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -824,13 +701,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -838,8 +712,6 @@ public class ReplaceTypeMap {
|
||||||
|
|
||||||
C_Upper upper= new C_Upper(columnReference);
|
C_Upper upper= new C_Upper(columnReference);
|
||||||
exp=new C_Cast(upper, targetType);
|
exp=new C_Cast(upper, targetType);
|
||||||
readableExpression = "Cast(Upper(" + readableColumnReference
|
|
||||||
+ "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,13 +728,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -870,8 +739,6 @@ public class ReplaceTypeMap {
|
||||||
|
|
||||||
C_Lower lower= new C_Lower(columnReference);
|
C_Lower lower= new C_Lower(columnReference);
|
||||||
exp=new C_Cast(lower, targetType);
|
exp=new C_Cast(lower, targetType);
|
||||||
readableExpression = "Cast(Lower(" + readableColumnReference
|
|
||||||
+ "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,13 +756,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -903,8 +767,6 @@ public class ReplaceTypeMap {
|
||||||
|
|
||||||
C_Trim trim= new C_Trim(columnReference);
|
C_Trim trim= new C_Trim(columnReference);
|
||||||
exp=new C_Cast(trim, targetType);
|
exp=new C_Cast(trim, targetType);
|
||||||
readableExpression = "Cast(Trim(" + readableColumnReference
|
|
||||||
+ "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,13 +783,10 @@ public class ReplaceTypeMap {
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column.getTrId(), dataType, column.getColumnId());
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
String readableColumnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
|
|
||||||
} else {
|
} else {
|
||||||
columnReference=columnRef;
|
columnReference=columnRef;
|
||||||
readableColumnReference= column.getLabel();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
@ -935,16 +794,14 @@ public class ReplaceTypeMap {
|
||||||
|
|
||||||
C_MD5 md5= new C_MD5(columnReference);
|
C_MD5 md5= new C_MD5(columnReference);
|
||||||
exp=new C_Cast(md5, targetType);
|
exp=new C_Cast(md5, targetType);
|
||||||
readableExpression = "Cast(MD5(" + readableColumnReference
|
|
||||||
+ "),"+targetType+")";
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getReadableExpression() {
|
/*public String getReadableExpression() {
|
||||||
return readableExpression;
|
return readableExpression;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
protected void checkTypeArgument(ColumnDataType columnDataType, String arg)
|
protected void checkTypeArgument(ColumnDataType columnDataType, String arg)
|
||||||
throws ReplaceTypeMapException {
|
throws ReplaceTypeMapException {
|
||||||
|
|
Loading…
Reference in New Issue