From 0236f5a65ce5292291078fabe2234965e9e0a0ac Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Wed, 18 May 2016 02:11:33 +0000 Subject: [PATCH] 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 --- .../healthmarketscience/jackcess/IndexBuilder.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); } @@ -124,6 +125,14 @@ public class IndexBuilder return this; } + /** + * Sets this index to encforce required. + */ + public IndexBuilder setRequired() { + _flags |= IndexData.REQUIRED_INDEX_FLAG; + return this; + } + /** * Sets this index to ignore null values. */ -- 2.39.5