|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.hibernate.impl.CriteriaImpl
Implementation of the Criteria interface
| Nested Class Summary | |
static class |
CriteriaImpl.CriterionEntry
|
static class |
CriteriaImpl.OrderEntry
|
class |
CriteriaImpl.Subcriteria
|
| Field Summary |
| Fields inherited from interface org.hibernate.criterion.CriteriaSpecification |
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, PROJECTION, ROOT_ALIAS, ROOT_ENTITY |
| Constructor Summary | |
CriteriaImpl(String entityOrClassName,
SessionImplementor session)
|
|
CriteriaImpl(String entityOrClassName,
String alias,
SessionImplementor session)
|
|
| Method Summary | |
Criteria |
add(Criteria criteriaInst,
Criterion expression)
|
Criteria |
add(Criterion expression)
Add a Criterion to constrain the results to be retrieved. |
Criteria |
addOrder(Order ordering)
Add an Order to the result set. |
protected void |
after()
|
protected void |
before()
|
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 |
boolean |
getCacheable()
|
String |
getCacheRegion()
|
String |
getComment()
|
String |
getEntityOrClassName()
|
FetchMode |
getFetchMode(String path)
|
Integer |
getFetchSize()
|
Integer |
getFirstResult()
|
Map |
getLockModes()
|
Integer |
getMaxResults()
|
Projection |
getProjection()
|
Criteria |
getProjectionCriteria()
|
ResultTransformer |
getResultTransformer()
|
SessionImplementor |
getSession()
|
Integer |
getTimeout()
|
boolean |
isLookupByNaturalKey()
|
Iterator |
iterateExpressionEntries()
|
Iterator |
iterateOrderings()
|
Iterator |
iterateSubcriteria()
|
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 |
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 tupleMapper)
Set a strategy for handling the query results. |
void |
setSession(SessionImplementor session)
|
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(String entityOrClassName,
SessionImplementor session)
public CriteriaImpl(String entityOrClassName,
String alias,
SessionImplementor session)
| Method Detail |
public void setSession(SessionImplementor session)
public SessionImplementor getSession()
public Iterator iterateSubcriteria()
public Criteria setFlushMode(FlushMode flushMode)
Criteria
setFlushMode in interface Criteriapublic Criteria setCacheMode(CacheMode cacheMode)
Criteria
setCacheMode in interface Criteriapublic 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 Integer getFetchSize()
public Criteria setFetchSize(int fetchSize)
Criteria
setFetchSize in interface CriteriafetchSize - the fetch sizepublic Criteria setTimeout(int timeout)
Criteria
setTimeout in interface Criteriatimeout -
public Criteria add(Criterion expression)
Criteria
add in interface Criteriaexpression -
public String getAlias()
Criteria
getAlias in interface Criteriapublic Integer getMaxResults()
public Integer getFirstResult()
public Integer getTimeout()
public List list()
throws HibernateException
Criteria
list in interface CriteriaHibernateExceptionpublic ScrollableResults scroll()
Criteria
scroll in interface Criteriapublic ScrollableResults scroll(ScrollMode scrollMode)
Criteria
scroll in interface Criteriapublic 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 cachepublic Iterator iterateExpressionEntries()
public Iterator iterateOrderings()
public String toString()
public Criteria addOrder(Order ordering)
Criteria
addOrder in interface Criteriaordering -
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 CriteriaHibernateException
public Criteria add(Criteria criteriaInst,
Criterion expression)
public Object uniqueResult()
throws HibernateException
Criteria
uniqueResult in interface CriteriaHibernateException - if there is more than one matching resultpublic String getEntityOrClassName()
public Criteria createCriteria(String associationPath,
String alias)
throws HibernateException
Criteria
createCriteria in interface CriteriaHibernateException
public Criteria createCriteria(String associationPath)
throws HibernateException
Criteria
createCriteria in interface CriteriaHibernateExceptionpublic Criteria setLockMode(LockMode lockMode)
Criteria
setLockMode in interface CriterialockMode - the lock mode
public 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 CriteriatupleMapper - CriteriaSpecification.ROOT_ENTITY,
CriteriaSpecification.DISTINCT_ROOT_ENTITY,
CriteriaSpecification.ALIAS_TO_ENTITY_MAPpublic Criteria setComment(String comment)
Criteria
setComment in interface Criteriacomment - a human-readable stringpublic String getComment()
public Criteria setProjection(Projection projection)
Criteria
setProjection in interface Criteriapublic Projection getProjection()
public Criteria getProjectionCriteria()
protected void before()
protected void after()
public boolean isLookupByNaturalKey()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||