Namespaces

Types

Type ICriteria

Namespace NHibernate

Methods

Properties

Public instance methods

ICriteria Add(ICriterion expression)

Add an Expression to constrain the results to be retrieved.
Parameters
return ICriteria
ICriterion expression

ICriteria AddOrder(Order order)

An an Order to the result set
Parameters
return ICriteria
Order order

ICriteria CreateAlias(string associationPath, string alias, JoinType joinType)

Join an association using the specified join-type, assigning an alias to the joined association
Parameters
return ICriteria this (for method chaining)
string associationPath
string alias
JoinType joinType The type of join to use.

ICriteria CreateAlias(string associationPath, string alias)

Join an association, assigning an alias to the joined entity
Parameters
return ICriteria
string associationPath
string alias

ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType)

Create a new ICriteria , "rooted" at the associated entity, assigning the given alias and using the specified join type.
Parameters
return ICriteria The created "sub criteria"
string associationPath A dot-separated property path
string alias The alias to assign to the joined association (for later reference).
JoinType joinType The type of join to use.

ICriteria CreateCriteria(string associationPath, JoinType joinType)

Create a new ICriteria , "rooted" at the associated entity, using the specified join type.
Parameters
return ICriteria The created "sub criteria"
string associationPath A dot-seperated property path
JoinType joinType The type of join to use

ICriteria CreateCriteria(string associationPath, string alias)

Create a new ICriteria , "rooted" at the associated entity, assigning the given alias
Parameters
return ICriteria
string associationPath
string alias

ICriteria CreateCriteria(string associationPath)

Create a new ICriteria , "rooted" at the associated entity
Parameters
return ICriteria
string associationPath

IList List()

Get the results
Parameters
return IList

void List(IList results)

Get the results and fill the IList
Parameters
IList results The list to fill with the results.

IList<T> List<T>()

Strongly-typed version of List .
Parameters
return IList<T>

ICriteria SetCacheable(bool cacheable)

Enable caching of this query result set
Parameters
return ICriteria
bool cacheable

ICriteria SetCacheRegion(string cacheRegion)

Set the name of the cache region.
Parameters
return ICriteria
string cacheRegion ${WriteSummary(content)}

ICriteria SetFetchMode(string associationPath, FetchMode mode)

Specify an association fetching strategy. Currently, only one-to-many and one-to-one associations are supported.
Parameters
return ICriteria
string associationPath A dot seperated property path.
FetchMode mode The Fetch mode.

ICriteria SetFirstResult(int firstResult)

Set the first result to be retrieved
Parameters
return ICriteria
int firstResult

ICriteria SetLockMode(LockMode lockMode)

Set the lock mode of the current entity
Parameters
return ICriteria
LockMode lockMode the lock mode

ICriteria SetLockMode(string alias, LockMode lockMode)

Set the lock mode of the aliased entity
Parameters
return ICriteria
string alias an alias
LockMode lockMode the lock mode

ICriteria SetMaxResults(int maxResults)

Set a limit upon the number of objects to be retrieved
Parameters
return ICriteria
int maxResults

ICriteria SetProjection(IProjection projection)

Used to specify that the query results will be a projection (scalar in nature). Implicitly specifies the projection result transformer.
Docu.Documentation.Comments.Paragraph
Parameters
return ICriteria This instance (for method chaining)
IProjection projection The projection representing the overall "shape" of the query results.

ICriteria SetResultTransformer(IResultTransformer resultTransformer)

Set a strategy for handling the query results. This determines the "shape" of the query result set.
Parameters
return ICriteria
IResultTransformer resultTransformer

ICriteria SetTimeout(int timeout)

Set a timeout for the underlying ADO.NET query
Parameters
return ICriteria
int timeout

object UniqueResult()

Convenience method to return a single instance that matches the query, or null if the query returns no results.
Parameters
return object ${WriteSummary(content)}

T UniqueResult<T>()

Strongly-typed version of UniqueResult .
Parameters
return T

Public properties

string Alias get;

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