com.elasticpath.persistence
Interface Query

All Known Implementing Classes:
HibernateQueryImpl

public interface Query

Represents a query in ElasticPath.


Method Summary
 java.util.List list()
          Return the query results as a List.
 void setFetchSize(int fetchSize)
          Set a fetch size for the underlying JDBC query.
 void setMaxResults(int maxResults)
          Set the maximum number of rows to retrieve.
 void setParameter(int position, java.lang.Object val)
          Bind a value to a JDBC-style query parameter.
 

Method Detail

list

java.util.List list()
                    throws EpPersistenceException
Return the query results as a List. If the query contains multiple results pre row, the results are returned in an instance of Object[].

Returns:
the result list
Throws:
EpPersistenceException - in case of errors

setFetchSize

void setFetchSize(int fetchSize)
Set a fetch size for the underlying JDBC query.

Parameters:
fetchSize - the fetch size

setMaxResults

void setMaxResults(int maxResults)
Set the maximum number of rows to retrieve. If not set, there is no limit to the number of rows retrieved.

Parameters:
maxResults - the maximum number of rows

setParameter

void setParameter(int position,
                  java.lang.Object val)
                  throws EpPersistenceException
Bind a value to a JDBC-style query parameter.

Parameters:
position - the position of the parameter in the query string, numbered from 0.
val - the non-null parameter value
Throws:
EpPersistenceException - if no type could be determined for the parameter