use of org.finos.waltz.model.tally.MeasurableRatingTally in project waltz by khartec.
the class MeasurableRatingHarness method main.
public static void main(String[] args) throws ParseException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
MeasurableRatingDao measurableRatingDao = ctx.getBean(MeasurableRatingDao.class);
MeasurableIdSelectorFactory measurableIdSelectorFactory = new MeasurableIdSelectorFactory();
EntityReference direct = mkRef(MEASURABLE, 18310);
EntityReference indirect = mkRef(MEASURABLE, 18064);
IdSelectionOptions directOpts = IdSelectionOptions.mkOpts(direct, CHILDREN);
IdSelectionOptions indirectOpts = IdSelectionOptions.mkOpts(indirect, CHILDREN);
Select<Record1<Long>> directSelector = measurableIdSelectorFactory.apply(directOpts);
Select<Record1<Long>> indirectSelector = measurableIdSelectorFactory.apply(indirectOpts);
List<MeasurableRatingTally> directTallies = measurableRatingDao.statsForRelatedMeasurable(directSelector);
List<MeasurableRatingTally> indirectTallies = measurableRatingDao.statsForRelatedMeasurable(indirectSelector);
List<Tally<Long>> tallies = measurableRatingDao.tallyByMeasurableCategoryId(1L);
System.out.println(tallies);
}
Aggregations