Understanding Indirection
Indirection is available for transformation mappings and for direct collection, one-to-one, one-to-many, and many-to-many relationship mappings.
You can enable or disable indirection for each mapping individually. By default, indirection is enabled for relationship mappings and disabled for transformation mappings. Indirection should be enabled only for transformation mappings if the execution of the transformation method is a resource-intensive task, such as accessing the database.
- Indirection disabled: An indirection object is not used. Whenever an object is retrieved from the database, all the objects associated with it through the mapping are also read.
- Indirection enabled: A value holder is used to represent the entire relationship. When an object is retrieved from the database, a value holder is created and stored in the attribute corresponding to the mapping. The first time the value holder is accessed, it retrieves the related object from the database.
In addition to this standard version of indirection, collection mappings (direct collection, one-to-many, and many-to-many) can use indirect containers.
Related Topics
Working with Indirection
Understanding Indirection
Using Value Holder Indirection
Specifying Indirection
Changing Java Classes to Use Indirection
Specifying Transparent Indirection
Implementing Proxy Indirection in Java
Copyright © 1997, 2004, Oracle.
All rights reserved.