|
Cool documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
interface of a Query at runtime, a Query allows searching for Aspects for given
search parameters and given input Keys.
An example using a Query could be:
IQuery query = serviceModule.createQuery("QUERY_NAME");
IStructure inputParameter = query.getInputParameter();
// setting input parameter
inputParameter.setAttributeValue("NAME1", "R*");
..
query.execute();
// now the result
IAspect aspect = query.getResult();
..
Additionally Query implements ICMIQuery and ICMIModelClassExecutable.
This is necessary to use a Query from Web Dynpro. Web Dynpro framework only knows this interfaces and uses the implicit
relations inputParameter and result for setting parameters and getting the
result of the Query.
A Query is the root of a cache. That means that all Aspects which were reached by navigation from this Query result,
are internally hold in a cache until this cache is invalidated implicitly or explicitly with
method invalidate().
Implicitly could be a new execute() of this Query or changing services (insert, update, delete) for an Aspect in the
cache.
| Field Summary | |
static java.lang.String |
BT
constant string value for operator BETWEEN in select options structure |
static java.lang.String |
EQ
constant string value for operator EQUAL (=) in select options structure |
static java.lang.String |
GE
constant string value for operator GREATER OR EQUAL (>=) in select options structure |
static java.lang.String |
GT
constant string value for operator GREATER (>) in select options structure |
static java.lang.String |
INPUT_PARAMETER
constant string for implicit inputParamter relation role |
static java.lang.String |
LE
constant string value for operator LESS EQUAL (<=) in select options structure |
static java.lang.String |
LT
constant string value for operator LESS (<) in select options structure |
static java.lang.String |
NE
constant string value for operator NOT EQUAL (!=) in select options structure |
static java.lang.String |
RESULT
constant string for implicit result relation role |
static java.lang.String |
SELECT_OPTIONS
constant string for implicit select options relation role |
| Method Summary | |
IStructure |
createSelectOption(java.lang.String fieldName)
creates a select option for this Query and the given fieldName. |
IStructure |
createSelectOption(java.lang.String fieldName,
java.lang.String operator,
java.lang.String from,
java.lang.String to)
creates a select option for this Query and the given fieldName. |
void |
execute()
Executes this Query by calling corresponding ServiceManager service. |
IQueryDescriptor |
getDescriptor()
returns meta data of this Query |
IKeyList |
getInputKeyList()
returns the input KeyList, which you can use as input of this Query to define a subset of the result. |
IStructure |
getInputParameterStructure()
returns the search parameter structure of this Query or throws an UnsupportedOperationException, if
this Query has no input parameter. |
IAspect |
getResultAspect()
returns the result of this Query |
IStructureList |
getSelectOptions()
returns a list of all currently set select options for this Query. |
void |
invalidate()
invalidates this Query and all Aspects, which were created by navigation from
Query result. |
void |
setSortingCriteria(SortingCriteria sorting)
set SortingCriteria for this Query. |
| Field Detail |
public static final java.lang.String INPUT_PARAMETER
public static final java.lang.String SELECT_OPTIONS
public static final java.lang.String RESULT
public static final java.lang.String EQ
public static final java.lang.String NE
public static final java.lang.String GT
public static final java.lang.String GE
public static final java.lang.String LT
public static final java.lang.String LE
public static final java.lang.String BT
| Method Detail |
public void execute()
Query by calling corresponding ServiceManager service.Before this is done, eventually existing result and cache are invalidated.
Note that this execute is propagated to the backend only when the message queue is flushed.
public IQueryDescriptor getDescriptor()
QueryQuerypublic IAspect getResultAspect()
QueryQuerypublic IStructure getInputParameterStructure()
Query or throws an UnsupportedOperationException, if
this Query has no input parameter.Querythrows - an UnsupportedOperationException, if this Query has no input parameter.public IKeyList getInputKeyList()
Query to define a subset of the result.
incomplete Keys in this KeyList are ignored.Query to define a subset of the result.public void setSortingCriteria(SortingCriteria sorting)
Query.sorting - the sorting criteria for this Querypublic IStructureList getSelectOptions()
Query.
A Structure(select option item) in this list contains the following fields:
"FIELDNAME" ,"OPTION", "LOW", "HIGH"
To add a select option to this list, the user must use the method createSelectOption(), removing of
entries is done with list methods like remove() and clear().
Example:
...
// create select options for a Query
IStructure nameOption = query.createSelectOption("NAME");
nameOption.setAttributeValue("OPTION",IQuery.BT);
nameOption.setAttributeValue("LOW","M*");
nameOption.setAttributeValue("HIGH","OTTO");
...
query.execute();
...
// remove select option
query.getSelectOptions().remove(nameOption);
quere.getInputParameterStructure().setAttributeValue("NAME","A*");
query.execute();
...Querypublic IStructure createSelectOption(java.lang.String fieldName)
Query and the given fieldName.
the method checks, if there is no value set for corresponding field in inputParameter structurefieldName - the name of the field, where the select options are set.java.lang.IllegalArgumentException - if fieldName is no fieldName from inputStructure or a value is set for inputStructure
public IStructure createSelectOption(java.lang.String fieldName,
java.lang.String operator,
java.lang.String from,
java.lang.String to)
Query and the given fieldName.
The given attributes are set to the corresponding Structure fields. If no "to" value is neeeded for
operator, "to" must be set to null.
the method checks, whether there is no value set for corresponding field in inputParameter structurefieldName - the name of the field, where the select options are set.operator - the operator, possible values are EQ, NE, GT, GE, LE, LT, BTfrom - the value or from value, if it is a range, for the select optionto - the to value, if it is a range, or null, if not for the select optionjava.lang.IllegalArgumentException - if fieldName is no fieldName from inputStructure or a value is set for inputStructurepublic void invalidate()
Query and all Aspects, which were created by navigation from
Query result.
invalidating the query doesn't mean, that the Query object itself isn't valid,
but the result of the query with its Aspect tree is no more valid.
You can set the input parameters and input keys a new, and then execute this Query again.
|
Cool documentation | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||