# newCriteria

Get a brand new criteria builder object to do criteria queries with (See [ORM:CriteriaBuilder](/criteria-queries/criteria-builder/getting-started.md))

## Returns

* This function returns *coldbox.system.orm.hibernate.CriteriaBuilder*

## Arguments

| Key              | Type    | Required | Default                | Description                                                                |
| ---------------- | ------- | -------- | ---------------------- | -------------------------------------------------------------------------- |
| entityName       | string  | true     | ---                    | The entity name to bind the criteria query to                              |
| useQueryCaching  | boolean | false    | false                  | Do automatic query caching for queries                                     |
| queryCacheRegion | string  | false    | criterias.{entityName} | The queryCacheRegion name property for all queries in this criteria object |
| datasource       | string  | false    |                        | The datasource to use or default it to the application or entity in use    |

## Examples

```javascript
var users = ORMService.newCriteria( entityName="User" )
    .gt( "age", ormService.idCast( 30 ) )
    .isTrue( "isActive" )
    .list( max=30, offset=10, sortOrder="lname" );
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coldbox-orm.ortusbooks.com/base-orm-service/service-methods/criteria-queries/newcriteria.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
