Skip Headers

# Configuring Named Query Options

Previous

Next

Use this tab to configure additional options for the query.

Use the following information to complete each field on the tab:

Field | Description
--- | ---
Refresh Identity Map Results Footref 2 | Refreshes the attributes of the object(s) resulting from the query. If cascading is used, the private parts of the objects will also be refreshed.
Cache Statement Foot 1 | Caches the prepared statements. This requires full parameter binding as well (see Bind Parameters).
Bind Parameters Footref 1 | Binds all of the query's parameters.

Cache Usage Foot 2

Selects how TopLink should use the session cache when a query is executed:

- Use descriptor settings

- Do not check cache

- Check cache by exact primary key

- Check cache by primary key

- Check cache then database

- Check cache only

- Conform results in unit of work

For more information, see the following:

- "Configuring Cache Usage for In-Memory Queries".

- "Configuring Unit of Work Conforming at the Descriptor Level"

In Memory Query Indirection Footref 2

Selects how TopLink should handle indirection when an in-memory or conforming query is executed:

- Throw indirection exception–if this object uses indirection and indirection has not been triggered, TopLink will throw an exception.

- Trigger indirection–if this object uses indirection and indirection has not been triggered, TopLink will trigger indirection.

- Ignore exception return conformed–returns conforming if an untriggered value holder is encountered. That is, you expect results from the database to conform, and an untriggered value holder is taken to mean that the underlying attribute has not changed.

- Ignore exception return not conformed–returns not conforming if an untriggered value holder is encountered.

For more information, see the following:

- "Handling Exceptions Resulting From In-Memory Queries".

- "Indirection".

Return Choice Foot 3

Selects how TopLink should handle `ReportQuery` results:

- Result collection–return `ReportQuery` results as a `Collection` of `ReportQueryResult` objects.

- Single result–return only the first `ReportQueryResult` object (not wrapped in a `Collection` or `Map`). Use this option if you know that the `ReportQuery` returns only one row.

- Single value–return only a single value. Use this option if you know that the `ReportQuery` returns only one row that contains only one attribute.

- Single attribute–return only a single `Collection` of values. If the query returns multiple rows, but each row only has a single attribute, this option will return a `Collection` of values, instead of a `Collection` of `ReportQueryResults`.

For more information, see "Collection Query Results".

Retrieve Primary Keys Footref 3

Selects whether or not TopLink retrieves the primary key values within each result. You can use the primary keys to retrieve the real objects.

- None–do not retrieve primary keys

- All–retrieve primary keys for each object read;

- First–return only the first primary key value (in the case of a composite primary key). This can be used if you just want to know if something exists or not, but do not really care about the value.

Footnote 1 For more information, see "Parameterized SQL (Binding) and Prepared Statement Caching".

Footnote 2 For `ReadObjectQuery` and `ReadAllQuery` queries only.

Footnote 3 For `ReportQuery` queries only.

Click Advanced to configure additional options. See "Configuring Named Query Advanced Options".

See Also

  Configuring Named Queries at the Descriptor Level