Class ModelRelation

java.lang.Object
org.ofbiz.core.entity.model.ModelRelation

public class ModelRelation extends Object
Generic Entity - Relation model class
Since:
2.0
Version:
$Revision: 1.1 $
Author:
David E. Jones
  • Field Details

    • title

      protected String title
      the title, gives a name/description to the relation
    • type

      protected String type
      the type: either "one" or "many" or "one-nofk"
    • relEntityName

      protected String relEntityName
      the name of the related entity
    • fkName

      protected String fkName
      the name to use for a database foreign key, if applies
    • keyMaps

      protected List<ModelKeyMap> keyMaps
      keyMaps defining how to lookup the relatedTable using columns from this table
    • mainEntity

      protected ModelEntity mainEntity
      the main entity of this relation
  • Constructor Details

    • ModelRelation

      public ModelRelation()
      Default Constructor
    • ModelRelation

      public ModelRelation(ModelEntity mainEntity, Element relationElement)
      XML Constructor
  • Method Details

    • getTitle

      public String getTitle()
      the title, gives a name/description to the relation
    • setTitle

      public void setTitle(String title)
    • getType

      public String getType()
      the type: either "one" or "many" or "one-nofk"
    • setType

      public void setType(String type)
    • getRelEntityName

      public String getRelEntityName()
      the name of the related entity
    • setRelEntityName

      public void setRelEntityName(String relEntityName)
    • getFkName

      public String getFkName()
    • setFkName

      public void setFkName(String fkName)
    • getMainEntity

      public ModelEntity getMainEntity()
      the main entity of this relation
    • setMainEntity

      public void setMainEntity(ModelEntity mainEntity)
    • getKeyMapsIterator

      public Iterator<ModelKeyMap> getKeyMapsIterator()
      keyMaps defining how to lookup the relatedTable using columns from this table
    • getKeyMapsSize

      public int getKeyMapsSize()
    • getKeyMap

      public ModelKeyMap getKeyMap(int index)
    • addKeyMap

      public void addKeyMap(ModelKeyMap keyMap)
    • removeKeyMap

      public ModelKeyMap removeKeyMap(int index)
    • 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
    • keyMapString

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

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

      public String keyMapRelatedUpperString(String separator, String afterLast)