Package com.exasol.sql.dql.select
Class LimitClause
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.dql.select.LimitClause
-
- All Implemented Interfaces:
SelectFragment
,Fragment
public class LimitClause extends AbstractFragment implements SelectFragment
This class represents the limit clause of an SQL statement. It lets you choose offset and / or count of rows to be handed back in the result.
-
-
Field Summary
-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Constructor Description LimitClause(SqlStatement root, int count)
Create a new instance of aLimitClause
LimitClause(SqlStatement root, int offset, int count)
Create a new instance of aLimitClause
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(SelectVisitor visitor)
Accept a visitor (e.g.int
getCount()
Get the maximum number of rows to be handed backint
getOffset()
Get the offset row for the limitboolean
hasOffset()
Check if the limit clause has an offset-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Constructor Detail
-
LimitClause
public LimitClause(SqlStatement root, int count)
Create a new instance of aLimitClause
- Parameters:
root
- SQL statement this LIMIT clause belongs tocount
- maximum number of rows to be included in the query result
-
LimitClause
public LimitClause(SqlStatement root, int offset, int count)
Create a new instance of aLimitClause
- Parameters:
root
- SQL statement this LIMIT clause belongs tooffset
- index of the first row to be included in the query resultcount
- maximum number of rows to be included in the query result
-
-
Method Detail
-
getOffset
public int getOffset()
Get the offset row for the limit- Returns:
- first row which should be handed back
-
getCount
public int getCount()
Get the maximum number of rows to be handed back- Returns:
- maximum number of rows
-
hasOffset
public boolean hasOffset()
Check if the limit clause has an offset- Returns:
true
if the limit clause has an offset
-
accept
public void accept(SelectVisitor visitor)
Description copied from interface:SelectFragment
Accept a visitor (e.g. a renderer or validator)- Specified by:
accept
in interfaceSelectFragment
- Parameters:
visitor
- visitor to accept
-
-