Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: E
- Next: field-name

## fetched-with

Specifies the fetch group configuration for fields and relationships. The `fetched-with` element has different allowed and default subelements based on its parent element and the data types of the fields.

- If there is no `fetched-with` subelement of a cmp-field-mapping, and the data type is not BLOB, CLOB, VARBINARY, LONGVARBINARY, or OTHER, `fetched-with` can have any valid subelement. The default subelement is as follows:

      <fetched-with><default/></fetched-with>

- If there is no `fetched-with` subelement of a cmp-field-mapping, and the data type is BLOB, CLOB, VARBINARY, LONGVARBINARY, or OTHER, `fetched-with` can have any valid subelement except `<default/>`. The default subelement is as follows:

      <fetched-with><none/></fetched-with>

- If there is no `fetched-with` subelement of a cmr-field-mapping, `fetched-with` can have any valid subelement. The default subelement is as follows:

      <fetched-with><none/></fetched-with>

Managed fields are multiple CMP or CMR fields that are mapped to the same column. A managed field can have any `fetched-with` subelement except `<default/>`. For additional information, see Managed Fields.

### Superelements

cmp-field-mapping, cmr-field-mapping (`sun-cmp-mappings.xml`)

### Subelements

The following table describes subelements for the `fetched-with` element.

Table A–44 `fetched-with` Subelements

Element | Required | Description
--- | --- | ---
default | exactly one subelement is required | Specifies that a CMP field belongs to the default hierarchical fetch group, which means it is fetched any time the bean is loaded from a database. Enables prefetching of a CMR field.
level | exactly one subelement is required | Specifies the level number of a hierarchical fetch group.
named-group | exactly one subelement is required | Specifies the name of an independent fetch group.
none | exactly one subelement is required | Specifies that this field or relationship is placed into its own individual fetch group, which means it is loaded from a database the first time it is accessed in this transaction.

- Previous: E
- Next: field-name

- © 2010, Oracle Corporation and/or its affiliates