diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2016-05-18 02:11:33 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2016-05-18 02:11:33 +0000 |
commit | 0236f5a65ce5292291078fabe2234965e9e0a0ac (patch) | |
tree | 4c3016384888e5c76d21c243c5ce5099f7d242c7 /src/main/java/com | |
parent | f243a9931563d6912fde914709fc4c99a1263e2c (diff) | |
download | jackcess-0236f5a65ce5292291078fabe2234965e9e0a0ac.tar.gz jackcess-0236f5a65ce5292291078fabe2234965e9e0a0ac.zip |
primary key indexes should also have required flag
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/mutateops@987 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java b/src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java index 88be6c5..9c9f584 100644 --- a/src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java +++ b/src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java @@ -109,10 +109,11 @@ public class IndexBuilder /** * Sets this index to be a primary key index (additionally sets the index as - * unique). + * unique and required). */ public IndexBuilder setPrimaryKey() { _type = IndexImpl.PRIMARY_KEY_INDEX_TYPE; + setRequired(); return setUnique(); } @@ -125,6 +126,14 @@ public class IndexBuilder } /** + * Sets this index to encforce required. + */ + public IndexBuilder setRequired() { + _flags |= IndexData.REQUIRED_INDEX_FLAG; + return this; + } + + /** * Sets this index to ignore null values. */ public IndexBuilder setIgnoreNulls() { |