CMI documentation

com.sap.tc.cmi.model
Interface ICMIQuery

All Superinterfaces:
ICMIModelClass, ICMIModelClassExecutable

public interface ICMIQuery
extends ICMIModelClassExecutable, ICMIModelClass

represents a query in a Model. This type can be called, extended or implemented by applications or frameworks using CMI.

Version:
$Id: //tc/CommonModelInterface/630_VAL_REL/src/_cmi_api/java/com/sap/tc/cmi/model/ICMIQuery.java#1 $

Field Summary
static java.lang.String ROLE_NAME_INPUT_PARAMETER
          Constant string for implicit inputParamter relation role.
static java.lang.String ROLE_NAME_RESULT
          Constant string for implicit result relation role.
 
Method Summary
 ICMIModelClassInfo associatedInputParameterInfo()
          returns the metadata for the model class holding the input parameters or null if no metadata is available
 ICMIModelObjectCollectionInfo associatedResultInfo()
          returns the metadata for the model object collection holding the query result or null if no such metadata is available
 long countOf()
          returns the number all matching model objects for the parameterized query independent of the fetch size.
 void execute()
          executes the query.
 java.lang.Object getInputParameter()
          Returns the model object which holds the query input parameters or null if the query doesn't support parameters.
 java.util.Collection getResult()
          returns the collection which matches the query.
 boolean isDirty()
          returns true if the query is not yet executed or the result is not consistent with input parameters any more and false otherwise.
 
Methods inherited from interface com.sap.tc.cmi.model.ICMIModelClass
associatedModel, associatedModelClassInfo
 

Field Detail

ROLE_NAME_INPUT_PARAMETER

public static final java.lang.String ROLE_NAME_INPUT_PARAMETER
Constant string for implicit inputParamter relation role. If a query implementation also implements ICMIGenericModelClass, it should return the input parameter as a result to
   getRelatedModelObject(ROLE_NAME_INPUT_PARAMETER);
 
An implementation is free to additionally accept its own role name or names.

ROLE_NAME_RESULT

public static final java.lang.String ROLE_NAME_RESULT
Constant string for implicit result relation role. If a query implementation also implements ICMIGenericModelClass, it should return the query result as a result to
   getRelatedModelObject(ROLE_NAME_RESULT);
 
An implementation is free to additionally accept its own role name or names.
Method Detail

execute

public void execute()
             throws CMIException
executes the query. When called immediately after query execution isDirty() will return false.
Specified by:
execute in interface ICMIModelClassExecutable
See Also:
ICMIModelClassExecutable.execute()

countOf

public long countOf()
returns the number all matching model objects for the parameterized query independent of the fetch size. If this is not supported, the method returns -1; if countOf() is too big or too expensive to calculate Long.MAX_VALUE will be returned as long.

isDirty

public boolean isDirty()
returns true if the query is not yet executed or the result is not consistent with input parameters any more and false otherwise.

getInputParameter

public java.lang.Object getInputParameter()
Returns the model object which holds the query input parameters or null if the query doesn't support parameters. The returned object must be compliant with the CMI. That means it must be an instance of a generic Model Class (therefore implementing ICMIGenericModelClass or an instance of a typed Model Class (therefore supporting typed accessor methods etc.)

getResult

public java.util.Collection getResult()
returns the collection which matches the query. The collection may or may not be a ICMIModelObjectCollection.

associatedInputParameterInfo

public ICMIModelClassInfo associatedInputParameterInfo()
returns the metadata for the model class holding the input parameters or null if no metadata is available

associatedResultInfo

public ICMIModelObjectCollectionInfo associatedResultInfo()
returns the metadata for the model object collection holding the query result or null if no such metadata is available

CMI documentation

Copyright © 2002 SAP AG. Automatically generated Thu Mar 3 2005, 21:53