|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
com.finalist.jaggenerator.modules.Relation
This class models a container-managed relation. A Relation maintains three views: a DefaultMutableTreeNode, an XML view and a Swing JPanel. Unfortunately this class is kind of a Model, View and Controller rolled into one, but that's just the way JagBeans have been designed...
The relation data is initially generated using foreign key information read from a database table (or just filled in by hand from the GUI).
| Nested Class Summary |
| Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode |
|
| Field Summary |
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
Relation(Entity localEntity)
Constructs a new Relation from scratch. |
|
Relation(Entity localEntity,
org.w3c.dom.Element el)
(Re-)Constructs a Relation from an XML element. |
|
Relation(Entity localEntity,
ForeignKey fk)
Constructs a Relation from a ForeignKey object. |
|
Relation(Entity localEntity,
ForeignKey fk,
boolean waitForInitSignal)
Constructs a Relation from a ForeignKey object. |
|
| Method Summary | |
TemplateString |
getFieldName()
Gets the name of the imported foreign key field in the parent entity bean on the 'local' side of this relation. |
Field |
getFkField()
|
java.lang.String |
getForeignColumn()
Gets 'foreignColumn' : the name of the primary key column at the other end of the relation. |
Field |
getForeignPkField()
|
TemplateString |
getForeignPkFieldName()
Gets the name of the exported primary key field at the other end of the relation. |
java.lang.String |
getForeignTable()
Gets 'foreignTable' : the name of the table at the other end of the relation. |
java.lang.String |
getLocalColumn()
Gets 'localColumn' : the name of the column at the local end of the relation. |
Entity |
getLocalEntity()
|
java.lang.String |
getName()
Gets 'name' : the name of this relation. |
javax.swing.JPanel |
getPanel()
Gets the Swing JPanel view of this relation. |
java.lang.String |
getRefName()
|
Entity |
getRelatedEntity()
Gets the Entity object that this Relation relates to. |
java.lang.String |
getTargetName()
Gets 'targetName' : the name given to the reciprocal end of this relation (if it is bidirectional). |
void |
getXML(org.w3c.dom.Element parent)
Creates the XML view of this relation and appends it as a new child to the specified XML element. |
boolean |
isBidirectional()
Gets 'bidirectional' : whether or not this relation is also navigable the other way round. |
boolean |
isTargetMultiple()
Gets 'targetMultiple' : whether or not this relation maps to multiple entities at the 'foreign' end. |
void |
notifyFieldNameChanged(java.lang.String oldName,
java.lang.String text)
|
void |
notifyLocalEntityIsComplete()
RelationPanels can't finish initialising themselves until the local-side entity is completely generated (until all the entity's fields are generated). |
void |
setBidirectional(boolean bidirectional)
|
void |
setFieldName(java.lang.String fieldName)
|
void |
setFkField(Field field)
|
void |
setForeignColumn(java.lang.String foreignColumn)
|
void |
setForeignPkField(Field foreignPkField)
|
void |
setForeignPkFieldName(java.lang.String foreignField)
|
void |
setForeignTable(java.lang.String foreignTable)
|
void |
setLocalColumn(java.lang.String localColumn)
|
void |
setName(java.lang.String name)
|
void |
setTargetMultiple(boolean targetMultiple)
|
void |
setTargetName(java.lang.String targetName)
|
java.lang.String |
toString()
|
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Relation(Entity localEntity)
localEntity - the parent entity bean on the local side of this relation.
public Relation(Entity localEntity,
ForeignKey fk)
localEntity - the parent entity bean on the local side of this relation.fk - the foreign key.
public Relation(Entity localEntity,
ForeignKey fk,
boolean waitForInitSignal)
localEntity - the parent entity bean on the local side of this relation.fk - the foreign key.waitForInitSignal - if true panel delays initialisation until notified.
public Relation(Entity localEntity,
org.w3c.dom.Element el)
localEntity - the parent entity bean on the local side of this relation.el - the XML element.| Method Detail |
public java.lang.String getRefName()
getRefName in interface JagBeanpublic javax.swing.JPanel getPanel()
getPanel in interface JagBeanpublic void getXML(org.w3c.dom.Element parent)
getXML in interface JagBeanparent - the XML element to become parent to this relation child.public java.lang.String getName()
public void setName(java.lang.String name)
public TemplateString getFieldName()
public void setFieldName(java.lang.String fieldName)
public java.lang.String getTargetName()
public void setTargetName(java.lang.String targetName)
public boolean isTargetMultiple()
public void setTargetMultiple(boolean targetMultiple)
public boolean isBidirectional()
public void setBidirectional(boolean bidirectional)
public java.lang.String getForeignTable()
public void setForeignTable(java.lang.String foreignTable)
public TemplateString getForeignPkFieldName()
public void setForeignPkFieldName(java.lang.String foreignField)
public Field getForeignPkField()
public void setForeignPkField(Field foreignPkField)
public java.lang.String getForeignColumn()
public void setForeignColumn(java.lang.String foreignColumn)
public java.lang.String getLocalColumn()
public void setLocalColumn(java.lang.String localColumn)
public Entity getRelatedEntity()
public java.lang.String toString()
public void setFkField(Field field)
public Field getFkField()
public Entity getLocalEntity()
public void notifyLocalEntityIsComplete()
public void notifyFieldNameChanged(java.lang.String oldName,
java.lang.String text)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||