]> source.dussan.org Git - jackcess.git/commitdiff
primary key indexes should also have required flag
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 18 May 2016 02:11:33 +0000 (02:11 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 18 May 2016 02:11:33 +0000 (02:11 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/mutateops@987 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/IndexBuilder.java

index 88be6c5a45e7940723812532e87b43810256aaca..9c9f5849c463369b3a57919a94a0ecacbc78881f 100644 (file)
@@ -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.
    */