Previous Page | Next Page

Understanding com.sas.metadata.remote Interfaces and Classes

Working with the AssociationList Class

The AssociationList class provides methods to manage the associations between metadata objects. A SAS Open Metadata Interface metadata object instance is defined by its properties. Attributes describe the characteristics of the object instance, and associations describe the object's relationships with other object instances. All associations on the SAS Metadata Server are bidirectional. An AssociationList object is required to represent each association name.

An AssociationList object is created by submitting a getAssociationName method on the metadata object on the SAS Metadata Server. When using this method, substitute a valid association name for AssociationName. The following is an example of a getAssociationName request:

AssociationList columns = tableObject.getColumns();
columns.add(columnObject);

Whenever you create an AssociationList object for a specified association name, the SAS Java Metadata Interface automatically creates an AssociationList object that represents the reverse association. For example, for each column listed by the getColumns method, the SAS Java Metadata Interface creates AssociationList objects in the object store representing the reverse association. So, for the preceding example, the columnObject.setTable(tableObject) is performed for the user by the SAS Java Metadata Interface.

If you want to clear the contents of an association, you can use the clear method from the AssociationList class. For the preceding example, you would issue the following:

columns.clear();

The clear method removes all Java objects representing both sides of the bidirectional association.

Previous Page | Next Page | Top of Page