Class AbstractDbmsLimitHandler
- java.lang.Object
-
- com.blazebit.persistence.impl.dialect.AbstractDbmsLimitHandler
-
- All Implemented Interfaces:
com.blazebit.persistence.spi.DbmsLimitHandler
- Direct Known Subclasses:
DB2DbmsLimitHandler,DefaultDbmsLimitHandler,MSSQL2012DbmsLimitHandler,MySQLDbmsLimitHandler,OracleDbmsLimitHandler,SQL2008DbmsLimitHandler
public abstract class AbstractDbmsLimitHandler extends Object implements com.blazebit.persistence.spi.DbmsLimitHandler
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
-
Constructor Summary
Constructors Constructor Description AbstractDbmsLimitHandler(int length)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringapplySql(String sql, boolean isSubquery, Integer limit, Integer offset)StringapplySqlInlined(String sql, boolean isSubquery, Integer limit, Integer offset)intbindLimitParametersAtStartOfQuery(Integer limit, Integer offset, PreparedStatement statement, int index)booleanlimitIncludesOffset()voidsetMaxRows(Integer limit, Integer offset, PreparedStatement statement)booleansupportsLimit()booleansupportsLimitOffset()protected abstract booleansupportsVariableLimit()Returns whether the dbms supports parameters for LIMIT and OFFSET via prepared statements.
-
-
-
Method Detail
-
supportsLimit
public boolean supportsLimit()
- Specified by:
supportsLimitin interfacecom.blazebit.persistence.spi.DbmsLimitHandler
-
supportsLimitOffset
public boolean supportsLimitOffset()
- Specified by:
supportsLimitOffsetin interfacecom.blazebit.persistence.spi.DbmsLimitHandler
-
limitIncludesOffset
public boolean limitIncludesOffset()
- Specified by:
limitIncludesOffsetin interfacecom.blazebit.persistence.spi.DbmsLimitHandler
-
supportsVariableLimit
protected abstract boolean supportsVariableLimit()
Returns whether the dbms supports parameters for LIMIT and OFFSET via prepared statements.- Returns:
- True if parameters allowed, otherwise false
-
applySql
public String applySql(String sql, boolean isSubquery, Integer limit, Integer offset)
- Specified by:
applySqlin interfacecom.blazebit.persistence.spi.DbmsLimitHandler
-
applySqlInlined
public String applySqlInlined(String sql, boolean isSubquery, Integer limit, Integer offset)
- Specified by:
applySqlInlinedin interfacecom.blazebit.persistence.spi.DbmsLimitHandler
-
bindLimitParametersAtStartOfQuery
public int bindLimitParametersAtStartOfQuery(Integer limit, Integer offset, PreparedStatement statement, int index) throws SQLException
- Specified by:
bindLimitParametersAtStartOfQueryin interfacecom.blazebit.persistence.spi.DbmsLimitHandler- Throws:
SQLException
-
setMaxRows
public void setMaxRows(Integer limit, Integer offset, PreparedStatement statement) throws SQLException
- Specified by:
setMaxRowsin interfacecom.blazebit.persistence.spi.DbmsLimitHandler- Throws:
SQLException
-
-