Implementing Proxy Indirection in Java

To enable proxy indirection in Java code, use the following API for ObjectReferenceMapping:

The following code example illustrates using proxy indirection.

// Define the 1:1 mapping, and specify that Proxy Indirection should be used
OneToOneMapping addressMapping = new OneToOneMapping();
addressMapping.setAttributeName("address");
addressMapping.setReferenceClass(AddressImpl.class);
addressMapping.setForeignKeyFieldName("ADDRESS_ID");
addressMapping.setSetMethodName("setAddress");
addressMapping.setGetMethodName("getAddress");
addressMapping.useProxyIndirection();
descriptor.addMapping(addressMapping);
. . .


Related Topics

Working with Indirection
Understanding Indirection

Using Value Holder Indirection
Specifying Indirection
Changing Java Classes to Use Indirection
Specifying Transparent Indirection

 

Copyright © 1997, 2004, Oracle. All rights reserved.