|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.impl.CriteriaImpl
Implementation of the Criteria interface
| Nested Class Summary | |
static class |
CriteriaImpl.CriterionEntry
|
class |
CriteriaImpl.Subcriteria
|
| Field Summary |
| Fields inherited from interface net.sf.hibernate.Criteria |
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, ROOT_ALIAS, ROOT_ENTITY |
| Constructor Summary | |
CriteriaImpl(Class persistentClass,
CriteriaImpl original)
Copy all the internal attributes of the given CrtieriaImpl except alter the root persistent class type to be the given one. |
|
CriteriaImpl(Class persistentClass,
SessionImpl session)
|
|
| Method Summary | |
Criteria |
add(Criterion expression)
Add a Criterion to constrain the results to be retrieved. |
Criteria |
add(String alias,
Criterion expression)
|
Criteria |
addOrder(Order ordering)
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(String associationPath)
|
Map |
getAliasClasses()
|
boolean |
getCacheable()
|
String |
getCacheRegion()
|
Class |
getClassForPath(String rootAlias,
String associationPath)
|
Class |
getCriteriaClass()
Get the persistent class that this Criteria applies to |
Class |
getCriteriaClass(String alias)
Get the persistent class that the alias refers to |
FetchMode |
getFetchMode(String path)
|
Integer |
getFetchSize()
|
Integer |
getFirstResult()
|
Map |
getLockModes()
|
Integer |
getMaxResults()
|
Class |
getPersistentClass(String alias)
|
ResultTransformer |
getResultTransformer()
|
Integer |
getTimeout()
|
boolean |
isJoin(String path)
|
Iterator |
iterateExpressionEntries()
|
Iterator |
iterateOrderings()
|
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 tupleMapper)
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 |
| Constructor Detail |
public CriteriaImpl(Class persistentClass, SessionImpl session)
public CriteriaImpl(Class persistentClass, CriteriaImpl original)
| Method Detail |
public Criteria setMaxResults(int maxResults)
Criteria
setMaxResults in interface CriteriamaxResults - the maximum number of results
public Criteria setFirstResult(int firstResult)
Criteria
setFirstResult in interface CriteriafirstResult - the first result, numbered from 0
public Criteria setTimeout(int timeout)
Criteria
setTimeout in interface Criteriatimeout -
public Criteria setFetchSize(int fetchSize)
Criteria
setFetchSize in interface CriteriafetchSize - the fetch sizepublic Criteria add(Criterion expression)
Criteria
expression -
public Integer getMaxResults()
public Integer getFirstResult()
public Integer getTimeout()
public Integer getFetchSize()
public List list() throws HibernateException
Criteria
HibernateExceptionpublic Iterator iterateExpressionEntries()
public Iterator iterateOrderings()
public Class getPersistentClass(String alias)
public Map getAliasClasses()
public String toString()
public Criteria addOrder(Order ordering)
Criteria
ordering -
public FetchMode getFetchMode(String path)
public Criteria setFetchMode(String associationPath, FetchMode mode)
Criteria
setFetchMode in interface CriteriaassociationPath - a dot seperated property pathmode - the fetch mode
public Criteria createAlias(String associationPath, String alias) throws HibernateException
Criteria
createAlias in interface CriteriaHibernateExceptionpublic boolean isJoin(String path)
public String getAlias(String associationPath)
public Criteria add(String alias, Criterion expression)
public Class getClassForPath(String rootAlias, String associationPath) throws HibernateException
HibernateExceptionpublic Criteria createCriteria(String associationPath) throws HibernateException
Criteria
createCriteria in interface CriteriaHibernateExceptionpublic Object uniqueResult() throws HibernateException
Criteria
uniqueResult in interface CriteriaHibernateException - if there is more than one matching resultpublic Class getCriteriaClass()
Criteria
getCriteriaClass in interface Criteriapublic Class getCriteriaClass(String alias)
Criteria
getCriteriaClass in interface Criteriapublic Criteria createCriteria(String associationPath, String alias) throws HibernateException
Criteria
createCriteria in interface CriteriaHibernateExceptionpublic Criteria returnMaps()
Criteria
returnMaps in interface CriteriaCriteria.returnRootEntities()public Criteria returnRootEntities()
Criteria
returnRootEntities in interface CriteriaCriteria.returnMaps()public Criteria setLockMode(LockMode lockMode)
Criteria
setLockMode in interface CriterialockMode - the lock modepublic Criteria setLockMode(String alias, LockMode lockMode)
Criteria
setLockMode in interface Criteriaalias - an aliaslockMode - the lock modepublic Map getLockModes()
public ResultTransformer getResultTransformer()
public Criteria setResultTransformer(ResultTransformer tupleMapper)
Criteria
setResultTransformer in interface CriteriaCriteria.ROOT_ENTITY,
Criteria.DISTINCT_ROOT_ENTITY,
Criteria.ALIAS_TO_ENTITY_MAPpublic boolean getCacheable()
public String getCacheRegion()
public Criteria setCacheable(boolean cacheable)
Criteria
setCacheable in interface Criteriapublic Criteria setCacheRegion(String cacheRegion)
Criteria
setCacheRegion in interface CriteriacacheRegion - the name of a query cache region, or null
for the default query cache
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||