public class BaseRepositoryImpl<T,ID extends Serializable> extends org.springframework.data.jpa.repository.support.SimpleJpaRepository<T,ID> implements BaseRepository<T,ID>
| 构造器和说明 |
|---|
BaseRepositoryImpl(org.springframework.data.jpa.repository.support.JpaEntityInformation<T,ID> entityInformation,
javax.persistence.EntityManager entityManager) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deleteValid(String ids)
假删
|
List<T> |
findByAttr(String attr,
String condition)
全匹配查询
|
List<T> |
findByConditions(Map<String,String> objConditions,
List<String> excludeLikeAttr,
String sortAttr)
省去不必要的关联map参数
|
org.springframework.data.domain.Page<T> |
findByPage(Map<String,String> objConditions,
Integer current,
Integer pageSize,
List<String> excludeLikeAttr,
String sortAttr)
分页条件查询
|
T |
findOneByAttr(String attr,
String condition)
全匹配查询某一个实体,查询到多个只返回第一个
|
count, count, count, delete, deleteAll, deleteAll, deleteAllInBatch, deleteById, deleteInBatch, exists, existsById, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAllById, findById, findOne, findOne, flush, getCountQuery, getCountQuery, getDomainClass, getOne, getQuery, getQuery, getQuery, getQuery, getQueryHints, getRepositoryMethodMetadata, readPage, readPage, save, saveAll, saveAndFlush, setEscapeCharacter, setRepositoryMethodMetadataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlushcount, delete, deleteAll, deleteAll, deleteById, existsById, findById, savepublic org.springframework.data.domain.Page<T> findByPage(Map<String,String> objConditions, Integer current, Integer pageSize, List<String> excludeLikeAttr, String sortAttr)
BaseRepositoryfindByPage 在接口中 BaseRepository<T,ID extends Serializable>objConditions - 查询条件excludeLikeAttr - 是字符串类型,但是不使用模糊查询的字段,可为空sortAttr - 排序,可为空public List<T> findByConditions(Map<String,String> objConditions, List<String> excludeLikeAttr, String sortAttr)
findByConditions 在接口中 BaseRepository<T,ID extends Serializable>objConditions - 查询条件excludeLikeAttr - 是字符串类型,但是不使用模糊查询的字段,可为空sortAttr - 排序,可为空@Transactional(isolation=READ_COMMITTED,
rollbackFor=java.lang.Exception.class)
public void deleteValid(String ids)
BaseRepositorydeleteValid 在接口中 BaseRepository<T,ID extends Serializable>ids - ","隔开public T findOneByAttr(String attr, String condition)
BaseRepositoryfindOneByAttr 在接口中 BaseRepository<T,ID extends Serializable>attr - 属性名称,唯一标识(id、code ...)condition - 对应条件(1、TK1000 ...)public List<T> findByAttr(String attr, String condition)
BaseRepositoryfindByAttr 在接口中 BaseRepository<T,ID extends Serializable>attr - 属性名称(id、name、code ...)condition - 对应条件(1、罐1、TK1000 ...)Copyright © 2022. All Rights Reserved.