类 BaseService<T,ID extends java.io.Serializable,R extends SupportRepository<T,ID>>
- java.lang.Object
-
- net.qimooc.commons.service.BaseService<T,ID,R>
-
- 所有已实现的接口:
CrudService<T,ID>,DataRuleService<T,java.io.Serializable>
@Deprecated public class BaseService<T,ID extends java.io.Serializable,R extends SupportRepository<T,ID>> extends java.lang.Object implements CrudService<T,ID>, DataRuleService<T,java.io.Serializable>
已过时。
-
-
字段概要
字段 修饰符和类型 字段 说明 protected DataRuleWapperdataRuleWapper已过时。protected booleanisReparable已过时。protected Rrepository已过时。
-
构造器概要
构造器 构造器 说明 BaseService()已过时。
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 protected booleancheckDeleteable(ID id)已过时。protected booleancheckDeleteable(T entity)已过时。longcount()已过时。Returns the number of entities available.longcount(org.springframework.data.jpa.domain.Specification<T> spec)已过时。Returns the number of instances that the givenSpecificationwill return.voiddelete(ID id)已过时。Deletes the entity with the given id.voiddelete(ID[] ids)已过时。voiddelete(ID[] ids, boolean isPhysical)已过时。voiddelete(ID id, boolean isPhysical)已过时。Deletes the entity with the given id.voiddelete(java.lang.Iterable<? extends T> entities)已过时。Deletes the given entities.voiddelete(java.lang.Iterable<? extends T> entities, boolean isPhysical)已过时。Deletes the given entities.voiddelete(java.util.List<ID> ids)已过时。voiddelete(java.util.List<ID> ids, boolean isPhysical)已过时。voiddelete(T entity)已过时。Deletes a given entity.voiddelete(T entity, boolean isPhysical)已过时。Deletes a given entity.voiddeleteAll()已过时。Deletes all entities managed by the repository.voiddeleteAll(boolean isPhysical)已过时。Deletes all entities managed by the repository.booleanexists(ID id)已过时。Returns whether an entity with the given id exists.java.lang.Iterable<T>findAll()已过时。Returns all instances of the type.java.lang.Iterable<T>findAll(java.lang.Iterable<ID> ids)已过时。Returns all instances of the type with the given IDs.<S extends T>
java.lang.Iterable<S>findAll(org.springframework.data.domain.Example<S> example)已过时。<S extends T>
org.springframework.data.domain.Page<S>findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)已过时。java.util.List<T>findAll(org.springframework.data.jpa.domain.Specification<T> spec)已过时。Returns all entities matching the givenSpecification.org.springframework.data.domain.Page<T>findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Pageable pageable)已过时。Returns aPageof entities matching the givenSpecification.java.util.List<T>findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Sort sort)已过时。Returns all entities matching the givenSpecificationandSort.java.util.List<T>findAll(T entity)已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,不带支持权限)java.util.List<T>findAll(T entity, org.springframework.data.domain.ExampleMatcher matcher)已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,不带支持权限)org.springframework.data.domain.Page<T>findAll(T entity, org.springframework.data.domain.ExampleMatcher matcher, org.springframework.data.domain.Pageable pageable)已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,不带支持权限)org.springframework.data.domain.Page<T>findAll(T entity, org.springframework.data.domain.Pageable pageable)已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,不带支持权限)java.util.List<T>findAllWithDataRule(org.springframework.data.jpa.domain.Specification<T> specification)已过时。根据传入的查询条件拼接上数据范围条件后查询org.springframework.data.domain.Page<T>findAllWithDataRule(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable)已过时。根据传入的查询条件拼接上数据范围条件后查询(分页)java.util.List<T>findAllWithDataRule(T entity)已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,支持权限)java.util.List<T>findAllWithDataRule(T entity, org.springframework.data.domain.ExampleMatcher matcher)已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,支持权限)org.springframework.data.domain.Page<T>findAllWithDataRule(T entity, org.springframework.data.domain.ExampleMatcher matcher, org.springframework.data.domain.Pageable pageable)已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,支持权限)org.springframework.data.domain.Page<T>findAllWithDataRule(T entity, org.springframework.data.domain.Pageable pageable)已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,支持权限)TfindOne(ID id)已过时。Retrieves an entity by its id.TfindOne(org.springframework.data.jpa.domain.Specification<T> spec)已过时。Returns a single entity matching the givenSpecification.TgetOne(ID id)已过时。Returns a reference to the entity with the given identifier.org.springframework.data.jpa.domain.Specification<T>handleQueryAnnotation(T entity)已过时。解析实体类上的Query*注解生成Specificationorg.springframework.data.jpa.domain.Specification<T>handleQueryAnnotation(T entity, org.springframework.data.domain.ExampleMatcher matcher)已过时。解析实体类上的Query*注解生成Specification, 带过滤条件<S extends T>
java.lang.Iterable<S>save(java.lang.Iterable<S> entities)已过时。Saves all given entities.<S extends T>
Ssave(S entity)已过时。Saves a given entity.voidsetDataRuleWapper(DataRuleWapper dataRuleWapper)已过时。<S extends R>
voidsetRepository(S repository)已过时。protected voidtagDelete(ID id)已过时。protected voidtagDelete(T entity)已过时。Tupdate(ID id, T entity)已过时。fetch an entityorg.springframework.data.jpa.domain.Specification<T>withDataRule(org.springframework.data.jpa.domain.Specification<T> specification)已过时。给传入的条件拼接数据范围条件
-
-
-
字段详细资料
-
repository
protected R extends SupportRepository<T,ID> repository
已过时。
-
isReparable
protected boolean isReparable
已过时。
-
dataRuleWapper
protected DataRuleWapper dataRuleWapper
已过时。
-
-
方法详细资料
-
setRepository
@Autowired public <S extends R> void setRepository(S repository)
已过时。
-
setDataRuleWapper
@Autowired(required=false) public void setDataRuleWapper(DataRuleWapper dataRuleWapper)
已过时。
-
save
@Transactional public <S extends T> S save(S entity)
已过时。从接口复制的说明:CrudServiceSaves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.- 指定者:
save在接口中CrudService<T,ID extends java.io.Serializable>- 类型参数:
S- S- 参数:
entity- Jpa Entity- 返回:
- the saved entity
-
save
public <S extends T> java.lang.Iterable<S> save(java.lang.Iterable<S> entities)
已过时。从接口复制的说明:CrudServiceSaves all given entities.- 指定者:
save在接口中CrudService<T,ID extends java.io.Serializable>- 类型参数:
S- S- 参数:
entities- The entities- 返回:
- the saved entities
-
findOne
public T findOne(ID id)
已过时。从接口复制的说明:CrudServiceRetrieves an entity by its id.- 指定者:
findOne在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- must not be null.- 返回:
- the entity with the given id or null if none found
-
getOne
public T getOne(ID id)
已过时。从接口复制的说明:CrudServiceReturns a reference to the entity with the given identifier.- 指定者:
getOne在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- must not be null.- 返回:
- a reference to the entity with the given identifier.
- 另请参阅:
EntityManager.getReference(Class, Object)
-
exists
public boolean exists(ID id)
已过时。从接口复制的说明:CrudServiceReturns whether an entity with the given id exists.- 指定者:
exists在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- must not be null.- 返回:
- true if an entity with the given id exists, false otherwise
-
findAll
public java.lang.Iterable<T> findAll()
已过时。从接口复制的说明:CrudServiceReturns all instances of the type.- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 返回:
- all entities
-
findAll
public java.lang.Iterable<T> findAll(java.lang.Iterable<ID> ids)
已过时。从接口复制的说明:CrudServiceReturns all instances of the type with the given IDs.- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
ids- ids- 返回:
- I
-
count
public long count()
已过时。从接口复制的说明:CrudServiceReturns the number of entities available.- 指定者:
count在接口中CrudService<T,ID extends java.io.Serializable>- 返回:
- the number of entities
-
delete
public void delete(ID id)
已过时。从接口复制的说明:CrudServiceDeletes the entity with the given id.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- must not be null.
-
delete
public void delete(java.util.List<ID> ids)
已过时。- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>
-
delete
public void delete(ID[] ids)
已过时。- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>
-
delete
public void delete(T entity)
已过时。从接口复制的说明:CrudServiceDeletes a given entity.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- The entity
-
delete
public void delete(java.lang.Iterable<? extends T> entities)
已过时。从接口复制的说明:CrudServiceDeletes the given entities.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entities- The entities
-
deleteAll
public void deleteAll()
已过时。从接口复制的说明:CrudServiceDeletes all entities managed by the repository.- 指定者:
deleteAll在接口中CrudService<T,ID extends java.io.Serializable>
-
findAll
public <S extends T> java.lang.Iterable<S> findAll(org.springframework.data.domain.Example<S> example)
已过时。- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>
-
findAll
public <S extends T> org.springframework.data.domain.Page<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)
已过时。- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>
-
findAll
public java.util.List<T> findAll(T entity)
已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,不带支持权限)- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- E- 返回:
- List
-
findAll
public org.springframework.data.domain.Page<T> findAll(T entity, org.springframework.data.domain.Pageable pageable)
已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,不带支持权限)- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- Epageable- p- 返回:
- page
-
findAll
public java.util.List<T> findAll(T entity, org.springframework.data.domain.ExampleMatcher matcher)
已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,不带支持权限)- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- E- 返回:
- List
-
findAll
public org.springframework.data.domain.Page<T> findAll(T entity, org.springframework.data.domain.ExampleMatcher matcher, org.springframework.data.domain.Pageable pageable)
已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,不带支持权限)- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- epageable- p- 返回:
- p
-
findAllWithDataRule
public java.util.List<T> findAllWithDataRule(T entity)
已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,支持权限)- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
entity- e- 返回:
- List
-
findAllWithDataRule
public org.springframework.data.domain.Page<T> findAllWithDataRule(T entity, org.springframework.data.domain.Pageable pageable)
已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,支持权限)- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
entity- Epageable- p- 返回:
- page
-
findAllWithDataRule
public java.util.List<T> findAllWithDataRule(T entity, org.springframework.data.domain.ExampleMatcher matcher)
已过时。解析form表单提交的查询entity,生成复杂查询(全部,过滤已删除数据,支持权限)- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
entity- Ematcher- 一般用来 ignore一组不需要自动匹配的属性- 返回:
- List
-
findAllWithDataRule
public org.springframework.data.domain.Page<T> findAllWithDataRule(T entity, org.springframework.data.domain.ExampleMatcher matcher, org.springframework.data.domain.Pageable pageable)
已过时。解析form表单提交的查询entity,生成复杂查询(分页,过滤已删除数据,支持权限)- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
entity- Epageable- pagematcher- 一般用来 ignore一组不需要自动匹配的属性- 返回:
- Page
-
delete
public void delete(ID id, boolean isPhysical)
已过时。从接口复制的说明:CrudServiceDeletes the entity with the given id.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- must not be null.isPhysical- default 'false' when the entity is reparable and give 'true' for need deleted by physical. Otherwise it will no use, same as delete(T)
-
delete
public void delete(java.util.List<ID> ids, boolean isPhysical)
已过时。- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>
-
delete
public void delete(ID[] ids, boolean isPhysical)
已过时。- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>
-
delete
public void delete(T entity, boolean isPhysical)
已过时。从接口复制的说明:CrudServiceDeletes a given entity.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- entityisPhysical- py
-
delete
public void delete(java.lang.Iterable<? extends T> entities, boolean isPhysical)
已过时。从接口复制的说明:CrudServiceDeletes the given entities.- 指定者:
delete在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entities- entitiesisPhysical- py
-
deleteAll
public void deleteAll(boolean isPhysical)
已过时。从接口复制的说明:CrudServiceDeletes all entities managed by the repository.- 指定者:
deleteAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
isPhysical- py
-
tagDelete
protected void tagDelete(ID id)
已过时。
-
tagDelete
protected void tagDelete(T entity)
已过时。
-
checkDeleteable
protected boolean checkDeleteable(T entity)
已过时。
-
checkDeleteable
protected boolean checkDeleteable(ID id)
已过时。
-
update
public T update(ID id, T entity)
已过时。从接口复制的说明:CrudServicefetch an entity- 指定者:
update在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
id- identity- en- 返回:
- T
-
withDataRule
public org.springframework.data.jpa.domain.Specification<T> withDataRule(org.springframework.data.jpa.domain.Specification<T> specification)
已过时。从接口复制的说明:DataRuleService给传入的条件拼接数据范围条件- 指定者:
withDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
specification- sp- 返回:
- 已拼接数据权限的条件
-
handleQueryAnnotation
public org.springframework.data.jpa.domain.Specification<T> handleQueryAnnotation(T entity)
已过时。解析实体类上的Query*注解生成Specification- 指定者:
handleQueryAnnotation在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- E- 返回:
- Specification
-
handleQueryAnnotation
public org.springframework.data.jpa.domain.Specification<T> handleQueryAnnotation(T entity, org.springframework.data.domain.ExampleMatcher matcher)
已过时。解析实体类上的Query*注解生成Specification, 带过滤条件- 指定者:
handleQueryAnnotation在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
entity- E- 返回:
- Specification
-
findAllWithDataRule
public java.util.List<T> findAllWithDataRule(org.springframework.data.jpa.domain.Specification<T> specification)
已过时。从接口复制的说明:DataRuleService根据传入的查询条件拼接上数据范围条件后查询- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
specification- sp- 返回:
- 带权限范围的数据集合
-
findAllWithDataRule
public org.springframework.data.domain.Page<T> findAllWithDataRule(org.springframework.data.jpa.domain.Specification<T> specification, org.springframework.data.domain.Pageable pageable)
已过时。从接口复制的说明:DataRuleService根据传入的查询条件拼接上数据范围条件后查询(分页)- 指定者:
findAllWithDataRule在接口中DataRuleService<T,ID extends java.io.Serializable>- 参数:
specification- sppageable- p- 返回:
- 带权限范围的数据集合
-
findOne
public T findOne(org.springframework.data.jpa.domain.Specification<T> spec)
已过时。从接口复制的说明:CrudServiceReturns a single entity matching the givenSpecification.- 指定者:
findOne在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
spec- spec- 返回:
- T
-
findAll
public java.util.List<T> findAll(org.springframework.data.jpa.domain.Specification<T> spec)
已过时。从接口复制的说明:CrudServiceReturns all entities matching the givenSpecification.- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
spec- spec- 返回:
- List T
-
findAll
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Pageable pageable)
已过时。从接口复制的说明:CrudServiceReturns aPageof entities matching the givenSpecification.- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
spec- specpageable- page- 返回:
- Page T
-
findAll
public java.util.List<T> findAll(org.springframework.data.jpa.domain.Specification<T> spec, org.springframework.data.domain.Sort sort)
已过时。从接口复制的说明:CrudServiceReturns all entities matching the givenSpecificationandSort.- 指定者:
findAll在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
spec- specsort- sort- 返回:
- List T
-
count
public long count(org.springframework.data.jpa.domain.Specification<T> spec)
已过时。从接口复制的说明:CrudServiceReturns the number of instances that the givenSpecificationwill return.- 指定者:
count在接口中CrudService<T,ID extends java.io.Serializable>- 参数:
spec- theSpecificationto count instances for- 返回:
- the number of instances
-
-