public AccountStore(CpCouchServer couchServer) {
super(couchServer, couchServer.getDatabaseName(), Account.class);
}
public Account get(AccountQuery accountQuery) {
RequestErrors errors = new RequestErrors();
accountQuery.validate(errors);
if (errors.isNotEmpty()) {
throw errors.toBadRequestException();
}
if (accountQuery instanceof AccountIdQuery) {
AccountIdQuery query = (AccountIdQuery)accountQuery;
return getByAccountId(query.getAccountId());