ColdFusion 9.0 Resources |
ORMExecuteQuery(hql, [,unique] [, queryoptions])DescriptionRuns HQL on the default data source specified for the application. You can specify several options to control the behavior of retrieval using queryOptions:
Note: Maxresults and timeout
are used for pagination.
CategoryExample<cfset employees = ORMExecuteQuery("from Employees")> <cfset employees = ORMExecuteQuery("from Employees where age > 40")> <cfset employeeObj = ORMExecuteQuery("from Employees where EmployeeID =1", true)> <cfset firstNameArray = ORMExecuteQuery("select FirstName from Employees")> <cfset numberOfEmps = ORMExecuteQuery("select count(*) from Employees")> <cfset firstName = ORMExecuteQuery("select FirstName from Employees where EmployeeID = 1", true)> <cfset employees = ORMExecuteQuery("from Employees", false, {offset=5, maxresults=10, timeout=5})> |