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 Details

    • SimpleSolrRepository

      public SimpleSolrRepository(SolrOperations solrOperations, SolrEntityInformation<T,?> metadata)
      Parameters:
      metadata - must not be null
      solrOperations - must not be null
    • SimpleSolrRepository

      public SimpleSolrRepository(SolrOperations solrOperations, Class<T> entityClass)
      Parameters:
      solrOperations - must not be null
      entityClass -
  • Method Details

    • findById

      public Optional<T> findById(ID id)
      Specified by:
      findById in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • findAll

      public Iterable<T> findAll()
      Specified by:
      findAll in interface org.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:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
    • findAll

      public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
    • findAllById

      public Iterable<T> findAllById(Iterable<ID> ids)
      Specified by:
      findAllById in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • count

      public long count()
      Description copied from interface: SolrRepository
      Returns the number of entities available.
      Specified by:
      count in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
      Specified by:
      count in interface SolrRepository<T,ID extends Serializable>
      Returns:
      the total number of entities
    • count

      protected long count(Query query)
    • save

      public <S extends T> S save(S entity)
      Specified by:
      save in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • save

      public <S extends T> S save(S entity, Duration commitWithin)
      Description copied from interface: SolrCrudRepository
      Saves a given entity and commits withing given Duration.
      Specified by:
      save in interface SolrCrudRepository<T,ID extends Serializable>
      Parameters:
      entity - must not be null.
      Returns:
      the saved entity will never be null.
    • saveAll

      public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
      Specified by:
      saveAll in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • saveAll

      public <S extends T> Iterable<S> saveAll(Iterable<S> entities, Duration commitWithin)
      Description copied from interface: SolrCrudRepository
      Saves all given entities and commits withing given Duration.
      Specified by:
      saveAll in interface SolrCrudRepository<T,ID extends Serializable>
      Parameters:
      entities - must not be null.
      Returns:
      the saved entity will never be null.
    • existsById

      public boolean existsById(ID id)
      Specified by:
      existsById in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • deleteById

      public void deleteById(ID id)
      Specified by:
      deleteById in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • delete

      public void delete(T entity)
      Specified by:
      delete in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • deleteAllById

      public void deleteAllById(Iterable<? extends ID> ids)
      Specified by:
      deleteAllById in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • deleteAll

      public void deleteAll(Iterable<? extends T> entities)
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • deleteAll

      public void deleteAll()
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<T,ID extends Serializable>
    • getIdFieldName

      public final String getIdFieldName()
    • getEntityClass

      public Class<T> getEntityClass()
    • getSolrOperations

      public final SolrOperations getSolrOperations()