Spring Data Solr

org.springframework.data.solr.repository.support
Class SimpleSolrRepository<T,ID extends Serializable>

java.lang.Object
  extended by org.springframework.data.solr.repository.support.SimpleSolrRepository<T,ID>
Type Parameters:
T -
All Implemented Interfaces:
CrudRepository<T,ID>, PagingAndSortingRepository<T,ID>, 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

Author:
Christoph Strobl

Constructor Summary
SimpleSolrRepository()
           
SimpleSolrRepository(SolrEntityInformation<T,?> metadata, SolrOperations solrOperations)
           
SimpleSolrRepository(SolrOperations solrOperations)
           
SimpleSolrRepository(SolrOperations solrOperations, Class<T> entityClass)
           
 
Method Summary
 long count()
          Returns the number of entities available.
protected  long count(Query query)
           
 void delete(ID id)
           
 void delete(Iterable<? extends T> entities)
           
 void delete(T entity)
           
 void deleteAll()
           
 boolean exists(ID id)
           
 Iterable<T> findAll()
           
 Iterable<T> findAll(Iterable<ID> ids)
           
 Page<T> findAll(Pageable pageable)
           
 Iterable<T> findAll(Sort sort)
           
 T findOne(ID id)
           
 Class<T> getEntityClass()
           
 String getIdFieldName()
           
 SolrOperations getSolrOperations()
           
<S extends T>
Iterable<S>
save(Iterable<S> entities)
           
<S extends T>
S
save(S entity)
           
 void setEntityClass(Class<T> entityClass)
           
 void setIdFieldName(String idFieldName)
           
 void setSolrOperations(SolrOperations solrOperations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSolrRepository

public SimpleSolrRepository()

SimpleSolrRepository

public SimpleSolrRepository(SolrOperations solrOperations)
Parameters:
solrOperations - must not be null

SimpleSolrRepository

public SimpleSolrRepository(SolrEntityInformation<T,?> metadata,
                            SolrOperations solrOperations)
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 Detail

findOne

public T findOne(ID id)
Specified by:
findOne in interface CrudRepository<T,ID extends Serializable>

findAll

public Iterable<T> findAll()
Specified by:
findAll in interface CrudRepository<T,ID extends Serializable>

findAll

public Page<T> findAll(Pageable pageable)
Specified by:
findAll in interface PagingAndSortingRepository<T,ID extends Serializable>

findAll

public Iterable<T> findAll(Sort sort)
Specified by:
findAll in interface PagingAndSortingRepository<T,ID extends Serializable>

findAll

public Iterable<T> findAll(Iterable<ID> ids)
Specified by:
findAll in interface 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 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 CrudRepository<T,ID extends Serializable>

save

public <S extends T> Iterable<S> save(Iterable<S> entities)
Specified by:
save in interface CrudRepository<T,ID extends Serializable>

exists

public boolean exists(ID id)
Specified by:
exists in interface CrudRepository<T,ID extends Serializable>

delete

public void delete(ID id)
Specified by:
delete in interface CrudRepository<T,ID extends Serializable>

delete

public void delete(T entity)
Specified by:
delete in interface CrudRepository<T,ID extends Serializable>

delete

public void delete(Iterable<? extends T> entities)
Specified by:
delete in interface CrudRepository<T,ID extends Serializable>

deleteAll

public void deleteAll()
Specified by:
deleteAll in interface CrudRepository<T,ID extends Serializable>

getIdFieldName

public final String getIdFieldName()

setIdFieldName

public final void setIdFieldName(String idFieldName)

getEntityClass

public Class<T> getEntityClass()

setEntityClass

public final void setEntityClass(Class<T> entityClass)

setSolrOperations

public final void setSolrOperations(SolrOperations solrOperations)

getSolrOperations

public final SolrOperations getSolrOperations()

Spring Data Solr

Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.