|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fesenmeyer.dbnormalizer.core.AbstractDBItem
de.fesenmeyer.dbnormalizer.core.FK
public class FK
This class represents a Foreign Key relationship (FK) between
two tables. The referenced table is called the PK-Table, because it
contains the primary key which is referenced. The properties of this class
with the prefix pk
hence describe the referenced table.
The referencing table is also called the FK-Table, because it defines
the FK. The properties of this class with the prefix fk
hence describe the referencing table.
Field Summary | |
---|---|
private int |
deferability
The deferability. |
private int |
deleteRule
The delete rule. |
private String |
fkCatalog
The catalog of the FK-Table, may be null. |
private List<String> |
fkColumnNames
The referencing columns of the FK-Table. |
private String |
fkSchema
The schema of the FK-Table, may be null. |
private String |
fkTableName
The name of the FK-Table. |
private String |
pkCatalog
The catalog of the PK-Table, may be null. |
private List<String> |
pkColumnNames
The referenced columns of the PK-Table. |
private String |
pkName
The name of the referenced PK. |
private String |
pkSchema
The schema of the PK-Table, may be null. |
private String |
pkTableName
The name of the PK-Table. |
private int |
updateRule
The update rule. |
Constructor Summary | |
---|---|
FK()
|
Method Summary | |
---|---|
int |
compareTo(FK fk)
Default implementation for comparing FKs. |
boolean |
equals(Object obj)
Overridden method, which compares this FK to an arbitrary object. |
int |
getDeferability()
Gets the deferability. |
int |
getDeleteRule()
Gets the deleteRule. |
String |
getFkCatalog()
Gets the catalog of the FK-Table, may be null. |
List<String> |
getFkColumnNames()
Gets the referencing columns of the FK-Table. |
String |
getFkSchema()
Gets the schema of the FK-Table, may be null. |
String |
getFkTableName()
Gets the name of the FK-Table. |
String |
getPkCatalog()
Gets the catalog of the PK-Table, may be null. |
List<String> |
getPkColumnNames()
Gets the referenced columns of the PK-Table. |
String |
getPkName()
Gets the name of the referenced PK. |
String |
getPkSchema()
Gets the schema of the PK-Table, may be null. |
String |
getPkTableName()
Gets the name of the PK-Table. |
int |
getUpdateRule()
Gets the updateRule. |
int |
hashCode()
Overridden method which compares a hashcode based on the toString() method. |
void |
setDeferability(int deferability)
Sets the deferability. |
void |
setDeleteRule(int deleteRule)
Sets the deleteRule. |
void |
setFkCatalog(String fkCatalog)
Sets the schema of the FK-Table, may be null. |
void |
setFkColumnNames(List<String> fkColumnNames)
Sets the referencing columns of the FK-Table. |
void |
setFkSchema(String fkSchema)
Sets the schema of the FK-Table, may be null. |
void |
setFkTableName(String fkTableName)
Sets the name of the FK-Table. |
void |
setPkCatalog(String pkCatalog)
Sets the catalog of the PK-Table, may be null. |
void |
setPkColumnNames(List<String> pkColumnNames)
Sets the referenced columns of the PK-Table. |
void |
setPkName(String pkName)
Sets the name of the referenced PK. |
void |
setPkSchema(String pkSchema)
Sets the schema of the PK-Table, may be null. |
void |
setPkTableName(String pkTableName)
Sets the name of the PK-Table. |
void |
setUpdateRule(int updateRule)
Sets the updateRule. |
String |
toString()
Overridden method which returns an appropriate string representation of this FK, for example: FK: Table1(A,B) --> Table2(A,B) |
Methods inherited from class de.fesenmeyer.dbnormalizer.core.AbstractDBItem |
---|
getName, setName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String pkCatalog
private String pkSchema
private String pkTableName
private String fkTableName
private String fkSchema
private String fkCatalog
private int updateRule
private int deleteRule
private String pkName
private int deferability
private List<String> pkColumnNames
private List<String> fkColumnNames
Constructor Detail |
---|
public FK()
Method Detail |
---|
public String getPkCatalog()
public void setPkCatalog(String pkCatalog)
pkCatalog
- the pkCatalog to setpublic String getPkSchema()
public void setPkSchema(String pkSchema)
pkSchema
- the pkSchema to setpublic String getPkTableName()
public void setPkTableName(String pkTableName)
pkTableName
- the pkTableName to setpublic String getFkTableName()
public void setFkTableName(String fkTableName)
fkTableName
- the fkTableName to setpublic String getFkSchema()
public void setFkSchema(String fkSchema)
fkSchema
- the fkSchema to setpublic String getFkCatalog()
public void setFkCatalog(String fkCatalog)
fkCatalog
- the fkCatalog to setpublic int getUpdateRule()
public void setUpdateRule(int updateRule)
updateRule
- the updateRule to setpublic int getDeleteRule()
public void setDeleteRule(int deleteRule)
deleteRule
- the deleteRule to setpublic String getPkName()
public void setPkName(String pkName)
pkName
- the pkName to setpublic int getDeferability()
public void setDeferability(int deferability)
deferability
- the deferability to setpublic List<String> getPkColumnNames()
public void setPkColumnNames(List<String> pkColumnNames)
pkColumnNames
- the pkColumnNames to setpublic List<String> getFkColumnNames()
public void setFkColumnNames(List<String> fkColumnNames)
fkColumnNames
- the fkColumnNames to setpublic boolean equals(Object obj)
equals
in class Object
obj
- the object to which this FK should be compared
toString()
method returns the same value
for both FKs; false, otherwise.public int hashCode()
toString()
method.
hashCode
in class Object
public String toString()
FK: Table1(A,B) --> Table2(A,B)
toString
in class AbstractDBItem
public int compareTo(FK fk)
toString()
method to compare the FKs.
compareTo
in interface Comparable<FK>
fk
- the FK to be compared with this FK.
0
,
if the string representation of this FK is smaller than
the other FK's one.
0
,
if the FKs' string representations are equal.
0
,
if the string representation of this FK is greater than
the other FK's one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |