Package org.apache.ofbiz.entity.model
Class ModelRelation
- java.lang.Object
-
- org.apache.ofbiz.entity.model.ModelChild
-
- org.apache.ofbiz.entity.model.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 newModelRelation
instance, initialized with the specified values.static ModelRelation
create(ModelEntity modelEntity, DatabaseUtil.ReferenceCheckInfo refInfo, boolean isAutoRelation)
static ModelRelation
create(ModelEntity modelEntity, org.w3c.dom.Element relationElement, boolean isAutoRelation)
Returns a newModelRelation
instance, initialized with the specified values.boolean
equals(java.lang.Object obj)
ModelKeyMap
findKeyMap(java.lang.String fieldName)
Find a KeyMap with the specified fieldNameModelKeyMap
findKeyMapByRelated(java.lang.String relFieldName)
Find a KeyMap with the specified relFieldNamejava.lang.String
getCombinedName()
Returns the combined name (title + related entity name).java.lang.String
getFkName()
Returns the foreign key name.java.util.List<ModelKeyMap>
getKeyMaps()
Returns the key maps.java.lang.String
getRelEntityName()
Returns the related entity name.java.lang.String
getTitle()
Returns the title.java.lang.String
getType()
Returns the type.int
hashCode()
boolean
isAutoRelation()
Returnstrue
if this relation was generated automatically by the entity engine.java.lang.String
keyMapRelatedUpperString(java.lang.String separator, java.lang.String afterLast)
java.lang.String
keyMapString(java.lang.String separator, java.lang.String afterLast)
java.lang.String
keyMapUpperString(java.lang.String separator, java.lang.String afterLast)
java.lang.String
toString()
org.w3c.dom.Element
toXmlElement(org.w3c.dom.Document document)
-
Methods inherited from class org.apache.ofbiz.entity.model.ModelChild
getDescription, getModelEntity
-
-
-
-
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 newModelRelation
instance, initialized with the specified values.- Parameters:
modelEntity
- TheModelEntity
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 newModelRelation
instance, initialized with the specified values.- Parameters:
modelEntity
- TheModelEntity
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 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()
Returnstrue
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 classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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)
-
-