Skip to content

Commit 63ce5ab

Browse files
committed
NH-3345 - Remove PersistentBag
1 parent bbc0980 commit 63ce5ab

File tree

7 files changed

+586
-694
lines changed

7 files changed

+586
-694
lines changed

src/NHibernate/Collection/AbstractPersistentCollection.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4-
using System.Data;
4+
using System.Data;
5+
using NHibernate.Collection.Generic;
56
using NHibernate.Engine;
67
using NHibernate.Impl;
78
using NHibernate.Loader;
@@ -482,7 +483,7 @@ protected void ThrowLazyInitializationException(string message)
482483
{
483484
var ownerEntityName = role == null ? "Unavailable" : StringHelper.Qualifier(role);
484485
throw new LazyInitializationException(ownerEntityName, key, "failed to lazily initialize a collection"
485-
+ (role == null ? "" : " of role: " + role) + ", " + message);
486+
+ (role == null ? "" : " of role: " + role) + ", " + message);
486487
}
487488

488489
/// <summary>
@@ -540,7 +541,7 @@ public bool UnsetSession(ISessionImplementor currentSession)
540541
public virtual bool SetCurrentSession(ISessionImplementor session)
541542
{
542543
if (session == this.session // NH: added to fix NH-704
543-
&& session.PersistenceContext.ContainsCollection(this))
544+
&& session.PersistenceContext.ContainsCollection(this))
544545
{
545546
return false;
546547
}
@@ -556,7 +557,7 @@ public virtual bool SetCurrentSession(ISessionImplementor session)
556557
else
557558
{
558559
throw new HibernateException("Illegal attempt to associate a collection with two open sessions: "
559-
+ MessageHelper.InfoString(ce.LoadedPersister, ce.LoadedKey, session.Factory));
560+
+ MessageHelper.InfoString(ce.LoadedPersister, ce.LoadedKey, session.Factory));
560561
}
561562
}
562563
else
@@ -574,7 +575,7 @@ public virtual bool SetCurrentSession(ISessionImplementor session)
574575
/// <param name="persister">The <see cref="ICollectionPersister"/> for this Collection.</param>
575576
/// <returns>
576577
/// <see langword="false" /> by default since most collections can determine which rows need to be
577-
/// individually updated/inserted/deleted. Currently only <see cref="PersistentBag"/>'s for <c>many-to-many</c>
578+
/// individually updated/inserted/deleted. Currently only <see cref="PersistentGenericBag{T}"/>'s for <c>many-to-many</c>
578579
/// need to be recreated.
579580
/// </returns>
580581
public virtual bool NeedsRecreate(ICollectionPersister persister)
@@ -690,8 +691,7 @@ public virtual void AfterRowInsert(ICollectionPersister persister, object entry,
690691
/// belong to the collection, and a collection of instances
691692
/// that currently belong, return a collection of orphans
692693
/// </summary>
693-
protected virtual ICollection GetOrphans(ICollection oldElements, ICollection currentElements, string entityName,
694-
ISessionImplementor session)
694+
protected virtual ICollection GetOrphans(ICollection oldElements, ICollection currentElements, string entityName, ISessionImplementor session)
695695
{
696696
// short-circuit(s)
697697
if (currentElements.Count == 0)
@@ -829,7 +829,7 @@ public virtual object GetIdentifier(object entry, int i)
829829
/// <param name="owner">The owner of this Collection.</param>
830830
/// <returns>The object that was contained in the row.</returns>
831831
public abstract object ReadFrom(IDataReader reader, ICollectionPersister role, ICollectionAliases descriptor,
832-
object owner);
832+
object owner);
833833

834834
public abstract object GetSnapshotElement(object entry, int i);
835835

0 commit comments

Comments
 (0)