Skip to content
Browse files

Update visitors to 2.1 standards

SVN: trunk@1313
  • Loading branch information...
1 parent 25ce87a commit 19b9ae8d0bc69f97dfa3f87767d23607414616e0 @phatcher phatcher committed Mar 14, 2005
Showing with 9 additions and 3 deletions.
  1. +7 −0 src/NHibernate/Impl/FlushVisitor.cs
  2. +2 −3 src/NHibernate/Impl/WrapVisitor.cs
View
7 src/NHibernate/Impl/FlushVisitor.cs
@@ -1,4 +1,5 @@
using System;
+using log4net;
using NHibernate.Collection;
using NHibernate.Type;
@@ -7,6 +8,7 @@ namespace NHibernate.Impl
internal class FlushVisitor : AbstractVisitor
{
private object _owner;
+ private static readonly ILog log = LogManager.GetLogger( typeof( AbstractVisitor ) );
public FlushVisitor(SessionImpl session, object owner)
: base( session )
@@ -16,6 +18,11 @@ public FlushVisitor(SessionImpl session, object owner)
protected override object ProcessCollection(object collection, PersistentCollectionType type)
{
+ if( log.IsDebugEnabled )
+ {
+ log.Debug( string.Format( "Processing collection for role {0}", type.Role ) );
+ }
+
if( collection != null )
{
PersistentCollection coll;
View
5 src/NHibernate/Impl/WrapVisitor.cs
@@ -27,15 +27,14 @@ public WrapVisitor(SessionImpl session) : base( session )
protected override object ProcessCollection(object collection, PersistentCollectionType collectionType)
{
- PersistentCollection coll = collection as PersistentCollection;
- if( coll!=null )
+ if( collection != null && (collection is PersistentCollection) )
{
+ PersistentCollection coll = collection as PersistentCollection;
if( coll.SetCurrentSession( Session ) )
{
Session.ReattachCollection( coll, coll.CollectionSnapshot );
}
return null;
-
}
else
{

0 comments on commit 19b9ae8

Please sign in to comment.
Something went wrong with that request. Please try again.