E
- public abstract class BaseDao<E>
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
private java.lang.Class<E> |
clazz |
protected IdWorker |
idWorker |
protected org.apache.commons.logging.Log |
log |
static java.lang.String |
ORDERTYPE_ASC
顺序
order type desc
|
static java.lang.String |
ORDERTYPE_DESC
倒序
order type desc
|
protected org.hibernate.SessionFactory |
sessionFactory |
构造器和说明 |
---|
BaseDao() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
batchWork(QueryHandler queryHandler,
java.util.function.ObjIntConsumer<java.util.List<E>> worker,
int batchSize)
处理数据
|
protected <T> void |
batchWork(QueryHandler queryHandler,
java.util.function.ObjIntConsumer<java.util.List<T>> worker,
int batchSize,
java.lang.Class<T> resultType)
处理数据
|
protected long |
count(QueryHandler queryHandler) |
long |
countResult(QueryHandler queryHandler,
java.lang.String countHql) |
void |
delete(E entity)
删除
Delete
|
protected int |
delete(QueryHandler queryHandler)
刪除
|
void |
delete(java.io.Serializable id)
删除
Delete
|
protected E |
getEntity(QueryHandler queryHandler)
获取实体
|
E |
getEntity(java.io.Serializable id)
获取实体
|
E |
getEntity(java.io.Serializable id,
java.lang.String primaryKeyName)
获取实体
|
java.lang.Class<E> |
getEntityClass() |
protected java.util.List<E> |
getEntityList(QueryHandler queryHandler)
获取列表
|
java.util.List<E> |
getEntitys(java.util.Collection<java.io.Serializable> ids)
获取实体集合
|
java.util.List<E> |
getEntitys(java.util.Collection<java.io.Serializable> ids,
java.lang.String primaryKeyName)
获取实体集合
|
java.util.List<E> |
getEntitys(java.io.Serializable[] ids)
获取实体集合
|
java.util.List<E> |
getEntitys(java.io.Serializable[] ids,
java.lang.String primaryKeyName)
获取实体集合
|
FacetPageHandler |
getFacetPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep,
java.util.function.UnaryOperator<org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?>> facetFieldKeys,
java.util.function.Function<org.hibernate.search.engine.search.query.SearchResult<E>,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>> facetFieldResult,
HighLighterQuery highLighterQuery,
java.lang.Integer pageIndex,
java.lang.Integer pageSize) |
FacetPageHandler |
getFacetPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep,
java.util.function.UnaryOperator<org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?>> facetFieldKeys,
java.util.function.Function<org.hibernate.search.engine.search.query.SearchResult<E>,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>> facetFieldResult,
HighLighterQuery highLighterQuery,
java.lang.Integer pageIndex,
java.lang.Integer pageSize,
java.lang.Integer maxResults) |
long |
getId() |
protected <T> java.util.List<T> |
getList(org.hibernate.query.Query<T> query,
QueryHandler queryHandler)
获取列表
|
protected java.util.List<?> |
getList(QueryHandler queryHandler)
获取列表
|
protected PageHandler |
getPage(QueryHandler queryHandler,
java.lang.Integer pageIndex,
java.lang.Integer pageSize) |
protected PageHandler |
getPage(QueryHandler queryHandler,
java.lang.Integer firstResult,
java.lang.Integer pageIndex,
java.lang.Integer pageSize) |
protected PageHandler |
getPage(QueryHandler queryHandler,
java.lang.Integer firstResult,
java.lang.Integer pageIndex,
java.lang.Integer pageSize,
java.lang.Integer maxResults) |
protected PageHandler |
getPage(QueryHandler queryHandler,
java.lang.String countHql,
java.lang.Integer firstResult,
java.lang.Integer pageIndex,
java.lang.Integer pageSize,
java.lang.Integer maxResults) |
PageHandler |
getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep,
HighLighterQuery highLighterQuery,
java.lang.Integer pageIndex,
java.lang.Integer pageSize) |
PageHandler |
getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep,
HighLighterQuery highLighterQuery,
java.lang.Integer pageIndex,
java.lang.Integer pageSize,
java.lang.Integer maxResults) |
PageHandler |
getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep,
HighLighterQuery highLighterQuery,
java.lang.Integer firstResult,
java.lang.Integer pageIndex,
java.lang.Integer pageSize,
java.lang.Integer maxResults) |
static QueryHandler |
getQueryHandler()
查询处理器
|
static QueryHandler |
getQueryHandler(java.lang.String hql)
查询处理器
|
org.hibernate.search.engine.backend.Backend |
getSearchBackend() |
protected org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory |
getSearchPredicateFactory() |
org.hibernate.search.mapper.orm.session.SearchSession |
getSearchSession() |
protected org.hibernate.Session |
getSession() |
protected void |
higtLighter(java.util.List<E> resultList,
HighLighterQuery highLighterQuery) |
protected void |
index(E entity) |
protected abstract E |
init(E entity) |
static java.lang.String |
like(java.lang.String text)
Like查询
|
java.util.concurrent.CompletionStage<?> |
reCreateIndex() |
static java.lang.String |
rightLike(java.lang.String text)
右Like查询
|
void |
save(E entity)
保存
|
protected int |
update(QueryHandler queryHandler)
更新
|
protected final org.apache.commons.logging.Log log
public static final java.lang.String ORDERTYPE_DESC
public static final java.lang.String ORDERTYPE_ASC
private java.lang.Class<E> clazz
protected org.hibernate.SessionFactory sessionFactory
protected IdWorker idWorker
public static QueryHandler getQueryHandler(java.lang.String hql)
hql
- public static QueryHandler getQueryHandler()
public static java.lang.String like(java.lang.String text)
text
- public static java.lang.String rightLike(java.lang.String text)
text
- public E getEntity(java.io.Serializable id)
id
- public long getId()
public E getEntity(java.io.Serializable id, java.lang.String primaryKeyName)
id
- primaryKeyName
- public java.util.List<E> getEntitys(java.util.Collection<java.io.Serializable> ids)
ids
- public java.util.List<E> getEntitys(java.util.Collection<java.io.Serializable> ids, java.lang.String primaryKeyName)
ids
- primaryKeyName
- public java.util.List<E> getEntitys(java.io.Serializable[] ids)
ids
- public java.util.List<E> getEntitys(java.io.Serializable[] ids, java.lang.String primaryKeyName)
ids
- primaryKeyName
- public void save(E entity)
entity
- public void delete(E entity)
entity
- public void delete(java.io.Serializable id)
id
- protected E getEntity(QueryHandler queryHandler)
queryHandler
- protected int update(QueryHandler queryHandler)
queryHandler
- protected int delete(QueryHandler queryHandler)
queryHandler
- protected <T> java.util.List<T> getList(org.hibernate.query.Query<T> query, QueryHandler queryHandler)
T
- query
- queryHandler
- protected void batchWork(QueryHandler queryHandler, java.util.function.ObjIntConsumer<java.util.List<E>> worker, int batchSize)
queryHandler
- worker
- batchSize
- protected <T> void batchWork(QueryHandler queryHandler, java.util.function.ObjIntConsumer<java.util.List<T>> worker, int batchSize, java.lang.Class<T> resultType)
T
- queryHandler
- worker
- batchSize
- protected java.util.List<E> getEntityList(QueryHandler queryHandler)
queryHandler
- protected java.util.List<?> getList(QueryHandler queryHandler)
queryHandler
- protected PageHandler getPage(QueryHandler queryHandler, java.lang.Integer firstResult, java.lang.Integer pageIndex, java.lang.Integer pageSize, java.lang.Integer maxResults)
queryHandler
- firstResult
- pageIndex
- pageSize
- maxResults
- protected PageHandler getPage(QueryHandler queryHandler, java.lang.Integer firstResult, java.lang.Integer pageIndex, java.lang.Integer pageSize)
queryHandler
- firstResult
- pageIndex
- pageSize
- protected PageHandler getPage(QueryHandler queryHandler, java.lang.Integer pageIndex, java.lang.Integer pageSize)
queryHandler
- pageIndex
- pageSize
- protected PageHandler getPage(QueryHandler queryHandler, java.lang.String countHql, java.lang.Integer firstResult, java.lang.Integer pageIndex, java.lang.Integer pageSize, java.lang.Integer maxResults)
queryHandler
- countHql
- firstResult
- pageIndex
- pageSize
- maxResults
- public PageHandler getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep, HighLighterQuery highLighterQuery, java.lang.Integer pageIndex, java.lang.Integer pageSize, java.lang.Integer maxResults)
optionsStep
- highLighterQuery
- pageIndex
- pageSize
- maxResults
- public PageHandler getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep, HighLighterQuery highLighterQuery, java.lang.Integer pageIndex, java.lang.Integer pageSize)
optionsStep
- highLighterQuery
- pageIndex
- pageSize
- public PageHandler getPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep, HighLighterQuery highLighterQuery, java.lang.Integer firstResult, java.lang.Integer pageIndex, java.lang.Integer pageSize, java.lang.Integer maxResults)
optionsStep
- highLighterQuery
- firstResult
- pageIndex
- pageSize
- maxResults
- public FacetPageHandler getFacetPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep, java.util.function.UnaryOperator<org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?>> facetFieldKeys, java.util.function.Function<org.hibernate.search.engine.search.query.SearchResult<E>,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>> facetFieldResult, HighLighterQuery highLighterQuery, java.lang.Integer pageIndex, java.lang.Integer pageSize)
optionsStep
- facetFieldKeys
- facetFieldResult
- highLighterQuery
- pageIndex
- pageSize
- public FacetPageHandler getFacetPage(org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?> optionsStep, java.util.function.UnaryOperator<org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep<?,E,?,?,?>> facetFieldKeys, java.util.function.Function<org.hibernate.search.engine.search.query.SearchResult<E>,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>> facetFieldResult, HighLighterQuery highLighterQuery, java.lang.Integer pageIndex, java.lang.Integer pageSize, java.lang.Integer maxResults)
optionsStep
- facetFieldKeys
- facetFieldResult
- highLighterQuery
- pageIndex
- pageSize
- maxResults
- protected void higtLighter(java.util.List<E> resultList, HighLighterQuery highLighterQuery)
resultList
- highLighterQuery
- public long countResult(QueryHandler queryHandler, java.lang.String countHql)
queryHandler
- countHql
- protected long count(QueryHandler queryHandler)
queryHandler
- protected void index(E entity)
entity
- public java.util.concurrent.CompletionStage<?> reCreateIndex()
protected org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory getSearchPredicateFactory()
protected org.hibernate.Session getSession()
public org.hibernate.search.mapper.orm.session.SearchSession getSearchSession()
public org.hibernate.search.engine.backend.Backend getSearchBackend()
public java.lang.Class<E> getEntityClass()