@Test @Transactional public void testOneNodeFormat(){ AdhocIntegrationQueryDto adhocIntegrationQuery = new AdhocIntegrationQueryDto(); adhocIntegrationQuery.setCriteria(new IntegrationQueryDto("subsys_design",2, ImmutableList.of(15), ImmutableList.of("subsys_design:guid"),null) .withAttrKeyNames(Lists.newArrayList("subsys_design:guid"))); adhocIntegrationQuery.setQueryRequest(new QueryRequest().withResultColumns(ImmutableList.of("subsys_design:guid"))); String expression = routeQueryExpressionFormatter.format(adhocIntegrationQuery); assertThat(expression, equalTo("subsys_design:[guid]")); adhocIntegrationQuery.setCriteria(new IntegrationQueryDto("subsys_design",2, ImmutableList.of(15,22), null) .withAttrKeyNames(ImmutableList.of("subsys_design.guid","subsys_design.key_name"))); adhocIntegrationQuery.setQueryRequest(new QueryRequest() .withResultColumns(ImmutableList.of("subsys_design.guid")) .addEqualsFilter("subsys_design.key_name","EDP")); expression = routeQueryExpressionFormatter.format(adhocIntegrationQuery); assertThat(expression, equalTo("subsys_design[{key_name eq 'EDP'}]:[guid]")); adhocIntegrationQuery.setCriteria(new IntegrationQueryDto("subsys_design",2, ImmutableList.of(15,22,25), null) .withAttrKeyNames(ImmutableList.of("subsys_design.guid","subsys_design.key_name","subsys_design.code"))); adhocIntegrationQuery.setQueryRequest(new QueryRequest() .withResultColumns(ImmutableList.of("subsys_design.guid")) .addEqualsFilter("subsys_design.key_name","EDP") .addEqualsFilter("subsys_design.code","HATS")); expression = routeQueryExpressionFormatter.format(adhocIntegrationQuery); assertThat(expression, equalTo("subsys_design[{key_name eq 'EDP'}{code eq 'HATS'}]:[guid]")); }
public String format(AdhocIntegrationQueryDto adhocIntegrationQuery){ IntegrationQueryDto integrationQuery = adhocIntegrationQuery.getCriteria(); List<String> resultColumns = adhocIntegrationQuery.getQueryRequest().getResultColumns(); List<Filter> filters = adhocIntegrationQuery.getQueryRequest().getFilters(); return format(integrationQuery,filters,resultColumns); }
RouteQueryExpressionFormatter { public String format(AdhocIntegrationQueryDto adhocIntegrationQuery){ IntegrationQueryDto integrationQuery = adhocIntegrationQuery.getCriteria(); List<String> resultColumns = adhocIntegrationQuery.getQueryRequest().getResultColumns(); List<Filter> filters = adhocIntegrationQuery.getQueryRequest().getFilters(); return format(integrationQuery,filters,resultColumns); } }
RouteQueryExpressionFormatter { public String format(AdhocIntegrationQueryDto adhocIntegrationQuery){ IntegrationQueryDto integrationQuery = adhocIntegrationQuery.getCriteria(); List<String> resultColumns = adhocIntegrationQuery.getQueryRequest().getResultColumns(); List<Filter> filters = adhocIntegrationQuery.getQueryRequest().getFilters(); return format(integrationQuery,filters,resultColumns); } RouteQueryExpressionFormatter(Map<Integer, DynamicEntityMeta> entityMap); }
RouteQueryExpressionFormatter { public String format(AdhocIntegrationQueryDto adhocIntegrationQuery){ IntegrationQueryDto integrationQuery = adhocIntegrationQuery.getCriteria(); List<String> resultColumns = adhocIntegrationQuery.getQueryRequest().getResultColumns(); List<Filter> filters = adhocIntegrationQuery.getQueryRequest().getFilters(); return format(integrationQuery,filters,resultColumns); } RouteQueryExpressionFormatter(Map<Integer, DynamicEntityMeta> entityMap); String format(AdhocIntegrationQueryDto adhocIntegrationQuery); }
RouteQueryExpressionFormatter { public String format(AdhocIntegrationQueryDto adhocIntegrationQuery){ IntegrationQueryDto integrationQuery = adhocIntegrationQuery.getCriteria(); List<String> resultColumns = adhocIntegrationQuery.getQueryRequest().getResultColumns(); List<Filter> filters = adhocIntegrationQuery.getQueryRequest().getFilters(); return format(integrationQuery,filters,resultColumns); } RouteQueryExpressionFormatter(Map<Integer, DynamicEntityMeta> entityMap); String format(AdhocIntegrationQueryDto adhocIntegrationQuery);  }