summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2010-06-09 20:27:29 -0700
committerShawn O. Pearce <sop@google.com>2010-06-09 20:27:29 -0700
commite510ae9bf66bab77e211e708ebd2fb0666e7ce59 (patch)
treecb4bb23b74fb487c0a0d4133c80086843a1d82cc
parent9c5c5d6a79403812ff7514d84ba0cbec0bde089a (diff)
downloadgwtorm-e510ae9bf66bab77e211e708ebd2fb0666e7ce59.tar.gz
Fix sequences on NoSQL to start at 1
The documentation says a sequence starts at 1, but we were starting from 0 when the starting value wasn't specified in the annotation. Fix it by starting from 1 if the annotation has 0. Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--src/main/java/com/google/gwtorm/nosql/generic/GenericSchema.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/gwtorm/nosql/generic/GenericSchema.java b/src/main/java/com/google/gwtorm/nosql/generic/GenericSchema.java
index 6607444..38568ff 100644
--- a/src/main/java/com/google/gwtorm/nosql/generic/GenericSchema.java
+++ b/src/main/java/com/google/gwtorm/nosql/generic/GenericSchema.java
@@ -85,6 +85,9 @@ public abstract class GenericSchema extends NoSqlSchema {
.getSequences()) {
if (poolName.equals(s.getSequenceName())) {
start = s.getSequence().startWith();
+ if (start == 0) {
+ start = 1;
+ }
break;
}
}