@Override public int getNoOfTotalDevice() { List<RegisteredDevice> rd = commonDao.fetchObjects(RegisteredDevice.class); if (rd != null && !rd.isEmpty()) { return rd.size(); } return 0; }
@Override public List<User> fetchAllUser() { return commonDao.fetchObjects(User.class); }
@Override public User findUserById(Long userId) { return commonDao.getObjectByID(User.class, userId); }
@Override public void deleteRegisteredDeviceById(Long id) { RegisteredDevice registeredDevice = commonService.getObjectByID(RegisteredDevice.class, id); if (registeredDevice != null) commonService.deleteObject(registeredDevice); }
@Override public List<RegisteredDevice> getAllDevices( int start, int max, String orderBy, String orderType) { return commonDao.fetchObjects(RegisteredDevice.class, start, max, orderBy, orderType); }