org.hibernate.impl
Class CriteriaImpl.Subcriteria

java.lang.Object
  extended byorg.hibernate.impl.CriteriaImpl.Subcriteria
All Implemented Interfaces:
Criteria, CriteriaSpecification, Serializable
Enclosing class:
CriteriaImpl

public final class CriteriaImpl.Subcriteria
extends Object
implements Criteria, Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.hibernate.criterion.CriteriaSpecification
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, PROJECTION, ROOT_ALIAS, ROOT_ENTITY
 
Method Summary
 Criteria add(Criterion expression)
          Add a Criterion to constrain the results to be retrieved.
 Criteria addOrder(Order order)
          Add an Order to the result set.
 Criteria createAlias(String associationPath, String alias)
          Join an association, assigning an alias to the joined entity
 Criteria createCriteria(String associationPath)
          Create a new Criteria, "rooted" at the associated entity
 Criteria createCriteria(String associationPath, String alias)
          Create a new Criteria, "rooted" at the associated entity, assigning the given alias
 String getAlias()
          Get the alias of the entity
 LockMode getLockMode()
           
 Criteria getParent()
           
 String getPath()
           
 List list()
          Get the results.
 ScrollableResults scroll()
          Get the results as an instance of ScrollableResults.
 ScrollableResults scroll(ScrollMode scrollMode)
          Get the results as an instance of ScrollableResults.
 Criteria setAlias(String alias)
           
 Criteria setCacheable(boolean cacheable)
          Enable caching of this query result set
 Criteria setCacheMode(CacheMode cacheMode)
          Override the cache mode
 Criteria setCacheRegion(String cacheRegion)
          Set the name of the cache region.
 Criteria setComment(String comment)
          Add a comment to the generated SQL
 Criteria setFetchMode(String associationPath, FetchMode mode)
          Specify an association fetching strategy for a one-to-many, many-to-one or one-to-one association, or for a collection of values.
 Criteria setFetchSize(int fetchSize)
          Set a fetch size for the underlying JDBC query.
 Criteria setFirstResult(int firstResult)
          Set the first result to be retrieved.
 Criteria setFlushMode(FlushMode flushMode)
          Override the flush mode
 Criteria setLockMode(LockMode lockMode)
          Set the lock mode of the current entity
 Criteria setLockMode(String alias, LockMode lockMode)
          Set the lock mode of the aliased entity
 Criteria setMaxResults(int maxResults)
          Set a limit upon the number of objects to be retrieved.
 Criteria setProjection(Projection projection)
          Set a projection of projection list, and select the PROJECTION result transformer
 Criteria setResultTransformer(ResultTransformer resultProcessor)
          Set a strategy for handling the query results.
 Criteria setTimeout(int timeout)
          Set a timeout for the underlying JDBC query.
 String toString()
           
 Object uniqueResult()
          Convenience method to return a single instance that matches the query, or null if the query returns no results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getParent

public Criteria getParent()

getPath

public String getPath()

toString

public String toString()

setAlias

public Criteria setAlias(String alias)

getAlias

public String getAlias()
Description copied from interface: Criteria
Get the alias of the entity

Specified by:
getAlias in interface Criteria

add

public Criteria add(Criterion expression)
Description copied from interface: Criteria
Add a Criterion to constrain the results to be retrieved.

Specified by:
add in interface Criteria
Parameters:
expression -
Returns:
Criteria

createAlias

public Criteria createAlias(String associationPath,
                            String alias)
                     throws HibernateException
Description copied from interface: Criteria
Join an association, assigning an alias to the joined entity

Specified by:
createAlias in interface Criteria
Throws:
HibernateException

addOrder

public Criteria addOrder(Order order)
Description copied from interface: Criteria
Add an Order to the result set.

Specified by:
addOrder in interface Criteria
Parameters:
order -
Returns:
Criteria

setCacheable

public Criteria setCacheable(boolean cacheable)
Description copied from interface: Criteria
Enable caching of this query result set

Specified by:
setCacheable in interface Criteria

setCacheRegion

public Criteria setCacheRegion(String cacheRegion)
Description copied from interface: Criteria
Set the name of the cache region.

Specified by:
setCacheRegion in interface Criteria
Parameters:
cacheRegion - the name of a query cache region, or null for the default query cache

createCriteria

public Criteria createCriteria(String associationPath)
                        throws HibernateException
Description copied from interface: Criteria
Create a new Criteria, "rooted" at the associated entity

Specified by:
createCriteria in interface Criteria
Throws:
HibernateException

list

public List list()
          throws HibernateException
Description copied from interface: Criteria
Get the results.

Specified by:
list in interface Criteria
Returns:
List
Throws:
HibernateException

scroll

public ScrollableResults scroll()
                         throws HibernateException
Description copied from interface: Criteria
Get the results as an instance of ScrollableResults.

Specified by:
scroll in interface Criteria
Returns:
ScrollableResults
Throws:
HibernateException

scroll

public ScrollableResults scroll(ScrollMode scrollMode)
                         throws HibernateException
Description copied from interface: Criteria
Get the results as an instance of ScrollableResults.

Specified by:
scroll in interface Criteria
Returns:
ScrollableResults
Throws:
HibernateException

uniqueResult

public Object uniqueResult()
                    throws HibernateException
Description copied from interface: Criteria
Convenience method to return a single instance that matches the query, or null if the query returns no results.

Specified by:
uniqueResult in interface Criteria
Returns:
the single result or null
Throws:
HibernateException - if there is more than one matching result

setFetchMode

public Criteria setFetchMode(String associationPath,
                             FetchMode mode)
                      throws HibernateException
Description copied from interface: Criteria
Specify an association fetching strategy for a one-to-many, many-to-one or one-to-one association, or for a collection of values.

Specified by:
setFetchMode in interface Criteria
Parameters:
associationPath - a dot seperated property path
mode - the fetch mode
Returns:
the Criteria object for method chaining
Throws:
HibernateException

setFlushMode

public Criteria setFlushMode(FlushMode flushMode)
Description copied from interface: Criteria
Override the flush mode

Specified by:
setFlushMode in interface Criteria

setCacheMode

public Criteria setCacheMode(CacheMode cacheMode)
Description copied from interface: Criteria
Override the cache mode

Specified by:
setCacheMode in interface Criteria

setFirstResult

public Criteria setFirstResult(int firstResult)
Description copied from interface: Criteria
Set the first result to be retrieved.

Specified by:
setFirstResult in interface Criteria
Parameters:
firstResult - the first result, numbered from 0
Returns:
Criteria

setMaxResults

public Criteria setMaxResults(int maxResults)
Description copied from interface: Criteria
Set a limit upon the number of objects to be retrieved.

Specified by:
setMaxResults in interface Criteria
Parameters:
maxResults - the maximum number of results
Returns:
Criteria

setTimeout

public Criteria setTimeout(int timeout)
Description copied from interface: Criteria
Set a timeout for the underlying JDBC query.

Specified by:
setTimeout in interface Criteria
Parameters:
timeout -
Returns:
Criteria

setFetchSize

public Criteria setFetchSize(int fetchSize)
Description copied from interface: Criteria
Set a fetch size for the underlying JDBC query.

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

createCriteria

public Criteria createCriteria(String associationPath,
                               String alias)
                        throws HibernateException
Description copied from interface: Criteria
Create a new Criteria, "rooted" at the associated entity, assigning the given alias

Specified by:
createCriteria in interface Criteria
Throws:
HibernateException

setLockMode

public Criteria setLockMode(LockMode lockMode)
Description copied from interface: Criteria
Set the lock mode of the current entity

Specified by:
setLockMode in interface Criteria
Parameters:
lockMode - the lock mode

getLockMode

public LockMode getLockMode()

setLockMode

public Criteria setLockMode(String alias,
                            LockMode lockMode)
Description copied from interface: Criteria
Set the lock mode of the aliased entity

Specified by:
setLockMode in interface Criteria
Parameters:
alias - an alias
lockMode - the lock mode

setResultTransformer

public Criteria setResultTransformer(ResultTransformer resultProcessor)
Description copied from interface: Criteria
Set a strategy for handling the query results. This determines the "shape" of the query result set.

Specified by:
setResultTransformer in interface Criteria
Parameters:
resultProcessor -
See Also:
CriteriaSpecification.ROOT_ENTITY, CriteriaSpecification.DISTINCT_ROOT_ENTITY, CriteriaSpecification.ALIAS_TO_ENTITY_MAP

setComment

public Criteria setComment(String comment)
Description copied from interface: Criteria
Add a comment to the generated SQL

Specified by:
setComment in interface Criteria
Parameters:
comment - a human-readable string

setProjection

public Criteria setProjection(Projection projection)
Description copied from interface: Criteria
Set a projection of projection list, and select the PROJECTION result transformer

Specified by:
setProjection in interface Criteria