...
Retrieving a CCS QueryDefinition instance
The TableQuery (e.g. CustomerQuery) can be used to formulate a CCS GetDatainstance used to retrieve data through the CCSBE interfaces.
Code Block | ||
---|---|---|
| ||
USING Ccs.BusinessLogic.* FROM PROPATH.
USING Ccs.Common.* FROM PROPATH.
USING Consultingwerk.Framework.* FROM PROPATH.
USING Consultingwerk.OERA.* FROM PROPATH.
USING Consultingwerk.OERA.Ccs.* FROM PROPATH.
USING Consultingwerk.SmartComponentsDemo.OERA.Model.* FROM PROPATH.
USING Consultingwerk.SmartComponentsDemo.OERA.Sports2000.* FROM PROPATH.
USING Consultingwerk.Util.* FROM PROPATH.
DEFINE VARIABLE oQuery AS CustomerQuery NO-UNDO .
DEFINE VARIABLE oRequest AS IGetDataRequest NO-UNDO .
DEFINE VARIABLE oEntity AS Ccs.BusinessLogic.IBusinessEntity NO-UNDO .
{Consultingwerk/SmartComponentsDemo/OERA/Sports2000/dsCustomer.i}
/* Simulate CCS Framework Bootstrap */
Ccs.Common.Application:ServiceManager = NEW CcsServiceManager() .
oQuery = NEW CustomerQuery() .
oQuery:Or (NEW CustomerQuery ():Country:Eq("USA"):And:City:Begins("Bost"),
NEW CustomerQuery ():Country:Eq("DE"):And:City:Begins("Colog"))
:And:CreditLimit:Lt(1000).
oRequest = NEW GetDataRequest(NEW GetDataTableRequest("eCustomer",
oQuery:ToQueryEntry(),
0)) .
oEntity = CAST (Ccs.Common.Application:ServiceManager:getService(GET-CLASS (CustomerBusinessEntity)),
Ccs.BusinessLogic.IBusinessEntity) .
oEntity:getData (oRequest,
OUTPUT DATASET dsCustomer) .
FOR EACH eCustomer:
DISPLAY CustNum Country City CreditLimit .
END. |