public class ModelRelation extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
fkName
the name to use for a database foreign key, if applies
|
protected List<ModelKeyMap> |
keyMaps
keyMaps defining how to lookup the relatedTable using columns from this table
|
protected ModelEntity |
mainEntity
the main entity of this relation
|
protected String |
relEntityName
the name of the related entity
|
protected String |
title
the title, gives a name/description to the relation
|
protected String |
type
the type: either "one" or "many" or "one-nofk"
|
| Constructor and Description |
|---|
ModelRelation()
Default Constructor
|
ModelRelation(ModelEntity mainEntity,
Element relationElement)
XML Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyMap(ModelKeyMap keyMap) |
ModelKeyMap |
findKeyMap(String fieldName)
Find a KeyMap with the specified fieldName
|
ModelKeyMap |
findKeyMapByRelated(String relFieldName)
Find a KeyMap with the specified relFieldName
|
String |
getFkName() |
ModelKeyMap |
getKeyMap(int index) |
Iterator<ModelKeyMap> |
getKeyMapsIterator()
keyMaps defining how to lookup the relatedTable using columns from this table
|
int |
getKeyMapsSize() |
ModelEntity |
getMainEntity()
the main entity of this relation
|
String |
getRelEntityName()
the name of the related entity
|
String |
getTitle()
the title, gives a name/description to the relation
|
String |
getType()
the type: either "one" or "many" or "one-nofk"
|
String |
keyMapRelatedUpperString(String separator,
String afterLast) |
String |
keyMapString(String separator,
String afterLast) |
String |
keyMapUpperString(String separator,
String afterLast) |
ModelKeyMap |
removeKeyMap(int index) |
void |
setFkName(String fkName) |
void |
setMainEntity(ModelEntity mainEntity) |
void |
setRelEntityName(String relEntityName) |
void |
setTitle(String title) |
void |
setType(String type) |
protected String title
protected String type
protected String relEntityName
protected String fkName
protected List<ModelKeyMap> keyMaps
protected ModelEntity mainEntity
public ModelRelation()
public ModelRelation(ModelEntity mainEntity, Element relationElement)
public String getTitle()
public void setTitle(String title)
public String getType()
public void setType(String type)
public String getRelEntityName()
public void setRelEntityName(String relEntityName)
public String getFkName()
public void setFkName(String fkName)
public ModelEntity getMainEntity()
public void setMainEntity(ModelEntity mainEntity)
public Iterator<ModelKeyMap> getKeyMapsIterator()
public int getKeyMapsSize()
public ModelKeyMap getKeyMap(int index)
public void addKeyMap(ModelKeyMap keyMap)
public ModelKeyMap removeKeyMap(int index)
public ModelKeyMap findKeyMap(String fieldName)
public ModelKeyMap findKeyMapByRelated(String relFieldName)
Copyright © 2015 Atlassian. All rights reserved.