dke.smwp.fragmentation
Class ForeignKeyConstraint

java.lang.Object
  |
  +--dke.smwp.fragmentation.ForeignKeyConstraint

public class ForeignKeyConstraint
extends java.lang.Object

mapping for foeign key contraints

Version:
1.0
Author:
Werner Enser

Field Summary
private  java.util.ArrayList _refencingColumns
          names of referencing columns
private  java.util.ArrayList _referencedColumns
          names of referenced columns
private  java.lang.String _referencedTable
          name of table which is referenced
 
Constructor Summary
ForeignKeyConstraint(java.util.ArrayList refencingColumns, java.lang.String referencedTable, java.util.ArrayList referencedColumns)
          default constructor
 
Method Summary
 java.util.ArrayList getReferencedColumns()
          get columns referenced by foreign key statement
 java.lang.String getReferencedTable()
          get table referenced by foreign key statement
 java.util.ArrayList getReferencingColumns()
          get columns which are referencing other columns via foreign key statement
 java.lang.String toString()
          generate String representation of foreign key constraint for usage as part of an SQL statement; syntax: " FOREIGN KEY (" column_name_referencing {"," column_name_referencing } ") REFERENCES " tablename_referenced "(" column_name_referenced {"," column_name_referenced } ")"
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

_refencingColumns

private java.util.ArrayList _refencingColumns
names of referencing columns

_referencedTable

private java.lang.String _referencedTable
name of table which is referenced

_referencedColumns

private java.util.ArrayList _referencedColumns
names of referenced columns
Constructor Detail

ForeignKeyConstraint

public ForeignKeyConstraint(java.util.ArrayList refencingColumns,
                            java.lang.String referencedTable,
                            java.util.ArrayList referencedColumns)
default constructor
Parameters:
refencingColumns - names of referencing columns
referencedTable - name of table which is referenced
referencedColumns - names of referenced columns
Method Detail

getReferencedTable

public java.lang.String getReferencedTable()
get table referenced by foreign key statement
Returns:
name of the referenced table

getReferencedColumns

public java.util.ArrayList getReferencedColumns()
get columns referenced by foreign key statement
Returns:
collection containing Column objects

getReferencingColumns

public java.util.ArrayList getReferencingColumns()
get columns which are referencing other columns via foreign key statement
Returns:
collection containing Column objects

toString

public java.lang.String toString()
generate String representation of foreign key constraint for usage as part of an SQL statement;

syntax: " FOREIGN KEY (" column_name_referencing {"," column_name_referencing } ") REFERENCES " tablename_referenced "(" column_name_referenced {"," column_name_referenced } ")"

Overrides:
toString in class java.lang.Object
Returns:
String representation of foreign key constraint