#275 - ENH: Add support for @SequenceGenerator initialValue and allocationSize

This commit is contained in:
rbygrave committed 2015-04-12 12:10:57 +12:00
1 parent 6c37dc494b
commit 2ed5e026e0
6 files changed
+70 -14

No files matched your search

@@ -36,12 +36,14 @@ public class CreateSequenceVisitor implements BeanVisitor {
+" as DatabasePlatform does not support sequences";
logger.warn(msg);
return false;
}
}
if (descriptor.getSequenceName() != null) {
ctx.write("create sequence ");
ctx.write(descriptor.getSequenceName());
ctx.write(";").writeNewLine().writeNewLine();
String sequenceName = descriptor.getSequenceName();
if (sequenceName != null) {
int initialValue = descriptor.getSequenceInitialValue();
int allocationSize = descriptor.getSequenceAllocationSize();
String createSeq = ctx.getDbPlatform().ddlCreateSequence(sequenceName, initialValue, allocationSize);
ctx.write(createSeq).writeNewLine().writeNewLine();
}
return true;
}