First page Back Continue Last page Text

oracle adf workshop


Traversing Associations

By default, JDeveloper generates accessor methods for each association: a getter and a setter in the destination to retrieve the source, and a getter in the source to get the destination. These accessor methods are generated in the entity object classes on either end of the association. The client code does not access the entity object code directly, so you could use these methods in application module service methods or in programmatic view object or entity object code.

Example of Accessor Methods: The entities PersonEO and OrderEO are linked by the association PersonEOToOrderEO. JDeveloper generates two methods in (the destination entity object) for traversing the association from destination to source:

public PersonEOImpl getPersonEO(): Get the department to which this employee belongs.

public void setPersonEO(PersonEOImpl value): Set the value of the department to which this employee belongs.

To retrieve an attribute’s value from the source entity while in the destination entity, use the get<Source>() method plus the get() method for the attribute that you want to retrieve, as shown in the above example for retrieving the e-mail address from the PersonEO entity. The PersonEO entity has only the getOrderEO accessor, with no setter.