Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
An interface alias allows an interface to be used to refer to a descriptor instead of the implementation class. This can be useful for classes that have public interface and the applications desire to refer to the class using the public interface. Specifying the interface alias allows any queries executed on a TopLink session to use the interface as the reference class instead of the implementation class.
This section includes information on configuring an interface alias. Interfaces cannot be created in TopLink Workbench, you must add the Java package or class to your TopLink Workbench project before configuring it.
Use the Interface Alias tab to specify a descriptor's alias. Each descriptor can have one interface alias. Use the interface in queries and relationship mappings.
Note: If you use an interface alias, do not associate an interface descriptor with the interface. |
To specify an interface alias, use this procedure:
In the Navigator, select a descriptor.
If the Interface Alias advanced property is not visible for the descriptor, right-click the descriptor and choose Select Advanced Properties > Interface Alias from context menu or from the Selected menu.
In the Interface Alias field, click Browse and select an interface.
To configure a descriptor with an interface alias using Java, create an amendment method (see "Configuring Amendment Methods") and use InterfacePolicy
method addParentInterface
as Example 29-7 shows.