Skip Headers

# Proxy Indirection

Previous

Next

Introduced in JDK 1.3, the Java class `Proxy` lets you to use dynamic proxy objects as place-holders for a defined interface. Certain TopLink mappings (see Table: Mapping Support for Indirection) can be configured to use proxy indirection, which gives you the benefits of TopLink indirection without the need to include TopLink classes in your domain model. Proxy indirection is to one-to-one relationship mappings as indirect containers are to collection mappings.

To use proxy indirection, your domain model must satisfy all of the following criteria:

- The target class of the one-to-one relationship must implement a public interface.

- The one-to-one attribute on the source class must be of the `interface` type.

- If you employ method accessing ("Configuring Method Accessing"), then the getter and setter methods must use the interface.

Before using proxy indirection, be aware of the restrictions it places on how you use the unit of work (see "Proxy Indirection Restrictions").

To configure proxy indirection, you can use TopLink Workbench (see "Using TopLink Workbench") or Java in an amendment method (see "Configuring Proxy Indirection").