For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
ColdFusion Help  / 

HQLMethods

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

The Hibernate Query Language (HQL) methods return a single or multi-dimensional array of values or entities, based on what the HQL query returns. If you are sure that only one record exists that matches this filter criteria, specify unique=true so that a single entity is returned instead of an array. 
If unique=true and multiple records are returned, then an exception is thrown.

Note: entityname and properties used in HQL are case sensitive.

The following HQL methods are available:

  • ORMExecuteQuery(hql, [,unique][, queryoptions])
  • ORMExecuteQuery(hql, params [,unique] [,queryOptions])
  • ORMExecuteQuery(hql, namedparams [, unique] [, queryOptions])

ORMExecuteQuery(hql, [,unique] [, queryoptions])

Description

Runs HQL on the default data source specified for the application. You can specify several options to control the behavior of retrieval using queryOptions:

  • ignorecase: Ignores the case of sort order when you set it to true. Use this option only when you specify the sortorder parameter.
  • maxResults: Specifies the maximum number of objects to be retrieved.
  • 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.
  • timeout: Specifies the timeout value (in seconds) for the query

    Note: Maxresults and timeout are used for pagination.

Category

ORM functions

Example
<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})>

ORMExecuteQuery(hql, params [,unique] [,queryOptions])

Description

This type of ORMExecuteQuery lets you pass parameters to the query. Use '?' (question mark) as the placeholder for the parameters. The values to the parameters must be passed as an array to params.In addition, you can specify several options to control the behavior of retrieval using queryOptions:

  • ignorecase: Ignores the case of sort order when you set it to true. Use this option only when you specify the sortorder parameter.
  • maxResults: Specifies the maximum number of objects to be retrieved.
  • 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.
  • timeout: Specifies the timeout value (in seconds) for the query

    Note: Maxresults and timeout are used for pagination.

Category

ORM functions

Example
<cfset employees = ORMExecuteQuery("from Employee where age > ?", [40])> 
<cfset employeeObj = ORMExecuteQuery("from Employee where EmployeeID=?", [1], true)> 
<cfset employees = ORMExecuteQuery("from Employee where age > ? and age < ?", [40, 80])>

ORMExecuteQuery(hql, namedparams [, unique] [, queryOptions])

Description

This 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:

  • ignorecase: Ignores the case of sort order when you set it to true. Use this option only when you specify the sortorder parameter.
  • maxResults: Specifies the maximum number of objects to be retrieved.
  • 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.
  • timeout: Specifies the timeout value (in seconds) for the query

    Note: Maxresults and timeout are used for pagination.

Category

ORM functions

Example

To 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)>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices