Class DDLIndex

java.lang.Object
net.java.ao.schema.ddl.DDLIndex

public class DDLIndex extends Object
Database-agnostic reprensentation of a general field index statement (not related to full-text indexing). To save on object creation, as well as to simplify schema parsing, table and field names are stored rather than full DDL representations. This class also defines the convention imposed to generate the names of field indexes. It is important that all DDL renderers (i.e. database providers) observe this convention, else migrations will do strange things.
Author:
Daniel Spiewak
  • Method Details

    • builder

      public static DDLIndex.DDLIndexBuilder builder()
    • getTable

      public String getTable()
    • getFields

      public DDLIndexField[] getFields()
    • getIndexName

      public String getIndexName()
    • containsFieldWithName

      public boolean containsFieldWithName(String fieldName)
    • containsFieldWithNameIgnoreCase

      public boolean containsFieldWithNameIgnoreCase(String fieldName)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Check if this is equal to other index.

      Two indexes are considered equivalent if and only if they have exactly the same column names in the same order and the same table name specified. Please note that index name does not matter when checking for index equality.

      Overrides:
      equals in class Object
      Parameters:
      o - object to compare with
      Returns:
      true if index is equivalent to the other index false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object