Class SpringDataResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
java.lang.Object
com.github.developframework.resource.spring.SpringDataResourceHandler<ENTITY,ID,REPOSITORY>
- All Implemented Interfaces:
ResourceHandler<ENTITY,ID>
public abstract class SpringDataResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable,REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID>>
extends Object
implements ResourceHandler<ENTITY,ID>
spring-data资源操作器
- Author:
- qiushui on 2019-08-15.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final REPOSITORYprotected final ResourceDefinition<ENTITY> -
Constructor Summary
ConstructorsConstructorDescriptionSpringDataResourceHandler(REPOSITORY repository, ResourceDefinition<ENTITY> resourceDefinition) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeleteById(ID id) booleanexistsById(ID id) voidvoidinsertAll(Collection<ENTITY> entities) query(org.springframework.data.domain.Sort sort, SEARCH search) queryPager(org.springframework.data.domain.Pageable pageable, SEARCH search) booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.developframework.resource.ResourceHandler
query, queryByIdForUpdate
-
Field Details
-
repository
protected final REPOSITORY extends org.springframework.data.repository.PagingAndSortingRepository<ENTITY,ID> repository -
resourceDefinition
-
-
Constructor Details
-
SpringDataResourceHandler
public SpringDataResourceHandler(REPOSITORY repository, ResourceDefinition<ENTITY> resourceDefinition)
-
-
Method Details
-
existsById
- Specified by:
existsByIdin interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
insert
- Specified by:
insertin interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
insertAll
- Specified by:
insertAllin interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
update
- Specified by:
updatein interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
delete
- Specified by:
deletein interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
queryById
- Specified by:
queryByIdin interfaceResourceHandler<ENTITY extends Entity<ID>,ID extends Serializable>
-
queryPager
-
query
-