diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2016-05-18 19:24:12 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2016-05-18 19:24:12 +0000 |
commit | 47a9886af53a48dae11b4e3100f9731c35fbed4b (patch) | |
tree | 05926f00df029b3ec97bd096bebba1d8d6789bc5 /src/main/java/com | |
parent | 03ce793c7c47942c97ac792ec7baca9fc1fc6384 (diff) | |
download | jackcess-47a9886af53a48dae11b4e3100f9731c35fbed4b.tar.gz jackcess-47a9886af53a48dae11b4e3100f9731c35fbed4b.zip |
primary key indexes should also have required flag
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@988 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() { |