站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

CriteriaImpl.Subcriteria (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.impl
Class CriteriaImpl.Subcriteria

java.lang.Object
  extended bynet.sf.hibernate.impl.CriteriaImpl.Subcriteria
All Implemented Interfaces:
Criteria
Enclosing class:
CriteriaImpl

public final class CriteriaImpl.Subcriteria
extends Object
implements Criteria


Field Summary
 
Fields inherited from interface net.sf.hibernate.Criteria
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, 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
 Class getCriteriaClass()
          Get the persistent class that this Criteria applies to
 Class getCriteriaClass(String alias)
          Get the persistent class that the alias refers to
 List list()
          Get the results.
 Criteria returnMaps()
          Return each row of results as a Map from alias to an instance of the aliased entity
 Criteria returnRootEntities()
          Return each row of results as a single instance of the "root" entity (this is the default mode)
 Criteria setCacheable(boolean cacheable)
          Enable caching of this query result set
 Criteria setCacheRegion(String cacheRegion)
          Set the name of the cache region.
 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 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 setResultTransformer(ResultTransformer resultProcessor)
          Set a strategy for handling the query results.
 Criteria setTimeout(int timeout)
          Set a timeout for the underlying JDBC query.
 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, toString, wait, wait, wait
 

Method Detail

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

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

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

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

getCriteriaClass

public Class getCriteriaClass()
Description copied from interface: Criteria
Get the persistent class that this Criteria applies to

Specified by:
getCriteriaClass in interface Criteria

getCriteriaClass

public Class getCriteriaClass(String alias)
Description copied from interface: Criteria
Get the persistent class that the alias refers to

Specified by:
getCriteriaClass in interface Criteria

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

returnMaps

public Criteria returnMaps()
Description copied from interface: Criteria
Return each row of results as a Map from alias to an instance of the aliased entity

Specified by:
returnMaps in interface Criteria
See Also:
Criteria.returnRootEntities()

returnRootEntities

public Criteria returnRootEntities()
Description copied from interface: Criteria
Return each row of results as a single instance of the "root" entity (this is the default mode)

Specified by:
returnRootEntities in interface Criteria
See Also:
Criteria.returnMaps()

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

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
See Also:
Criteria.ROOT_ENTITY, Criteria.DISTINCT_ROOT_ENTITY, Criteria.ALIAS_TO_ENTITY_MAP

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