Class ForeignKeyRelationshipEdge

java.lang.Object
org.dbunit.util.search.Edge
org.dbunit.database.search.ForeignKeyRelationshipEdge
All Implemented Interfaces:
Comparable<Object>, IEdge

public class ForeignKeyRelationshipEdge extends Edge
Implementation of an edge representing a foreign key (FK) relationship between two tables.
The from node is the table which have the FK, while the to node is the table with the PK. In other words, the edge A->B means FK(A) = PK(B).
NOTE: only single-column PKs are supported at this moment
Since:
2.2 (Sep 9, 2005)
Version:
$Revision$ $Date$
Author:
Felipe Leme (dbunit@felipeal.net), Last changed by: $Author$
  • Constructor Details

    • ForeignKeyRelationshipEdge

      public ForeignKeyRelationshipEdge(String tableFrom, String tableTo, String fkColumn, String pkColumn)
      Creates an edge representing a FK.
      Parameters:
      tableFrom - table that has the FK
      tableTo - table that has the PK
      fkColumn - name of the FK column on tableFrom
      pkColumn - name of the PK column on tableTo
  • Method Details

    • getFKColumn

      public String getFKColumn()
      Gets the name of the foreign key column in the relationship.
      Returns:
      name of the foreign key column in the relationship.
    • getPKColumn

      public String getPKColumn()
      Gets the name of the primary key column in the relationship.
      Returns:
      name of the primary key column in the relationship.
    • toString

      public String toString()
      Overrides:
      toString in class Edge
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Edge
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Edge
    • compareTo

      public int compareTo(Object o)
      Description copied from class: Edge
      Compares this edge to the given one using the Edge.getFrom() nodes first. If those are equal the Edge.getTo()} is used for comparison.
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class Edge
      See Also: