pageContext.undefinedScope().setEL(CFQUERY,sct);
}
private Object executeORM(SQL sql, int returnType, Struct ormoptions) throws PageException {
ORMSession session=ORMUtil.getSession(pageContext);
// params
SQLItem[] _items = sql.getItems();
Array params=new ArrayImpl();
for(int i=0;i<_items.length;i++){
params.appendEL(_items[i]);
}
// query options
if(maxrows!=-1 && !ormoptions.containsKey(MAX_RESULTS)) ormoptions.setEL(MAX_RESULTS, new Double(maxrows));
if(timeout!=-1 && !ormoptions.containsKey(TIMEOUT)) ormoptions.setEL(TIMEOUT, new Double(timeout));
/* MUST
offset: Specifies the start index of the resultset from where it has to start the retrieval.
cacheable: Whether the result of this query is to be cached in the secondary cache. Default is false.
cachename: Name of the cache in secondary cache.
*/
Object res = session.executeQuery(pageContext,sql.getSQLString(),params,unique,ormoptions);
if(returnType==RETURN_TYPE_ARRAY_OF_ENTITY) return res;
return session.toQuery(pageContext, res, null);
}