Class PrimaryKey

java.lang.Object
org.apache.sis.internal.sql.feature.PrimaryKey
Direct Known Subclasses:
PrimaryKey.Composite, PrimaryKey.Single

abstract class PrimaryKey extends Object
Represents SQL primary key constraint. It contains the list of columns composing the key.
Since:
1.1
Version:
1.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
    A primary key composed of two or more columns.
    private static final class 
    A primary key composed of exactly one column.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final Class<?>
    The class of primary key values.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PrimaryKey(Class<?> valueClass)
    For sub-class constructors only.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static PrimaryKey
    create(Class<?> valueClass, Collection<String> columns)
    Creates a new key for the given columns, or returns null if none.
    abstract List<String>
    Returns the list of column names composing the key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • valueClass

      final Class<?> valueClass
      The class of primary key values. If the primary key use more than one column, then this field is the class of an array; it may be an array of primitive type.
  • Constructor Details

    • PrimaryKey

      PrimaryKey(Class<?> valueClass)
      For sub-class constructors only.
  • Method Details

    • create

      static PrimaryKey create(Class<?> valueClass, Collection<String> columns)
      Creates a new key for the given columns, or returns null if none.
      Parameters:
      columns - the columns composing the primary key. May be empty.
      Returns:
      the primary key, or null if the given list is empty.
    • getColumns

      public abstract List<String> getColumns()
      Returns the list of column names composing the key. Shall never be null nor empty.
      Returns:
      column names composing the key. Contains at least one element.