Class BaseDAO<T extends IEntity<I>, I, M extends org.springframework.data.jpa.repository.JpaRepository<@NonNull T, @NonNull I> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<@NonNull T>>

java.lang.Object
io.github.xezzon.zeroweb.common.jpa.BaseDAO<T,I,M>
Type Parameters:
T - 实体类型
I - ID类型
M - 实体操作类类型
All Implemented Interfaces:
NewType<M>

public abstract class BaseDAO<T extends IEntity<I>, I, M extends org.springframework.data.jpa.repository.JpaRepository<@NonNull T, @NonNull I> & org.springframework.data.jpa.repository.JpaSpecificationExecutor<@NonNull T>> extends Object implements NewType<M>
持久层基类,封装了常用的数据访问操作,支持 OData 查询。
Author:
xezzon
  • Method Details

    • get

      public M get()
      获取底层的 JpaRepository 实例。
      Specified by:
      get in interface NewType<T extends IEntity<I>>
      Returns:
      JpaRepository 实例
    • findAll

      public org.springframework.data.domain.Page<@NonNull T> findAll(@NonNull ODataQueryOption odata)
      分页查询数据
      Parameters:
      odata - OData 查询条件
      Returns:
      分页数据