类 BaseDaoImpl<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>,​T extends BaseEntity>

  • 所有已实现的接口:
    BaseDao<T>

    @NoRepositoryBean
    public abstract class BaseDaoImpl<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>,​T extends BaseEntity>
    extends Object
    implements BaseDao<T>
    Dao层基础接口实现类
    作者:
    weizhiwen
    • 字段详细资料

      • repository

        @Autowired
        protected R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer> repository
    • 构造器详细资料

      • BaseDaoImpl

        public BaseDaoImpl()
    • 方法详细资料

      • create

        public T create​(T t)
        从接口复制的说明: BaseDao
        创建对象
        指定者:
        create 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 对象
        返回:
        创建的对象
      • createAll

        public List<T> createAll​(List<T> list)
        从接口复制的说明: BaseDao
        批量创建对象
        指定者:
        createAll 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        list - 对象列表
        返回:
        创建的对象列表
      • update

        public T update​(T t)
        从接口复制的说明: BaseDao
        根据id更新对象,默认忽略Null值更新
        指定者:
        update 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 待更新对象
        返回:
        更新后的对象
      • updateWithNull

        public T updateWithNull​(T t)
        从接口复制的说明: BaseDao
        根据id更新对象,可以设置Null值是否更新
        指定者:
        updateWithNull 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 待更新对象
        返回:
        更新后的对象
      • findById

        public T findById​(Integer id)
        从接口复制的说明: BaseDao
        根据id查找对象
        指定者:
        findById 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        id - 对象Id
        返回:
        对象或Null
      • deleteById

        public void deleteById​(Integer id)
        从接口复制的说明: BaseDao
        根据id删除对象 默认逻辑删除
        指定者:
        deleteById 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        id - 对象Id
      • delete

        public void delete​(T t)
        从接口复制的说明: BaseDao
        根据对象删除对象 默认逻辑删除
        指定者:
        delete 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 查询对象
      • pageQuery

        public org.springframework.data.domain.Page<T> pageQuery​(T t,
                                                                 org.springframework.data.domain.Pageable pageable)
        从接口复制的说明: BaseDao
        分页查询
        指定者:
        pageQuery 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 查询对象
        pageable - 分页对象
        返回:
        分页结果
      • findOne

        public T findOne​(T t)
        从接口复制的说明: BaseDao
        根据查询对象查找对象
        指定者:
        findOne 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 查询对象
        返回:
        对象
      • findAll

        public List<T> findAll​(T t)
        从接口复制的说明: BaseDao
        根据查询对象查找对象
        指定者:
        findAll 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        参数:
        t - 查询对象
        返回:
        对象列表
      • findAll

        public List<T> findAll()
        从接口复制的说明: BaseDao
        根据查询对象查找对象
        指定者:
        findAll 在接口中 BaseDao<R extends org.springframework.data.jpa.repository.JpaRepository<T,​Integer>>
        返回:
        所有对象列表