sk.baka.tools.jpa
Class Paging

java.lang.Object
  extended by sk.baka.tools.jpa.Paging
All Implemented Interfaces:
Serializable

@Immutable
public final class Paging
extends Object
implements Serializable

Paging criteria.

Author:
Martin Vysny
See Also:
Serialized Form

Field Summary
 int firstResult
          the start position of the first result, numbered from 0.
 int maxResults
          the maximum number of results to retrieve.
 
Constructor Summary
Paging(int firstResult, int maxResults)
          Creates new paging results criteria.
 
Method Summary
 javax.persistence.Query apply(javax.persistence.Query query)
          Applies the paging criteria to given query.
 boolean equals(Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstResult

public final int firstResult
the start position of the first result, numbered from 0.


maxResults

public final int maxResults
the maximum number of results to retrieve.

Constructor Detail

Paging

public Paging(int firstResult,
              int maxResults)
Creates new paging results criteria.

Parameters:
firstResult - the start position of the first result, numbered from 0.
maxResults - the maximum number of results to retrieve.
Method Detail

apply

public javax.persistence.Query apply(javax.persistence.Query query)
Applies the paging criteria to given query.

Parameters:
query - the query
Returns:
query with applied values.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009-2010. All Rights Reserved.