All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.miemiedev.mybatis.paginator.dialect.H2Dialect Maven / Gradle / Ivy

The newest version!
package com.github.miemiedev.mybatis.paginator.dialect;


import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.mapping.MappedStatement;

/**
 * A dialect compatible with the H2 database.
 * 
 * @author Thomas Mueller
 * @author miemiedev
 */
public class H2Dialect extends Dialect {

    public H2Dialect(MappedStatement mappedStatement, Object parameterObject, PageBounds pageBounds) {
        super(mappedStatement, parameterObject, pageBounds);
    }

    protected String getLimitString(String sql, String offsetName,int offset, String limitName, int limit) {
		return new StringBuffer(sql.length() + 40).
			append(sql).
			append((offset > 0) ? " limit "+String.valueOf(limit)+" offset "+String.valueOf(offset) : " limit "+String.valueOf(limit)).
			toString();
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy