# RHQuery
Inherits from: RHObject :: Paginator
# Class Methods
# Inherited methods
# New
function Frame New(Object prgCtx, String sql, List args={}, Object obj=Undefined)
# Overrides:
New
in class Paginator
# Instance Methods
# Property Methods
Property methods can be accessed with the valueForKey
method.
bury classidentifier classname clone columnnames count currentpagesize cursor endindex errorassoc exists first hash hasnext hasotherpages hasprevious identityhashcode ispagingenabled issortpossible items iterator last methods modelinstance nextpagenumber okassoc pagecount pagenumber pagerange pagesize pagesizes precache previouspagenumber propertymethods queryvalues reset reverse serialize startindex string toexcel values_list
# Inherited methods
assert cacheMethod cacheValueForKey callSuper checkError class classIdentifier className clone currentPageSize deserialize dict endIndex endTrans exists filterIfDefined first hash hasNext hasOtherPages hasPrevious identityHashCode isAccessorMethod isCached isInstanceOf isPagingEnabled isProperty isPropertyMethod last methods modelInstance nextPageNumber pageCount pageNumber pageRange pageSize pageSizes pluck precache prepareForReuse previousPageNumber propertyMethods removeFromCache reset resetCache respondsTo serialize setCacheValueForKey setLimit setObject setOffset setPageNumber setPageSize setPaging setSort setValueForKey setValueForKeyPath setValues sort startIndex startTrans string super toExcel valueForKey valueForKeyPath
# bury
function Frame bury()
# columnNames
function List columnNames()
# Overrides:
columnNames
in class Paginator
# count
function Integer count()
Based on .fetch() but wrapped to apply a count.
# Overrides:
count
in class Paginator
# cursor
function Object cursor()
# extra
function Frame extra(Dynamic where=Undefined, Dynamic value=Undefined)
# filter
function Frame filter(String key, String op, Dynamic value=Undefined, Dynamic extra=Undefined)
# Overrides:
filter
in class Paginator
# fixdbfieldcase
function String fixdbfieldcase(String dbfieldname)
# isSortPossible
function Boolean isSortPossible()
# items
function Dynamic items()
# Overrides:
items
in class Paginator
# iterator
function Frame iterator()
# Overrides:
iterator
in class Paginator
# join
function Frame join(String joinString)
# keyToDBFieldname
function String keyToDBFieldname(String key, Boolean prefix=true)
# keyToDBFieldnameNoPrefix
function String keyToDBFieldnameNoPrefix(String key)
# max
function Dynamic max(String fieldName, Dynamic defaultValue=Undefined)
# min
function Dynamic min(String fieldName, Dynamic defaultValue=Undefined)
# order_by
function Frame order_by(Dynamic fieldNames)
This function exists to be compatible with the sort filter in templates.
01.05.17 - Changed to stop appending sort criteria. Calling this again will clobber previous sort criteria. Also moved the evaluation of the SQL to _orderByClause().
# Overrides:
order_by
in class Paginator
# queryValues
function List queryValues()
# resetSubclass
function Void resetSubclass()
# Overrides:
resetSubclass
in class Paginator
# reverse
function Frame reverse()
# setOrderBy
function Frame setOrderBy(Dynamic fieldNames)
# setQueryOrderBy
function Frame setQueryOrderBy(String orderByQuery)
This function accepts the raw "order by" clause for the underlying query. It must be prepended with the database keywords "order by".
This is useful in situations where a custom sort is required. See RHCore.RHNode.ancestors() for a use case.
# setQueryValues
function Frame setQueryValues(List values)
# setSQL
function Frame setSQL(String sql)
# sortCustom
function Frame sortCustom(String fieldName, List items)
# sql
function String sql(String queryField="*", Boolean includeOrderBy=true)
# sum
function Dynamic sum(String fieldName, Dynamic defaultValue=Undefined)
# toCSV
function String toCSV(String sep=";")
# values_list
function List values_list(String fieldName=.pkFieldName(), Boolean distinct=true)
This function does not respect the order_by clause when using distinct.
# Overrides:
values_list
in class Paginator
← RHPrimaryKey RHRecMan →