Package mil.nga.geopackage.db.table
Class UniqueConstraint
- java.lang.Object
-
- mil.nga.geopackage.db.table.Constraint
-
- mil.nga.geopackage.db.table.UniqueConstraint
-
- All Implemented Interfaces:
Comparable<Constraint>
public class UniqueConstraint extends Constraint
Table unique constraint for one or more columns- Since:
- 3.3.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static String
UNIQUE
Unique keyword-
Fields inherited from class mil.nga.geopackage.db.table.Constraint
CONSTRAINT
-
-
Constructor Summary
Constructors Constructor Description UniqueConstraint()
ConstructorUniqueConstraint(Integer order)
ConstructorUniqueConstraint(String name)
ConstructorUniqueConstraint(String name, Integer order)
ConstructorUniqueConstraint(String name, UserColumn... columns)
ConstructorUniqueConstraint(UniqueConstraint userUniqueConstraint)
Copy ConstructorUniqueConstraint(UserColumn... columns)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(UserColumn... columns)
Add columnsString
buildSql()
Build the constraint SQLUniqueConstraint
copy()
Copy the constraintList<UserColumn>
getColumns()
Get the columns-
Methods inherited from class mil.nga.geopackage.db.table.Constraint
buildNameSql, compareTo, getName, getOrder, getType, setName, setOrder, setType
-
-
-
-
Field Detail
-
UNIQUE
public static final String UNIQUE
Unique keyword- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UniqueConstraint
public UniqueConstraint()
Constructor
-
UniqueConstraint
public UniqueConstraint(String name)
Constructor- Parameters:
name
- constraint name
-
UniqueConstraint
public UniqueConstraint(Integer order)
Constructor- Parameters:
order
- constraint order- Since:
- 5.0.0
-
UniqueConstraint
public UniqueConstraint(String name, Integer order)
Constructor- Parameters:
name
- constraint nameorder
- constraint order- Since:
- 5.0.0
-
UniqueConstraint
public UniqueConstraint(UserColumn... columns)
Constructor- Parameters:
columns
- columns
-
UniqueConstraint
public UniqueConstraint(String name, UserColumn... columns)
Constructor- Parameters:
name
- constraint namecolumns
- columns
-
UniqueConstraint
public UniqueConstraint(UniqueConstraint userUniqueConstraint)
Copy Constructor- Parameters:
userUniqueConstraint
- user unique constraint
-
-
Method Detail
-
buildSql
public String buildSql()
Build the constraint SQL- Specified by:
buildSql
in classConstraint
- Returns:
- sql constraint
-
copy
public UniqueConstraint copy()
Copy the constraint- Specified by:
copy
in classConstraint
- Returns:
- copied constraint
-
add
public void add(UserColumn... columns)
Add columns- Parameters:
columns
- columns
-
getColumns
public List<UserColumn> getColumns()
Get the columns- Returns:
- columns
-
-