Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public InfoDto getActiveInfo(long customerId, boolean isSpecial) {
  2. List counts = myDao.get<ThatEntity>BySearchStringAnd<ID-1>CountGroupedBy<SOME-CRITERIA>(customerId, null, isSpecial);
  3. Long total = 0L;
  4. long active = 0;
  5. for (Object o : counts) {
  6. Object[] inObj = (Object[])o;
  7. Boolean isActive = MyStatusEnum.values()[(Byte)inObj[0]] == MyStatusEnum.ENABLED;
  8. long cnt = ((BigInteger)inObj[1]).longValue();
  9. if (isActive) {
  10. active +=cnt;
  11. }
  12. total += cnt;
  13. }
  14. InfoDto dto = new InfoDto(null, active, total);
  15. return dto;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement