|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.persist.query.JQueryFactory
Query factory interface. The queries are reusable, read-only objects that allow filtering the data in a container. Usually, you create the query on first use, store it into a static field and then re-use it later. A JQuery only selects the specified attributes and not whole instances of PersistableEntities. The intention is to display screens very fast using JQueries.
The query interface supports sorting and grouping. To enable sorting, simply add attribute terms on which you wish to sort when creating the query.
Conditions should be added from left to right with decreasing selectivity.
The query can be parameterized using JQueryParameters. Parameters can be set during runtime. This makes a query reusable for differnet parameters without the need to create a new JQuery instance. Simply pass new parameter values to the executeQuery method on the PersistenceManager.
JQuery
,
JQueryAttribute
,
JQueryParameter
,
JQueryCondition
,
JQuerySortOrder
,
JQueryGroupBy
,
JQueryFactory
,
JQueryResult
Constructor Summary | |
JQueryFactory()
|
Method Summary | |
abstract JQueryAttribute |
createAggregate(JQueryAttribute attr,
AggregationOperatorType aggreg)
Create an aggregate on the query attribute. |
abstract JQueryAttribute |
createAttribute(ClassDescriptor candidateClass,
AttributeDescriptor fieldName)
Create a query attribute. |
abstract JQueryAttribute |
createAttribute(ClassDescriptor candidateClass,
AttributeDescriptor fieldName,
java.lang.Object tag)
Create a query attribute. |
abstract JQueryLinkAttribute |
createAttribute(ClassDescriptor candidateClass,
LinkDescriptor fieldName)
Create a query attribute for links between tables. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
java.lang.Object[] right)
Deprecated. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
java.lang.Object[] right,
java.lang.Object tag)
Deprecated. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
RelationalOperatorType operator,
JQueryAttribute right)
Create simple condition between two attributes. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
RelationalOperatorType operator,
JQueryParameter right)
Create simple condition with parameterized right operand. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
RelationalOperatorType operator,
java.lang.Object right)
Deprecated. |
abstract JQueryCondition |
createCondition(JQueryAttribute left,
RelationalOperatorType operator,
java.lang.Object right,
java.lang.Object tag)
Deprecated. |
abstract JQueryCondition |
createCondition(JQueryCondition[] conditions,
LogicalOperatorType operator)
Construct n-ary logical operator. |
abstract JQueryCondition |
createCondition(JQueryCondition left,
LogicalOperatorType operator,
JQueryCondition right)
Construct binary logical operator. |
abstract JQueryCondition |
createCondition(LogicalOperatorType operator,
JQueryCondition right)
Construct unary logical operator. |
abstract JQueryGroupBy |
createGroupBy(JQueryAttribute[] groupBy)
Create group by for the specified attributes in the same order as the delivered JQueryAttribute[] |
abstract JQueryCondition |
createLinkCondition(JQueryLinkAttribute link)
Create link condition to join two tables over link table. |
abstract JQueryParameter |
createParameter(java.lang.Object defaultValue)
Create unnamed query parameter. |
abstract JQueryParameter |
createParameter(java.lang.Object defaultValue,
java.lang.Object tag)
Create named query parameter. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond)
Create query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
boolean distinct)
Create query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
boolean distinct,
JQuerySortOrder sortOrder)
Create sorted query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
boolean distinct,
JQuerySortOrder[] sortOrders)
Create sorted query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
boolean distinct,
JQuerySortOrder[] sortOrders,
JQueryGroupBy groupBy)
Create sorted and grouped query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
JQuerySortOrder sortOrder)
Create sorted query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
JQuerySortOrder[] sortOrders)
Create sorted query based on specified attributes and condition. |
abstract JQuery |
createQuery(JQueryAttribute[] attributes,
JQueryCondition cond,
JQuerySortOrder[] sortOrders,
JQueryGroupBy groupBy)
Create sorted and grouped query based on specified attributes and condition. |
abstract JQuerySortOrder |
createSortOrder(JQueryAttribute attribute)
Create ascending sort order on given attribute. |
abstract JQuerySortOrder |
createSortOrder(JQueryAttribute attribute,
boolean ascending)
Create sort order on given attribute. |
abstract JQuerySortOrder |
createSortOrder(JQuerySortOrder[] sortOrders)
Deprecated. |
static JQueryFactory |
getInstance()
Get instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JQueryFactory()
Method Detail |
public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.
java.lang.IllegalArgumentException
- if condition uses
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, JQuerySortOrder[] sortOrders) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.sortOrders
- sort orders to use for this query or null to use default sorting.
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, JQuerySortOrder sortOrder) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.sortOrder
- sort order to use for this query or null to use default sorting.
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, JQuerySortOrder[] sortOrders, JQueryGroupBy groupBy) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.groupBy
- grouping to use for this query or null to use no grouping
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, boolean distinct) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.distinct
- if true, select unique (no row duplicates).
java.lang.IllegalArgumentException
- if condition uses
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, boolean distinct, JQuerySortOrder[] sortOrders) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.distinct
- if true, select unique (no row duplicates).sortOrders
- sort orders to use for this query or null to use default sorting.
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, boolean distinct, JQuerySortOrder sortOrder) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.distinct
- if true, select unique (no row duplicates).sortOrder
- sort order to use for this query or null to use default sorting.
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQuery createQuery(JQueryAttribute[] attributes, JQueryCondition cond, boolean distinct, JQuerySortOrder[] sortOrders, JQueryGroupBy groupBy) throws java.lang.IllegalArgumentException
attributes
- attributes used in this query.cond
- condition to use to filter results.distinct
- if true, select unique (no row duplicates).groupBy
- attributes to group by or null for no grouping
java.lang.IllegalArgumentException
- if condition or sort orders use
attributes not mentioned in attributes parameter.public abstract JQueryAttribute createAttribute(ClassDescriptor candidateClass, AttributeDescriptor fieldName) throws java.lang.IllegalArgumentException
candidateClass
- candidate class.fieldName
- field name in candidate class to bind to this term.
java.lang.IllegalArgumentException
public abstract JQueryAttribute createAttribute(ClassDescriptor candidateClass, AttributeDescriptor fieldName, java.lang.Object tag) throws java.lang.IllegalArgumentException
candidateClass
- candidate class.fieldName
- field name in candidate class to bind to this term.tag
- identificator tag that can be later used to identify this attribute.
java.lang.IllegalArgumentException
public abstract JQueryAttribute createAggregate(JQueryAttribute attr, AggregationOperatorType aggreg)
attr
- attribute to change to aggregate.aggreg
- aggregation function to use.
public abstract JQueryLinkAttribute createAttribute(ClassDescriptor candidateClass, LinkDescriptor fieldName) throws java.lang.IllegalArgumentException
candidateClass
- candidate class.fieldName
- field name in candidate class to bind to this term.
java.lang.IllegalArgumentException
public abstract JQueryParameter createParameter(java.lang.Object defaultValue)
defaultValue
- default value for this parameter.
public abstract JQueryParameter createParameter(java.lang.Object defaultValue, java.lang.Object tag)
defaultValue
- default value for this parameter.tag
- parameter identification tag.
public abstract JQuerySortOrder createSortOrder(JQueryAttribute attribute)
Make sure you haven marked the AttributeDescriptor as index for best performance!
attribute
- attribute to sort by (should be indexed!).
public abstract JQuerySortOrder createSortOrder(JQueryAttribute attribute, boolean ascending)
Make sure you haven marked the AttributeDescriptor as index for best performance!
attribute
- attribute to sort.ascending
- if true, sort ascending.
public abstract JQuerySortOrder createSortOrder(JQuerySortOrder[] sortOrders)
sortOrders
- sort orders.
public abstract JQueryGroupBy createGroupBy(JQueryAttribute[] groupBy)
groupBy
- attributes to group by
public abstract JQueryCondition createCondition(JQueryAttribute left, RelationalOperatorType operator, JQueryParameter right) throws java.lang.IllegalArgumentException
left
- left operand.operator
- comparison operator.right
- right operand as parameter.
java.lang.IllegalArgumentException
- if the operator is invalid,
one of terms is null or the term types do not match.public abstract JQueryCondition createCondition(JQueryAttribute left, RelationalOperatorType operator, JQueryAttribute right) throws java.lang.IllegalArgumentException
left
- left operand.operator
- comparison operator.right
- right operand as parameter.
java.lang.IllegalArgumentException
- if the operator is invalid,
one of terms is null or the term types do not match.public abstract JQueryCondition createCondition(JQueryAttribute left, RelationalOperatorType operator, java.lang.Object right) throws java.lang.IllegalArgumentException
left
- left operand.operator
- comparison operator.right
- right operand as parameter (can be an array for IN operator).
java.lang.IllegalArgumentException
- if the operator is invalid,
one of terms is null or the term types do not match.public abstract JQueryCondition createCondition(JQueryAttribute left, RelationalOperatorType operator, java.lang.Object right, java.lang.Object tag) throws java.lang.IllegalArgumentException
left
- left operand.operator
- comparison operator.right
- right operand as parameter (can be an array for IN operator).tag
- identifier tag to use for the parameter.
java.lang.IllegalArgumentException
- if the operator is invalid,
one of terms is null or the term types do not match.public abstract JQueryCondition createCondition(JQueryAttribute left, java.lang.Object[] right) throws java.lang.IllegalArgumentException
left
- left operand.right
- array of values for right operand.
java.lang.IllegalArgumentException
- if the attribute is null or the types don't match.public abstract JQueryCondition createCondition(JQueryAttribute left, java.lang.Object[] right, java.lang.Object tag) throws java.lang.IllegalArgumentException
left
- left operand.right
- array of values for right operand.tag
- identifier tag to use for the parameter.
java.lang.IllegalArgumentException
- if the attribute is null or the types don't match.public abstract JQueryCondition createLinkCondition(JQueryLinkAttribute link)
link
- link attribute.public abstract JQueryCondition createCondition(JQueryCondition left, LogicalOperatorType operator, JQueryCondition right) throws java.lang.IllegalArgumentException
left
- left operand.operator
- logical operator.right
- right operand.
java.lang.IllegalArgumentException
- if an invalid operator is
specified or one of operands is null.public abstract JQueryCondition createCondition(JQueryCondition[] conditions, LogicalOperatorType operator) throws java.lang.IllegalArgumentException
conditions
- operands.operator
- logical operator.
java.lang.IllegalArgumentException
- if an invalid operator is
specified or one of operands is null.public abstract JQueryCondition createCondition(LogicalOperatorType operator, JQueryCondition right) throws java.lang.IllegalArgumentException
operator
- logical operator (only NOT supported).right
- right operand.
java.lang.IllegalArgumentException
- if an invalid operator is specified
or the operand is null.public static JQueryFactory getInstance()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |