org.eobjects.metamodel.schema
Class MutableRelationship

java.lang.Object
  extended by org.eobjects.metamodel.util.BaseObject
      extended by org.eobjects.metamodel.schema.AbstractRelationship
          extended by org.eobjects.metamodel.schema.MutableRelationship
All Implemented Interfaces:
Serializable, Comparable<Relationship>, Relationship

public class MutableRelationship
extends AbstractRelationship
implements Serializable, Relationship

Immutable implementation of the Relationship interface. The immutability help ensure integrity of object-relationships. To create relationsips use the createRelationship method.

Author:
Kasper Sørensen
See Also:
Serialized Form

Method Summary
static Relationship createRelationship(Column[] primaryColumns, Column[] foreignColumns)
          Factory method to create relations between two tables by specifying which columns from the tables that enforce the relationship.
static Relationship createRelationship(Column primaryColumn, Column foreignColumn)
           
protected  void finalize()
           
 Column[] getForeignColumns()
          Gets the foreign key columns of this relationship.
 Column[] getPrimaryColumns()
          Gets the primary key columns of this relationship.
 void remove()
           
 
Methods inherited from class org.eobjects.metamodel.schema.AbstractRelationship
checkSameTable, classEquals, compareTo, containsColumnPair, decorateIdentity, getForeignTable, getPrimaryTable, toString
 
Methods inherited from class org.eobjects.metamodel.util.BaseObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.schema.Relationship
containsColumnPair, getForeignTable, getPrimaryTable
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

createRelationship

public static Relationship createRelationship(Column[] primaryColumns,
                                              Column[] foreignColumns)
Factory method to create relations between two tables by specifying which columns from the tables that enforce the relationship.

Parameters:
primaryColumns - the columns from the primary key table
foreignColumns - the columns from the foreign key table
Returns:
the relation created

remove

public void remove()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

createRelationship

public static Relationship createRelationship(Column primaryColumn,
                                              Column foreignColumn)

getPrimaryColumns

public Column[] getPrimaryColumns()
Description copied from interface: Relationship
Gets the primary key columns of this relationship.

Specified by:
getPrimaryColumns in interface Relationship
Returns:
an array of primary key columns.

getForeignColumns

public Column[] getForeignColumns()
Description copied from interface: Relationship
Gets the foreign key columns of this relationship.

Specified by:
getForeignColumns in interface Relationship
Returns:
an array of foreign key columns.


Copyright © 2007-2013. All Rights Reserved.