com.sap.tc.mobile.cfs.wdbll
Class GenericMobileQuery

java.lang.Object
  extended by com.sap.tc.mobile.cfs.wdbll.GenericMobileQuery
All Implemented Interfaces:
com.sap.tc.cmi.model.ICMIModelClass, com.sap.tc.cmi.model.ICMIModelClassExecutable, com.sap.tc.cmi.model.ICMIQuery, MobileQuery

public class GenericMobileQuery
extends java.lang.Object
implements MobileQuery

Generic query container. This container allows for building queries at runtime. At the same time, it serves as a base class for query-only model classes (purely transient classes).

Author:
D039184

Field Summary
 
Fields inherited from interface com.sap.tc.cmi.model.ICMIQuery
ROLE_NAME_INPUT_PARAMETER, ROLE_NAME_RESULT
 
Constructor Summary
GenericMobileQuery(java.lang.String queryString)
          Construct a generic query from query string.
GenericMobileQuery(java.lang.String queryString, com.sap.tc.cmi.model.ICMIModel model, com.sap.tc.cmi.metadata.ICMIModelClassInfo modelClassInfo, com.sap.tc.cmi.metadata.ICMIModelClassInfo resultClassInfo)
          Construct a generic query from query string.
 
Method Summary
 void addAuthorizationCheck(java.lang.String aoName)
          Add optional authorization check for query execution.
 void addConditions(java.lang.String condString)
          Add one or more conditions.
 com.sap.tc.cmi.metadata.ICMIModelClassInfo associatedInputParameterInfo()
           
 com.sap.tc.cmi.model.ICMIModel associatedModel()
           
 com.sap.tc.cmi.metadata.ICMIModelClassInfo associatedModelClassInfo()
           
 com.sap.tc.cmi.metadata.ICMIModelObjectCollectionInfo associatedResultInfo()
           
 long countOf()
           
 void execute()
           
 java.lang.Object getInputParameter()
           
 java.util.Collection getResult()
           
 boolean isDirty()
           
 void replaceSortOrders(java.lang.String sortString)
          Replace sort order(s).
 void reset()
          Reset the query to original state (remove any added conditions, sort orders and optional authorizations).
 void setInputParameter(java.lang.Object input)
          Set input parameter to use for next execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericMobileQuery

public GenericMobileQuery(java.lang.String queryString)
Construct a generic query from query string.

Parameters:
queryString - query string.

GenericMobileQuery

public GenericMobileQuery(java.lang.String queryString,
                          com.sap.tc.cmi.model.ICMIModel model,
                          com.sap.tc.cmi.metadata.ICMIModelClassInfo modelClassInfo,
                          com.sap.tc.cmi.metadata.ICMIModelClassInfo resultClassInfo)
Construct a generic query from query string.

Parameters:
queryString - query string.
model - model of this query.
modelClassInfo - class info of this query class.
resultClassInfo - class info of this query result class.
Method Detail

addAuthorizationCheck

public void addAuthorizationCheck(java.lang.String aoName)
Description copied from interface: MobileQuery
Add optional authorization check for query execution. The subsequent query executions will consider this authorization object as well.

Specified by:
addAuthorizationCheck in interface MobileQuery
Parameters:
aoName - AO name to use.
See Also:
MobileQuery.reset()

addConditions

public void addConditions(java.lang.String condString)
Description copied from interface: MobileQuery
Add one or more conditions. Added conditions will be AND-ed with already-existing conditions in WHERE clause of the query. Syntax is the same as WHERE clause. Conditions can be reset using @link{#reset()} method.

Specified by:
addConditions in interface MobileQuery
Parameters:
condString - condition string.
See Also:
MobileQuery.reset()

replaceSortOrders

public void replaceSortOrders(java.lang.String sortString)
Description copied from interface: MobileQuery
Replace sort order(s). These sort order(s) will be used instead of original sort order(s) of the query. Syntax is the same as in ORDER BY clause of the query. Sort orders can be reset using @link{#reset()} method.

Specified by:
replaceSortOrders in interface MobileQuery
Parameters:
sortString - sort string.
See Also:
MobileQuery.reset()

reset

public void reset()
Description copied from interface: MobileQuery
Reset the query to original state (remove any added conditions, sort orders and optional authorizations).

Specified by:
reset in interface MobileQuery
See Also:
MobileQuery.addConditions(String), MobileQuery.replaceSortOrders(String), MobileQuery.addAuthorizationCheck(String)

associatedInputParameterInfo

public com.sap.tc.cmi.metadata.ICMIModelClassInfo associatedInputParameterInfo()
Specified by:
associatedInputParameterInfo in interface com.sap.tc.cmi.model.ICMIQuery

associatedResultInfo

public com.sap.tc.cmi.metadata.ICMIModelObjectCollectionInfo associatedResultInfo()
Specified by:
associatedResultInfo in interface com.sap.tc.cmi.model.ICMIQuery

countOf

public long countOf()
Specified by:
countOf in interface com.sap.tc.cmi.model.ICMIQuery

execute

public void execute()
             throws com.sap.tc.cmi.exception.CMIException
Specified by:
execute in interface com.sap.tc.cmi.model.ICMIModelClassExecutable
Specified by:
execute in interface com.sap.tc.cmi.model.ICMIQuery
Throws:
com.sap.tc.cmi.exception.CMIException

getInputParameter

public java.lang.Object getInputParameter()
Specified by:
getInputParameter in interface com.sap.tc.cmi.model.ICMIQuery

setInputParameter

public void setInputParameter(java.lang.Object input)
Description copied from interface: MobileQuery
Set input parameter to use for next execution.

Specified by:
setInputParameter in interface MobileQuery
Parameters:
input - input parameter to use.

getResult

public java.util.Collection getResult()
Specified by:
getResult in interface com.sap.tc.cmi.model.ICMIQuery

isDirty

public boolean isDirty()
Specified by:
isDirty in interface com.sap.tc.cmi.model.ICMIQuery

associatedModel

public com.sap.tc.cmi.model.ICMIModel associatedModel()
Specified by:
associatedModel in interface com.sap.tc.cmi.model.ICMIModelClass

associatedModelClassInfo

public com.sap.tc.cmi.metadata.ICMIModelClassInfo associatedModelClassInfo()
Specified by:
associatedModelClassInfo in interface com.sap.tc.cmi.model.ICMIModelClass