com.samskivert.jdbc.depot.clause
Class Limit

java.lang.Object
  extended by com.samskivert.jdbc.depot.clause.QueryClause
      extended by com.samskivert.jdbc.depot.clause.Limit
All Implemented Interfaces:
SQLExpression

public class Limit
extends QueryClause

Represents a LIMIT/OFFSET clause, for pagination.


Field Summary
protected  int _count
          The number of rows, at most, to return.
protected  int _offset
          The first row of the result set to return.
 
Constructor Summary
Limit(int offset, int count)
           
 
Method Summary
 void accept(ExpressionVisitor builder)
          Most uses of this class have been implemented with a visitor pattern.
 void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
          Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation.
 int getCount()
           
 int getOffset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_offset

protected int _offset
The first row of the result set to return.


_count

protected int _count
The number of rows, at most, to return.

Constructor Detail

Limit

public Limit(int offset,
             int count)
Method Detail

getOffset

public int getOffset()

getCount

public int getCount()

accept

public void accept(ExpressionVisitor builder)
            throws Exception
Description copied from interface: SQLExpression
Most uses of this class have been implemented with a visitor pattern. Create your own ExpressionVisitor and call this method with it.

Throws:
Exception
See Also:
SQLBuilder

addClasses

public void addClasses(Collection<Class<? extends PersistentRecord>> classSet)
Description copied from interface: SQLExpression
Adds all persistent classes that are brought into the SQL context by this clause: FROM clauses, JOINs, UPDATEs, anything that could create a new table abbreviation. This method should recurse into any subordinate state that may in turn bring in new classes so that sub-queries work correctly.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.