Class ModelRelation

  • All Implemented Interfaces:
    java.io.Serializable

    @ThreadSafe
    public final class ModelRelation
    extends ModelChild
    An object that models the <relation> element.
    See Also:
    Serialized Form
    • Method Detail

      • create

        public static ModelRelation create​(ModelEntity modelEntity,
                                           java.lang.String description,
                                           java.lang.String type,
                                           java.lang.String title,
                                           java.lang.String relEntityName,
                                           java.lang.String fkName,
                                           java.util.List<ModelKeyMap> keyMaps,
                                           boolean isAutoRelation)
        Returns a new ModelRelation instance, initialized with the specified values.
        Parameters:
        modelEntity - The ModelEntity this relation is a member of.
        description - The relation description.
        type - The relation type.
        title - The relation title.
        relEntityName - The related entity's name.
        fkName - The foreign key name.
        keyMaps - The key maps included in this relation.
        isAutoRelation - true if this relation was generated automatically by the entity engine.
      • create

        public static ModelRelation create​(ModelEntity modelEntity,
                                           org.w3c.dom.Element relationElement,
                                           boolean isAutoRelation)
        Returns a new ModelRelation instance, initialized with the specified values.
        Parameters:
        modelEntity - The ModelEntity this relation is a member of.
        relationElement - The <relation> element containing the values for this relation.
        isAutoRelation - true if this relation was generated automatically by the entity engine.
      • getCombinedName

        public java.lang.String getCombinedName()
        Returns the combined name (title + related entity name).
      • getTitle

        public java.lang.String getTitle()
        Returns the title.
      • getType

        public java.lang.String getType()
        Returns the type.
      • getRelEntityName

        public java.lang.String getRelEntityName()
        Returns the related entity name.
      • getFkName

        public java.lang.String getFkName()
        Returns the foreign key name.
      • getKeyMaps

        public java.util.List<ModelKeyMap> getKeyMaps()
        Returns the key maps.
      • isAutoRelation

        public boolean isAutoRelation()
        Returns true if this relation was generated automatically by the entity engine.
      • findKeyMap

        public ModelKeyMap findKeyMap​(java.lang.String fieldName)
        Find a KeyMap with the specified fieldName
      • findKeyMapByRelated

        public ModelKeyMap findKeyMapByRelated​(java.lang.String relFieldName)
        Find a KeyMap with the specified relFieldName
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • keyMapString

        public java.lang.String keyMapString​(java.lang.String separator,
                                             java.lang.String afterLast)
      • keyMapUpperString

        public java.lang.String keyMapUpperString​(java.lang.String separator,
                                                  java.lang.String afterLast)
      • keyMapRelatedUpperString

        public java.lang.String keyMapRelatedUpperString​(java.lang.String separator,
                                                         java.lang.String afterLast)
      • toXmlElement

        public org.w3c.dom.Element toXmlElement​(org.w3c.dom.Document document)