Set the read-only mode for entities (and proxies) loaded by this Criteria. This
setting overrides the default for the session (see DefaultReadOnly).
Namespace: NHibernate.ImplAssembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)
Syntax
C# |
---|
public ICriteria SetReadOnly( bool readOnly ) |
Visual Basic |
---|
Public Function SetReadOnly ( _ readOnly As Boolean _ ) As ICriteria |
Visual C++ |
---|
public: virtual ICriteria^ SetReadOnly( bool readOnly ) sealed |
Parameters
- readOnly
- Type: System..::..Boolean
If true, entities (and proxies) loaded by the criteria will be read-only.
Return Value
this (for method chaining)Implements
ICriteria..::..SetReadOnly(Boolean)Remarks
To set the default read-only setting for entities and proxies that are loaded into the session, see DefaultReadOnly.
Read-only entities can be modified, but changes are not persisted. They are not dirty-checked and snapshots of persistent state are not maintained.
When a proxy is initialized, the loaded entity will have the same read-only setting as the uninitialized proxy has, regardless of the session's current setting.
The read-only setting has no impact on entities or proxies returned by the criteria that existed in the session before the criteria was executed.