Skip to content

Commit c732eca

Browse files
authored
Merge branch 'master' into contributing-breaking-changes
2 parents 26b3983 + c53ef0c commit c732eca

File tree

72 files changed

+2286
-297
lines changed

Some content is hidden

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

72 files changed

+2286
-297
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"gitreleasemanager.tool": {
12-
"version": "0.18.0",
12+
"version": "0.20.0",
1313
"commands": [
1414
"dotnet-gitreleasemanager"
1515
]

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ dotnet_diagnostic.NUnit2031.severity = suggestion
2727
dotnet_diagnostic.NUnit2049.severity = suggestion
2828
# The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference
2929
dotnet_diagnostic.NUnit2040.severity = suggestion
30+
dotnet_diagnostic.CA1849.severity = error
31+
dotnet_diagnostic.CA2007.severity = error
32+
dotnet_code_quality.CA2007.output_kind = DynamicallyLinkedLibrary
3033

3134
[*.xsd]
3235
indent_style = tab

.github/workflows/GenerateAsyncCode.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
with:
1818
ref: ${{ github.event.pull_request.head.ref }}
1919
repository: ${{ github.event.pull_request.head.repo.full_name }}
2020

2121
- name: Setup .NET
22-
uses: actions/setup-dotnet@v4
22+
uses: actions/setup-dotnet@v5
2323
with:
2424
dotnet-version: 8.0.x
2525

.github/workflows/NetCoreTests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
DB_INIT: |
1717
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
1818
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
19-
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;"
19+
CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;TrustServerCertificate=true;"
2020
OS: ubuntu-latest
2121
DB_INIT: |
2222
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress mcr.microsoft.com/mssql/server:2019-latest;
@@ -64,12 +64,12 @@ jobs:
6464
run: ${{matrix.DB_INIT}}
6565

6666
- name: Set up .NET
67-
uses: actions/setup-dotnet@v4
67+
uses: actions/setup-dotnet@v5
6868
with:
6969
dotnet-version: 8.0.x
7070

7171
- name: Checkout
72-
uses: actions/checkout@v4
72+
uses: actions/checkout@v5
7373
with:
7474
show-progress: false
7575

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
version: '{build}'
22
image: Visual Studio 2022
3+
skip_branch_with_pr: true
34
environment:
45
matrix:
56
- DB: SqlServer2008
67
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
78
- DB: SqlServer2008-MicrosoftDataSqlClientDriver
8-
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;
9+
CONNECTION_STRING: Server=(local)\SQL2017;User ID=sa;Password=Password12!;initial catalog=nhibernate;TrustServerCertificate=true;
910
- DB: Firebird
1011
- DB: Firebird4
1112
- DB: MySQL

doc/reference/modules/configuration.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,11 @@ in the parameter binding.</programlisting>
16061606
<entry><literal>NHibernate.Dialect.SybaseASE15Dialect</literal></entry>
16071607
<entry></entry>
16081608
</row>
1609+
<row>
1610+
<entry>Sybase Adaptive Server Enterprise 16</entry>
1611+
<entry><literal>NHibernate.Dialect.SybaseASE16Dialect</literal></entry>
1612+
<entry></entry>
1613+
</row>
16091614
<row>
16101615
<entry>Sybase SQL Anywhere 10</entry>
16111616
<entry><literal>NHibernate.Dialect.SybaseSQLAnywhere10Dialect</literal></entry>

releasenotes.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
Build 5.5.2
1+
Build 5.5.3
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.5.3
5+
6+
2 issues were resolved in this release.
7+
8+
** Task
9+
10+
* #3692 Release 5.5.3
11+
* #3691 Merge 5.4.10 into 5.5.x
12+
13+
14+
Build 5.5.2
215
=============================
316

417
Release notes - NHibernate - Version 5.5.2
@@ -122,6 +135,23 @@ Release notes - NHibernate - Version 5.5.0
122135
* #3412 Revive hql ParsingFixture
123136

124137

138+
Build 5.4.10
139+
=============================
140+
141+
Release notes - NHibernate - Version 5.4.10
142+
143+
3 issues were resolved in this release.
144+
145+
** Bug
146+
147+
* #3609 Fitering with a subquery on a many-to-one with property-ref generates invalid SQL
148+
* #3607 Invalid ByCode serialization to XML for OneToOne mappings
149+
150+
** Task
151+
152+
* #3688 Release 5.4.10
153+
154+
125155
Build 5.4.9
126156
=============================
127157

src/NHibernate.Test/Ado/BatcherFixture.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44

55
namespace NHibernate.Test.Ado
66
{
7-
[TestFixture]
7+
#if NET6_0_OR_GREATER
8+
[TestFixture(true)]
9+
#endif
10+
[TestFixture(false)]
811
public class BatcherFixture: TestCase
912
{
13+
private readonly bool _useDbBatch;
14+
15+
public BatcherFixture(bool useDbBatch)
16+
{
17+
_useDbBatch = useDbBatch;
18+
}
1019
protected override string MappingsAssembly
1120
{
1221
get { return "NHibernate.Test"; }
@@ -22,10 +31,22 @@ protected override void Configure(Configuration configuration)
2231
configuration.SetProperty(Environment.FormatSql, "true");
2332
configuration.SetProperty(Environment.GenerateStatistics, "true");
2433
configuration.SetProperty(Environment.BatchSize, "10");
34+
#if NET6_0_OR_GREATER
35+
if (_useDbBatch)
36+
{
37+
configuration.SetProperty(Environment.BatchStrategy, typeof(DbBatchBatcherFactory).AssemblyQualifiedName);
38+
}
39+
#endif
2540
}
2641

2742
protected override bool AppliesTo(Engine.ISessionFactoryImplementor factory)
2843
{
44+
#if NET6_0_OR_GREATER
45+
if (_useDbBatch)
46+
{
47+
return factory.Settings.BatcherFactory is DbBatchBatcherFactory && factory.Settings.ConnectionProvider.Driver is Driver.DriverBase driverBase && driverBase.CanCreateBatch;
48+
}
49+
#endif
2950
return !(factory.Settings.BatcherFactory is NonBatchingBatcherFactory);
3051
}
3152

@@ -129,20 +150,25 @@ public void SqlClientOneRoundTripForUpdateAndInsert()
129150
Cleanup();
130151
}
131152

132-
[Test, NetFxOnly]
153+
[Test]
133154
[Description("SqlClient: The batcher log output should be formatted")]
134155
public void BatchedoutputShouldBeFormatted()
135156
{
136157
#if NETFX
137158
if (Sfi.Settings.BatcherFactory is SqlClientBatchingBatcherFactory == false)
138159
Assert.Ignore("This test is for SqlClientBatchingBatcher only");
160+
#elif NET6_0_OR_GREATER
161+
if (Sfi.Settings.BatcherFactory is DbBatchBatcherFactory == false)
162+
Assert.Ignore("This test is for DbBatchBatcherFactory only");
163+
#else
164+
Assert.Ignore("This test is for NETFX and NET6_0_OR_GREATER only");
139165
#endif
140166

141167
using (var sqlLog = new SqlLogSpy())
142168
{
143169
FillDb();
144170
var log = sqlLog.GetWholeLog();
145-
Assert.IsTrue(log.Contains("INSERT \n INTO"));
171+
Assert.That(log, Does.Contain("INSERT \n INTO").IgnoreCase);
146172
}
147173

148174
Cleanup();
@@ -213,7 +239,7 @@ public void AbstractBatcherLog()
213239
foreach (var loggingEvent in sl.Appender.GetEvents())
214240
{
215241
string message = loggingEvent.RenderedMessage;
216-
if(message.ToLowerInvariant().Contains("insert"))
242+
if(message.Contains("insert"))
217243
{
218244
Assert.That(message, Does.Contain("batch").IgnoreCase);
219245
}

src/NHibernate.Test/Async/Ado/BatcherFixture.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@ namespace NHibernate.Test.Ado
1616
{
1717
using System.Threading.Tasks;
1818
using System.Threading;
19-
[TestFixture]
19+
#if NET6_0_OR_GREATER
20+
[TestFixture(true)]
21+
#endif
22+
[TestFixture(false)]
2023
public class BatcherFixtureAsync: TestCase
2124
{
25+
private readonly bool _useDbBatch;
26+
27+
public BatcherFixtureAsync(bool useDbBatch)
28+
{
29+
_useDbBatch = useDbBatch;
30+
}
2231
protected override string MappingsAssembly
2332
{
2433
get { return "NHibernate.Test"; }
@@ -34,10 +43,22 @@ protected override void Configure(Configuration configuration)
3443
configuration.SetProperty(Environment.FormatSql, "true");
3544
configuration.SetProperty(Environment.GenerateStatistics, "true");
3645
configuration.SetProperty(Environment.BatchSize, "10");
46+
#if NET6_0_OR_GREATER
47+
if (_useDbBatch)
48+
{
49+
configuration.SetProperty(Environment.BatchStrategy, typeof(DbBatchBatcherFactory).AssemblyQualifiedName);
50+
}
51+
#endif
3752
}
3853

3954
protected override bool AppliesTo(Engine.ISessionFactoryImplementor factory)
4055
{
56+
#if NET6_0_OR_GREATER
57+
if (_useDbBatch)
58+
{
59+
return factory.Settings.BatcherFactory is DbBatchBatcherFactory && factory.Settings.ConnectionProvider.Driver is Driver.DriverBase driverBase && driverBase.CanCreateBatch;
60+
}
61+
#endif
4162
return !(factory.Settings.BatcherFactory is NonBatchingBatcherFactory);
4263
}
4364

@@ -101,20 +122,25 @@ public async Task OneRoundTripUpdateAsync()
101122
await (CleanupAsync());
102123
}
103124

104-
[Test, NetFxOnly]
125+
[Test]
105126
[Description("SqlClient: The batcher log output should be formatted")]
106127
public async Task BatchedoutputShouldBeFormattedAsync()
107128
{
108129
#if NETFX
109130
if (Sfi.Settings.BatcherFactory is SqlClientBatchingBatcherFactory == false)
110131
Assert.Ignore("This test is for SqlClientBatchingBatcher only");
132+
#elif NET6_0_OR_GREATER
133+
if (Sfi.Settings.BatcherFactory is DbBatchBatcherFactory == false)
134+
Assert.Ignore("This test is for DbBatchBatcherFactory only");
135+
#else
136+
Assert.Ignore("This test is for NETFX and NET6_0_OR_GREATER only");
111137
#endif
112138

113139
using (var sqlLog = new SqlLogSpy())
114140
{
115141
await (FillDbAsync());
116142
var log = sqlLog.GetWholeLog();
117-
Assert.IsTrue(log.Contains("INSERT \n INTO"));
143+
Assert.That(log, Does.Contain("INSERT \n INTO").IgnoreCase);
118144
}
119145

120146
await (CleanupAsync());
@@ -185,7 +211,7 @@ public async Task AbstractBatcherLogAsync()
185211
foreach (var loggingEvent in sl.Appender.GetEvents())
186212
{
187213
string message = loggingEvent.RenderedMessage;
188-
if(message.ToLowerInvariant().Contains("insert"))
214+
if(message.Contains("insert"))
189215
{
190216
Assert.That(message, Does.Contain("batch").IgnoreCase);
191217
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System;
12+
using System.Collections;
13+
using System.Collections.Generic;
14+
using NUnit.Framework;
15+
16+
namespace NHibernate.Test.CollectionTest
17+
{
18+
using System.Threading.Tasks;
19+
[TestFixture]
20+
public class IdBagRelaxedFixtureAsync : TestCase
21+
{
22+
protected override string[] Mappings
23+
{
24+
get { return new string[] { "CollectionTest.IdBagRelaxedFixture.hbm.xml" }; }
25+
}
26+
27+
protected override string MappingsAssembly
28+
{
29+
get { return "NHibernate.Test"; }
30+
}
31+
32+
protected override void OnTearDown()
33+
{
34+
using( ISession s = OpenSession() )
35+
{
36+
s.Delete( "from A" );
37+
s.Flush();
38+
}
39+
}
40+
41+
[Test]
42+
public async Task SimpleAsync()
43+
{
44+
A a = new A();
45+
a.Name = "first generic type";
46+
a.Items = new List<string>();
47+
a.Items.Add( "first string" );
48+
a.Items.Add( "second string" );
49+
50+
ISession s = OpenSession();
51+
await (s.SaveOrUpdateAsync( a ));
52+
// this flush should test how NH wraps a generic collection with its
53+
// own persistent collection
54+
await (s.FlushAsync());
55+
s.Close();
56+
Assert.IsNotNull( a.Id );
57+
Assert.AreEqual( "first string", ( string ) a.Items[ 0 ] );
58+
59+
s = OpenSession();
60+
a = ( A ) await (s.LoadAsync( typeof( A ), a.Id ));
61+
Assert.AreEqual( "first string", ( string ) a.Items[ 0 ], "first item should be 'first string'" );
62+
Assert.AreEqual( "second string", ( string ) a.Items[ 1 ], "second item should be 'second string'" );
63+
// ensuring the correct generic type was constructed
64+
a.Items.Add( "third string" );
65+
Assert.AreEqual( 3, a.Items.Count, "3 items in the list now" );
66+
67+
a.Items[ 1 ] = "new second string";
68+
await (s.FlushAsync());
69+
s.Close();
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)