org.hibernate
Interface Criteria

Criteria is a simplified API for retrieving entities
by composing Criterion objects. This is a very
convenient approach for functionality like "search" screens
where there is a variable number of conditions to be placed
upon the result set.

The Session is a factory for Criteria.
Criterion instances are usually obtained via
the factory methods on Restrictions. eg.

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.

getAlias()
Get the alias of the entity encapsulated by this criteria instance.

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.

isReadOnly

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

Throws:

IllegalStateException - if isReadOnlyInitialized() returns false
and this Criteria is not associated with a session.