Package org.beangle.db.jdbc.grammar

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


    registerType(BLOB, "oid");
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean("{} limit ?", "{} limit ? offset ?", true, false, false);
  }
View Full Code Here


    registerType(CLOB, "longvarchar");
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean("{} limit ?", "{}  offset ? limit ?", false, false, false);
  }
View Full Code Here

    registerType(CLOB, "text");
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean(null, null, false, false, true) {

      public String limit(String querySqlString, boolean hasOffset) {
        StringBuilder sb = new StringBuilder(querySqlString.trim().toLowerCase());

        int orderByIndex = sb.indexOf("order by");
View Full Code Here

        .append(hasOffset ? " limit ? offset ?" : " limit ?").toString();
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean("{} limit ?", "{} limit ? offset ?", true, false, false);
  }
View Full Code Here

    registerType(CLOB, "longtext");
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean("{} limit ?", "{} limit ?, ?", false, false, false);
  }
View Full Code Here

    return bean;
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean(null, null, false, true, false) {
      @Override
      public String limit(String sql, boolean hasOffset) {
        return new StringBuilder(sql.length() + 10).append(sql)
            .insert(sql.toLowerCase().indexOf("select") + 6, hasOffset ? " limit ? ?" : " top ?")
            .toString();
View Full Code Here

    registerType(CLOB, "clob");
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean(null, null, true, false, true) {
      public String limit(String sql, boolean hasOffset) {
        sql = sql.trim();
        boolean isForUpdate = false;
        if (sql.toLowerCase().endsWith(" for update")) {
          sql = sql.substring(0, sql.length() - 11);
View Full Code Here

    return sql.toLowerCase().indexOf("select distinct") >= 0;
  }

  @Override
  protected LimitGrammar buildLimitGrammar() {
    return new LimitGrammarBean(null, null, false, false, true) {
      public String limit(String sql, boolean hasOffset) {
        int startOfSelect = sql.toLowerCase().indexOf("select");
        StringBuilder pagingSelect = new StringBuilder(sql.length() + 100)
            .append(sql.substring(0, startOfSelect)) // add the comment
            .append("select * from ( select ") // nest the main query in an
View Full Code Here

TOP

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

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.