petdao.java

来自「网上购物系统」· Java 代码 · 共 68 行

JAVA
68
字号
// ----------------------------------------------------------
// $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 + =
减小字号Ctrl + -
显示快捷键?