Class PrimaryKey

java.lang.Object
org.alfresco.util.schemacomp.model.AbstractDbObject
org.alfresco.util.schemacomp.model.PrimaryKey
All Implemented Interfaces:
DbObject

public class PrimaryKey extends AbstractDbObject
Primary key on a table.
Author:
Matt Ward
  • Constructor Details

    • PrimaryKey

      public PrimaryKey(String name)
    • PrimaryKey

      public PrimaryKey(Table table, String name, List<String> columnNames, List<Integer> columnOrders)
      Constructor
      Parameters:
      table - the parent table
      name - String
  • Method Details

    • getColumnNames

      public List<String> getColumnNames()
      Returns:
      the columnNames
    • setColumnNames

      public void setColumnNames(List<String> columnNames)
      Parameters:
      columnNames - the columnNames to set
    • getColumnOrders

      public List<Integer> getColumnOrders()
      Returns:
      the columnOrders
    • setColumnOrders

      public void setColumnOrders(List<Integer> columnOrders)
      Parameters:
      columnOrders - the columnOrders to set
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class AbstractDbObject
    • doDiff

      protected void doDiff(DbObject right, DiffContext ctx)
      Description copied from class: AbstractDbObject
      Override this method to provide subclass specific diffing logic.
      Overrides:
      doDiff in class AbstractDbObject
      Parameters:
      right - DbObject
      ctx - DiffContext
    • accept

      public void accept(DbObjectVisitor visitor)
      Description copied from interface: DbObject
      Allows a visitor to be invoked against this DbObject. Implementations should ensure that child objects are visited first (by calling accept on them) before invoking the visitor on itself.
      Parameters:
      visitor - DbObjectVisitor
    • getTypeName

      public String getTypeName()
      Description copied from interface: DbObject
      Type name, e.g. "column", "foreign key"
      Specified by:
      getTypeName in interface DbObject
      Overrides:
      getTypeName in class AbstractDbObject
      Returns:
      String
    • sameAs

      public boolean sameAs(DbObject other)
      Description copied from interface: DbObject
      Are the two DbObjects logically the same? For example two Index objects may have different names, but are the same index as they both index the same columns for the same table.

      If two objects a and b have the same logical identity, it does not mean that a.equals(b) == true. The two objects may well have differences and will be flagged as such by the schema comparison tool. When a.sameAs(b) == true it makes it easier to show the differences as related, i.e. a and b are different rather than, a is only in the 'left' tree and b is only in the 'right' tree.

      Specified by:
      sameAs in interface DbObject
      Overrides:
      sameAs in class AbstractDbObject
      Parameters:
      other - DbObject
      Returns:
      boolean