com.arsdigita.metadata
Class DynamicAssociation

java.lang.Object
  extended bycom.arsdigita.metadata.DynamicElement
      extended bycom.arsdigita.metadata.DynamicAssociation

public class DynamicAssociation
extends com.arsdigita.metadata.DynamicElement

This class provides support to create dynamic two-way associations between any object types. Link attributes will eventually be supported.

Version:
$Revision: #19 $ $Date: 2004/04/07 $
Author:
Patrick McNeill

Field Summary
static String versionId
           
 
Constructor Summary
DynamicAssociation(String modelName, String objectType1, String property1, int multiplicity1, String objectType2, String property2, int multiplicity2)
          Creates a new DynamicAssociation.
DynamicAssociation(String modelName, String objectType1, String property1, String objectType2, String property2)
          Load a pre-existing DynamicAssociation for editing.
 
Method Summary
 Property getProperty1()
           
 Property getProperty2()
           
 Association save()
          Saves this DynamicAssociation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

DynamicAssociation

public DynamicAssociation(String modelName,
                          String objectType1,
                          String property1,
                          String objectType2,
                          String property2)
Load a pre-existing DynamicAssociation for editing. Note this is rather useless right now since we don't support link attributes.

Parameters:
modelName - the fully-qualified model name for this association
objectType1 - the fully-qualified name of the datatype of the first property
property1 - the name of the first property
objectType2 - the fully-qualified name of the datatype of the second property
property2 - the name of the second property
Throws:
PersistenceException - if either ObjectType is null or if they do not contain the correct property

DynamicAssociation

public DynamicAssociation(String modelName,
                          String objectType1,
                          String property1,
                          int multiplicity1,
                          String objectType2,
                          String property2,
                          int multiplicity2)
Creates a new DynamicAssociation. The two named properties will be created with the given datatypes and multiplicities.

Parameters:
modelName - the fully-qualified model name for this association
objectType1 - the fully-qualified name of the datatype of the first property
property1 - the name of the first property
objectType2 - the fully-qualified name of the datatype of the second property
property2 - the name of the second property
Throws:
PersistenceException - if either ObjectType is null or if they do not contain the correct property
Method Detail

getProperty1

public Property getProperty1()

getProperty2

public Property getProperty2()

save

public Association save()
Saves this DynamicAssociation. If it's a new Association, the table will be created. Editing really makes no sense right now, so it won't do a whole lot but resave the PDL. The Properties are also added to the object types, facilitating retrieval of the association.

Returns:
the newly created Association


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC