Class ModelRelation

java.lang.Object
org.apache.ofbiz.entity.model.ModelChild
org.apache.ofbiz.entity.model.ModelRelation
All Implemented Interfaces:
Serializable

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

    • create

      public static ModelRelation create(ModelEntity modelEntity, String description, String type, String title, String relEntityName, String fkName, 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, 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.
    • create

      public static ModelRelation create(ModelEntity modelEntity, DatabaseUtil.ReferenceCheckInfo refInfo, boolean isAutoRelation)
    • getCombinedName

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

      public String getTitle()
      Returns the title.
    • getType

      public String getType()
      Returns the type.
    • getRelEntityName

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

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

      public 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(String fieldName)
      Find a KeyMap with the specified fieldName
    • findKeyMapByRelated

      public ModelKeyMap findKeyMapByRelated(String relFieldName)
      Find a KeyMap with the specified relFieldName
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

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

      public String keyMapString(String separator, String afterLast)
    • keyMapUpperString

      public String keyMapUpperString(String separator, String afterLast)
    • keyMapRelatedUpperString

      public String keyMapRelatedUpperString(String separator, String afterLast)
    • toXmlElement

      public Element toXmlElement(Document document)