@@ -812,23 +812,26 @@ private String getWhere(ServiceRequest request, HashMap<String, Object> tablesAn
812812 String name = item .getField ();
813813
814814
815- //Check if the column name is a function
816- Field [] fields = request .getFields (name );
817- if (fields !=null ){
818- Field field = fields [0 ];
819- if (field .isFunction ()){
820- arr .add ("(" + item .toString () + ")" );
821- continue ;
822- }
823- }
824-
825-
826- //Filter out unknown fields and append table name to the column
815+ // //Check if the column name is a function
816+ // Field[] fields = request.getFields(name);
817+ // if (fields!=null){
818+ // Field field = fields[0];
819+ // if (field.isFunction()){
820+ // arr.add("(" + item.toString() + ")");
821+ // continue;
822+ // }
823+ // }
824+
825+
826+ //Append table name to the column
827827 Iterator <String > it = fieldMap .keySet ().iterator ();
828+ boolean foundField = false ;
828829 while (it .hasNext ()){
829830 String fieldName = it .next ();
830831 String columnName = fieldMap .get (fieldName );
831832 if (name .equalsIgnoreCase (fieldName ) || name .equalsIgnoreCase (columnName )){
833+ foundField = true ;
834+
832835 String op = item .getOperation ();
833836 String v = item .getValue ().toString ();
834837
@@ -842,6 +845,12 @@ private String getWhere(ServiceRequest request, HashMap<String, Object> tablesAn
842845 break ;
843846 }
844847 }
848+
849+
850+ if (!foundField ){
851+ arr .add ("(" + item .toString () + ")" );
852+ }
853+
845854 }
846855 if (!arr .isEmpty ()){
847856 where = String .join (" and " , arr );
0 commit comments