Class PrimaryKey
java.lang.Object
org.apache.sis.internal.sql.feature.PrimaryKey
- Direct Known Subclasses:
PrimaryKey.Composite
,PrimaryKey.Single
Represents SQL primary key constraint.
It contains the list of columns composing the key.
- Since:
- 1.1
- Version:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate 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
FieldsModifier and TypeFieldDescription(package private) final Class<?>
The class of primary key values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static PrimaryKey
create
(Class<?> valueClass, Collection<String> columns) Creates a new key for the given columns, or returnsnull
if none.Returns the list of column names composing the key.
-
Field Details
-
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
Creates a new key for the given columns, or returnsnull
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
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.
-