Skip to content

Commit 08ff4ad

Browse files
committed
ParameterizedUserCollectionTest now green
1 parent 38ffcb6 commit 08ff4ad

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

Src/NHibernate.Envers.Tests/NHibernate.Envers.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
</ItemGroup>
3737

3838
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
39-
<Exec Command='if not exist "$(ProjectDir)\hibernate.cfg.xml" copy "$(ProjectDir)\hibernate.cfg.xml.template" "$(ProjectDir)\hibernate.cfg.xml"' />
39+
<Exec Command="if not exist &quot;$(ProjectDir)\hibernate.cfg.xml&quot; copy &quot;$(ProjectDir)\hibernate.cfg.xml.template&quot; &quot;$(ProjectDir)\hibernate.cfg.xml&quot;" />
4040
</Target>
4141
</Project>

Src/NHibernate.Envers.Tests/NetSpecific/Integration/CustomMapping/UserCollection/SpecialMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class SpecialMapper : BagCollectionMapper<Number>
1010
private readonly MiddleComponentData _elementComponentData;
1111

1212
public SpecialMapper(CommonCollectionMapperData commonCollectionMapperData, MiddleComponentData elementComponentData, bool embeddableElementType)
13-
: base(commonCollectionMapperData, typeof(ISpecialCollection), elementComponentData, embeddableElementType)
13+
: base(commonCollectionMapperData, typeof(SpecialProxyCollectionType), elementComponentData, embeddableElementType)
1414
{
1515
_elementComponentData = elementComponentData;
1616
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using NHibernate.Envers.Entities.Mapper.Relation.Lazy.Initializor;
3+
using NHibernate.Envers.Entities.Mapper.Relation.Lazy.Proxy;
4+
5+
namespace NHibernate.Envers.Tests.NetSpecific.Integration.CustomMapping.UserCollection
6+
{
7+
public class SpecialProxyCollectionType : ListProxy<Number>, ISpecialCollection
8+
{
9+
private Lazy<ISpecialCollection> _delegate;
10+
11+
public SpecialProxyCollectionType(IInitializor initializor) : base(initializor)
12+
{
13+
_delegate = new Lazy<ISpecialCollection>(() => (ISpecialCollection) initializor.Initialize());
14+
}
15+
16+
public int ItemsOverLimit()
17+
{
18+
return _delegate.Value.ItemsOverLimit();
19+
}
20+
21+
public int Limit => _delegate.Value.Limit;
22+
}
23+
}

Src/ReleaseNotes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* ...nhibernate.envers.proxy_factory removed from configuration
66
* ...removed from all ICollectionMapperFactory methods
77
* ...removed from ICustomCollectionMapperFactory.Create method
8+
* If using custom collections, AbstractCollectionMapper now expects a concrete type for proxyType.
9+
See ParameterizedUserCollectionTest.
810

911
** Bug
1012
* #2 Make conversion of RevisionType explicit to avoid failure using Npgsql

0 commit comments

Comments
 (0)