diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/OperatorTypeMap.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/OperatorTypeMap.java index 3505748..1737817 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/OperatorTypeMap.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/OperatorTypeMap.java @@ -79,8 +79,7 @@ public class OperatorTypeMap { case ANY: break; case BEGINS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextBeginsWith(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextBeginsWith(placeHolder,new TD_Value(dataType,firstArg)); break; case BETWEEN: fArg=new TD_Value(dataType,firstArg); @@ -116,23 +115,19 @@ public class OperatorTypeMap { case DIVISION: break; case ENDS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextEndsWith(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg)); break; case EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_Equals(placeHolder,new C_ConstantList(arguments)); + exp=new C_Equals(placeHolder,new TD_Value(dataType,firstArg)); break; case EXISTS: //exp=new C_Exi(placeHolder,new C_ConstantList(arguments)); break; case GREATER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_GreaterThan(placeHolder,new C_ConstantList(arguments)); + exp=new C_GreaterThan(placeHolder,new TD_Value(dataType,firstArg)); break; case GREATER_OR_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_GreaterOrEquals(placeHolder,new C_ConstantList(arguments)); + exp=new C_GreaterOrEquals(placeHolder,new TD_Value(dataType,firstArg)); break; case IN: break; @@ -143,18 +138,15 @@ public class OperatorTypeMap { exp=new C_IsNull(placeHolder); break; case LESSER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_LessThan(placeHolder,new C_ConstantList(arguments)); + exp=new C_LessThan(placeHolder,new TD_Value(dataType,firstArg)); break; case LESSER_OR_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_LessOrEquals(placeHolder,new C_ConstantList(arguments)); + exp=new C_LessOrEquals(placeHolder,new TD_Value(dataType,firstArg)); break; case LIKE: break; case MATCH_REGEX: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextMatchSQLRegexp(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg)); break; case MODULUS: break; @@ -163,8 +155,7 @@ public class OperatorTypeMap { case NOT: break; case NOT_BEGINS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextBeginsWith(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextBeginsWith(placeHolder, new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case NOT_BETWEEN: @@ -201,29 +192,24 @@ public class OperatorTypeMap { exp=new C_Not(exp); break; case NOT_ENDS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextEndsWith(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case NOT_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotEquals(placeHolder,new C_ConstantList(arguments)); + exp=new C_NotEquals(placeHolder,new TD_Value(dataType,firstArg)); break; case NOT_GREATER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotGreater(placeHolder,new C_ConstantList(arguments)); + exp=new C_NotGreater(placeHolder,new TD_Value(dataType,firstArg)); break; case NOT_IN: break; case NOT_LESSER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotLess(placeHolder,new C_ConstantList(arguments)); + exp=new C_NotLess(placeHolder,new TD_Value(dataType,firstArg)); break; case NOT_LIKE: break; case NOT_MATCH_REGEX: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextMatchSQLRegexp(placeHolder,new C_ConstantList(arguments)); + exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case OR: @@ -267,8 +253,7 @@ public class OperatorTypeMap { case ANY: break; case BEGINS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextBeginsWith(columnReference,new C_ConstantList(arguments)); + exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg)); break; case BETWEEN: fArg=new TD_Value(dataType,firstArg); @@ -304,23 +289,19 @@ public class OperatorTypeMap { case DIVISION: break; case ENDS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextEndsWith(columnReference,new C_ConstantList(arguments)); + exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg)); break; case EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_Equals(columnReference,new C_ConstantList(arguments)); + exp=new C_Equals(columnReference,new TD_Value(dataType,firstArg)); break; case EXISTS: //exp=new C_Exi(placeHolder,new C_ConstantList(arguments)); break; case GREATER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_GreaterThan(columnReference,new C_ConstantList(arguments)); + exp=new C_GreaterThan(columnReference,new TD_Value(dataType,firstArg)); break; case GREATER_OR_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_GreaterOrEquals(columnReference,new C_ConstantList(arguments)); + exp=new C_GreaterOrEquals(columnReference,new TD_Value(dataType,firstArg)); break; case IN: break; @@ -331,18 +312,15 @@ public class OperatorTypeMap { exp=new C_IsNull(columnReference); break; case LESSER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_LessThan(columnReference,new C_ConstantList(arguments)); + exp=new C_LessThan(columnReference,new TD_Value(dataType,firstArg)); break; case LESSER_OR_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_LessOrEquals(columnReference,new C_ConstantList(arguments)); + exp=new C_LessOrEquals(columnReference,new TD_Value(dataType,firstArg)); break; case LIKE: break; case MATCH_REGEX: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextMatchSQLRegexp(columnReference,new C_ConstantList(arguments)); + exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg)); break; case MODULUS: break; @@ -351,8 +329,7 @@ public class OperatorTypeMap { case NOT: break; case NOT_BEGINS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextBeginsWith(columnReference,new C_ConstantList(arguments)); + exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case NOT_BETWEEN: @@ -389,29 +366,24 @@ public class OperatorTypeMap { exp=new C_Not(exp); break; case NOT_ENDS_WITH: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextEndsWith(columnReference,new C_ConstantList(arguments)); + exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case NOT_EQUALS: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotEquals(columnReference,new C_ConstantList(arguments)); + exp=new C_NotEquals(columnReference,new TD_Value(dataType,firstArg)); break; case NOT_GREATER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotGreater(columnReference,new C_ConstantList(arguments)); + exp=new C_NotGreater(columnReference,new TD_Value(dataType,firstArg)); break; case NOT_IN: break; case NOT_LESSER: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_NotLess(columnReference,new C_ConstantList(arguments)); + exp=new C_NotLess(columnReference,new TD_Value(dataType,firstArg)); break; case NOT_LIKE: break; case NOT_MATCH_REGEX: - arguments.add(new TD_Value(dataType,firstArg)); - exp=new C_TextMatchSQLRegexp(columnReference,new C_ConstantList(arguments)); + exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg)); exp=new C_Not(exp); break; case OR: diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java index 75b8e2b..505abb0 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java @@ -1,10 +1,8 @@ package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf; -import java.io.Serializable; - import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; -public class TD_Value implements Serializable { +public class TD_Value extends C_Leaf { private static final long serialVersionUID = 2802022467528178596L; protected String id="TD_Value";