public class ElasticSearchServiceImpl<R extends IElasticSearchRepository<T,ID>,T,ID extends Serializable> extends Object implements IElasticSearchService<T,ID>
| 构造器和说明 |
|---|
ElasticSearchServiceImpl(R repository) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
count(com.lmaye.app.common.query.Query query,
Class<T> clazz)
Returns entities number matching the given
Query.In case no match could be found, an zero |
void |
deleteById(ID id)
Deletes the entity with the given id.
|
List<T> |
findAll(com.lmaye.app.common.query.ListQuery query,
Class<T> clazz)
|
List<T> |
findAll(com.lmaye.app.common.query.Query query,
Class<T> clazz)
Returns all entities matching the given
Query. |
Optional<T> |
findById(ID id)
Retrieves an entity by its id.
|
com.lmaye.app.common.context.PageResult<T> |
findPage(com.lmaye.app.common.query.PageQuery query,
Class<T> clazz)
Returns a
PageResult of entities matching the given PageQuery.In case no match could be found, an empty
PageResult is returned. |
List<T> |
findScrollAll(com.lmaye.app.common.query.ListQuery query,
Class<T> clazz)
|
com.lmaye.app.common.context.PageResult<T> |
findScrollPage(com.lmaye.app.common.query.PageQuery query,
Class<T> clazz)
Returns a
PageResult of entities matching the given PageQuery.In case no match could be found, an empty
PageResult is returned. |
<S extends T> |
insertOrUpdate(S entity)
Saves a given entity.
|
<S extends T> |
saveAll(Iterable<S> entities)
Saves all given entities.
|
public ElasticSearchServiceImpl(R repository)
public <S extends T> S insertOrUpdate(S entity)
insertOrUpdate 在接口中 IElasticSearchService<T,ID extends Serializable>entity - must not be null.@Transactional(rollbackFor=java.lang.Exception.class) public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
saveAll 在接口中 IElasticSearchService<T,ID extends Serializable>entities - must not be null.IllegalArgumentException - in case the given entity is null.public void deleteById(ID id)
deleteById 在接口中 IElasticSearchService<T,ID extends Serializable>id - must not be null.IllegalArgumentException - in case the given id is nullpublic Optional<T> findById(ID id)
findById 在接口中 IElasticSearchService<T,ID extends Serializable>id - must not be null.public List<T> findAll(com.lmaye.app.common.query.Query query, Class<T> clazz)
Query. In case no match could be found an empty List
is returned.findAll 在接口中 IElasticSearchService<T,ID extends Serializable>query - must not be null.clazz - TList of entities matching the given Query.public List<T> findAll(com.lmaye.app.common.query.ListQuery query, Class<T> clazz)
List of entities matching the given ListQuery.In case no match could be found, an empty
List is returned.findAll 在接口中 IElasticSearchService<T,ID extends Serializable>query - may be null.clazz - TList of entities matching the given ListQuery.public List<T> findScrollAll(com.lmaye.app.common.query.ListQuery query, Class<T> clazz)
List of entities matching the given ListQuery.In case no match could be found, an empty
List is returned.findScrollAll 在接口中 IElasticSearchService<T,ID extends Serializable>query - may be null.clazz - TList of entities matching the given ListQuery.public com.lmaye.app.common.context.PageResult<T> findPage(com.lmaye.app.common.query.PageQuery query, Class<T> clazz)
PageResult of entities matching the given PageQuery.In case no match could be found, an empty
PageResult is returned.findPage 在接口中 IElasticSearchService<T,ID extends Serializable>query - must not be null.clazz - TPageResult of entities matching the given PageQuery.public com.lmaye.app.common.context.PageResult<T> findScrollPage(com.lmaye.app.common.query.PageQuery query, Class<T> clazz)
PageResult of entities matching the given PageQuery.In case no match could be found, an empty
PageResult is returned.findScrollPage 在接口中 IElasticSearchService<T,ID extends Serializable>query - must not be null.clazz - TPageResult of entities matching the given PageQuery.public long count(com.lmaye.app.common.query.Query query,
Class<T> clazz)
Query.In case no match could be found, an zerocount 在接口中 IElasticSearchService<T,ID extends Serializable>query - must not be null.clazz - TCopyright © 2020. All rights reserved.