|
|||||||||||
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,
SessionImpl session)
|
|
CriteriaImpl(String entityOrClassName,
String alias,
SessionImpl 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()
|
SessionImpl |
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(SessionImpl 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, SessionImpl session)
public CriteriaImpl(String entityOrClassName, String alias, SessionImpl session)
Method Detail |
public void setSession(SessionImpl session)
public SessionImpl getSession()
public Iterator iterateSubcriteria()
public Criteria setFlushMode(FlushMode flushMode)
Criteria
setFlushMode
in interface Criteria
public Criteria setCacheMode(CacheMode cacheMode)
Criteria
setCacheMode
in interface Criteria
public Criteria setMaxResults(int maxResults)
Criteria
setMaxResults
in interface Criteria
maxResults
- the maximum number of results
public Criteria setFirstResult(int firstResult)
Criteria
setFirstResult
in interface Criteria
firstResult
- the first result, numbered from 0
public Integer getFetchSize()
public Criteria setFetchSize(int fetchSize)
Criteria
setFetchSize
in interface Criteria
fetchSize
- the fetch sizepublic Criteria setTimeout(int timeout)
Criteria
setTimeout
in interface Criteria
timeout
-
public Criteria add(Criterion expression)
Criteria
add
in interface Criteria
expression
-
public String getAlias()
Criteria
getAlias
in interface Criteria
public Integer getMaxResults()
public Integer getFirstResult()
public Integer getTimeout()
public List list() throws HibernateException
Criteria
list
in interface Criteria
HibernateException
public ScrollableResults scroll()
Criteria
scroll
in interface Criteria
public ScrollableResults scroll(ScrollMode scrollMode)
Criteria
scroll
in interface Criteria
public boolean getCacheable()
public String getCacheRegion()
public Criteria setCacheable(boolean cacheable)
Criteria
setCacheable
in interface Criteria
public Criteria setCacheRegion(String cacheRegion)
Criteria
setCacheRegion
in interface Criteria
cacheRegion
- 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 Criteria
ordering
-
public FetchMode getFetchMode(String path)
public Criteria setFetchMode(String associationPath, FetchMode mode)
Criteria
setFetchMode
in interface Criteria
associationPath
- a dot seperated property pathmode
- the fetch mode
public Criteria createAlias(String associationPath, String alias) throws HibernateException
Criteria
createAlias
in interface Criteria
HibernateException
public Criteria add(Criteria criteriaInst, Criterion expression)
public Object uniqueResult() throws HibernateException
Criteria
uniqueResult
in interface Criteria
HibernateException
- if there is more than one matching resultpublic String getEntityOrClassName()
public Criteria createCriteria(String associationPath, String alias) throws HibernateException
Criteria
createCriteria
in interface Criteria
HibernateException
public Criteria createCriteria(String associationPath) throws HibernateException
Criteria
createCriteria
in interface Criteria
HibernateException
public Criteria setLockMode(LockMode lockMode)
Criteria
setLockMode
in interface Criteria
lockMode
- the lock modepublic Criteria setLockMode(String alias, LockMode lockMode)
Criteria
setLockMode
in interface Criteria
alias
- an aliaslockMode
- the lock modepublic Map getLockModes()
public ResultTransformer getResultTransformer()
public Criteria setResultTransformer(ResultTransformer tupleMapper)
Criteria
setResultTransformer
in interface Criteria
tupleMapper
- CriteriaSpecification.ROOT_ENTITY
,
CriteriaSpecification.DISTINCT_ROOT_ENTITY
,
CriteriaSpecification.ALIAS_TO_ENTITY_MAP
public Criteria setComment(String comment)
Criteria
setComment
in interface Criteria
comment
- a human-readable stringpublic String getComment()
public Criteria setProjection(Projection projection)
Criteria
setProjection
in interface Criteria
public 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 |