Class Relationship


  • public class Relationship
    extends java.lang.Object
    Represents a relationship between two datamodels where one set of properties is the primary key, and another set is the foreign key.
    • Constructor Detail

      • Relationship

        public Relationship​(java.util.List<IProperty> primaryProperties,
                            java.util.List<IProperty> foreignProperties)
    • Method Detail

      • getPrimaryDataModel

        public IDataModel getPrimaryDataModel()
        Gets the datamodule of the primary key property(s).
        Returns:
        the datamodule of the primary key property(s).
      • getPrimaryProperties

        public java.util.List<IProperty> getPrimaryProperties()
        Gets the primary key properties of this relationship.
        Returns:
        an array of primary key properties.
      • getForeignDataModel

        public IDataModel getForeignDataModel()
        Gets the datamodule of the foreign key property(s).
        Returns:
        the datamodule of the foreign key property(s).
      • getForeignProperties

        public java.util.List<IProperty> getForeignProperties()
        Gets the foreign key properties of this relationship.
        Returns:
        an array of foreign key properties.
      • containsPropertyPair

        public boolean containsPropertyPair​(IProperty pkProperty,
                                            IProperty fkProperty)
        Determines whether this relationship contains a specific pair of properties
        Parameters:
        pkProperty - primary key property
        fkProperty - foreign key property
        Returns:
        true if this relation contains the specified primary and foreign properties as a part of the relation