接口 BaseDao<T extends BaseEntity>

  • 类型参数:
    T - 实体类
    所有已知实现类:
    BaseDaoImpl

    public interface BaseDao<T extends BaseEntity>
    Dao层基础接口
    作者:
    shixin
    • 方法详细资料

      • create

        T create​(T t)
        创建对象
        参数:
        t - 对象
        返回:
        创建的对象
      • createAll

        List<T> createAll​(List<T> list)
        批量创建对象
        参数:
        list - 对象列表
        返回:
        创建的对象列表
      • update

        T update​(T t)
        根据id更新对象,默认忽略Null值更新
        参数:
        t - 待更新对象
        返回:
        更新后的对象
      • updateWithNull

        T updateWithNull​(T t)
        根据id更新对象,可以设置Null值是否更新
        参数:
        t - 待更新对象
        返回:
        更新后的对象
      • findById

        T findById​(Integer id)
        根据id查找对象
        参数:
        id - 对象Id
        返回:
        对象或Null
      • findOne

        T findOne​(T t)
        根据查询对象查找对象
        参数:
        t - 查询对象
        返回:
        对象
      • findAll

        List<T> findAll​(T t)
        根据查询对象查找对象
        参数:
        t - 查询对象
        返回:
        对象列表
      • findAll

        List<T> findAll()
        根据查询对象查找对象
        返回:
        所有对象列表
      • deleteById

        void deleteById​(Integer id)
        根据id删除对象 默认逻辑删除
        参数:
        id - 对象Id
      • delete

        void delete​(T t)
        根据对象删除对象 默认逻辑删除
        参数:
        t - 查询对象
      • pageQuery

        org.springframework.data.domain.Page<T> pageQuery​(T t,
                                                          org.springframework.data.domain.Pageable pageable)
        分页查询
        参数:
        t - 查询对象
        pageable - 分页对象
        返回:
        分页结果