org.jboss.dna.common.jdbc.model.spi
Class ForeignKeyBean

java.lang.Object
  extended by org.jboss.dna.common.jdbc.model.spi.CoreMetaDataBean
      extended by org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
          extended by org.jboss.dna.common.jdbc.model.spi.SchemaObjectBean
              extended by org.jboss.dna.common.jdbc.model.spi.ForeignKeyBean
All Implemented Interfaces:
Serializable, CoreMetaData, DatabaseNamedObject, ForeignKey, SchemaObject

public class ForeignKeyBean
extends SchemaObjectBean
implements ForeignKey

Provides database table's foreing key specific metadata.

Author:
Sergiy Litsenko
See Also:
Serialized Form

Constructor Summary
ForeignKeyBean()
          Default constructor
 
Method Summary
 void addColumn(ForeignKeyColumn column)
          Adds ForeignKeyColumn
 void deleteColumn(ForeignKeyColumn column)
          Removes ForeignKeyColumn
 ForeignKeyColumn findColumnByName(String columnName)
          Returns table column for specified column name or null
 Set<ForeignKeyColumn> getColumns()
          Retrieves foreign key columns
 KeyDeferrabilityType getDeferrability()
          Can the evaluation of foreign key constraints be deferred until commit
 KeyModifyRuleType getDeleteRule()
          What happens to a foreign key when the primary key is deleted
 PrimaryKey getSourcePrimaryKey()
          Returns the PK of scope table.
 Table getSourceTable()
          Returns the scope table of a foreign key.
 KeyModifyRuleType getUpdateRule()
          What happens to a foreign key when the primary key is updated
 void setDeferrability(KeyDeferrabilityType deferrability)
          Can the evaluation of foreign key constraints be deferred until commit
 void setDeleteRule(KeyModifyRuleType deleteRule)
          What happens to a foreign key when the primary key is deleted
 void setSourcePrimaryKey(PrimaryKey primaryKey)
          Sets the PK of scope table.
 void setSourceTable(Table sourceTable)
          Sets the scope table of a foreign key.
 void setUpdateRule(KeyModifyRuleType updateRule)
          What happens to a foreign key when the primary key is updated
 
Methods inherited from class org.jboss.dna.common.jdbc.model.spi.SchemaObjectBean
getCatalog, getSchema, setCatalog, setSchema
 
Methods inherited from class org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.SchemaObject
getCatalog, getSchema, setCatalog, setSchema
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 

Constructor Detail

ForeignKeyBean

public ForeignKeyBean()
Default constructor

Method Detail

getColumns

public Set<ForeignKeyColumn> getColumns()
Retrieves foreign key columns

Specified by:
getColumns in interface ForeignKey
Returns:
foreign key columns

addColumn

public void addColumn(ForeignKeyColumn column)
Adds ForeignKeyColumn

Specified by:
addColumn in interface ForeignKey
Parameters:
column - the ForeignKeyColumn

deleteColumn

public void deleteColumn(ForeignKeyColumn column)
Removes ForeignKeyColumn

Specified by:
deleteColumn in interface ForeignKey
Parameters:
column - the ForeignKeyColumn

findColumnByName

public ForeignKeyColumn findColumnByName(String columnName)
Returns table column for specified column name or null

Specified by:
findColumnByName in interface ForeignKey
Parameters:
columnName - the name of column
Returns:
table column for specified column name or null.

getSourceTable

public Table getSourceTable()
Returns the scope table of a foreign key.

Specified by:
getSourceTable in interface ForeignKey
Returns:
the scope table of a foreign key.

setSourceTable

public void setSourceTable(Table sourceTable)
Sets the scope table of a foreign key.

Specified by:
setSourceTable in interface ForeignKey
Parameters:
sourceTable - the scope table of a foreign key.

getSourcePrimaryKey

public PrimaryKey getSourcePrimaryKey()
Returns the PK of scope table.

Specified by:
getSourcePrimaryKey in interface ForeignKey
Returns:
the PK of scope table.

setSourcePrimaryKey

public void setSourcePrimaryKey(PrimaryKey primaryKey)
Sets the PK of scope table.

Specified by:
setSourcePrimaryKey in interface ForeignKey
Parameters:
primaryKey - the PK of scope table.

getUpdateRule

public KeyModifyRuleType getUpdateRule()
What happens to a foreign key when the primary key is updated

Specified by:
getUpdateRule in interface ForeignKey
Returns:
what happens to a foreign key when the primary key is updated

setUpdateRule

public void setUpdateRule(KeyModifyRuleType updateRule)
What happens to a foreign key when the primary key is updated

Specified by:
setUpdateRule in interface ForeignKey
Parameters:
updateRule - what happens to a foreign key when the primary key is updated

getDeleteRule

public KeyModifyRuleType getDeleteRule()
What happens to a foreign key when the primary key is deleted

Specified by:
getDeleteRule in interface ForeignKey
Returns:
what happens to a foreign key when the primary key is deleted

setDeleteRule

public void setDeleteRule(KeyModifyRuleType deleteRule)
What happens to a foreign key when the primary key is deleted

Specified by:
setDeleteRule in interface ForeignKey
Parameters:
deleteRule - what happens to a foreign key when the primary key is deleted

getDeferrability

public KeyDeferrabilityType getDeferrability()
Can the evaluation of foreign key constraints be deferred until commit

Specified by:
getDeferrability in interface ForeignKey
Returns:
the evaluation of foreign key constraints be deferred until commit

setDeferrability

public void setDeferrability(KeyDeferrabilityType deferrability)
Can the evaluation of foreign key constraints be deferred until commit

Specified by:
setDeferrability in interface ForeignKey
Parameters:
deferrability - the evaluation of foreign key constraints be deferred until commit


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.