com.sap.ip.me.api.persist.query
Class QueryRuntime

java.lang.Object
  extended bycom.sap.ip.me.api.persist.query.QueryRuntime
All Implemented Interfaces:
InternalQueryRuntime

public final class QueryRuntime
extends java.lang.Object
implements InternalQueryRuntime

QueryRuntime creates Query instances and components of Query instances which the application programmer can then use to obtain entities from persistence by query. A Query instance consists of a Condition and (optionally) of a SortOrder instance. The application programmer will use QueryRuntime to first create a Condition instance, then optionally create a SortOrder instance and finally with these two (or only * with condition) create a Query instance. Condition instances as well as SortOrder instances can be nested.

Author:
SAP

Method Summary
 Condition createCondition(AttributeDescriptor attribute, RelationalOperatorType relationalOperator, java.lang.Object value)
          Creates a Condition which is used to create a Query.
 Condition createCondition(Condition[] conditions, LogicalOperatorType logicalOperator)
          Creates a Condition which is used to create a Query.
 Query createQuery(java.lang.String classtype, Condition condition)
          Creates a Query out of a classtype (represented as a String) and a Condition
 Query createQuery(java.lang.String classtype, Condition condition, int maxCount)
          Creates a Query out of a classtype (represented as a String), a Condition and a size-limitation of the result set.
 Query createQuery(java.lang.String classtype, Condition condition, SortOrder sortOrder)
          Creates a Query out of a classtype (represented as a String), a Condition and a SortOrder
 Query createQuery(java.lang.String classtype, Condition condition, SortOrder sortOrder, int maxCount)
          Creates a Query out of a classtype (represented as a String), a Condition, a and a size-limitation of the result set
 Query createQuery(java.lang.String classtype, Condition condition, SortOrder sortOrder, int startIdx, int maxCount)
          Creates a Query out of a classtype (represented as a String), a Condition, a and a size-limitation of the result set
 Query createQuery(java.lang.String classtype, SortOrder sortOrder, int startIdx, int maxCount)
          Creates a Query out of a classtype (represented as a String), a Condition and a size-limitation of the result set.
 SortOrder createSortOrder(AttributeDescriptor attrib, boolean isAscending)
          Creates a SortOrder instance.
 SortOrder createSortOrder(SortOrder[] sortOrders)
          Creates a SortOrder instance out of multiple SingleSortOrder and / or MultipleSortOrder instances.
static QueryRuntime getInstance()
          Gets the QueryRuntime singleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static QueryRuntime getInstance()
Gets the QueryRuntime singleton

Returns:
The instance value

createCondition

public Condition createCondition(AttributeDescriptor attribute,
                                 RelationalOperatorType relationalOperator,
                                 java.lang.Object value)
Creates a Condition which is used to create a Query. The returned Condition instance is a SingleCondition instance. Multiple SingleConditions can be grouped as a CompositeCondition instance.

Specified by:
createCondition in interface InternalQueryRuntime
Parameters:
relationalOperator - Description of the Parameter
value - Description of the Parameter
attribute - Description of the Parameter
Returns:
Description of the Return Value

createCondition

public Condition createCondition(Condition[] conditions,
                                 LogicalOperatorType logicalOperator)
Creates a Condition which is used to create a Query. The returned Condition instance is a CompositeCondition instance, created out of multiple SingleCondition and / or CompositeCondition. Multiple CompositeCondition can be grouped as a CompositeCondition instance again.

Specified by:
createCondition in interface InternalQueryRuntime
Parameters:
conditions - Description of the Parameter
logicalOperator - Description of the Parameter
Returns:
Description of the Return Value

createSortOrder

public SortOrder createSortOrder(AttributeDescriptor attrib,
                                 boolean isAscending)
Creates a SortOrder instance. The returned instance is a SingleSortOrder instance. Multiple SingleSortOrder instances can be grouped as a MultipleSortOrder instance.

Specified by:
createSortOrder in interface InternalQueryRuntime
Parameters:
isAscending - Description of the Parameter
attrib - Description of the Parameter
Returns:
Description of the Return Value

createSortOrder

public SortOrder createSortOrder(SortOrder[] sortOrders)
Creates a SortOrder instance out of multiple SingleSortOrder and / or MultipleSortOrder instances. The returned instance is a MultipleSortOrder instance. Multiple MultipleSortOrder instances can be grouped as a MultipleSortOrder instance again.

Specified by:
createSortOrder in interface InternalQueryRuntime
Parameters:
sortOrders - Description of the Parameter
Returns:
Description of the Return Value

createQuery

public Query createQuery(java.lang.String classtype,
                         Condition condition)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String) and a Condition

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
condition - Description of the Parameter
classtype - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception

createQuery

public Query createQuery(java.lang.String classtype,
                         Condition condition,
                         SortOrder sortOrder)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String), a Condition and a SortOrder

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
condition - Description of the Parameter
sortOrder - Description of the Parameter
classtype - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception

createQuery

public Query createQuery(java.lang.String classtype,
                         Condition condition,
                         int maxCount)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String), a Condition and a size-limitation of the result set.

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
condition - Description of the Parameter
maxCount - Description of the Parameter
classtype - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception

createQuery

public Query createQuery(java.lang.String classtype,
                         SortOrder sortOrder,
                         int startIdx,
                         int maxCount)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String), a Condition and a size-limitation of the result set.

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
maxCount - Description of the Parameter
classtype - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception

createQuery

public Query createQuery(java.lang.String classtype,
                         Condition condition,
                         SortOrder sortOrder,
                         int maxCount)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String), a Condition, a and a size-limitation of the result set

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
condition - Description of the Parameter
sortOrder - Description of the Parameter
maxCount - Description of the Parameter
classtype - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception

createQuery

public Query createQuery(java.lang.String classtype,
                         Condition condition,
                         SortOrder sortOrder,
                         int startIdx,
                         int maxCount)
                  throws PersistenceException
Creates a Query out of a classtype (represented as a String), a Condition, a and a size-limitation of the result set

Specified by:
createQuery in interface InternalQueryRuntime
Parameters:
condition - Description of the Parameter
sortOrder - Description of the Parameter
maxCount - Description of the Parameter
classtype - Description of the Parameter
startIdx - Description of the Parameter
Returns:
Description of the Return Value
Throws:
PersistenceException - Description of the Exception


Copyright © 2003 SAP AG. All Rights Reserved.