test_class.declarator: jsonFilterService
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      JsonFilterService jsonFilterService;
test_class.type: JsonFilterService
test_class.var_name: jsonFilterService
test_class.declarator: resultSetMetaData
test_class.modifier: @Mock
test_class.original_string: @Mock
      ResultSetMetaData resultSetMetaData;
test_class.type: ResultSetMetaData
test_class.var_name: resultSetMetaData
test_class.file: abixen-platform-business-intelligence-service/src/test/java/com/abixen/platform/service/businessintelligence/multivisualisation/application/service/JsonFilterServiceTest.java
test_class.identifier: JsonFilterServiceTest
test_case.body: @Ignore
      @Test
      public void convertJsonToSqlTest() throws SQLException {
          String jsonCriteria = "{\n" +
                  "  \"group\": {\n" +
                  "    \"operator\": \"AND\",\n" +
                  "    \"rules\": [\n" +
                  "      {\n" +
                  "        \"condition\": \"=\",\n" +
                  "        \"field\": \"REVENUE_GROSS\",\n" +
                  "        \"data\": \"23\",\n" +
                  "        \"$$hashKey\": \"object:434\"\n" +
                  "      },\n" +
                  "      {\n" +
                  "        \"condition\": \"=\",\n" +
                  "        \"field\": \"ID\",\n" +
                  "        \"data\": \"4\",\n" +
                  "        \"$$hashKey\": \"object:454\"\n" +
                  "      },\n" +
                  "      {\n" +
                  "        \"group\": {\n" +
                  "          \"operator\": \"AND\",\n" +
                  "          \"rules\": [\n" +
                  "            {\n" +
                  "              \"condition\": \"=\",\n" +
                  "              \"field\": \"REVENUE_NET\",\n" +
                  "              \"data\": \"22\",\n" +
                  "              \"$$hashKey\": \"object:476\"\n" +
                  "            },\n" +
                  "            {\n" +
                  "              \"condition\": \"=\",\n" +
                  "              \"field\": \"SALES_DAY\",\n" +
                  "              \"data\": \"2016-10-02T232\",\n" +
                  "              \"$$hashKey\": \"object:476\"\n" +
                  "            }\n" +
                  "          ]\n" +
                  "        },\n" +
                  "        \"$$hashKey\": \"object:463\"\n" +
                  "      }\n" +
                  "    ]\n" +
                  "  }\n" +
                  "}";
          when(resultSetMetaData.getColumnCount()).thenReturn(new Integer(3));
          when(resultSetMetaData.getColumnName(0)).thenReturn("REVENUE_GROSS");
          when(resultSetMetaData.getColumnName(1)).thenReturn("ID");
          when(resultSetMetaData.getColumnName(2)).thenReturn("REVENUE_NET");
          when(resultSetMetaData.getColumnName(3)).thenReturn("SALES_DAY");
          when(resultSetMetaData.getColumnTypeName(0)).thenReturn("DOUBLE");
          when(resultSetMetaData.getColumnTypeName(1)).thenReturn("BIGINT");
          when(resultSetMetaData.getColumnTypeName(2)).thenReturn("DOUBLE");
          when(resultSetMetaData.getColumnTypeName(3)).thenReturn("DATE");
          String manualyConvertedCriteria = "(REVENUE_GROSS = 23 AND ID = 4 AND (REVENUE_NET = 22 AND SALES_DAY = '2016-10-02'))";
          String convertedCriteria = jsonFilterService.convertJsonToJpql(jsonCriteria, resultSetMetaData);
          assertEquals(manualyConvertedCriteria, convertedCriteria);
      }
test_case.class_method_signature: JsonFilterServiceTest.convertJsonToSqlTest()
test_case.full_signature: @Ignore @Test public void convertJsonToSqlTest()
test_case.identifier: convertJsonToSqlTest
test_case.invocations: thenReturn when getColumnCount thenReturn when getColumnName thenReturn when getColumnName thenReturn when getColumnName thenReturn when getColumnName thenReturn when getColumnTypeName thenReturn when getColumnTypeName thenReturn when getColumnTypeName thenReturn when getColumnTypeName convertJsonToJpql assertEquals
test_case.modifiers: @Ignore @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void convertJsonToSqlTest()
focal_class.declarator: DATA_END_INDEX = 10
focal_class.modifier: private static final
focal_class.original_string: private static final int DATA_END_INDEX = 10;
focal_class.type: int
focal_class.var_name: DATA_END_INDEX
focal_class.declarator: DATA_BEGIN_INDEX = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int DATA_BEGIN_INDEX = 0;
focal_class.type: int
focal_class.var_name: DATA_BEGIN_INDEX
focal_class.file: abixen-platform-business-intelligence-service/src/main/java/com/abixen/platform/service/businessintelligence/multivisualisation/application/service/JsonFilterService.java
focal_class.identifier: JsonFilterService
focal_class.class_method_signature: JsonFilterService.convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_class.full_signature: public String convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_class.identifier: convertJsonToJpql
focal_class.modifiers: public
focal_class.parameters: (String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_class.return: String
focal_class.signature: String convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_class.class_method_signature: JsonFilterService.convertJsonToJpqlRecursive(Map<String, Object> jsonCriteriaMap, List<Object> parameters, Map<String, String> typeMapping)
focal_class.full_signature: protected String convertJsonToJpqlRecursive(Map<String, Object> jsonCriteriaMap, List<Object> parameters, Map<String, String> typeMapping)
focal_class.identifier: convertJsonToJpqlRecursive
focal_class.modifiers: protected
focal_class.parameters: (Map<String, Object> jsonCriteriaMap, List<Object> parameters, Map<String, String> typeMapping)
focal_class.return: String
focal_class.signature: String convertJsonToJpqlRecursive(Map<String, Object> jsonCriteriaMap, List<Object> parameters, Map<String, String> typeMapping)
focal_class.class_method_signature: JsonFilterService.prepareDataSection(DataValueType dataValueType, String data)
focal_class.full_signature: private String prepareDataSection(DataValueType dataValueType, String data)
focal_class.identifier: prepareDataSection
focal_class.modifiers: private
focal_class.parameters: (DataValueType dataValueType, String data)
focal_class.return: String
focal_class.signature: String prepareDataSection(DataValueType dataValueType, String data)
focal_class.class_method_signature: JsonFilterService.getColumnTypeMapping(ResultSetMetaData rsmd)
focal_class.full_signature: private Map<String, String> getColumnTypeMapping(ResultSetMetaData rsmd)
focal_class.identifier: getColumnTypeMapping
focal_class.modifiers: private
focal_class.parameters: (ResultSetMetaData rsmd)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getColumnTypeMapping(ResultSetMetaData rsmd)
focal_method.body: public String convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData) throws SQLException {
          Map<String, Object> jsonCriteriaMap = new Gson().fromJson(jsonCriteria, new TypeToken<HashMap<String, Object>>() {
          }.getType());
          String conditionString = "()";
          if (jsonCriteriaMap != null && jsonCriteriaMap.size() > 0) {
              List<Object> queryParameters = new ArrayList<>();
              conditionString = convertJsonToJpqlRecursive(jsonCriteriaMap, queryParameters, getColumnTypeMapping(resultSetMetaData));
          }
          return !"()".equals(conditionString) ? conditionString : "1=1";
      }
focal_method.class_method_signature: JsonFilterService.convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_method.full_signature: public String convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_method.identifier: convertJsonToJpql
focal_method.invocations: fromJson getType size convertJsonToJpqlRecursive getColumnTypeMapping equals
focal_method.modifiers: public
focal_method.parameters: (String jsonCriteria, ResultSetMetaData resultSetMetaData)
focal_method.return: String
focal_method.signature: String convertJsonToJpql(String jsonCriteria, ResultSetMetaData resultSetMetaData)