zoukankan      html  css  js  c++  java
  • 面向接口,定义接口


    /**
    * 针对数据库的数据的增删改查的功能做的接口
    * @author ZY
    *
    */
    public interface IDaoBBS<T> {
    /**
    * 向数据库表里添加一条数据的方法
    * @param t
    * @throws SQLException
    * @throws IllegalAccessException
    * @throws IllegalArgumentException
    */
    public int addItem(T t);
    /**
    * 从数据库表里删除一条数据的方法
    * @param objId
    */
    public int removeItem(Object objId);
    /**
    * 更新数据库表里的一条字段的方法
    * @param t
    */
    public int updateItem(T t);

    /**
    * 根据主键字段获取该条数据,并转换成实体对象
    * @param objId
    * @return
    * @throws InvocationTargetException
    * @throws IllegalArgumentException
    * @throws IllegalAccessException
    * @throws SecurityException
    * @throws NoSuchMethodException
    */
    public T getModel(Object objId) ;

    /**
    * 根据查询条件获取多条数据,并转换成相应的集合
    * @param objects
    * @return
    * @throws InvocationTargetException
    * @throws IllegalArgumentException
    * @throws IllegalAccessException
    * @throws SecurityException
    * @throws NoSuchMethodException
    */
    public List<T> getList(T t);
    }

  • 相关阅读:
    牛客小白月赛29 种树 题解(思维)
    E
    D
    方格取数(number) 题解(dp)
    csust T1097 “是时候表演真正的技术了” 题解(虚点跑最短路)
    poj 2352 Stars
    poj 3321 Apple Tree
    poj 3067 Japan
    poj 1195 Mobile phones
    poj 2155 Matrix
  • 原文地址:https://www.cnblogs.com/tutuwowo/p/5847744.html
Copyright © 2011-2022 走看看