From: <jul...@us...> - 2011-02-24 14:37:51
|
Revision: 5396 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5396&view=rev Author: julian-maughan Date: 2011-02-24 14:37:45 +0000 (Thu, 24 Feb 2011) Log Message: ----------- XML documentation refinements for read-only entity APIs. Modified Paths: -------------- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/IPersistenceContext.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/QueryParameters.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/StatefulPersistenceContext.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/ICriteria.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/IQuery.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/ISession.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/SessionImpl.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/AbstractLazyInitializer.cs branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/ILazyInitializer.cs Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/IPersistenceContext.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/IPersistenceContext.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/IPersistenceContext.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -55,38 +55,21 @@ bool Flushing { get; set;} /// <summary> - /// Change the default for entities and proxies loaded into this persistence - /// context from modifiable to read-only mode, or from modifiable to read-only - /// mode. + /// The read-only status for entities (and proxies) loaded into this persistence context. /// </summary> /// <remarks> /// <para> - /// Read-only entities are not dirty-checked and snapshots of persistent - /// state are not maintained. Read-only entities can be modified, but - /// changes are not persisted. + /// When a proxy is initialized, the loaded entity will have the same read-only + /// setting as the uninitialized proxy has, regardless of the persistence context's + /// current setting. /// </para> /// <para> - /// When a proxy is initialized, the loaded entity will have the same - /// read-only/modifiable setting as the uninitialized - /// proxy has, regardless of the persistence context's current setting. + /// To change the read-only setting for a particular entity or proxy that is already + /// in the current persistence context, use <see cref="IPersistenceContext.SetReadOnly(object, bool)" />. /// </para> - /// <para> - /// To change the read-only/modifiable setting for a particular entity - /// or proxy that is already in this session: - /// <see cref="SetReadOnly(object, bool)" /> - /// <see cref="ISession.SetReadOnly(object, bool)" /> - /// </para> - /// <para> - /// To determine the read-only/modifiable setting for a particular entity or proxy: - /// <see cref="IsReadOnly(object)" /> - /// <see cref="ISession.IsReadOnly(object)" /> - /// </para> - /// <para> - /// To override this session's read-only/modifiable setting for entities - /// and proxies loaded by an IQuery: - /// <see cref="IQuery.SetReadOnly(bool)" /> - /// </para> /// </remarks> + /// <seealso cref="IPersistenceContext.IsReadOnly(object)" /> + /// <seealso cref="IPersistenceContext.SetReadOnly(object, bool)" /> bool DefaultReadOnly { get; set; } /// <summary> Add a collection which has no owner loaded</summary> @@ -377,53 +360,36 @@ bool IsPropertyNull(EntityKey ownerKey, string propertyName); /// <summary> - /// Set the entity or proxy to read only and discard it's snapshot. - /// Set an unmodified persistent object to read-only mode, or a read-only - /// object to modifiable mode. + /// Change the read-only status of an entity (or proxy). /// </summary> /// <remarks> /// <para> - /// Read-only entities are not dirty-checked and snapshots of persistent - /// state are not maintained. Read-only entities can be modified, but - /// changes are not persisted. + /// Read-only entities can be modified, but changes are not persisted. They are not dirty-checked + /// and snapshots of persistent state are not maintained. /// </para> /// <para> - /// When a proxy is initialized, the loaded entity will have the same - /// read-only/modifiable setting as the uninitialized - /// proxy has, regardless of the session's current setting. + /// Immutable entities cannot be made read-only. /// </para> /// <para> - /// If the entity or proxy already has the specified read-only/modifiable - /// setting, then this method does nothing. + /// To set the <em>default</em> read-only setting for entities and proxies that are loaded + /// into the persistence context, see <see cref="IPersistenceContext.DefaultReadOnly" />. /// </para> - /// <para> - /// To set the default read-only/modifiable setting used for - /// entities and proxies that are loaded into this persistence context: - /// <see cref="IPersistenceContext.DefaultReadOnly" /> - /// <see cref="ISession.DefaultReadOnly" /> - /// </para> - /// <para> - /// To override this persistence context's read-only/modifiable setting - /// for entities and proxies loaded by a Query: - /// <see cref="IQuery.SetReadOnly(bool)" /> - /// </para> /// </remarks> - /// <param name="entity">An entity or INHibernateProxy</param> - /// <param name="readOnly">if <c>true</c>, the entity or proxy is made read-only; if <c>false</c>, the entity or proxy is made modifiable.</param> - /// <seealso cref="ISession.SetReadOnly(object, bool)" /> - void SetReadOnly(object entity, bool readOnly); + /// <param name="entityOrProxy">An entity (or <see cref="NHibernate.Proxy.INHibernateProxy" />).</param> + /// <param name="readOnly">If <c>true</c>, the entity or proxy is made read-only; if <c>false</c>, it is made modifiable.</param> + /// <seealso cref="IPersistenceContext.DefaultReadOnly" /> + /// <seealso cref="IPersistenceContext.IsReadOnly(object)" /> + void SetReadOnly(object entityOrProxy, bool readOnly); /// <summary> - /// Is the entity or proxy read-only? + /// Is the specified entity (or proxy) read-only? /// </summary> - /// <remarks> - /// To get the default read-only/modifiable setting used for - /// entities and proxies that are loaded into the session: - /// <see cref="ISession.DefaultReadOnly" /> - /// </remarks> + /// <param name="entityOrProxy">An entity (or <see cref="NHibernate.Proxy.INHibernateProxy" />)</param> /// <returns> - /// <c>true</c>, the object is read-only; <c>false</c>, the object is modifiable. + /// <c>true</c> if the entity or proxy is read-only, otherwise <c>false</c>. /// </returns> + /// <seealso cref="IPersistenceContext.DefaultReadOnly" /> + /// <seealso cref="IPersistenceContext.SetReadOnly(object, bool)" /> bool IsReadOnly(object entityOrProxy); void ReplaceDelayedEntityIdentityInsertKeys(EntityKey oldKey, object generatedId); Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -16,7 +16,7 @@ namespace NHibernate.Engine { /// <summary> - /// Defines the internal contract between the <c>Session</c> and other parts of Hibernate + /// Defines the internal contract between the <c>Session</c> and other parts of NHibernate /// such as implementors of <c>Type</c> or <c>ClassPersister</c> /// </summary> public interface ISessionImplementor Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/QueryParameters.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -168,14 +168,6 @@ set { _lockModes = value; } } - /// <summary> - /// Has the read-only/modifiable mode been explicitly set? - /// </summary> - /// <value> - /// <c>true</c>, the read-only/modifiable mode was explicitly set; <c>false</c>, the read-only/modifiable mode was not explicitly set - /// </value> - /// <seealso cref="ReadOnly" /> - /// <seealso cref="IsReadOnly(ISessionImplementor)" /> public bool IsReadOnlyInitialized { get { return _isReadOnlyInitialized; } @@ -281,15 +273,6 @@ public bool Callable { get; set; } - /// <summary> - /// Should entities and proxies loaded by the query be put in read-only mode? - /// </summary> - /// <remarks> - /// The read-only/modifiable setting has no impact on entities/proxies returned by the - /// query that existed in the session before the query was executed. - /// </remarks> - /// <seealso cref="IsReadOnlyInitialized" /> - /// <seealso cref="IsReadOnly(ISessionImplementor)" /> public bool ReadOnly { get @@ -693,23 +676,6 @@ return copy; } - /// <summary> - /// Should entities and proxies loaded by the query be put in read-only mode? If the - /// read-only/modifiable setting was not initialized - /// (i.e. <see cref="IsReadOnlyInitialized" /> == false), then the default - /// read-only/modifiable setting for the persistence context is returned instead. - /// </summary> - /// <remarks> - /// The read-only/modifiable setting has no impact on entities/proxies returned by the - /// query that existed in the session before the query was executed. - /// </remarks> - /// <seealso cref="IsReadOnlyInitialized" /> - /// <seealso cref="ReadOnly" /> - /// <seealso cref="IPersistenceContext.DefaultReadOnly" /> - /// <param name="session"></param> - /// <returns> - /// <c>true</c>, entities and proxies loaded by the query will be put in read-only mode; <c>false</c>, entities and proxies loaded by the query will be put in modifiable mode - /// </returns> public bool IsReadOnly(ISessionImplementor session) { return _isReadOnlyInitialized ? this.ReadOnly : session.PersistenceContext.DefaultReadOnly; Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/StatefulPersistenceContext.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/StatefulPersistenceContext.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Engine/StatefulPersistenceContext.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -1113,6 +1113,7 @@ return nullAssociations.Contains(new AssociationKey(ownerKey, propertyName)); } + /// <inheritdoc /> public void SetReadOnly(object entityOrProxy, bool readOnly) { if (entityOrProxy == null) @@ -1164,6 +1165,7 @@ hasNonReadOnlyEntities |= !readOnly; } + /// <inheritdoc /> public bool IsReadOnly(object entityOrProxy) { if (entityOrProxy == null) Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/ICriteria.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/ICriteria.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/ICriteria.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -61,26 +61,32 @@ string Alias { get; } /// <summary> - /// Was the read-only/modifiable mode explicitly initialized? + /// Was the read-only mode explicitly initialized? /// </summary> - /// <seealso cref="SetReadOnly(bool)" /> - /// <returns><c>true</c>, the read-only/modifiable mode was explicitly initialized; <c>false</c>, otherwise.</returns> + /// <returns><c>true</c> if the read-only mode was explicitly initialized, otherwise <c>false</c>.</returns> + /// <seealso cref="ICriteria.SetReadOnly(bool)" /> + /// <seealso cref="ICriteria.IsReadOnly" />/// bool IsReadOnlyInitialized { get; } /// <summary> - /// 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. + /// Will entities (and proxies) loaded by this Criteria be put in read-only mode? /// </summary> /// <remarks> - /// The read-only/modifiable setting has no impact on entities/proxies returned by the + /// <para> + /// If the read-only setting was not initialized, then the value of the session's + /// <see cref="ISession.DefaultReadOnly" /> property is returned instead. + /// </para> + /// <para> + /// 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. + /// </para> /// </remarks> - /// <seealso cref="SetReadOnly(bool)" /> - /// <seealso cref="NHibernate.Engine.IPersistenceContext.DefaultReadOnly" /> /// <returns> - /// <c>true</c>, entities and proxies loaded by the criteria will be put in read-only mode; <c>false</c>, entities and proxies loaded by the criteria will be put in modifiable mode + /// <c>true</c> if entities and proxies loaded by the criteria will be put in read-only mode, + /// otherwise <c>false</c>. /// </returns> + /// <seealso cref="ICriteria.SetReadOnly(bool)" /> + /// <seealso cref="ICriteria.IsReadOnlyInitialized" /> bool IsReadOnly { get; } /// <summary> @@ -310,28 +316,33 @@ IFutureValue<T> FutureValue<T>(); /// <summary> - /// Set the read-only/modifiable mode for entities and proxies - /// loaded by this Criteria. This setting overrides the default setting - /// for the persistence context. + /// Set the read-only mode for entities (and proxies) loaded by this Criteria. This + /// setting overrides the default for the session (see <see cref="ISession.DefaultReadOnly" />). /// </summary> /// <remarks> - /// <para>Use <see cref="NHibernate.Engine.IPersistenceContext.DefaultReadOnly" /> or - /// <see cref="NHibernate.ISession.DefaultReadOnly" /> to set the default read-only/modifiable - /// setting used for entities and proxies that are loaded into the session.</para> - /// <para>Read-only entities are not dirty-checked and snapshots of persistent - /// state are not maintained. Read-only entities can be modified, but - /// changes are not persisted.</para> - /// <para>When a proxy is initialized, the loaded entity will have the same - /// read-only/modifiable setting as the uninitialized proxy has, regardless - /// of the session's current setting.</para> - /// <para>The read-only/modifiable setting has no impact on entities/proxies - /// returned by the criteria that existed in the session before the criteria was - /// executed.</para> + /// <para> + /// To set the <em>default</em> read-only setting for entities and proxies that are loaded + /// into the session, see <see cref="ISession.DefaultReadOnly" />. + /// </para> + /// <para> + /// Read-only entities can be modified, but changes are not persisted. They are not + /// dirty-checked and snapshots of persistent state are not maintained. + /// </para> + /// <para> + /// 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. + /// </para> + /// <para> + /// 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. + /// </para> /// </remarks> /// <param name="readOnly"> - /// <c>true</c>, entities and proxies loaded by the criteria will be put in read-only mode; <c>false</c>, entities and proxies loaded by the criteria will be put in modifiable mode + /// If <c>true</c>, entities (and proxies) loaded by the criteria will be read-only. /// </param> /// <returns><c>this</c> (for method chaining)</returns> + /// <seealso cref="ICriteria.IsReadOnly" /> + /// <seealso cref="ICriteria.IsReadOnlyInitialized" /> ICriteria SetReadOnly(bool readOnly); #region NHibernate specific Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/IQuery.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/IQuery.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/IQuery.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -67,7 +67,7 @@ IType[] ReturnTypes { get; } /// <summary> Return the HQL select clause aliases (if any)</summary> - /// <returns> an array of aliases as strings </returns> + /// <returns> An array of aliases as strings </returns> string[] ReturnAliases { get; } /// <summary> @@ -77,19 +77,23 @@ string[] NamedParameters { get; } /// <summary> - /// Should entities and proxies loaded by this query 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. + /// Will entities (and proxies) returned by the query be loaded in read-only mode? /// </summary> /// <remarks> - /// The read-only/modifiable setting has no impact on entities/proxies returned by the + /// <para> + /// If the query's read-only setting is not initialized (with <see cref="SetReadOnly(bool)" />), + /// the value of the session's <see cref="ISession.DefaultReadOnly" /> property is + /// returned instead. + /// </para> + /// <para> + /// The value of this property has no effect on entities or proxies returned by the /// query that existed in the session before the query was executed. + /// </para> /// </remarks> /// <returns> - /// <c>true</c>, entities and proxies loaded by the query will be put in read-only mode; <c>false</c>, entities and proxies loaded by the query will be put in modifiable mode + /// <c>true</c> if entities and proxies loaded by the query will be put in read-only mode, otherwise <c>false</c>. /// </returns> - /// <seealso cref="SetReadOnly(bool)" /> - /// <seealso cref="NHibernate.Engine.IPersistenceContext.DefaultReadOnly()" /> + /// <seealso cref="IQuery.SetReadOnly(bool)" /> bool IsReadOnly { get; } /// <summary> @@ -171,13 +175,28 @@ IQuery SetFirstResult(int firstResult); /// <summary> - /// Entities retrieved by this query will be loaded in - /// a read-only mode where NHibernate will never dirty-check - /// them or make changes persistent. + /// Set the read-only mode for entities (and proxies) loaded by this query. This setting + /// overrides the default setting for the session (see <see cref="ISession.DefaultReadOnly" />). /// </summary> + /// <remarks> + /// <para> + /// Read-only entities can be modified, but changes are not persisted. They are not + /// dirty-checked and snapshots of persistent state are not maintained. + /// </para> + /// <para> + /// When a proxy is initialized, the loaded entity will have the same read-only setting + /// as the uninitialized proxy, regardless of the session's current setting. + /// </para> + /// <para> + /// 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. + /// </para> + /// </remarks> /// <param name="readOnly"> - /// <c>true</c>, entities and proxies loaded by the query will be put in read-only mode; <c>false</c>, entities and proxies loaded by the query will be put in modifiable mode + /// If <c>true</c>, entities (and proxies) loaded by the query will be read-only. /// </param> + /// <returns><c>this</c> (for method chaining)</returns> + /// <seealso cref="IsReadOnly" /> IQuery SetReadOnly(bool readOnly); /// <summary> Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/ISession.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/ISession.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/ISession.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -179,71 +179,66 @@ bool IsDirty(); /// <summary> - /// Is the specified entity or proxy read-only? + /// Is the specified entity (or proxy) read-only? /// </summary> /// <remarks> - /// To get the default read-only/modifiable setting used for - /// entities and proxies that are loaded into the session: - /// <see cref="DefaultReadOnly" /> + /// Facade for <see cref="IPersistenceContext.IsReadOnly(object)" />. /// </remarks> - /// <param name="entityOrProxy">An entity or INHibernateProxy</param> + /// <param name="entityOrProxy">An entity (or <see cref="NHibernate.Proxy.INHibernateProxy" />)</param> /// <returns> - /// <c>true</c>, the entity or proxy is read-only; <c>false</c>, the entity or proxy is modifiable. + /// <c>true</c> if the entity (or proxy) is read-only, otherwise <c>false</c>. /// </returns> + /// <seealso cref="ISession.DefaultReadOnly" /> + /// <seealso cref="ISession.SetReadOnly(object, bool)" /> bool IsReadOnly(object entityOrProxy); /// <summary> - /// Set an unmodified persistent object to read-only mode, or a read-only - /// object to modifiable mode. In read-only mode, no snapshot is maintained, - /// the instance is never dirty checked, and changes are not persisted. + /// Change the read-only status of an entity (or proxy). /// </summary> /// <remarks> /// <para> - /// If the entity or proxy already has the specified read-only/modifiable - /// setting, then this method does nothing. + /// Read-only entities can be modified, but changes are not persisted. They are not dirty-checked + /// and snapshots of persistent state are not maintained. /// </para> /// <para> - /// To set the default read-only/modifiable setting used for - /// entities and proxies that are loaded into the session: - /// <see cref="ISession.DefaultReadOnly" /> + /// Immutable entities cannot be made read-only. /// </para> /// <para> - /// To override this session's read-only/modifiable setting for entities - /// and proxies loaded by a query: - /// <see cref="IQuery.SetReadOnly(bool)" /> + /// To set the <em>default</em> read-only setting for entities and proxies that are loaded + /// into the session, see <see cref="ISession.DefaultReadOnly" />. /// </para> + /// <para> + /// This method a facade for <see cref="IPersistenceContext.SetReadOnly(object, bool)" />. + /// </para> /// </remarks> - /// <param name="entityOrProxy">An entity or INHibernateProxy</param> - /// <param name="readOnly">if <c>true</c>, the entity or proxy is made read-only; if <c>false</c>, the entity or proxy is made modifiable.</param> + /// <param name="entityOrProxy">An entity (or <see cref="NHibernate.Proxy.INHibernateProxy" />).</param> + /// <param name="readOnly">If <c>true</c>, the entity or proxy is made read-only; if <c>false</c>, it is made modifiable.</param> + /// <seealso cref="ISession.DefaultReadOnly" /> + /// <seealso cref="ISession.IsReadOnly(object)" /> void SetReadOnly(object entityOrProxy, bool readOnly); /// <summary> - /// The default read-only status of the Session - /// Will entities and proxies that are loaded into this session be made - /// read-only by default? + /// The read-only status for entities (and proxies) loaded into this Session. /// </summary> /// <remarks> /// <para> - /// Read-only entities are not dirty-checked and snapshots of persistent - /// state are not maintained. Read-only entities can be modified, but - /// changes are not persisted. + /// When a proxy is initialized, the loaded entity will have the same read-only setting + /// as the uninitialized proxy, regardless of the session's current setting. /// </para> /// <para> - /// When a proxy is initialized, the loaded entity will have the same - /// read-only/modifiable setting as the uninitialized - /// proxy has, regardless of the session's current setting. + /// To change the read-only setting for a particular entity or proxy that is already in + /// this session, see <see cref="ISession.SetReadOnly(object, bool)" />. /// </para> /// <para> - /// To change the read-only/modifiable setting for a particular entity - /// or proxy that is already in this session: - /// <see cref="ISession.SetReadOnly(object, bool)" /> + /// To override this session's read-only setting for entities and proxies loaded by a query, + /// see <see cref="IQuery.SetReadOnly(bool)" />. /// </para> /// <para> - /// To override this session's read-only/modifiable setting for entities - /// and proxies loaded by a query: - /// <see cref="IQuery.SetReadOnly(bool)" /> + /// This method is a facade for <see cref="IPersistenceContext.DefaultReadOnly" />. /// </para> /// </remarks> + /// <seealso cref="ISession.IsReadOnly(object)" /> + /// <seealso cref="ISession.SetReadOnly(object, bool)" /> bool DefaultReadOnly { get; set; } /// <summary> Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -124,11 +124,13 @@ get { return projection; } } + /// <inheritdoc /> public bool IsReadOnlyInitialized { get { return (readOnly != null); } } + /// <inheritdoc /> public bool IsReadOnly { get @@ -496,7 +498,8 @@ return this; } - + + /// <inheritdoc /> public ICriteria SetReadOnly(bool readOnly) { this.readOnly = readOnly; @@ -795,12 +798,12 @@ return root.FutureValue<T>(); } - public IEnumerable<T> Future<T>() - { - return root.Future<T>(); - } + public IEnumerable<T> Future<T>() + { + return root.Future<T>(); + } - public void List(IList results) + public void List(IList results) { root.List(results); } Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -2394,12 +2394,12 @@ } /// <inheritdoc /> - public void SetReadOnly(object entity, bool readOnly) + public void SetReadOnly(object entityOrProxy, bool readOnly) { using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); - persistenceContext.SetReadOnly(entity, readOnly); + persistenceContext.SetReadOnly(entityOrProxy, readOnly); } } Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/AbstractLazyInitializer.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/AbstractLazyInitializer.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/AbstractLazyInitializer.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -50,6 +50,7 @@ SetSession(session); } + /// <inheritdoc /> public void SetSession(ISessionImplementor s) { if (s != _session) @@ -84,6 +85,7 @@ } } + /// <inheritdoc /> public void UnsetSession() { _session = null; @@ -207,6 +209,7 @@ initialized = true; } + /// <inheritdoc /> public bool IsReadOnlySettingAvailable { get { return (_session != null && !_session.IsClosed); } Modified: branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/ILazyInitializer.cs =================================================================== --- branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/ILazyInitializer.cs 2011-02-24 13:58:45 UTC (rev 5395) +++ branches/ReadOnlyEntities/nhibernate/src/NHibernate/Proxy/ILazyInitializer.cs 2011-02-24 14:37:45 UTC (rev 5396) @@ -40,7 +40,7 @@ ISessionImplementor Session { get; set; } /// <summary> - /// Is the proxy's read-only/modifiable setting available? + /// Is the read-only setting available? /// </summary> bool IsReadOnlySettingAvailable { get; } @@ -49,22 +49,15 @@ /// </summary> /// <remarks> /// <para> - /// The read-only/modifiable setting is not available when the proxy is - /// detached or its associated session is closed. + /// Not available when the proxy is detached or its associated session is closed. /// </para> /// <para> - /// If the proxy is currently initialized, its implementation will be set to - /// the same mode; otherwise, when the proxy is initialized, its implementation - /// will have the same read-only/modifiable setting as the proxy. In read-only - /// mode, no snapshot is maintained and the instance is never dirty checked. - /// </para> + /// To check if the read-only setting is available, use <see cref="IsReadOnlySettingAvailable" /> + /// </para> /// <para> - /// If the associated proxy already has the specified read-only/modifiable - /// setting, then this method does nothing. + /// The read-only status of the entity will be made to match the read-only status of the proxy + /// upon initialization. /// </para> - /// <para> - /// To check if the read-only/modifiable setting is available: <see cref="IsReadOnlySettingAvailable" /> - /// </para> /// </remarks> bool ReadOnly { get; set; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |