public final class

CriteriaImpl.Subcriteria

extends Object
implements Serializable Criteria
java.lang.Object
   ↳ org.hibernate.impl.CriteriaImpl.Subcriteria

Summary

[Expand]
Inherited Constants
From interface org.hibernate.criterion.CriteriaSpecification
[Expand]
Inherited Fields
From interface org.hibernate.criterion.CriteriaSpecification
Public Methods
Criteria add(Criterion expression)
Add a restriction to constrain the results to be retrieved.
Criteria addOrder(Order order)
Add an ordering to the result set.
Criteria createAlias(String associationPath, String alias, int joinType)
Join an association using the specified join-type, assigning an alias to the joined association.
Criteria createAlias(String associationPath, String alias)
Join an association, assigning an alias to the joined association.
Criteria createAlias(String associationPath, String alias, int joinType, Criterion withClause)
Join an association using the specified join-type, assigning an alias to the joined association.
Criteria createCriteria(String associationPath)
Create a new Criteria, "rooted" at the associated entity.
Criteria createCriteria(String associationPath, int joinType)
Create a new Criteria, "rooted" at the associated entity, using the specified join type.
Criteria createCriteria(String associationPath, String alias)
Create a new Criteria, "rooted" at the associated entity, assigning the given alias.
Criteria createCriteria(String associationPath, String alias, int joinType)
Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.
Criteria createCriteria(String associationPath, String alias, int joinType, Criterion withClause)
Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.
String getAlias()
Get the alias of the entity encapsulated by this criteria instance.
int getJoinType()
LockMode getLockMode()
Criteria getParent()
String getPath()
Criterion getWithClause()
boolean isReadOnly()
Should entities and proxies loaded by this Criteria be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.
boolean isReadOnlyInitialized()
Was the read-only/modifiable mode explicitly initialized?
List list()
Get the results.
ScrollableResults scroll(ScrollMode scrollMode)
Get the results as an instance of ScrollableResults based on the given scroll mode.
ScrollableResults scroll()
Get the results as an instance of ScrollableResults
void setAlias(String alias)
Criteria setCacheMode(CacheMode cacheMode)
Override the cache mode for this particular query.
Criteria setCacheRegion(String cacheRegion)
Set the name of the cache region to use for query result caching.
Criteria setCacheable(boolean cacheable)
Enable caching of this query result, provided query caching is enabled for the underlying session factory.
Criteria setComment(String comment)
Add a comment to the generated SQL.
Criteria setFetchMode(String associationPath, FetchMode mode)
Specify an association fetching strategy for an association or 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 for this particular query.
Criteria setLockMode(String alias, LockMode lockMode)
Set the lock mode of the aliased entity
Criteria setLockMode(LockMode lockMode)
Set the lock mode of the current entity
Criteria setMaxResults(int maxResults)
Set a limit upon the number of objects to be retrieved.
Criteria setProjection(Projection projection)
Used to specify that the query results will be a projection (scalar in nature).
Criteria setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies loaded by this Criteria.
Criteria setResultTransformer(ResultTransformer resultProcessor)
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.Criteria

Public Methods

public Criteria add (Criterion expression)

Add a restriction to constrain the results to be retrieved.

Parameters
expression The criterion object representing the restriction to be applied.
Returns
  • this (for method chaining)

public Criteria addOrder (Order order)

Add an ordering to the result set.

Parameters
order The order object representing an ordering to be applied to the results.
Returns
  • this (for method chaining)

public Criteria createAlias (String associationPath, String alias, int joinType)

Join an association using the specified join-type, assigning an alias to the joined association.

The joinType is expected to be one of INNER_JOIN (the default), FULL_JOIN, or LEFT_JOIN.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
joinType The type of join to use.
Returns
  • this (for method chaining)

public Criteria createAlias (String associationPath, String alias)

Join an association, assigning an alias to the joined association.

Functionally equivalent to createAlias(String, String, int) using INNER_JOIN for the joinType.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
Returns
  • this (for method chaining)

public Criteria createAlias (String associationPath, String alias, int joinType, Criterion withClause)

Join an association using the specified join-type, assigning an alias to the joined association.

The joinType is expected to be one of INNER_JOIN (the default), FULL_JOIN, or LEFT_JOIN.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
joinType The type of join to use.
withClause The criteria to be added to the join condition (ON clause)
Returns
  • this (for method chaining)

public Criteria createCriteria (String associationPath)

Create a new Criteria, "rooted" at the associated entity.

Functionally equivalent to createCriteria(String, int) using INNER_JOIN for the joinType.

Parameters
associationPath A dot-seperated property path
Returns
  • the created "sub criteria"

public Criteria createCriteria (String associationPath, int joinType)

Create a new Criteria, "rooted" at the associated entity, using the specified join type.

Parameters
associationPath A dot-seperated property path
joinType The type of join to use.
Returns
  • the created "sub criteria"

public Criteria createCriteria (String associationPath, String alias)

Create a new Criteria, "rooted" at the associated entity, assigning the given alias.

Functionally equivalent to createCriteria(String, String, int) using INNER_JOIN for the joinType.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
Returns
  • the created "sub criteria"

public Criteria createCriteria (String associationPath, String alias, int joinType)

Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
joinType The type of join to use.
Returns
  • the created "sub criteria"

public Criteria createCriteria (String associationPath, String alias, int joinType, Criterion withClause)

Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.

Parameters
associationPath A dot-seperated property path
alias The alias to assign to the joined association (for later reference).
joinType The type of join to use.
withClause The criteria to be added to the join condition (ON clause)
Returns
  • the created "sub criteria"

public String getAlias ()

Get the alias of the entity encapsulated by this criteria instance.

Returns
  • The alias for the encapsulated entity.

public int getJoinType ()

public LockMode getLockMode ()

public Criteria getParent ()

public String getPath ()

public Criterion getWithClause ()

public boolean isReadOnly ()

Should entities and proxies loaded by this Criteria be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.

Returns
  • true, entities and proxies loaded by the criteria will be put in read-only mode false, entities and proxies loaded by the criteria will be put in modifiable mode

public boolean isReadOnlyInitialized ()

Was the read-only/modifiable mode explicitly initialized?

Returns
  • true, the read-only/modifiable mode was explicitly initialized; false, otherwise.

public List list ()

Get the results.

Returns
  • The list of matched query results.

public ScrollableResults scroll (ScrollMode scrollMode)

Get the results as an instance of ScrollableResults based on the given scroll mode.

Parameters
scrollMode Indicates the type of underlying database cursor to request.
Returns

public ScrollableResults scroll ()

Get the results as an instance of ScrollableResults

Returns

public void setAlias (String alias)

public Criteria setCacheMode (CacheMode cacheMode)

Override the cache mode for this particular query.

Parameters
cacheMode The cache mode to use.
Returns
  • this (for method chaining)

public Criteria setCacheRegion (String cacheRegion)

Set the name of the cache region to use for query result caching.

Parameters
cacheRegion the name of a query cache region, or null for the default query cache
Returns
  • this (for method chaining)

public Criteria setCacheable (boolean cacheable)

Enable caching of this query result, provided query caching is enabled for the underlying session factory.

Parameters
cacheable Should the result be considered cacheable; default is to not cache (false).
Returns
  • this (for method chaining)

public Criteria setComment (String comment)

Add a comment to the generated SQL.

Parameters
comment a human-readable string
Returns
  • this (for method chaining)

public Criteria setFetchMode (String associationPath, FetchMode mode)

Specify an association fetching strategy for an association or a collection of values.

Parameters
associationPath a dot seperated property path
mode The fetch mode for the referenced association
Returns
  • this (for method chaining)

public Criteria setFetchSize (int fetchSize)

Set a fetch size for the underlying JDBC query.

Parameters
fetchSize the fetch size
Returns
  • this (for method chaining)

public Criteria setFirstResult (int firstResult)

Set the first result to be retrieved.

Parameters
firstResult the first result to retrieve, numbered from 0
Returns
  • this (for method chaining)

public Criteria setFlushMode (FlushMode flushMode)

Override the flush mode for this particular query.

Parameters
flushMode The flush mode to use.
Returns
  • this (for method chaining)

public Criteria setLockMode (String alias, LockMode lockMode)

Set the lock mode of the aliased entity

Parameters
alias The previously assigned alias representing the entity to which the given lock mode should apply.
lockMode The lock mode to be applied
Returns
  • this (for method chaining)

public Criteria setLockMode (LockMode lockMode)

Set the lock mode of the current entity

Parameters
lockMode The lock mode to be applied
Returns
  • this (for method chaining)

public Criteria setMaxResults (int maxResults)

Set a limit upon the number of objects to be retrieved.

Parameters
maxResults the maximum number of results
Returns
  • this (for method chaining)

public Criteria setProjection (Projection projection)

Used to specify that the query results will be a projection (scalar in nature). Implicitly specifies the PROJECTION result transformer.

The individual components contained within the given projection determines the overall "shape" of the query result.

Parameters
projection The projection representing the overall "shape" of the query results.
Returns
  • this (for method chaining)

public Criteria setReadOnly (boolean readOnly)

Set the read-only/modifiable mode for entities and proxies loaded by this Criteria. This setting overrides the default setting for the persistence context.

Parameters
readOnly true, entities and proxies loaded by the criteria will be put in read-only mode false, entities and proxies loaded by the criteria will be put in modifiable mode

public Criteria setResultTransformer (ResultTransformer resultProcessor)

Set a strategy for handling the query results. This determines the "shape" of the query result.

Parameters
resultProcessor The transformer to apply
Returns
  • this (for method chaining)

public Criteria setTimeout (int timeout)

Set a timeout for the underlying JDBC query.

Parameters
timeout The timeout value to apply.
Returns
  • this (for method chaining)

public String toString ()

public Object uniqueResult ()

Convenience method to return a single instance that matches the query, or null if the query returns no results.

Returns
  • the single result or null