Hi
I have problem with custom datasource. First of all I create native query in service like below
QueryRunner queryRunner = new QueryRunner(persistence.getDataSource());
try {
List<Map<String, Object>> rows = queryRunner.query(query, new MapListHandler());
return rows;
} catch (SQLException e) {
throw new RuntimeException(e);
}
second I create CustomValueGroupDatasource
like below
@Override
protected Collection<KeyValueEntity> getEntities(Map<String, Object> params) {
Service service = AppBeans.get(Service.NAME);
List<Map<String, Object>> rows = service.getRow();
return rows.stream().map(row -> {
KeyValueEntity entity = new KeyValueEntity();
entity.setValue("customer_shortname", row.get("customer_shortname"));
return entity;
}).collect(Collectors.toList());
}
}
I attach my custom datasource to groupTable
component in xml file
<rows datasource="reportCustomResultDs"/>
and register this datasource in xml obviously.
Query returns rows, but there aren’t any position in groupTable
component. When I refesh browse I see in debug mode then rows load from data, but groupTable
is empty.
Any suggestion what is wrong ?