addOrder
public Criteria addOrder(Order order)
- addOrder in interface Criteria
order
- The order
object representing an ordering
to be applied to the results.
- this (for method chaining)
createAlias
public Criteria createAlias(String associationPath,
String alias)
- createAlias in interface Criteria
associationPath
- A dot-seperated property pathalias
- The alias to assign to the joined association (for later reference).
- this (for method chaining)
createAlias
public Criteria createAlias(String associationPath,
String alias,
int joinType)
throws HibernateException
- createAlias in interface Criteria
associationPath
- A dot-seperated property pathalias
- The alias to assign to the joined association (for later reference).joinType
- The type of join to use.
- this (for method chaining)
createCriteria
public Criteria createCriteria(String associationPath)
- createCriteria in interface Criteria
associationPath
- A dot-seperated property path
- the created "sub criteria"
createCriteria
public Criteria createCriteria(String associationPath,
String alias)
- createCriteria in interface Criteria
associationPath
- A dot-seperated property pathalias
- The alias to assign to the joined association (for later reference).
- the created "sub criteria"
createCriteria
public Criteria createCriteria(String associationPath,
String alias,
int joinType)
throws HibernateException
Create a new Criteria, "rooted" at the associated entity,
assigning the given alias and using the specified join type.
- createCriteria in interface Criteria
associationPath
- A dot-seperated property pathalias
- The alias to assign to the joined association (for later reference).joinType
- The type of join to use.
- the created "sub criteria"
createCriteria
public Criteria createCriteria(String associationPath,
int joinType)
throws HibernateException
Create a new Criteria, "rooted" at the associated entity, using the
specified join type.
- createCriteria in interface Criteria
associationPath
- A dot-seperated property pathjoinType
- The type of join to use.
- the created "sub criteria"
getAlias
public String getAlias()
Get the alias of the entity encapsulated by this criteria instance.
- getAlias in interface Criteria
- The alias for the encapsulated entity.
getJoinType
public int getJoinType()
getLockMode
public LockMode getLockMode()
getPath
public String getPath()
setAlias
public void setAlias(String alias)
setCacheMode
public Criteria setCacheMode(CacheMode cacheMode)
Override the cache mode for this particular query.
- setCacheMode in interface Criteria
cacheMode
- The cache mode to use.
- this (for method chaining)
setCacheRegion
public Criteria setCacheRegion(String cacheRegion)
Set the name of the cache region to use for query result caching.
- setCacheRegion in interface Criteria
cacheRegion
- the name of a query cache region, or null
for the default query cache
- this (for method chaining)
setCacheable
public Criteria setCacheable(boolean cacheable)
Enable caching of this query result, provided query caching is enabled
for the underlying session factory.
- setCacheable in interface Criteria
cacheable
- Should the result be considered cacheable; default is
to not cache (false).
- this (for method chaining)
setComment
public Criteria setComment(String comment)
Add a comment to the generated SQL.
- setComment in interface Criteria
comment
- a human-readable string
- this (for method chaining)
setFetchMode
public Criteria setFetchMode(String associationPath,
FetchMode mode)
throws HibernateException
Specify an association fetching strategy for an association or a
collection of values.
- setFetchMode in interface Criteria
associationPath
- a dot seperated property pathmode
- The fetch mode for the referenced association
- this (for method chaining)
setFetchSize
public Criteria setFetchSize(int fetchSize)
Set a fetch size for the underlying JDBC query.
- setFetchSize in interface Criteria
fetchSize
- the fetch size
- this (for method chaining)
java.sql.Statement.setFetchSize
setFirstResult
public Criteria setFirstResult(int firstResult)
Set the first result to be retrieved.
- setFirstResult in interface Criteria
firstResult
- the first result to retrieve, numbered from 0
- this (for method chaining)
setFlushMode
public Criteria setFlushMode(FlushMode flushMode)
Override the flush mode for this particular query.
- setFlushMode in interface Criteria
flushMode
- The flush mode to use.
- this (for method chaining)
setLockMode
public Criteria setLockMode(String alias,
LockMode lockMode)
Set the lock mode of the aliased entity
- setLockMode in interface Criteria
alias
- The previously assigned alias representing the entity to
which the given lock mode should apply.lockMode
- The lock mode to be applied
- this (for method chaining)
setLockMode
public Criteria setLockMode(LockMode lockMode)
Set the lock mode of the current entity
- setLockMode in interface Criteria
lockMode
- The lock mode to be applied
- this (for method chaining)
setMaxResults
public Criteria setMaxResults(int maxResults)
Set a limit upon the number of objects to be retrieved.
- setMaxResults in interface Criteria
maxResults
- the maximum number of results
- this (for method chaining)
setProjection
public Criteria setProjection(Projection projection)
Used to specify that the query results will be a projection (scalar in
nature). Implicitly specifies the
CriteriaSpecification.PROJECTION
result transformer.
The individual components contained within the given
projection
determines the overall "shape" of the
query result.
- setProjection in interface Criteria
projection
- The projection representing the overall "shape" of the
query results.
- this (for method chaining)
setTimeout
public Criteria setTimeout(int timeout)
Set a timeout for the underlying JDBC query.
- setTimeout in interface Criteria
timeout
- The timeout value to apply.
- this (for method chaining)
java.sql.Statement.setQueryTimeout
toString
public String toString()
uniqueResult
public Object uniqueResult()
throws HibernateException
Convenience method to return a single instance that matches
the query, or null if the query returns no results.
- uniqueResult in interface Criteria
- the single result or null