Package top.codef.dao

Class BaseDao

All Implemented Interfaces:
AmebaDao
Direct Known Subclasses:
CommonDao

public abstract class BaseDao extends AbstractDao
  • Constructor Details

    • BaseDao

      public BaseDao()
  • Method Details

    • getSingle

      public <T> T getSingle(Class<T> clazz, CommonFilter commonFilter)
      获取单个实例
      Parameters:
      clazz -
      commonFilter -
      Returns:
    • getSingle

      public <T, K> T getSingle(Class<T> tarClazz, Class<K> rootClass, CommonFilter commonFilter)
      获取单个实例
      Type Parameters:
      T -
      K -
      Parameters:
      tarClazz -
      rootClass -
      commonFilter -
      Returns:
    • getList

      public <T, K> List<T> getList(Class<T> tarClazz, Class<K> rootClazz, CommonFilter commonFilter)
    • getList

      public <T> List<T> getList(Class<T> clazz, Pageable page, CommonFilter commonFilter)
      分页所做查询列表
      Type Parameters:
      T -
      Parameters:
      clazz -
      page -
      commonFilter -
      Returns:
    • getList

      public <T, R> List<T> getList(Class<T> tarClazz, Class<R> rootClazz, Pageable page, CommonFilter commonFilter)
      Parameters:
      tarClazz -
      rootClazz -
      page -
      commonFilter -
      Returns:
    • getPage

      public <T> Page<T> getPage(Class<T> clazz, Pageable pageable, CommonFilter filter)
    • getPage

      public <T, R> Page<T> getPage(Class<T> tarClazz, Class<R> rootClazz, Pageable pageable, CommonFilter filter)
    • getList

      public <T> List<T> getList(Class<T> clazz)
      获取所有数据
      Parameters:
      clazz -
      Returns:
    • getList

      public <T> List<T> getList(Class<T> clazz, CommonFilter commonFilter)
      获取列表
      Type Parameters:
      T -
      Parameters:
      clazz -
      commonFilter -
      Returns:
    • count

      public <T> Long count(Class<T> clazz, CommonFilter commonFilter)
      数量
      Type Parameters:
      T -
      Parameters:
      clazz -
      commonFilter -
      Returns:
    • countDistinct

      public <T> Long countDistinct(Class<T> clazz, String field, CommonFilter commonFilter)
      数量
      Type Parameters:
      T -
      Parameters:
      clazz -
      field -
      commonFilter -
      Returns:
    • update

      public <T> Integer update(Class<T> clazz, CommonFilter commonFilter)
    • updateWithNull

      public <T> Integer updateWithNull(Class<T> clazz, CommonFilter commonFilter)
    • delete

      public <T> int delete(Class<T> clazz, CommonFilter commonFilter)