Java Reference
In-Depth Information
}
public int update(Account account) {
return update("Account.update", account);
}
public int delete(Account account) {
return delete(account.getAccountId());
}
public int delete(Integer accountId) {
return delete("Account.delete", accountId);
}
public List<Account> getAccountListByExample(
Account account) {
return queryForList("Account.getAccountListByExample",
account);
}
public List<Map<String, Object>>
getMapListByExample(Account account) {
return queryForList("Account.getMapListByExample",
account);
}
public List<IdDescription>
getIdDescriptionListByExample(Account account) {
return
queryForList("Account.getIdDescriptionListByExample",
account);
}
public Account getById(Integer accountId) {
return (Account) queryForObject("Account.getById",
accountId);
}
public Account getById(Account account) {
return (Account) queryForList("Account.getById",
account);
}
}
The astute reader may notice that this is almost exactly the same as the code we
saw in listing 10.11; the only difference is the class that we extend. Everything else
in this class is identical. Right now, you might be asking yourself when you would
want to use one class or the other. Let's take a look at that next.
Search WWH ::




Custom Search