com.elasticpath.persistence.impl
Class HibernateQueryImpl

java.lang.Object
  extended by com.elasticpath.persistence.impl.HibernateQueryImpl
All Implemented Interfaces:
Query

public class HibernateQueryImpl
extends java.lang.Object
implements Query

The hibernate implementation of a query in ElasticPath. It is a wrap of org.hibernate.Query.


Constructor Summary
HibernateQueryImpl(org.hibernate.Query query)
          The default constructor.
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateQueryImpl

public HibernateQueryImpl(org.hibernate.Query query)
The default constructor.

Parameters:
query - the hibernate query
Method Detail

list

public 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[].

Specified by:
list in interface Query
Returns:
the result list
Throws:
EpPersistenceException - in case of errors

setFetchSize

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

Specified by:
setFetchSize in interface Query
Parameters:
fetchSize - the fetch size

setMaxResults

public 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.

Specified by:
setMaxResults in interface Query
Parameters:
maxResults - the maximum number of rows

setParameter

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

Specified by:
setParameter in interface Query
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