Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public InfoDto getActiveInfo(long customerId, boolean isSpecial) {
- List counts = myDao.get<ThatEntity>BySearchStringAnd<ID-1>CountGroupedBy<SOME-CRITERIA>(customerId, null, isSpecial);
- Long total = 0L;
- long active = 0;
- for (Object o : counts) {
- Object[] inObj = (Object[])o;
- Boolean isActive = MyStatusEnum.values()[(Byte)inObj[0]] == MyStatusEnum.ENABLED;
- long cnt = ((BigInteger)inObj[1]).longValue();
- if (isActive) {
- active +=cnt;
- }
- total += cnt;
- }
- InfoDto dto = new InfoDto(null, active, total);
- return dto;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement