📄 petdao.java
字号:
// ----------------------------------------------------------
// $Id: $
// Copyright (c) SHSAFE 2005-2006. All Rights Reserved.
// ----------------------------------------------------------
package example.pet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import com.shsafe.common.basic.attribute.PageInformation;
import com.shsafe.common.basic.dto.DTOFactory;
import com.shsafe.common.database.DatabaseConnection;
import example.common.dao.ExampleDAO;
import example.common.dto.PetDTO;
/**
* @author Michael J Chane
* @version $Revision: $ $Date: $
*/
public class PetDAO extends ExampleDAO {
/**
* Creates a new <code>UserDAO</code> object.
*
* @param connection
* @throws SQLException
*/
public PetDAO(DatabaseConnection connection) throws SQLException {
super(connection);
}
/**
* @param condition
* @return count of pets
* @throws SQLException
*/
public int countPets(PetDTO condition) throws SQLException {
return count("countPets", condition);
}
/**
* @param condition
* @param pageInfo
* @return pets
* @throws SQLException
*/
@SuppressWarnings("unchecked")
public List<PetDTO> searchPets(PetDTO condition, PageInformation pageInfo)
throws SQLException {
List<Map<String, Object>> list = findOnPage("searchPets", condition,
pageInfo);
List<PetDTO> dtoList = DTOFactory.convert(list, PetDTO.class);
return dtoList;
}
/**
* @param pets
* @return rows affected
* @throws SQLException
*/
@SuppressWarnings("unchecked")
public int updatePets(List pets) throws SQLException {
return changeAll("updatePets", pets);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -