Package org.beangle.db.jdbc.grammar

Examples of org.beangle.db.jdbc.grammar.SequenceGrammar


    super("[8.0]");
  }

  @Override
  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select name as sequence_name,start-1 as current_value,increment,cache from sysibm.syssequences where schema=':schema'");
    ss.setNextValSql("values nextval for :name");
    ss.setDropSql("drop sequence :name restrict");
    ss.setSelectNextValSql("nextval for :name");
    return ss;
  }
View Full Code Here


    super("[8.4)");
  }

  @Override
  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select relname as sequence_name from pg_class where relkind='S'");
    ss.setNextValSql("select nextval (':name')");
    ss.setSelectNextValSql("nextval (':name')");
    return ss;
  }
View Full Code Here

    super("[2.0.0,)");
  }

  @Override
  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select sequence_name,next_value,increment from information_schema.sequences where sequence_schema=':schema'");
    ss.setNextValSql("call next value for :name");
    ss.setSelectNextValSql("next value for :name");
    ss.setCreateSql("create sequence :name start with :start increment by :increment");
    ss.setDropSql("drop sequence if exists :name");
    return ss;
  }
View Full Code Here

    super("[1.3,)");
  }

  @Override
  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select sequence_name,current_value,increment,cache from information_schema.sequences where sequence_schema=':schema'");
    ss.setNextValSql("call next value for :name");
    ss.setSelectNextValSql("next value for :name");
    ss.setCreateSql("create sequence :name start with :start increment by :increment cache :cache");
    ss.setDropSql("drop sequence if exists :name");
    return ss;
  }
View Full Code Here

  public HSQL18Dialect() {
    super("(,1.8)");
  }

  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select sequence_name,start_with as current_value,increment from information_schema.system_sequences where sequence_schema=':schema'");
    ss.setNextValSql("call next value for :name");
    ss.setSelectNextValSql("next value for :name");
    ss.setCreateSql("create sequence :name start with :start increment by :increment");
    ss.setDropSql("drop sequence if exists :name");
    return ss;
  }
View Full Code Here

    registerKeywords("resource","level");
  }

  @Override
  protected SequenceGrammar buildSequenceGrammar() {
    SequenceGrammar ss = new SequenceGrammar();
    ss.setQuerySequenceSql("select sequence_name,last_number,increment_by,cache_size from all_sequences where sequence_owner=':schema'");
    ss.setCreateSql("create sequence :name increment by :increment start with :start cache :cache");
    ss.setNextValSql("select :name.nextval from dual");
    ss.setSelectNextValSql(":name.nextval");
    return ss;
  }
View Full Code Here

    }
  }

  public Set<Sequence> loadSequences(Connection connection, String schema) throws SQLException {
    Set<Sequence> sequences = CollectUtils.newHashSet();
    SequenceGrammar ss = dialect.getSequenceGrammar();
    if (null == ss) return sequences;
    String sql = ss.getQuerySequenceSql();
    sql = replace(sql, ":schema", schema);
    if (sql != null) {
      Statement statement = null;
      ResultSet rs = null;
      try {
View Full Code Here

TOP

Related Classes of org.beangle.db.jdbc.grammar.SequenceGrammar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.