public class QueryExecutor extends Object
QuerySpecification
.Constructor and Description |
---|
QueryExecutor(ExecutionContext context)
Creates new instance.
|
QueryExecutor(ExecutionContext context,
InterpreterStackTrace stackTrace)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec,
Collection<?> parameters,
Object entity)
Returns true if the given query result list contains the given entity.
|
Decimal |
count(ClosureHolder closureWithQuery,
String recordIterator,
Expression additionalWhereExp)
Dynamically creates query and executes it.
|
Decimal |
count(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec,
Collection<?> parameters)
Executes the count query.
|
protected Decimal |
count(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions)
Dynamically creates query and executes it.
|
Decimal |
count(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec,
Collection<?> parameters)
Executes the given query and returns a list of results.
|
Decimal |
count(com.whitestein.lsps.model.sharedrecord.SharedRecordType type,
String recordIterator,
Expression whereExp)
Dynamically creates query and executes it.
|
Decimal |
countAll(RecordType recordType)
Runs a count query for records of a given type.
|
List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> |
getAll(RecordType recordType)
Returns all the entities for the given type.
|
QueryResult<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> |
getAll(RecordType recordType,
OrderingAndPagingCriteria pagingCriteria)
Returns all the entities for the given type.
|
protected List<Object> |
getAuditResultList(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions,
List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings,
Integer index,
Integer count,
Long revision,
List<AuditCriteria> auditCriteria)
Dynamically creates query and executes it.
|
List<Object> |
getAuditResultList(com.whitestein.lsps.model.sharedrecord.SharedRecordType type,
String recordIterator,
Expression whereExp,
List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings,
Integer index,
Integer count,
Long revision,
List<AuditCriteria> auditCriteria)
Dynamically creates query and executes it.
|
protected List<Object> |
getAuditResultListInternal(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions,
List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings,
Integer index,
Integer count,
Long revision,
List<AuditCriteria> auditCriteria) |
List<Object> |
getAuditRevisions(Object id,
com.whitestein.lsps.model.sharedrecord.SharedRecordType sharedRecordType,
Date from,
Date to)
Returns audit revisions.
|
List<Object> |
getResultList(ClosureHolder closureWithQuery,
String recordIterator,
Expression additionalWhereExp,
List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings,
Integer index,
Integer count)
Dynamically creates query and executes it.
|
List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> |
getResultList(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec,
Collection<?> parameters)
Executes the query and returns a result list.
|
protected List<Object> |
getResultList(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions,
com.whitestein.lsps.engine.sharedrecord.QueryExecutor.Orderings orderings,
Integer index,
Integer count)
Dynamically creates query and executes it.
|
List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> |
getResultList(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec,
Collection<?> parameters)
Executes the given query and returns a list of results.
|
QueryResult<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> |
getResultList(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec,
Collection<?> parameters,
OrderingAndPagingCriteria pagingCriteria)
Executes the given query and returns a list of results.
|
List<Object> |
getResultList(com.whitestein.lsps.model.sharedrecord.SharedRecordType type,
String recordIterator,
Expression whereExp,
List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings,
Integer index,
Integer count)
Dynamically creates query and executes it.
|
protected org.hibernate.Session |
getSession(String jndi) |
com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity |
getSingleResult(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec,
Collection<?> parameters)
Executes the query and returns a unique result.
|
com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity |
getSingleResult(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec,
Collection<?> parameters)
Executes the given query and returns only the first result.
|
public QueryExecutor(ExecutionContext context)
context
- public QueryExecutor(ExecutionContext context, InterpreterStackTrace stackTrace)
context
- stackTrace
- protected org.hibernate.Session getSession(String jndi)
public List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> getAll(RecordType recordType) throws ErrorException
recordType
- ErrorException
public QueryResult<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> getAll(RecordType recordType, OrderingAndPagingCriteria pagingCriteria) throws ErrorException
recordType
- pagingCriteria
- ErrorException
public List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> getResultList(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
public Decimal count(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
public QueryResult<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> getResultList(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec, Collection<?> parameters, OrderingAndPagingCriteria pagingCriteria) throws ErrorException
spec
- pagingCriteria
- parameters
- ErrorException
public com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity getSingleResult(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
public boolean contains(com.whitestein.lsps.model.sharedrecord.QuerySpecification spec, Collection<?> parameters, Object entity) throws ErrorException
spec
- parameters
- entity
- ErrorException
protected List<Object> getAuditResultListInternal(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions, List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings, Integer index, Integer count, Long revision, List<AuditCriteria> auditCriteria) throws ErrorException, ValidationException
whereExpressions
- orderings
- index
- count
- revision
- auditCriteria
- ErrorException
ValidationException
public List<Object> getAuditRevisions(Object id, com.whitestein.lsps.model.sharedrecord.SharedRecordType sharedRecordType, Date from, Date to) throws ErrorException
id
- sharedRecordType
- from
- to
- ErrorException
protected List<Object> getAuditResultList(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions, List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings, Integer index, Integer count, Long revision, List<AuditCriteria> auditCriteria) throws ErrorException, ValidationException
whereExpressions
- orderings
- index
- count
- revision
- auditCriteria
- ErrorException
ValidationException
public List<Object> getAuditResultList(com.whitestein.lsps.model.sharedrecord.SharedRecordType type, String recordIterator, Expression whereExp, List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings, Integer index, Integer count, Long revision, List<AuditCriteria> auditCriteria) throws ErrorException, ValidationException
type
- recordIterator
- whereExp
- orderings
- index
- count
- revision
- auditCriteria
- ErrorException
ValidationException
protected List<Object> getResultList(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions, com.whitestein.lsps.engine.sharedrecord.QueryExecutor.Orderings orderings, Integer index, Integer count) throws ErrorException, ValidationException
whereExpressions
- orderings
- index
- count
- ErrorException
ValidationException
public List<Object> getResultList(com.whitestein.lsps.model.sharedrecord.SharedRecordType type, String recordIterator, Expression whereExp, List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings, Integer index, Integer count) throws ErrorException, ValidationException
type
- recordIterator
- whereExp
- orderings
- index
- count
- ErrorException
ValidationException
public List<Object> getResultList(ClosureHolder closureWithQuery, String recordIterator, Expression additionalWhereExp, List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> orderings, Integer index, Integer count) throws ErrorException, ValidationException
closureWithQuery
- recordIterator
- additionalWhereExp
- orderings
- index
- count
- ErrorException
ValidationException
protected Decimal count(List<com.whitestein.lsps.engine.sharedrecord.QueryExecutor.WhereExpression> whereExpressions) throws ErrorException, ValidationException
whereExpressions
- ErrorException
ValidationException
public Decimal count(com.whitestein.lsps.model.sharedrecord.SharedRecordType type, String recordIterator, Expression whereExp) throws ErrorException, ValidationException
type
- recordIterator
- whereExp
- ErrorException
ValidationException
public Decimal countAll(RecordType recordType) throws ErrorException
recordType
- ErrorException
public Decimal count(ClosureHolder closureWithQuery, String recordIterator, Expression additionalWhereExp) throws ErrorException, ValidationException
closureWithQuery
- recordIterator
- additionalWhereExp
- ErrorException
ValidationException
public List<com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity> getResultList(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
public com.whitestein.lsps.model.sharedrecord.ExternalRecordEntity getSingleResult(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
public Decimal count(com.whitestein.lsps.model.sharedrecord.HQLQuerySpecification spec, Collection<?> parameters) throws ErrorException
spec
- parameters
- ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.