> For the complete documentation index, see [llms.txt](https://bxorm.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bxorm.ortusbooks.com/release-history/whats-new-1.7.3.md). Agents can also search and read this documentation through its [MCP server](https://bxorm.ortusbooks.com/~gitbook/mcp).

# What's New in 1.7.3

What's new in bx-orm 1.7.3, HQL through the query component and typed values from forms and URLs

bx-orm 1.7.3 is a fix release for the 1.x line (Hibernate 5). It lets the query component and `queryExecute()` run HQL, and stops typed properties from failing when their value arrives as a string, such as an id from a form or a URL. There are no breaking changes. Update the module and your code keeps working.

```bash
box install bx-orm@1.7.3
```

## HQL in the Query Component and queryExecute()

[BLMODULES-306](https://ortussolutions.atlassian.net/browse/BLMODULES-306)

`<bx:query>` (`<cfquery>` in CFML templates) and `queryExecute()` now run HQL when you set `dbtype="hql"`. They return the same result as [ORMExecuteQuery](https://bxorm.ortusbooks.com/reference/built-in-functions/ormexecutequery.md): an array of entities, or an array of rows for a projection. Before 1.7.3 the `dbtype` was ignored, so the HQL ran as SQL against the default datasource and returned a query or a SQL error.

```html
<bx:query name="toyotas" dbtype="hql">
    FROM Auto WHERE make = <bx:queryparam value="#form.make#" sqltype="varchar">
</bx:query>
```

```js
var toyotas = queryExecute(
    "FROM Auto WHERE make = :make",
    { make: "Toyota" },
    { dbtype: "hql" }
);
```

* `<bx:queryparam>` (`<cfqueryparam>`) in the body binds a positional parameter. With a `sqltype` (`cfsqltype`) the value is cast first, and `list="true"` binds a list for `IN ( ... )`.
* `params` binds named (struct) or positional (array) parameters, as in `ORMExecuteQuery()`.
* `ormoptions` takes the `ORMExecuteQuery()` [options](https://bxorm.ortusbooks.com/usage/querying.md#options), such as `maxResults`, `offset`, `readOnly` and `unique`. `maxrows`, `timeout` and `datasource` apply too.
* `result` gets a struct with `sql` (the HQL), `recordCount`, `executionTime` and `cached`.

Without `dbtype="hql"`, both run SQL exactly as before. See [HQL in the Query Component](https://bxorm.ortusbooks.com/usage/querying.md#hql-in-the-query-component-and-queryexecute).

## Typed Values from Forms and URLs

[BLMODULES-307](https://ortussolutions.atlassian.net/browse/BLMODULES-307)

Form and URL values are always strings, and BoxLang arithmetic produces decimals. Before 1.7.3, binding one of them to a typed property failed, because Hibernate 5 binds values as they are:

```
class java.lang.String cannot be cast to class java.lang.Integer
```

bx-orm now converts each value to the property's mapped type before Hibernate binds it, so this code works:

```js
// A string id from the URL
var user = entityLoad( "User", { id: url.id }, true );

// Named, positional and list parameters
var users  = ormExecuteQuery( "FROM User WHERE id = :id", { id: url.id } );
var admins = ormExecuteQuery( "FROM User WHERE id IN (:ids)", { ids: listToArray( form.ids ) } );
```

```html
<!--- An untyped queryparam in an HQL query --->
<bx:query name="user" dbtype="hql">
    FROM User WHERE id = <bx:queryparam value="#url.id#">
</bx:query>
```

The conversion covers `entityLoad()` filters and every HQL parameter: `ORMExecuteQuery()`, `dbtype="hql"` queries, untyped `<bx:queryparam>` and list parameters.

| Property type                                            | Accepted values                                                                     |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Whole numbers (`integer`, `long`, `short`, `biginteger`) | Numbers and numeric strings with no fractional part: `"1"`, `" 1 "`, `"1.0"`, `1.0` |
| Decimals (`double`, `float`, `bigdecimal`)               | Numbers and numeric strings: `"2.5"`                                                |
| `boolean`                                                | Booleans, numbers and boolean strings: `"true"`, `"yes"`, `0`                       |
| `string`                                                 | Numbers and booleans                                                                |

A value that does not fit the type is passed to Hibernate unchanged and fails as before. For example, `"1.5"` is never truncated to `1` for an integer property, and `"abc"` still fails. `entityLoadByPK()` and a `<bx:queryparam>` with a `sqltype` already converted their values and work as before.

## Also in 1.7

If you are coming from an earlier 1.x release, these arrived earlier in the 1.7 line:

* **1.7.2**:
  * value collections with `fieldtype="collection"` (arrays and structs of simple values in their own table);
  * ORM observability events (`onORMQuery`, `onORMFlush`, `onORMException`) and Hibernate statistics. See [Observability](https://bxorm.ortusbooks.com/usage/observability.md).
* **1.7.1**: `entityToQuery()` no longer adds always-`null` columns for relationship properties. See [Entities as Queries](https://bxorm.ortusbooks.com/usage/queries.md).
* **1.7.0**:
  * [EntityIsAttached](https://bxorm.ortusbooks.com/reference/built-in-functions/entityisattached.md);
  * raw Hibernate properties through `hibernateProperties` and `ormConfig`. See [Custom Hibernate Config](https://bxorm.ortusbooks.com/getting-started/configuration/custom-hibernate-config.md);
  * SQLite support;
  * the `uuid2` generator.

The full list is in the [1.x release notes](https://bxorm.ortusbooks.com/release-history/1x.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://bxorm.ortusbooks.com/release-history/whats-new-1.7.3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
