org.spicefactory.pimento.service
Interface Query

All Known Implementing Classes:
DefaultQuery

public interface Query

Represents a single query to be executed by an associated persistence adapter.

Author:
Jens Halm

Method Summary
 int getFirstResult()
          Returns the zero-based offset of the first result.
 Map<String,Object> getHints()
          Returns the persistence-provider-specific hints for this query.
 int getMaxResults()
          Returns the maximum number of entities to include in the result.
 QueryMode getMode()
          Returns the mode for this query.
 Map<String,Object> getNamedParameters()
          Returns the named parameters for this query.
 Map<Integer,Object> getPositionalParameters()
          Returns the positional parameters for this query.
 String getQuery()
          Returns the query as a String.
 boolean isNamed()
          Checks whether this instance represents a named query.
 

Method Detail

isNamed

boolean isNamed()
Checks whether this instance represents a named query.

Returns:
true if this instance represents a named query

getMode

QueryMode getMode()
Returns the mode for this query.

Returns:
the mode for this query

getQuery

String getQuery()
Returns the query as a String. For a named query this is the name of the query, otherwise it is the query String itself.

Returns:
the query as a String

getFirstResult

int getFirstResult()
Returns the zero-based offset of the first result.

Returns:
the zero-based offset of the first result or -1 if not specified

getMaxResults

int getMaxResults()
Returns the maximum number of entities to include in the result.

Returns:
the maximum number of entities to include in the result or -1 if not specified

getHints

Map<String,Object> getHints()
Returns the persistence-provider-specific hints for this query.

Returns:
the persistence-provider-specific hints for this query

getNamedParameters

Map<String,Object> getNamedParameters()
Returns the named parameters for this query.

Returns:
the named parameters for this query

getPositionalParameters

Map<Integer,Object> getPositionalParameters()
Returns the positional parameters for this query.

Returns:
the positional parameters for this query