To enable proxy indirection in Java code, use the following API for ObjectReferenceMapping:
Example 5-4 Proxy indirection Example
The following code example illustrates using proxy indirection.
// Define the 1:1 mapping, and specify that Proxy Indirection should be usedOneToOneMapping 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);. . .
Copyright © 1997, 2004, Oracle. All rights reserved.