org.springframework.data.elasticsearch.repository.support
Class SimpleElasticsearchRepository<T>
java.lang.Object
org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- ElasticsearchCrudRepository<T,String>, ElasticsearchRepository<T,String>, org.springframework.data.repository.CrudRepository<T,String>, org.springframework.data.repository.PagingAndSortingRepository<T,String>, org.springframework.data.repository.Repository<T,String>
public class SimpleElasticsearchRepository<T>
- extends Object
- implements ElasticsearchRepository<T,String>
Elasticsearch specific repository implementation. Likely to be used as target within ElasticsearchRepositoryFactory
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleElasticsearchRepository
public SimpleElasticsearchRepository()
SimpleElasticsearchRepository
public SimpleElasticsearchRepository(ElasticsearchOperations elasticsearchOperations)
SimpleElasticsearchRepository
public SimpleElasticsearchRepository(ElasticsearchEntityInformation<T,String> metadata,
ElasticsearchOperations elasticsearchOperations)
createIndex
@PostConstruct
public void createIndex()
findOne
public T findOne(String id)
- Specified by:
findOne
in interface org.springframework.data.repository.CrudRepository<T,String>
findAll
public Iterable<T> findAll()
- Specified by:
findAll
in interface org.springframework.data.repository.CrudRepository<T,String>
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,String>
findAll
public Iterable<T> findAll(org.springframework.data.domain.Sort sort)
- Specified by:
findAll
in interface org.springframework.data.repository.PagingAndSortingRepository<T,String>
findAll
public Iterable<T> findAll(Iterable<String> ids)
- Specified by:
findAll
in interface org.springframework.data.repository.CrudRepository<T,String>
count
public long count()
- Specified by:
count
in interface org.springframework.data.repository.CrudRepository<T,String>
save
public <S extends T> S save(S entity)
- Specified by:
save
in interface org.springframework.data.repository.CrudRepository<T,String>
save
public <S extends T> List<S> save(List<S> entities)
- Specified by:
save
in interface ElasticsearchCrudRepository<T,String>
index
public <S extends T> S index(S entity)
- Specified by:
index
in interface ElasticsearchRepository<T,String>
save
public <S extends T> Iterable<S> save(Iterable<S> entities)
- Specified by:
save
in interface org.springframework.data.repository.CrudRepository<T,String>
exists
public boolean exists(String id)
- Specified by:
exists
in interface org.springframework.data.repository.CrudRepository<T,String>
search
public Iterable<T> search(org.elasticsearch.index.query.QueryBuilder elasticsearchQuery)
- Specified by:
search
in interface ElasticsearchRepository<T,String>
search
public org.springframework.data.domain.Page<T> search(org.elasticsearch.index.query.QueryBuilder elasticsearchQuery,
org.springframework.data.domain.Pageable pageable)
- Specified by:
search
in interface ElasticsearchRepository<T,String>
search
public org.springframework.data.domain.Page<T> search(SearchQuery query)
- Specified by:
search
in interface ElasticsearchRepository<T,String>
delete
public void delete(String id)
- Specified by:
delete
in interface org.springframework.data.repository.CrudRepository<T,String>
delete
public void delete(T entity)
- Specified by:
delete
in interface org.springframework.data.repository.CrudRepository<T,String>
delete
public void delete(Iterable<? extends T> entities)
- Specified by:
delete
in interface org.springframework.data.repository.CrudRepository<T,String>
deleteAll
public void deleteAll()
- Specified by:
deleteAll
in interface org.springframework.data.repository.CrudRepository<T,String>
getEntityClass
public Class<T> getEntityClass()
setEntityClass
public final void setEntityClass(Class<T> entityClass)
setElasticsearchOperations
public final void setElasticsearchOperations(ElasticsearchOperations elasticsearchOperations)
Copyright © 2012-2013 BioMed Central. All Rights Reserved.