Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/NHibernate/Impl
Modified Files:
SessionImpl.cs
Log Message:
Fixed a major bug that was causing problems with fetching collections
in hql. I had mistyped the parameter "collectin" to the ctor of
LoadingCollectionEntry - since I was using
this.collection = collection
there was no problem and collection was staying null. The private vars are
now prefixed with "_" and exposed via properties.
Index: SessionImpl.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** SessionImpl.cs 24 May 2004 20:52:47 -0000 1.27
--- SessionImpl.cs 23 Jun 2004 21:11:41 -0000 1.28
***************
*** 3027,3045 ****
private string loadingRole;
! private sealed class LoadingCollectionEntry {
! public PersistentCollection collection;
! public bool initialize;
! public object id;
! public object owner;
! internal LoadingCollectionEntry(PersistentCollection collection, object id) {
! this.collection = collection;
! this.id = id;
}
! internal LoadingCollectionEntry(PersistentCollection collectin, object id, object owner) {
! this.collection = collection;
! this.id = id;
! this.owner = owner;
}
}
--- 3027,3073 ----
private string loadingRole;
! private sealed class LoadingCollectionEntry
! {
! private PersistentCollection _collection;
! private bool _initialize;
! private object _id;
! private object _owner;
! internal LoadingCollectionEntry(PersistentCollection collection, object id)
! {
! _collection = collection;
! _id = id;
}
! internal LoadingCollectionEntry(PersistentCollection collection, object id, object owner)
! {
! _collection = collection;
! _id = id;
! _owner = owner;
! }
!
! public PersistentCollection Collection
! {
! get { return _collection;}
! set { _collection = value; }
! }
!
! public object Id
! {
! get { return _id; }
! set { _id = value; }
! }
!
!
! public object Owner
! {
! get { return _owner; }
! set { _owner = value; }
! }
!
! public bool Initialize
! {
! get { return _initialize; }
! set { _initialize = value; }
}
}
***************
*** 3060,3064 ****
}
else {
! return lce.collection;
}
}
--- 3088,3092 ----
}
else {
! return lce.Collection;
}
}
***************
*** 3078,3082 ****
}
else {
! return lce.collection;
}
}
--- 3106,3110 ----
}
else {
! return lce.Collection;
}
}
***************
*** 3087,3093 ****
foreach (LoadingCollectionEntry lce in loadingCollections.Values) {
//lce.collection.EndRead();
! lce.collection.EndRead(persister, lce.owner);
! AddInitializedCollection(lce.collection, persister, lce.id);
! persister.Cache(lce.id, lce.collection, this);
}
--- 3115,3121 ----
foreach (LoadingCollectionEntry lce in loadingCollections.Values) {
//lce.collection.EndRead();
! lce.Collection.EndRead(persister, lce.Owner);
! AddInitializedCollection(lce.Collection, persister, lce.Id);
! persister.Cache(lce.Id, lce.Collection, this);
}
***************
*** 3105,3110 ****
}
else {
! lce.initialize = true;
! return lce.collection;
}
}
--- 3133,3138 ----
}
else {
! lce.Initialize = true;
! return lce.Collection;
}
}
|