001package io.ebean.config.dbplatform.sqlserver;
002
003import io.ebean.BackgroundExecutor;
004import io.ebean.config.dbplatform.SequenceStepIdGenerator;
005
006import javax.sql.DataSource;
007
008public class SqlServerStepSequence extends SequenceStepIdGenerator {
009
010  private final String nextSql;
011
012  /**
013   * Construct where batchSize is the sequence step size.
014   */
015  public SqlServerStepSequence(BackgroundExecutor be, DataSource ds, String seqName, int stepSize) {
016    super(be, ds, seqName, stepSize);
017    this.nextSql = "select next value for "+seqName;
018  }
019
020  @Override
021  public String getSql(int batchSize) {
022    return nextSql;
023  }
024}