From: James Ahlborn Date: Mon, 17 Mar 2008 15:31:26 +0000 (+0000) Subject: add some notes on unique indexes X-Git-Tag: rel_1_1_13~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8f8d0c0756b4f483ddf1022743387c65d0769d1d;p=jackcess.git add some notes on unique indexes git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@279 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/Index.java b/src/java/com/healthmarketscience/jackcess/Index.java index d0431db..d52db99 100644 --- a/src/java/com/healthmarketscience/jackcess/Index.java +++ b/src/java/com/healthmarketscience/jackcess/Index.java @@ -233,10 +233,25 @@ public class Index implements Comparable { return _indexType == FOREIGN_KEY_INDEX_TYPE; } + /** + * Whether or not {@code null} values are actually recorded in the index. + */ public boolean shouldIgnoreNulls() { return((_indexFlags & IGNORE_NULLS_INDEX_FLAG) != 0); } - + + /** + * Whether or not index entries must be unique. + *

+ * Some notes about uniqueness: + *

+ */ public boolean isUnique() { return(isPrimaryKey() || ((_indexFlags & UNIQUE_INDEX_FLAG) != 0)); } @@ -694,8 +709,8 @@ public class Index implements Comparable { idx = missingIndexToInsertionPoint(idx); // determine if the addition of this entry would break the uniqueness - // constraint (note, access does not seem to consider multiple null - // entries invalid for a "unique" index) + // constraint. See isUnique() for some notes about uniqueness as + // defined by Access. if(isUnique() && !isNullEntry && (((idx > 0) && newEntry.equalsEntryBytes(_entries.get(idx - 1))) ||