use of org.ff4j.springjdbc.store.rowmapper.HitCountRowMapper in project ff4j by ff4j.
the class EventRepositorySpringJdbc method computeHitCount.
/**
* Compute over a column.
*
* @param query
* current query definition
* @param colName
* column name
* @return
* hit count for this value.
*/
private Map<String, MutableHitCount> computeHitCount(EventQueryDefinition query, String colName) {
List<HitCountDto> rawResult = getJdbcTemplate().query(getQueryBuilder().getHitCount(colName), new HitCountRowMapper(colName), new Timestamp(query.getFrom()), new Timestamp(query.getTo()));
Map<String, MutableHitCount> mapofHitCount = new HashMap<String, MutableHitCount>();
for (HitCountDto dto : rawResult) {
mapofHitCount.put(dto.getColumnName(), dto.getHitcount());
}
return mapofHitCount;
}
Aggregations