public class DataRequest extends FSRParent
//indicate that data service capability is being used
loginEnv.getUsedCapabilities().add(AISClientCapability.DATA_SERVICE);
//created the data request
DataRequest children = new DataRequest(loginEnv);
//it is a count type
children.setDataServiceType(DataRequest.TYPE_COUNT);
//over the F0150 table
children.setTargetName("F0150");
//indicate table type
children.setTargetType(DataRequest.TARGET_TABLE);
//create a query
Query childrenQ = new Query(loginEnv);
//set it to do a find
childrenQ.setAutoFind(true);
//match all conditions
childrenQ.setMatchType(Query.MATCH_ALL);
//first condition is value of ES in the OSTP column
childrenQ.addStringCondition("F0150.OSTP", StringOperator.EQUAL(), "ES");
//second condition is value of 7500 in the PA8 column
childrenQ.addStringCondition("F0150.PA8", StringOperator.EQUAL(), "7500");
//set the query to the request
children.setQuery(childrenQ);
//send the request in, indicatging the data service uri
String response = JDERestServiceProvider.jdeRestServiceCall(loginEnv, children, JDERestServiceProvider.POST_METHOD, JDERestServiceProvider.DATA_SERVICE_URI);
//marchal the response to the CountResponse class
CountResponse childrenCount = loginEnv.getObjectMapper().readValue(response, CountResponse.class);
//print out the count
System.out.println(childrenCount.getCount());
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TARGET_TABLE |
static java.lang.String |
TARGET_VIEW |
static java.lang.String |
TYPE_BROWSE |
static java.lang.String |
TYPE_COUNT |
| Constructor and Description |
|---|
DataRequest(LoginEnvironment loginEnv) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDataServiceType() |
java.lang.String |
getTargetName() |
java.lang.String |
getTargetType() |
void |
setDataServiceType(java.lang.String dataServiceType) |
void |
setTargetName(java.lang.String targetName) |
void |
setTargetType(java.lang.String targetType) |
addFSREvent, getFindOnEntry, getFormActions, getFormServiceDemo, getMaxPageSize, getQuery, getReturnControlIDs, setFindOnEntry, setFormActions, setFormServiceDemo, setMaxPageSize, setQuery, setReturnControlIDsgetDeviceName, getEnvironment, getJasserver, getPassword, getPsToken, getRole, getSsoUniqueId, getToken, getUsername, isAliasNaming, isSsoEnabled, setAliasNaming, setDeviceName, setEnvironment, setJasserver, setPassword, setPsToken, setRole, setSsoEnabled, setSsoUniqueId, setToken, setUsernamepublic static final java.lang.String TARGET_TABLE
public static final java.lang.String TARGET_VIEW
public static final java.lang.String TYPE_BROWSE
public static final java.lang.String TYPE_COUNT
public DataRequest(LoginEnvironment loginEnv) throws CapabilityException
CapabilityExceptionpublic void setTargetName(java.lang.String targetName)
public java.lang.String getTargetName()
public void setTargetType(java.lang.String targetType)
public java.lang.String getTargetType()
public void setDataServiceType(java.lang.String dataServiceType)
public java.lang.String getDataServiceType()
Copyright © 2015 Oracle and/or its affiliates. All Rights Reserved.