Skip to content

Commit d00399a

Browse files
authored
Merge pull request #153 from spring-projects/features/nhibernate5
NHibernate 5 support
2 parents a2af8c0 + bf82409 commit d00399a

File tree

88 files changed

+2143
-1854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2143
-1854
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PrecompiledWeb
6060
/src/Spring/Spring.Core/Spring.Core.xml
6161
/src/Spring/Spring.Data.NHibernate3/Spring.Data.NHibernate3.xml
6262
/src/Spring/Spring.Data.NHibernate4/Spring.Data.NHibernate4.xml
63+
/src/Spring/Spring.Data.NHibernate5/Spring.Data.NHibernate5.xml
6364
/src/Spring/Spring.Messaging.Ems/Spring.Messaging.Ems.xml
6465
/src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.xml
6566
/src/Spring/Spring.Messaging/Spring.Messaging.xml

Spring.Net.2010.sln

+42
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Template.Velocity.Ca
109109
EndProject
110110
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests", "test\Spring\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests\Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests.csproj", "{DE276F7C-4564-49EC-AABC-B964EC3D1626}"
111111
EndProject
112+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate5.2010", "src\Spring\Spring.Data.NHibernate5\Spring.Data.NHibernate5.2010.csproj", "{26604974-B6B8-45BA-A72A-66574ADC498B}"
113+
EndProject
114+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate5.Integration.Tests.2010", "test\Spring\Spring.Data.NHibernate5.Integration.Tests\Spring.Data.NHibernate5.Integration.Tests.2010.csproj", "{740CDA28-39BC-455A-86C3-5323D14F5B2E}"
115+
EndProject
116+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.NHibernate5.Tests.2010", "test\Spring\Spring.Data.NHibernate5.Tests\Spring.Data.NHibernate5.Tests.2010.csproj", "{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}"
117+
EndProject
112118
Global
113119
GlobalSection(SolutionConfigurationPlatforms) = preSolution
114120
Debug|.NET = Debug|.NET
@@ -589,6 +595,42 @@ Global
589595
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Release|Any CPU.Build.0 = Release|Any CPU
590596
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
591597
{DE276F7C-4564-49EC-AABC-B964EC3D1626}.Release|Mixed Platforms.Build.0 = Release|Any CPU
598+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|.NET.ActiveCfg = Debug|Any CPU
599+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|.NET.Build.0 = Debug|Any CPU
600+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
601+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|Any CPU.Build.0 = Debug|Any CPU
602+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
603+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
604+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|.NET.ActiveCfg = Release|Any CPU
605+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|.NET.Build.0 = Release|Any CPU
606+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|Any CPU.ActiveCfg = Release|Any CPU
607+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|Any CPU.Build.0 = Release|Any CPU
608+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
609+
{26604974-B6B8-45BA-A72A-66574ADC498B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
610+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|.NET.ActiveCfg = Debug|Any CPU
611+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|.NET.Build.0 = Debug|Any CPU
612+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
613+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
614+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
615+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
616+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|.NET.ActiveCfg = Release|Any CPU
617+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|.NET.Build.0 = Release|Any CPU
618+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
619+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|Any CPU.Build.0 = Release|Any CPU
620+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
621+
{740CDA28-39BC-455A-86C3-5323D14F5B2E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
622+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|.NET.ActiveCfg = Debug|Any CPU
623+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|.NET.Build.0 = Debug|Any CPU
624+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
625+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
626+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
627+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
628+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|.NET.ActiveCfg = Release|Any CPU
629+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|.NET.Build.0 = Release|Any CPU
630+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
631+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|Any CPU.Build.0 = Release|Any CPU
632+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
633+
{BEEBC49B-4519-4C77-AE93-11E68F4CA7E3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
592634
EndGlobalSection
593635
GlobalSection(SolutionProperties) = preSolution
594636
HideSolutionNode = FALSE

Spring.build

+15-24
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ Commandline Examples:
377377
<do>
378378
<echo message="Running .NET Framework tests for ${path}" />
379379
<property name="test.bin.dir" value="${path}/net452" />
380+
<if test="${directory::exists(test.bin.dir) == false}">
381+
<property name="test.bin.dir" value="${path}/net461" />
382+
</if>
383+
380384
<property name="test.assemblyname" value="${string::substring(path, string::last-index-of(path, '\') + 1, string::get-length(path) - string::last-index-of(path, '\') - 1)}" />
381385
<property name="test.assemblyfile" value="${test.assemblyname}.dll" />
382386
<property name="test.assemblyname.tocover" value="${string::substring(test.assemblyname,0,string::last-index-of(test.assemblyname, '.Tests') )}" />
@@ -411,6 +415,8 @@ Commandline Examples:
411415
<include name="${spring.basedir}/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2010.csproj" />
412416
<include name="${spring.basedir}/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2010.csproj" />
413417
<include name="${spring.basedir}/test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.2010.csproj" />
418+
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Integration.Tests/Spring.Data.NHibernate5.Integration.Tests.2010.csproj" />
419+
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Tests/Spring.Data.NHibernate5.Tests.2010.csproj" />
414420
</items>
415421
</in>
416422
<do>
@@ -892,30 +898,6 @@ Commandline Examples:
892898
</copy>
893899
</if>
894900

895-
<mkdir dir="${current.package.dir}/lib/NHibernate3"/>
896-
<if test="${property::exists('build.allnamespaces') and not build.allnamespaces}">
897-
<copy todir="${current.package.dir}/lib/NHibernate3" verbose="${copy-verbose}">
898-
<fileset basedir="lib/NHibernate3">
899-
<include name="**/*.dll"/>
900-
<include name="**/*.xml"/>
901-
<include name="**/*.license.txt"/>
902-
<exclude name="mono/**"/>
903-
</fileset>
904-
</copy>
905-
</if>
906-
907-
<mkdir dir="${current.package.dir}/lib/NHibernate4"/>
908-
<if test="${property::exists('build.allnamespaces') and not build.allnamespaces}">
909-
<copy todir="${current.package.dir}/lib/NHibernate4" verbose="${copy-verbose}">
910-
<fileset basedir="lib/NHibernate4">
911-
<include name="**/*.dll"/>
912-
<include name="**/*.xml"/>
913-
<include name="**/*.license.txt"/>
914-
<exclude name="mono/**"/>
915-
</fileset>
916-
</copy>
917-
</if>
918-
919901
<if test="${property::exists('build.allnamespaces') and build.allnamespaces}">
920902
<copy todir="${current.package.dir}/lib" verbose="${copy-verbose}">
921903
<fileset basedir="lib">
@@ -1113,6 +1095,10 @@ Commandline Examples:
11131095
<include name="*/*/Spring.Web.Conversation.NHibernate4.xml"/>
11141096
<include name="*/*/Spring.Web.Conversation.NHibernate4.pdb"/>
11151097

1098+
<include name="*/*/Spring.Web.Conversation.NHibernate5.dll"/>
1099+
<include name="*/*/Spring.Web.Conversation.NHibernate5.xml"/>
1100+
<include name="*/*/Spring.Web.Conversation.NHibernate5.pdb"/>
1101+
11161102
</fileset>
11171103
</copy>
11181104

@@ -1307,6 +1293,7 @@ Commandline Examples:
13071293
<include name="src/Spring/Spring.Data/**"/>
13081294
<include name="src/Spring/Spring.Data.NHibernate3/**"/>
13091295
<include name="src/Spring/Spring.Data.NHibernate4/**"/>
1296+
<include name="src/Spring/Spring.Data.NHibernate5/**"/>
13101297
<include name="src/Spring/Spring.Messaging/**"/>
13111298
<include name="src/Spring/Spring.Messaging.Nms/**"/>
13121299
<include name="src/Spring/Spring.Messaging.Ems/**"/>
@@ -1317,6 +1304,7 @@ Commandline Examples:
13171304
<include name="src/Spring/CommonAssemblyInfo.cs"/>
13181305
<include name="src/Spring/Spring.Web.Conversation.NHibernate3/**"/>
13191306
<include name="src/Spring/Spring.Web.Conversation.NHibernate4/**"/>
1307+
<include name="src/Spring/Spring.Web.Conversation.NHibernate5/**"/>
13201308

13211309
<include name="test/Spring/Spring.Core.Tests/**"/>
13221310
<include name="test/Spring/Spring.Aop.Tests/**"/>
@@ -1332,6 +1320,8 @@ Commandline Examples:
13321320
<include name="test/Spring/Spring.Data.NHibernate4.Tests/**"/>
13331321
<include name="test/Spring/Spring.Data.NHibernate4.Integration.Tests/**"/>
13341322
<include name="test/Spring/Spring.Data.NHibernate4.NestedTxSuspension.Integration.Tests/**"/>
1323+
<include name="test/Spring/Spring.Data.NHibernate5.Tests/**"/>
1324+
<include name="test/Spring/Spring.Data.NHibernate5.Integration.Tests/**"/>
13351325
<include name="test/Spring/Spring.Messaging.Tests/**"/>
13361326
<include name="test/Spring/Spring.Messaging.Nms.Tests/**"/>
13371327
<include name="test/Spring/Spring.Messaging.Nms.Integration.Tests/**"/>
@@ -1343,6 +1333,7 @@ Commandline Examples:
13431333
<include name="test/Spring/CommonAssemblyInfo.cs"/>
13441334
<include name="test/Spring/Spring.Web.Conversation.NHibernate3.Tests/**"/>
13451335
<include name="test/Spring/Spring.Web.Conversation.NHibernate4.Tests/**"/>
1336+
<include name="test/Spring/Spring.Web.Conversation.NHibernate5.Tests/**"/>
13461337

13471338
<include name="examples/Spring/Spring.Examples.build"/>
13481339
<include name="examples/Spring/Spring.AopQuickStart/**"/>

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/BytecodeProvider.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,8 +14,6 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
2117
using System;
2218
using NHibernate.Bytecode;
2319
using NHibernate.Properties;

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/LazyInitializer.cs

+18-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,8 +14,6 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
2117
using System;
2218
using System.Reflection;
2319
using AopAlliance.Intercept;
@@ -53,13 +49,22 @@ static LazyInitializer()
5349
///<param name="componentIdType"></param>
5450
///<param name="session"></param>
5551
public LazyInitializer(string entityName, Type persistentClass, object id, MethodInfo getIdentifierMethod,
56-
MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType,
57-
ISessionImplementor session)
52+
MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType,
53+
ISessionImplementor session)
5854
: base(
59-
entityName, persistentClass, id, getIdentifierMethod,
60-
setIdentifierMethod, componentIdType, session) { }
61-
62-
#region Implementation of IInterceptor
55+
entityName,
56+
persistentClass,
57+
id,
58+
getIdentifierMethod,
59+
setIdentifierMethod,
60+
componentIdType,
61+
session
62+
#if NH_5
63+
, overridesEquals: false
64+
#endif
65+
)
66+
{
67+
}
6368

6469
/// <summary>
6570
/// Implement this method to perform extra treatments before and after
@@ -106,27 +111,12 @@ public object Invoke(IMethodInvocation invocation)
106111
}
107112
}
108113

109-
#endregion
110-
111-
#region Implementation of ITargetSource
112-
113-
object ITargetSource.GetTarget()
114-
{
115-
return Target;
116-
}
114+
object ITargetSource.GetTarget() => Target;
117115

118116
void ITargetSource.ReleaseTarget(object target) { }
119117

120-
Type ITargetSource.TargetType
121-
{
122-
get { return PersistentClass; }
123-
}
124-
125-
bool ITargetSource.IsStatic
126-
{
127-
get { return false; }
128-
}
118+
Type ITargetSource.TargetType => PersistentClass;
129119

130-
#endregion
120+
bool ITargetSource.IsStatic => false;
131121
}
132122
}

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ObjectsFactory.cs

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,19 +14,13 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
21-
#region Imports
22-
2317
using System;
2418
using System.Collections.Generic;
2519

2620
using NHibernate.Bytecode;
2721

2822
using Spring.Objects.Factory;
2923

30-
#endregion
31-
3224
namespace Spring.Data.NHibernate.Bytecode
3325
{
3426
/// <summary>

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ProxyFactory.cs

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,8 +14,6 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
2117
using System;
2218
using Common.Logging;
2319
using NHibernate;
@@ -46,8 +42,6 @@ public override bool IsSerializable
4642
}
4743
}
4844

49-
#region IProxyFactory Members
50-
5145
/// <summary>
5246
/// Creates a new proxy.
5347
/// </summary>
@@ -78,7 +72,5 @@ public override INHibernateProxy GetProxy(object id, ISessionImplementor session
7872
throw new HibernateException("Creating a proxy instance failed", ex);
7973
}
8074
}
81-
82-
#endregion
8375
}
8476
}

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ProxyFactoryFactory.cs

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,16 +14,10 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
21-
#region Imports
22-
2317
using System;
2418
using NHibernate.Bytecode;
2519
using NHibernate.Proxy;
2620

27-
#endregion
28-
2921
namespace Spring.Data.NHibernate.Bytecode
3022
{
3123
/// <summary>

src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ReflectionOptimizer.cs

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#region License
2-
31
/*
42
* Copyright © 2002-2011 the original author or authors.
53
*
@@ -16,19 +14,13 @@
1614
* limitations under the License.
1715
*/
1816

19-
#endregion
20-
21-
#region Imports
22-
2317
using System;
2418
using System.Collections.Generic;
2519

2620
using NHibernate.Properties;
2721

2822
using Spring.Objects.Factory;
2923

30-
#endregion
31-
3224
namespace Spring.Data.NHibernate.Bytecode
3325
{
3426
/// <summary>

0 commit comments

Comments
 (0)