public class AccountDAO extends HibernateRepository<Account>
Account
objects in the database.Constructor and Description |
---|
AccountDAO() |
Modifier and Type | Method and Description |
---|---|
Account |
get(long id)
Retrieve
Account by id from the database. |
List<Account> |
getAccounts(int offset,
int limit,
String sort,
boolean asc,
String filter)
Retrieves list of pageable accounts, matching the parameter values
|
long |
getAccountsCount(String filter)
Retrieves maximum number of distinct accounts available and, if specified, whose firstName, lastName and email
fields match the filter token.
|
Account |
getByEmail(String email)
Retrieve an
Account by the email field. |
List<Account> |
getMatchingAccounts(String token,
int limit)
Retrieves accounts whose firstName, lastName, or email fields match the specified
token up to the specified limit.
|
create, currentSession, delete, get, getBuilder, update
public Account get(long id) throws DAOException
Account
by id from the database.id
- unique local identifier for objectDAOException
public List<Account> getMatchingAccounts(String token, int limit)
token
- filter for the account fieldslimit
- maximum number of matching accounts to return; 0 to return allpublic Account getByEmail(String email)
Account
by the email field.email
- unique email identifier for accountpublic List<Account> getAccounts(int offset, int limit, String sort, boolean asc, String filter)
offset
- offset to start retrieving matching accountslimit
- maximum number of accounts to retrievesort
- sort order for retrievalasc
- whether to sort in ascending or descending orderfilter
- optional filter to for matching text against firstName, lastName or email fields of accountsDAOException
- on HibernateException
retrieving accountspublic long getAccountsCount(String filter)
filter
- optional token used to match against the firstName, lastName and email fields of accountsDAOException
- on HibernateException
retrieving the numberCopyright © 2017. All rights reserved.