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

com.jn.sqlhelper.hibernate.dialect.HibernateSqlHelpers Maven / Gradle / Ivy

The newest version!
package com.jn.sqlhelper.hibernate.dialect;

import com.jn.sqlhelper.dialect.pagination.RowSelection;
/**
 * @since 3.6.1
 */
class HibernateSqlHelpers {
    public static RowSelection toSqlHelperRowSelection(org.hibernate.engine.spi.RowSelection rowSelection) {
        RowSelection rs = new RowSelection();
        rs.setMaxRows(rowSelection.getMaxRows());
        rs.setFetchSize(rowSelection.getFetchSize());
        rs.setTimeout(rowSelection.getTimeout());
        Integer firstRow = rowSelection.getFirstRow();
        if (firstRow != null) {
            rs.setOffset(firstRow.longValue());
        }
        rs.setLimit(rowSelection.getMaxRows());
        return rs;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy