org.jooq.util
Class DefaultRelations

java.lang.Object
  extended by org.jooq.util.DefaultRelations
All Implemented Interfaces:
Relations

public class DefaultRelations
extends Object
implements Relations


Constructor Summary
DefaultRelations()
           
 
Method Summary
 void addForeignKey(String foreignKeyName, String uniqueKeyName, ColumnDefinition foreignKeyColumn, SchemaDefinition uniqueKeySchema)
           
 void addPrimaryKey(String keyName, ColumnDefinition column)
           
 void addUniqueKey(String keyName, ColumnDefinition column)
           
 ForeignKeyDefinition getForeignKey(ColumnDefinition column)
          Get the foreign key for a given column, or null if that column is not part of a foreign key.
 List<ForeignKeyDefinition> getForeignKeys(TableDefinition table)
          Get a list of foreign keys for a given table.
 UniqueKeyDefinition getPrimaryKey(ColumnDefinition column)
          Get the the primary for a given column, or null if that column is not part of the primary key.
 List<UniqueKeyDefinition> getUniqueKeys(ColumnDefinition column)
          Get a list of referenced keys (primary or unique) for a given table, that the column participates in.
 List<UniqueKeyDefinition> getUniqueKeys(TableDefinition table)
          Get a list of referenced keys (primary or unique) for a given table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRelations

public DefaultRelations()
Method Detail

addPrimaryKey

public void addPrimaryKey(String keyName,
                          ColumnDefinition column)

addUniqueKey

public void addUniqueKey(String keyName,
                         ColumnDefinition column)

addForeignKey

public void addForeignKey(String foreignKeyName,
                          String uniqueKeyName,
                          ColumnDefinition foreignKeyColumn,
                          SchemaDefinition uniqueKeySchema)

getPrimaryKey

public UniqueKeyDefinition getPrimaryKey(ColumnDefinition column)
Description copied from interface: Relations
Get the the primary for a given column, or null if that column is not part of the primary key.

Specified by:
getPrimaryKey in interface Relations

getUniqueKeys

public List<UniqueKeyDefinition> getUniqueKeys(ColumnDefinition column)
Description copied from interface: Relations
Get a list of referenced keys (primary or unique) for a given table, that the column participates in. Returns an empty list if the given column is not part of any primary key or unique key.

Specified by:
getUniqueKeys in interface Relations

getUniqueKeys

public List<UniqueKeyDefinition> getUniqueKeys(TableDefinition table)
Description copied from interface: Relations
Get a list of referenced keys (primary or unique) for a given table. Returns an empty list if the given table has no primary or unique keys.

Specified by:
getUniqueKeys in interface Relations

getForeignKey

public ForeignKeyDefinition getForeignKey(ColumnDefinition column)
Description copied from interface: Relations
Get the foreign key for a given column, or null if that column is not part of a foreign key.

Specified by:
getForeignKey in interface Relations

getForeignKeys

public List<ForeignKeyDefinition> getForeignKeys(TableDefinition table)
Description copied from interface: Relations
Get a list of foreign keys for a given table. Returns an empty list if the given table has no foreign keys.

Specified by:
getForeignKeys in interface Relations


Copyright © 2012. All Rights Reserved.