Java Reference
In-Depth Information
Listing 10.11
Our Account DAO implementation
package org.apache.mapper2.examples.chapter10.dao.sqlmap;
import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import org.apache.mapper2.examples.bean.Account;
import org.apache.mapper2.examples.bean.IdDescription;
import
org.apache.mapper2.examples.chapter10.dao.AccountDao;
import java.util.List;
import java.util.Map;
public class AccountDaoImpl extends SqlMapDaoTemplate
implements AccountDao {
public AccountDaoImpl(DaoManager daoManager) {
super(daoManager);
}
public Integer insert(Account account) {
return (Integer) insert("Account.insert", account);
}
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) {
Search WWH ::




Custom Search