User Tools

Site Tools


magik-demo:developer:class:core:foreignkey

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
magik-demo:developer:class:core:foreignkey [2013/07/19 16:39]
alex
magik-demo:developer:class:core:foreignkey [2017/07/06 15:24] (current)
Line 1: Line 1:
 ====== Foreign Key ====== ====== Foreign Key ======
 +
 +**''​public class ForeignKey''​** \\
 +**''​implements Serializable''​**
  
 Foreign Key describes a foreign key dependency between two relations from the common schema \\ Foreign Key describes a foreign key dependency between two relations from the common schema \\
 +
 ''​(sourceRelation[sourceAttriutes] REFERENCES targetRealtion[targetKey])''​ ''​(sourceRelation[sourceAttriutes] REFERENCES targetRealtion[targetKey])''​
  
 +===== Class Attributes =====
 +<code java>
 +private long id;
 +private Relation sourceRelation;​
 +private Relation targetRelation;​
 +private java.util.ArrayList<​Integer>​ sourceAttributes;​
 +private boolean virtual;
 +private boolean enforced;
 +</​code>​
 +
 +===== Class Constructors =====
 +==== ForeignKey ====
 +
 +<code java>
 +public ForeignKey()
 +</​code>​
 +
 +Default constructor
 +
 +----
 +
 +==== ForeignKey ====
 +
 +<code java>
 +public ForeignKey (Relation sourceRelation, ​
 +                   ​Relation targetRelation,​
 +    ​java.util.ArrayList<​Integer>​ sourceAttributes)
 +</​code>​
 +
 +Constructor that store also values inside the class attributes.
 +
 +//Called by://
 +  * it.unibz.inf.magik.web.SessionControl
 +  * it.unibz.inf.magik.db.DatabaseConnector
 +  * it.unibz.inf.magik.test.CycleDetectionTest
 +  * it.unibz.inf.magik.test.TestFK
 +  * it.unibz.inf.magik.test.TestFK2
 +  * it.unibz.inf.magik.test.TestHardCaseFDCandFK
 +  * it.unibz.inf.magik.test.TestQueryGeneralization
 +  * it.unibz.inf.magik.test.TCQCReasonerFKandFD
 +  * it.unibz.inf.magik.test.TCQCReasonerTCSuggestions
 +  * it.unibz.inf.magik.test.TestQueryClass
 +
 +**Parameters:​**
 +  * sourceRelation - source relation
 +  * targetRelation - target relation
 +  * sourceAttributes - source attributes (position)
 +===== Class Methods =====
 +
 +==== printHTML ====
 +
 +<code java>
 +public java.lang.String printHTML()
 +</​code>​
 +
 +This method is used for create a compact view of a foreign key (''​table[field] -> table2[field]''​)
 +
 +**Returns:​**
 +  * foreign key adapted to the compact view
 +
 +
 +----
 +
 +==== getters and setters methods ====
 +<code java>
 +public Relation getSourceRelation() ​
 +public void setSourceRelation(Relation sourceRelation) ​
 +
 +public Relation getTargetRelation() ​
 +public void setTargetRelation(Relation targetRelation) ​
 +
 +public java.util.ArrayList<​Integer>​ getSourceAttributes() ​
 +public void setSourceAttributes(java.util.ArrayList<​Integer>​ sourceAttributes) ​
 +
 +public long getId() ​
 +public void setId(long id) 
 +
 +public boolean isVirtual()
 +public void setVirtual(boolean virtual) ​
 +
 +public boolean isEnforced() ​
 +public void setEnforced(boolean enforced) ​
 +
 +public Integer getTargetKey()
 +</​code>​
  
 +[[magik-demo:​developer:​class:​core:​foreignkey|Back to Top]] | [[magik-demo:​start|Back to Home Page]]
magik-demo/developer/class/core/foreignkey.1374244766.txt.gz ยท Last modified: 2017/07/06 15:24 (external edit)