001package io.ebean.config.dbplatform.hana;
002
003import io.ebean.config.dbplatform.BasicSqlLimiter;
004
005public class HanaBasicSqlLimiter implements BasicSqlLimiter {
006  @Override
007  public String limit(String dbSql, int firstRow, int maxRows) {
008    StringBuilder sb = new StringBuilder(50 + dbSql.length());
009
010    sb.append(dbSql);
011
012    if (maxRows > 0) {
013      sb.append(" ").append("limit");
014      sb.append(" ").append(maxRows);
015
016      if (firstRow > 0) {
017        sb.append(" ").append("offset").append(" ");
018        sb.append(firstRow);
019      }
020    }
021
022    return sb.toString();
023  }
024}