@Override protected void aInit() throws Exception { SingularAttribute<UserAccount, ?> orderByAttribute = UserAccount_.id; if (csortField != null && csortField.equals("id")) { orderByAttribute = UserAccount_.id; } else if (csortField != null && csortField.equals("username")) { orderByAttribute = UserAccount_.username; } dataModel = userAccountService.getAllEntities( (page - 1) * rows, rows, orderByAttribute, getSortOrderType()); }
@Override protected long initAllRowsCount() throws Exception { return userAccountService.count(); }