ColdFusion 9.0 Resources |
ORMExecuteQuery(hql, namedparams [, unique] [, queryOptions])DescriptionThis type of ORMExecuteQuery lets you pass named parameters to the query. The placeholder for the parameter must be a name and must start with ":" as in ":age" or ":id". The values to the names must be passed as key-value pairs.In addition, you can specify several options to control the behavior of retrieval using queryOptions:
Note: Maxresults and timeout
are used for pagination.
CategoryExampleTo retrieve employee details of all employees whose reside in USA and are also citizens of USA: <cfset USEmployees = ORMExecuteQuery("from Employee where country=:country and citizenship=:country", {country='USA'})> <cfset orderDetail = ORMExecuteQuery("from Orders where OrderID=:orderid and ProductID=:productid", {orderid=1, productid=901}, true)> |