Class SimpleSolrRepository<T,ID extends Serializable>
java.lang.Object
org.springframework.data.solr.repository.support.SimpleSolrRepository<T,ID>
- Type Parameters:
T-ID-
- All Implemented Interfaces:
org.springframework.data.repository.CrudRepository<T,,ID> org.springframework.data.repository.PagingAndSortingRepository<T,,ID> org.springframework.data.repository.Repository<T,,ID> SolrCrudRepository<T,,ID> SolrRepository<T,ID>
public class SimpleSolrRepository<T,ID extends Serializable>
extends Object
implements SolrCrudRepository<T,ID>
Solr specific repository implementation. Likely to be used as target within
SolrRepositoryFactory-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSolrRepository(SolrOperations solrOperations, Class<T> entityClass) SimpleSolrRepository(SolrOperations solrOperations, SolrEntityInformation<T, ?> metadata) -
Method Summary
Modifier and TypeMethodDescriptionlongcount()Returns the number of entities available.protected longvoidvoidvoidvoiddeleteAllById(Iterable<? extends ID> ids) voiddeleteById(ID id) booleanexistsById(ID id) findAll()org.springframework.data.domain.Page<T>findAll(org.springframework.data.domain.Pageable pageable) findAll(org.springframework.data.domain.Sort sort) findAllById(Iterable<ID> ids) final Stringfinal SolrOperations<S extends T>
Ssave(S entity) <S extends T>
SSaves a given entity and commits withing givenDuration.Saves all given entities and commits withing givenDuration.
-
Constructor Details
-
SimpleSolrRepository
- Parameters:
metadata- must not be nullsolrOperations- must not be null
-
SimpleSolrRepository
- Parameters:
solrOperations- must not be nullentityClass-
-
-
Method Details
-
findById
- Specified by:
findByIdin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
findAll
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable) - Specified by:
findAllin interfaceorg.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
-
findAll
- Specified by:
findAllin interfaceorg.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
-
findAllById
- Specified by:
findAllByIdin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
count
public long count()Description copied from interface:SolrRepositoryReturns the number of entities available.- Specified by:
countin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable> - Specified by:
countin interfaceSolrRepository<T,ID extends Serializable> - Returns:
- the total number of entities
-
count
-
save
- Specified by:
savein interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
save
Description copied from interface:SolrCrudRepositorySaves a given entity and commits withing givenDuration.- Specified by:
savein interfaceSolrCrudRepository<T,ID extends Serializable> - Parameters:
entity- must not be null.- Returns:
- the saved entity will never be null.
-
saveAll
- Specified by:
saveAllin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
saveAll
Description copied from interface:SolrCrudRepositorySaves all given entities and commits withing givenDuration.- Specified by:
saveAllin interfaceSolrCrudRepository<T,ID extends Serializable> - Parameters:
entities- must not be null.- Returns:
- the saved entity will never be null.
-
existsById
- Specified by:
existsByIdin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
deleteById
- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
delete
- Specified by:
deletein interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
deleteAllById
- Specified by:
deleteAllByIdin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
deleteAll
- Specified by:
deleteAllin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
deleteAll
public void deleteAll()- Specified by:
deleteAllin interfaceorg.springframework.data.repository.CrudRepository<T,ID extends Serializable>
-
getIdFieldName
-
getEntityClass
-
getSolrOperations
-