HSQLDialect.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Copyright (c) 2011-2014, hubin (jobob@qq.com).
  3. * <p>
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. * <p>
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * <p>
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.baomidou.mybatisplus.plugins.pagination.dialects;
  17. import com.baomidou.mybatisplus.plugins.pagination.IDialect;
  18. /**
  19. * <p>
  20. * HSQL 数据库分页语句组装实现
  21. * </p>
  22. *
  23. * @author hubin
  24. * @Date 2016-01-23
  25. */
  26. public class HSQLDialect implements IDialect {
  27. public static final HSQLDialect INSTANCE = new HSQLDialect();
  28. @Override
  29. public String buildPaginationSql(String originalSql, int offset, int limit) {
  30. StringBuilder sql = new StringBuilder(originalSql);
  31. sql.append(" limit ").append(offset).append(",").append(limit);
  32. return sql.toString();
  33. }
  34. }