예제 #1
0
 @Override
 public final void bind(BindContext context) {
   if (symmetric
       && asList(CUBRID, DB2, DERBY, FIREBIRD, H2, MYSQL, ORACLE, SQLSERVER, SQLITE, SYBASE)
           .contains(context.getDialect())) {
     simulateSymmetric().bind(context);
   } else {
     context.bind(field).bind(minValue).bind(maxValue);
   }
 }
예제 #2
0
파일: Limit.java 프로젝트: hanzheng/jOOQ
  @Override
  public final void bind(BindContext context) {
    switch (context.getDialect()) {

        // OFFSET .. LIMIT support provided by the following dialects
        // ----------------------------------------------------------
      case MYSQL:
      case DERBY:
        {
          context.bind(val(getOffset()));
          context.bind(val(getNumberOfRows()));
          break;
        }

        // LIMIT .. OFFSET support provided by the following dialects
        // ----------------------------------------------------------
      case HSQLDB:
      case H2:
      case POSTGRES:
      case SQLITE:
        {
          context.bind(val(getNumberOfRows()));
          context.bind(val(getOffset()));
          break;
        }

        // No bind variables in the TOP .. START AT clause
        // -----------------------------------------------
      case INGRES:
      case SYBASE:
        {
          break;
        }

        // These dialects don't allow bind variables in their TOP clauses
        // --------------------------------------------------------------
      case ASE:
      case DB2:
      case SQLSERVER:
        {

          // TOP clauses without bind variables
          if (offset == 0) {
            break;
          }

          // With simulated OFFSETs, no break, fall through
          else {
          }
        }

        // Oracle knows no TOP clause, limits are always bound
        // Also, with simulated OFFSETs, the previous dialects fall through
        // -----------------------------------------------------------------
      case ORACLE:
        {
          context.bind(val(getLowerRownum()));
          context.bind(val(getUpperRownum()));
          break;
        }
    }
  }