|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fesenmeyer.dbnormalizer.core.algorithms.NormalizationFKsDetermination
public class NormalizationFKsDetermination
Class which can be used for determination of the foreign keys (FKs) which should be defined for the tables of a normalization proposal. The implementation is based on the assumption that foreign keys cannot reference arbitrary candidate keys, but only primary keys.
NOTE: The current implementation only leads to an optimal solution, if each of the created tables of the normalization proposal just contains one candidate key. For a better solution, the selection of the primary keys for the created tables could possibly be made dependent on which foreign keys can be defined between the tables.
NormalizationFKsProposal
Field Summary | |
---|---|
private static DBNormalizerLogger |
logger
The logger for this class. |
private NormalizationProposal |
normProposal
The normalization proposal for which FKs should be proposed. |
Constructor Summary | |
---|---|
NormalizationFKsDetermination(NormalizationProposal normProposal)
Class constructor specifying the normalization proposal for which FKs should be proposed. |
Method Summary | |
---|---|
private void |
addExportedKeysToTables(Collection<FK> fks,
Collection<Table> tables)
Helper method which adds each FK given by the fks argument as exported key to the appropriate table contained in the collection given by the tables argument, if possible. |
private void |
addImportedKeysToTables(Collection<FK> fks,
Collection<Table> tables)
Helper method which adds each FK given by the fks argument as imported key to the appropriate table contained in the collection given by the tables argument, if possible. |
private ArrayList<FK> |
computeExportedFKs()
Helper method which computes FKs to be defined due to the old table's exported keys. |
private ArrayList<FK> |
computeHierarchicalFKs()
Helper method which computes FKs to be defined due to FKs between the old table's attributes ("hierarchical FKs"). |
private ArrayList<FK> |
computeImportedFKs()
Helper method which computes FKs to be defined due to the old table's imported keys. |
private ArrayList<FK> |
computeInnerFKs()
Helper method which computes FKs to be defined between the created tables of the normalization proposal. |
NormalizationFKsProposal |
getNormalizationFKsProposal()
Computes a proposal of FKs to be defined and sets these FKs for the tables which are returned by the NormalizationProposal.getCreatedTables() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static DBNormalizerLogger logger
private NormalizationProposal normProposal
Constructor Detail |
---|
public NormalizationFKsDetermination(NormalizationProposal normProposal)
normProposal
- the normalization proposalMethod Detail |
---|
public NormalizationFKsProposal getNormalizationFKsProposal()
NormalizationProposal.getCreatedTables()
method.
NormalizationFKsProposal
private void addExportedKeysToTables(Collection<FK> fks, Collection<Table> tables)
fks
- a collection of FKstables
- a collection of tablesprivate void addImportedKeysToTables(Collection<FK> fks, Collection<Table> tables)
fks
- a collection of FKstables
- a collection of tablesprivate ArrayList<FK> computeExportedFKs()
private ArrayList<FK> computeImportedFKs()
private ArrayList<FK> computeInnerFKs()
private ArrayList<FK> computeHierarchicalFKs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |