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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface实体属性复制器接口。static interface更新条件组装器接口。 -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<@NonNull T> findAll(@NonNull ODataQueryOption odata) 分页查询数据get()获取底层的 JpaRepository 实例。abstract BaseDAO.ICopier<T> 获取实体属性复制器。partialUpdate(T target) 局部更新实体(仅更新非空字段)
-
Method Details
-
getCopier
-
get
-
partialUpdate
-
findAll
分页查询数据- Parameters:
odata- OData查询条件- Returns:
- 分页数据
-