diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 00000000000..529caf149f7
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "csharpasyncgenerator.tool": {
+ "version": "0.19.1",
+ "commands": [
+ "async-generator"
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
index 67c20a705b8..cdafebe60ab 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,6 +7,13 @@ insert_final_newline = true
indent_style = tab
dotnet_sort_system_directives_first = true
csharp_space_after_cast = true
+csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
+csharp_new_line_between_query_expression_clauses = true
[*.xsd]
indent_style = tab
diff --git a/.gitignore b/.gitignore
index 977afb3cb6b..678ae179fb6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@ TestResult.xml
.idea/
.vs/
/build-common/NHibernate.dev.props
+/doc/reference/master.xml
diff --git a/.travis.yml b/.travis.yml
index 748f57bd794..dddf94fa59c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,8 @@
+os: linux
+dist: xenial
language: csharp
-mono: latest
+mono: none
dotnet: 2.1.300
-sudo: required
services:
- mysql
- postgresql
@@ -12,27 +13,24 @@ env:
- DB=Firebird
- DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
- DB=SQLite
-matrix:
- allow_failures:
- - env: DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;"
before_install:
- - curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- - curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
- sudo apt-get update -qq
- sudo apt-get install -y powershell
- |-
if [[ "$DB" == "MySQL" ]]
then
- echo -e '[server]\nlower_case_table_names=1' | sudo tee -a /etc/mysql/my.cnf
+ echo -e '[server]\nlower_case_table_names=1\n[mysqld]\ncharacter-set-server=utf8\ncollation-server=utf8_general_ci' | sudo tee -a /etc/mysql/my.cnf
sudo service mysql restart
fi
- |-
if [[ "$DB" == "Firebird" ]]
then
- sudo apt-get install -y libicu-dev libtommath-dev curl
- curl -L -O https://github.com/FirebirdSQL/firebird/releases/download/R3_0_3/Firebird-3.0.3.32900-0.amd64.tar.gz
- tar xzvf Firebird-3.0.3.32900-0.amd64.tar.gz
- pushd Firebird-3.0.3.32900-0.amd64
+ sudo apt-get install -y libtommath-dev
+ # This would be required on bionic and above
+ # sudo ln -s /usr/lib/x86_64-linux-gnu/libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0
+ wget -q https://github.com/FirebirdSQL/firebird/releases/download/R3_0_5/Firebird-3.0.5.33220-0.amd64.tar.gz
+ tar xzvf Firebird-3.0.5.33220-0.amd64.tar.gz
+ pushd Firebird-3.0.5.33220-0.amd64
sudo ./install.sh -silent
popd
export $(sudo cat /opt/firebird/SYSDBA.password | grep -v ^# | xargs)
@@ -40,7 +38,7 @@ before_install:
echo -e "nhibernate = /tmp/firebird/nhibernate.fdb" | sudo tee -a /opt/firebird/databases.conf
echo -e "AuthServer = Srp\nAuthClient = Srp\nUserManager = Srp\nWireCrypt = Enabled" | sudo tee -a /opt/firebird/firebird.conf
sudo /opt/firebird/bin/gsec -modify SYSDBA -pw masterkey -admin yes
- sudo service firebird restart
+ sudo systemctl restart firebird-superserver
fi
before_script:
- if [[ "$DB" == "SqlServer2008" ]]; then docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress microsoft/mssql-server-linux:latest; fi
diff --git a/HowInstall.txt b/HowInstall.txt
index 1893c600540..febc1b2f8ba 100644
--- a/HowInstall.txt
+++ b/HowInstall.txt
@@ -4,4 +4,4 @@ Required Bins : Minimal required assemblies to work with NHibernate
Required for LazyLoading :
NHibernate 2.1 has a new important feature regarding dynamic-proxy systems for lazy-loading
Details are available in releasenotes.txt and in this post
-http://nhibernate.info/blog/2008/11/09/nh2-1-0-bytecode-providers.html
\ No newline at end of file
+https://nhibernate.info/blog/2008/11/09/nh2-1-0-bytecode-providers.html
\ No newline at end of file
diff --git a/README.md b/README.md
index 04280734b54..8da992df161 100644
--- a/README.md
+++ b/README.md
@@ -4,24 +4,42 @@ Welcome to NHibernate
NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed,
fully featured and used in thousands of successful projects.
-The NHibernate community website - - has a range of resources to help you get started,
+The NHibernate community website - - has a range of resources to help you get started,
including [howtos][A1], [blogs][A2] and [reference documentation][A3].
-[A1]: http://nhibernate.info/doc/
-[A2]: http://nhibernate.info/blog/
-[A3]: http://nhibernate.info/doc/nh/en/index.html
+[A1]: https://nhibernate.info/doc/
+[A2]: https://nhibernate.info/blog/
+[A3]: https://nhibernate.info/doc/nh/en/index.html
-Latest Version
+Latest Release Version
--------------
The quickest way to get the latest release of NHibernate is to add it to your project using
-NuGet ().
+NuGet ().
Alternatively binaries are available from SourceForge at .
You are encouraged to review the release notes ([releasenotes.txt](releasenotes.txt)), particularly when upgrading to a
later version. The release notes will generally document any breaking changes.
+Nightly Development Builds
+--------------------------
+
+The quickest way to get the latest development build of NHibernate is to add it to your project using
+NuGet from MyGet feed ().
+
+In order to make life a little bit easier you can register the package source in the NuGet.Config
+file in the top folder of your project, similar to the following.
+
+```xml
+
+
+
+
+
+
+```
+
Community Forums
----------------
@@ -40,8 +58,8 @@ If you find any bugs, please report them using the [GitHub issue tracker][C1]. A
test-case that demonstrates the issue is usually required. Instructions on providing a test-case
can be found in [contributing guidelines][C3] or [here][C2].
-[C1]: http://github.com/nhibernate/nhibernate-core/issues
-[C2]: http://nhibernate.info/blog/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.html
+[C1]: https://github.com/nhibernate/nhibernate-core/issues
+[C2]: https://nhibernate.info/blog/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.html
[C3]: CONTRIBUTING.md
Licenses
@@ -85,7 +103,7 @@ of NHibernate (in no particular order):
[Apache Software Foundation]: http://www.apache.org
[JetBrains]: http://www.jetbrains.com
[ReSharper]: http://www.jetbrains.com/resharper
-[LinFu]: http://code.google.com/p/linfu
+[LinFu]: https://github.com/philiplaureano/LinFu
[article]: http://www.codeproject.com/KB/recipes/sets.aspx
-[Relinq]: http://relinq.codeplex.com/
+[Relinq]: https://github.com/re-motion/Relinq
[AsyncGenerator]: http://github.com/maca88/AsyncGenerator
diff --git a/ReleaseProcedure.txt b/ReleaseProcedure.txt
index 753cce5c66a..b61cf9809b5 100644
--- a/ReleaseProcedure.txt
+++ b/ReleaseProcedure.txt
@@ -4,11 +4,11 @@ These are the tasks typically needed to create an official NHibernate release.
that is about to happen (as these will show in the milestone).
* Create a draft release in Github with GitReleaseManager. If you have used
- the NHibernate build menu, it should be available in Tools\gitreleasemanage.x.x.x\
+ the NHibernate build menu, it should be available in Tools\gitreleasemanager\x.x.x\
(change x.x.x by its current version in tools).
By example:
-Tools\gitreleasemanager.0.7.0\tools\GitReleaseManager.exe create -o nhibernate -r nhibernate-core -m 5.1 -u username -p password
+Tools\gitreleasemanager\0.11.0\tools\GitReleaseManager.exe create -o nhibernate -r nhibernate-core -m 5.3 --token yourGitHubTokenWithRepoScope
(Adjust the -m milestone parameter above, and add "-c branchname" if
releasing another branch than master)
@@ -25,9 +25,8 @@ Tools\gitreleasemanager.0.7.0\tools\GitReleaseManager.exe create -o nhibernate -
If the release tag does not match the released version with major.minor.release
formalism, the NuGet package will have an invalid link to release notes.
- * Check/update version number in common.xml and NHibernate.props under
- build-common folder, in master.xml under doc\reference folder, and in
- appveyor.yml in the NHibernate root.
+ * Check/update version number in NHibernate.props under build-common folder.
+ Clear VersionSuffix if present.
* Don't forget to commit the above.
@@ -55,3 +54,10 @@ Tools\gitreleasemanager.0.7.0\tools\GitReleaseManager.exe create -o nhibernate -
* If this was a stable branch, merge it forward to master. Perhaps some
changes need to be edited out in the merge, but this will reduce the
risk of some issue being left unfixed on master.
+
+ * If this was the master branch, create the stable branch for the new release, named
+ according to its version with "x" instead of its patch number. By example, "5.3.x".
+
+ * If next version is decided set it in NHibernate.props under build-common folder
+ (in most cases - increment minor version) and set VersionSuffix to "dev".
+ Commit it directly (without going through a PR).
diff --git a/ShowBuildMenu.bat b/ShowBuildMenu.bat
index 38ed467ae77..4bbb640c761 100644
--- a/ShowBuildMenu.bat
+++ b/ShowBuildMenu.bat
@@ -1,15 +1,21 @@
@echo off
pushd %~dp0
+for /f "tokens=* USEBACKQ delims= " %%i in (`findstr /c:"NUnit.Console" "Tools\packages.csproj"`) do set NUNIT_VERSION=%%i
+set NUNIT_VERSION=%NUNIT_VERSION:~51%
+set NUNIT_VERSION=%NUNIT_VERSION:" />=%
+
set NANT="%~dp0Tools\nant\bin\NAnt.exe" -t:net-4.0
set BUILD_TOOL_PATH=%~dp0Tools\BuildTool\bin\BuildTool.dll
set BUILDTOOL=dotnet %BUILD_TOOL_PATH%
set AVAILABLE_CONFIGURATIONS=%~dp0available-test-configurations
set CURRENT_CONFIGURATION=%~dp0current-test-configuration
-set NUNIT="%~dp0Tools\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe"
+set NUNIT="%~dp0Tools\NUnit.ConsoleRunner\%NUNIT_VERSION%\tools\nunit3-console.exe"
if not exist %BUILD_TOOL_PATH% (
- dotnet build %~dp0Tools\BuildTool\BuildTool.sln -c Release -o bin
+ pushd %~dp0Tools\BuildTool
+ dotnet build BuildTool.sln -c Release -o bin
+ popd
)
:main-menu
@@ -182,7 +188,8 @@ SET NUNITPLATFORM=
goto test-run
:test-run
-start "nunit3-console" cmd /K %NUNIT% %NUNITPLATFORM% --agents=1 --process=separate NHibernate.nunit
+%NANT% common.tools-restore
+start "nunit3-console" cmd /K %NUNIT% %NUNITPLATFORM% --agents=1 NHibernate.nunit
goto main-menu
rem :build-test
diff --git a/ShowBuildMenu.sh b/ShowBuildMenu.sh
index 4fef99c721a..066cfae5ac4 100755
--- a/ShowBuildMenu.sh
+++ b/ShowBuildMenu.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+cd "$(dirname "$0")"
+SCRIPT_PATH="$(pwd)"
BUILD_TOOL_PATH="./Tools/BuildTool/bin/BuildTool.dll"
BUILD_TOOL="dotnet $BUILD_TOOL_PATH"
AVAILABLE_CONFIGURATIONS="available-test-configurations"
@@ -10,11 +12,14 @@ LIB_FILES2=""
CURRENT_CONFIGURATION="./current-test-configuration"
OPTION=0
async_generator_path=""
+async_generator_version=""
if [ ! -f $BUILD_TOOL_PATH ]
then
- dotnet build ./Tools/BuildTool/BuildTool.sln -c Release -o bin
+ cd ./Tools/BuildTool
+ dotnet build BuildTool.sln -c Release -o bin
fi
+cd "$SCRIPT_PATH"
buildDebug(){
dotnet build ./src/NHibernate.sln
@@ -173,48 +178,15 @@ testRun(){
}
generateAsync(){
- dotnet msbuild /t:Restore ./src/NHibernate.sln
-
- getAsyncGeneratorPath
cd src
- mono ../"$async_generator_path"
+ dotnet tool restore
+ dotnet restore ./NHibernate.sln
+ dotnet async-generator
cd ..
mainMenu
}
-getAsyncGeneratorPath(){
- if [ "$async_generator_path" ]
- then
- return
- fi
-
- cd Tools
-
- if [ ! -f nuget.exe ]
- then
- wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
- fi
-
- async_generator_path="CSharpAsyncGenerator.CommandLine.$(cat packages.config | grep id=\"CSharpAsyncGenerator.CommandLine | cut -d\" -f4)/tools"
-
- if [ ! -d $async_generator_path ]
- then
- mono nuget.exe install
- fi
-
- if [ ! -f $async_generator_path/SQLitePCLRaw.core.dll ]
- then
- # This "hidden" dependency causes a failure under some Mono setup, add it explicitly
- mono nuget.exe install SQLitePCLRaw.core -Version 1.0.0
- cp SQLitePCLRaw.core.1.0.0/lib/net45/SQLitePCLRaw.core.dll $async_generator_path/
- fi
-
- async_generator_path="Tools/$async_generator_path/AsyncGenerator.CommandLine.exe"
-
- cd ..
-}
-
mainMenu() {
echo "========================= NHIBERNATE BUILD MENU =========================="
echo "--- TESTING ---"
diff --git a/Tools/.gitignore b/Tools/.gitignore
index 1128a77fed4..c98efa933bc 100644
--- a/Tools/.gitignore
+++ b/Tools/.gitignore
@@ -1,6 +1,6 @@
-nuget.exe
-NUnit.*
-vswhere.*
-CSharpAsyncGenerator.CommandLine.*
-gitreleasemanager.*
-SQLitePCLRaw.core.*
+nunit.*
+vswhere/
+csharpasyncgenerator.commandline/
+gitreleasemanager/
+obj/
+microsoft.*
diff --git a/Tools/actual_msbuild.cmd b/Tools/actual_msbuild.cmd
index 7db65390fe3..7596a39ba5b 100644
--- a/Tools/actual_msbuild.cmd
+++ b/Tools/actual_msbuild.cmd
@@ -1,6 +1,6 @@
@echo off
-for /f "usebackq tokens=*" %%i in (`%~dp0\vswhere.2.1.4\tools\vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
+for /f "usebackq tokens=*" %%i in (`%~dp0\vswhere\2.1.4\tools\vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set InstallDir=%%i
)
diff --git a/Tools/packages.config b/Tools/packages.config
deleted file mode 100644
index 6d41f85d78e..00000000000
--- a/Tools/packages.config
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Tools/packages.csproj b/Tools/packages.csproj
new file mode 100644
index 00000000000..dd520651934
--- /dev/null
+++ b/Tools/packages.csproj
@@ -0,0 +1,19 @@
+
+
+
+ netcoreapp2.1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/appveyor.yml b/appveyor.yml
index bd4cb525ae6..da4e1a33bfd 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,4 +1,4 @@
-version: 5.2.5.{build}
+version: '{build}'
image: Visual Studio 2017
environment:
matrix:
@@ -13,9 +13,6 @@ environment:
init:
# Required for having windows endlines in sources zip
- git config --global core.autocrlf true
-matrix:
- allow_failures:
- - DB: MySQL
build: off
before_test:
- ps: |-
@@ -25,7 +22,7 @@ before_test:
# Install Firebird
New-Item -ItemType Directory -Force $FireBirdPath > $null
Push-Location $FireBirdPath
- Invoke-WebRequest 'https://github.com/FirebirdSQL/firebird/releases/download/R3_0_3/Firebird-3.0.3.32900-0_x64.zip' -OutFile firebird.zip
+ Invoke-WebRequest 'https://github.com/FirebirdSQL/firebird/releases/download/R3_0_5/Firebird-3.0.5.33220-0_x64.zip' -OutFile firebird.zip
Unblock-File firebird.zip
7z x firebird.zip
New-Item -ItemType Directory -Force Data
diff --git a/build-common/DotNetSdkMono.props b/build-common/DotNetSdkMono.props
deleted file mode 100644
index 908be710f81..00000000000
--- a/build-common/DotNetSdkMono.props
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
- true
-
-
- /Library/Frameworks/Mono.framework/Versions/Current/lib/mono
- /usr/lib/mono
- /usr/local/lib/mono
-
-
- $(BaseFrameworkPathOverrideForMono)/4.5-api
- $(BaseFrameworkPathOverrideForMono)/4.5.1-api
- $(BaseFrameworkPathOverrideForMono)/4.5.2-api
- $(BaseFrameworkPathOverrideForMono)/4.6-api
- $(BaseFrameworkPathOverrideForMono)/4.6.1-api
- $(BaseFrameworkPathOverrideForMono)/4.6.2-api
- $(BaseFrameworkPathOverrideForMono)/4.7-api
- $(BaseFrameworkPathOverrideForMono)/4.7.1-api
- true
-
-
- $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)
-
-
diff --git a/build-common/NHibernate.props b/build-common/NHibernate.props
index 5e7cabbbd7a..fb0b9750621 100644
--- a/build-common/NHibernate.props
+++ b/build-common/NHibernate.props
@@ -1,16 +1,17 @@
-
- 5
- 2
- 5
-
+ 5.4
+ 0
+
+ dev
- $(VersionMajor).$(VersionMinor).$(VersionPatch)
- $(VersionMajor).$(VersionMinor).0.0
- $(VersionPrefix).0
+ $(NhVersion).$(VersionPatch)
+ $(VersionSuffix).$(BuildNumber)
+ $(NhVersion).0.0
+ $(VersionPrefix).$(BuildNumber)
+ $(VersionPrefix).0net461;netcoreapp2.0net461;netcoreapp2.0;netstandard2.0
@@ -24,11 +25,13 @@
NHibernate community, Hibernate communityen-US
- http://nhibernate.info
+ https://nhibernate.infohttps://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png
+ NHibernate-NuGet.pngfalseLGPL-2.1-only
- https://github.com/nhibernate/nhibernate-core/blob/$(VersionPrefix)/releasenotes.txt
+ https://github.com/nhibernate/nhibernate-core/blob/$(VersionPrefix)/releasenotes.txt
+ This is development version for testing purposes onlytruetruesnupkg
@@ -38,4 +41,7 @@
True
+
+
+
diff --git a/build-common/common.xml b/build-common/common.xml
index 26e5302a66d..6985723bd35 100644
--- a/build-common/common.xml
+++ b/build-common/common.xml
@@ -11,15 +11,31 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -31,18 +47,13 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/default.build b/default.build
index d9c5afd369d..8ea8ec5e4f9 100644
--- a/default.build
+++ b/default.build
@@ -2,7 +2,7 @@
@@ -21,14 +21,14 @@
-
-
+
+
@@ -39,6 +39,8 @@
+
+
@@ -46,7 +48,7 @@
-
+
@@ -54,24 +56,18 @@
-
+
-
+ file="${tools.dir}/packages.csproj"
+ xpath="/Project/ItemGroup/PackageReference[@Include = '${tool.id}']/@Version"
+ property="tool.version" />
+
-
-
-
-
-
-
-
-
+
+
+
+
@@ -150,9 +146,9 @@
-
-
-
+
+
+
@@ -310,11 +306,9 @@
-
-
-
@@ -323,12 +317,12 @@
-
+
-
@@ -338,7 +332,8 @@
-
+
+
diff --git a/doc/NHibernate.shfbproj.template b/doc/NHibernate.shfbproj.template
index 3e8e83d2363..de6d308eba5 100644
--- a/doc/NHibernate.shfbproj.template
+++ b/doc/NHibernate.shfbproj.template
@@ -18,12 +18,12 @@
NHibernateAPIHtmlHelp1xNHibernate
- nhibernate.info
- http://groups.google.com/group/nhibernate-development
+ https://nhibernate.info
+ https://groups.google.com/group/nhibernate-developmentnhibernate teamNHibernate API ReferenceFalse
- ${project.version.numeric}
+ ${project.version}
diff --git a/doc/documentation.build b/doc/documentation.build
index 86104ac767b..52cf503cd6d 100644
--- a/doc/documentation.build
+++ b/doc/documentation.build
@@ -9,7 +9,7 @@
-
+
diff --git a/doc/reference/master.xml b/doc/reference/master.template.xml
similarity index 98%
rename from doc/reference/master.xml
rename to doc/reference/master.template.xml
index 25d73df2047..23df7a16535 100644
--- a/doc/reference/master.xml
+++ b/doc/reference/master.template.xml
@@ -39,7 +39,7 @@
NHibernate - Relational Persistence for Idiomatic .NETNHibernate Reference Documentation
- 5.2
+
diff --git a/doc/reference/modules/basic_mapping.xml b/doc/reference/modules/basic_mapping.xml
index f30fa154507..30166e03d4a 100644
--- a/doc/reference/modules/basic_mapping.xml
+++ b/doc/reference/modules/basic_mapping.xml
@@ -13,11 +13,13 @@
Note that, even though many NHibernate users choose to define XML mappings by hand,
- a number of tools exist to generate the mapping document, including
- NHibernate.Mapping.Attributes library and various template-based code
- generators (CodeSmith, MyGeneration). You may also use
- NHibernate.Mapping.ByCode available since NHibernate 3.2, or
- Fluent NHibernate.
+ a number of tools exist to generate the mapping document, even transparently at runtime.
+ This includes the NHibernate.Mapping.Attributes
+ library which allows to directly annotate your entities with mapping declarations,
+ various template-based code generators (CodeSmith, MyGeneration), the built-in
+ NHibernate.Mapping.ByCode API available since NHibernate 3.2, or
+ the Fluent NHibernate
+ independent library.
diff --git a/doc/reference/modules/best_practices.xml b/doc/reference/modules/best_practices.xml
index 21af3661540..4e0e3b327d2 100644
--- a/doc/reference/modules/best_practices.xml
+++ b/doc/reference/modules/best_practices.xml
@@ -18,7 +18,7 @@
NHibernate makes identifier properties optional. There are all sorts of reasons why
you should use them. We recommend that identifiers be 'synthetic' (generated, with
- no business meaning) and of a non-primitive type. For maximum flexibility, use
+ no business meaning) and of a primitive type. For maximum flexibility, use
Int64 or String.
diff --git a/doc/reference/modules/configuration.xml b/doc/reference/modules/configuration.xml
index a97775563d5..8540764df70 100644
--- a/doc/reference/modules/configuration.xml
+++ b/doc/reference/modules/configuration.xml
@@ -433,6 +433,45 @@ var session = sessions.OpenSession(conn);
+
+ Using a custom configuration provider
+
+
+ By default, NHibernate attempts to read the hibernate-configuration section
+ through the .Net ConfigurationManager. Some environments do not support it, so
+ NHibernate provides a way to set a custom configuration provider, through the
+ NHibernate.Cfg.ConfigurationProvider.Current property.
+
+
+
+ To disable the configuration provider, in case you configure NHibernate entirely programmatically,
+ set this property to null.
+
+
+
+
+
+ To provide directly the System.Configuration.Configuration instance to use, assign
+ the Current property with an instance of
+ NHibernate.Cfg.SystemConfigurationProvider built with your
+ Configuration instance.
+
+
+
+
+
+ You may also derive a custom provider from NHibernate.Cfg.ConfigurationProvider,
+ implements its abstract methods, and assign an instance of your custom provider to the
+ NHibernate.Cfg.ConfigurationProvider.Current property.
+
+
+
+ Changes of the ConfigurationProvider.Current property value are to be done very
+ early in the application lifecycle, before any other call on a NHibernate API. Otherwise they
+ may not be taken into account.
+
+
+
Optional configuration properties
@@ -703,6 +742,19 @@ var session = sessions.OpenSession(conn);
+
+
+ query.pre_transformer_registrar
+
+
+ The class name of the LINQ query pre-transformer registrar, implementing
+ IExpressionTransformerRegistrar. Defaults to null (no registrar).
+
+ eg.
+ classname.of.ExpressionTransformerRegistrar, assembly
+
+
+ linqtohql.generatorsregistry
@@ -717,6 +769,57 @@ var session = sessions.OpenSession(conn);
+
+
+ linqtohql.legacy_preevaluation
+
+
+ Whether to use the legacy pre-evaluation or not in Linq queries. Defaults to true.
+
+ eg.
+ true | false
+
+
+ Legacy pre-evaluation is causing special properties or functions like DateTime.Now
+ or Guid.NewGuid() to be always evaluated with the .Net runtime and replaced in the
+ query by parameter values.
+
+
+ The new pre-evaluation allows them to be converted to HQL function calls which will be run on the db
+ side. This allows for example to retrieve the server time instead of the client time, or to generate
+ UUIDs for each row instead of an unique one for all rows.
+
+
+ The new pre-evaluation will likely be enabled by default in the next major version (6.0).
+
+
+
+
+
+ linqtohql.fallback_on_preevaluation
+
+
+ When the new pre-evaluation is enabled, should methods which translation is not supported by the current
+ dialect fallback to pre-evaluation? Defaults to false.
+
+ eg.
+ true | false
+
+
+ When this fallback option is enabled while legacy pre-evaluation is disabled, properties or functions
+ like DateTime.Now or Guid.NewGuid() used in Linq expressions
+ will not fail when the dialect does not support them, but will instead be pre-evaluated.
+
+
+ When this fallback option is disabled while legacy pre-evaluation is disabled, properties or functions
+ like DateTime.Now or Guid.NewGuid() used in Linq expressions
+ will fail when the dialect does not support them.
+
+
+ This option has no effect if the legacy pre-evaluation is enabled.
+
+
+ sql_exception_converter
@@ -778,7 +881,7 @@ var session = sessions.OpenSession(conn);
is closed explicitly.
eg.
- create | create-drop
+ create | create-drop | update | validate
@@ -807,6 +910,20 @@ var session = sessions.OpenSession(conn);
+
+
+ hbm2ddl.throw_on_update
+
+
+ When hbm2ddl.auto is update, whether to throw or not on schema auto-update failures.
+
+ Disabled by default.
+
+ eg.
+ true | false
+
+
+ use_proxy_validator
@@ -905,6 +1022,25 @@ var session = sessions.OpenSession(conn);
+
+
+ transaction.auto_join
+
+
+ Should sessions check on every operation whether there is an ongoing system transaction or not, and enlist
+ into it if any?
+
+ Default is true. It can also be controlled at session opening, with
+ ISessionFactory.WithOptions. A session can also be instructed to explicitly join the current
+ transaction by calling ISession.JoinTransaction. This setting has no effect when using a
+ transaction factory that is not system transactions aware.
+
+
+ eg.
+ false
+
+
+ default_flush_mode
@@ -1081,6 +1217,20 @@ in the parameter binding.
+
+
+ sqlite.binaryguid
+
+
+ SQLite can store GUIDs in binary or text form, controlled by the BinaryGuid
+ connection string parameter (default is 'true'). The BinaryGuid setting will affect
+ how to cast GUID to string in SQL. NHibernate will attempt to detect this
+ setting automatically from the connection string, but if the connection
+ or connection string is being handled by the application instead of by NHibernate,
+ you can use the sqlite.binaryguid NHibernate setting to override the behavior.
+ The value can be true or false.
+
+ nhibernate-logger
diff --git a/doc/reference/modules/nhibernate_caches.xml b/doc/reference/modules/nhibernate_caches.xml
index f7304d94c2f..997b5ff1a0b 100644
--- a/doc/reference/modules/nhibernate_caches.xml
+++ b/doc/reference/modules/nhibernate_caches.xml
@@ -2,7 +2,6 @@
NHibernate.Caches
-
What is NHibernate.Caches?
@@ -108,7 +107,17 @@
Uses System.Runtime.Caching.MemoryCache.Default as the cache provider. This provider
- is available for the .Net Framework only. See .
+ is available as a .Net Standard NuGet package. See .
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis
+
+
+ Uses StackExchange.Redis. This provider is available as a .Net Standard
+ NuGet package. It can batch together puts and reads, reducing incurred IOs.
+ See .
@@ -233,6 +242,43 @@
+
+ Using a custom configuration provider
+
+
+ Most caches have their own configuration section. By default, the cache attempts to read its configuration section
+ through the .Net ConfigurationManager. Some environments do not support it, especially when
+ running under .Net Core. The .Net Core compatible caches provide a way to set a custom configuration provider, through
+ their NHibernate.Caches. cache specific namespace .ConfigurationProvider class.
+
+
+
+ To disable the configuration provider, in case you configure the cache entirely programmatically,
+ set its ConfigurationProvider.Current property to null.
+
+
+
+
+
+ To provide directly the System.Configuration.Configuration instance to use, call
+ the cache ConfigurationProvider.SetConfiguration method.
+
+
+
+
+
+ You may also derive a custom provider from the ConfigurationProvider of the cache,
+ implements its abstract method GetConfiguration, and assign an instance of your
+ custom provider to the cache ConfigurationProvider.Current property.
+
+
+
+ Changes of the ConfigurationProvider.Current property value are to be done very
+ early in the application lifecycle, before building any session factory using the cache provider or
+ before any other call on the cache API. Otherwise they will not be taken into account.
+
+
+
Prevalence Cache Configuration
@@ -241,7 +287,7 @@
full path. If the directory doesn't exist, it will be created.
- The prevalenceBase setting can only be set programmatically through on the NHibernate
+ The prevalenceBase setting can only be set programmatically through the NHibernate
configuration object, by example with Configuration.SetProperty.
@@ -250,6 +296,11 @@
SysCache Configuration
SysCache relies on System.Web.Caching.Cache for the underlying implementation.
+ This is a .Net Framework only library, since System.Web.Caching is available neither
+ in the .Net Standard nor in .Net Core.
+
+
+
The following NHibernate configuration settings are available:
@@ -306,12 +357,18 @@
SysCache2 Configuration
- SysCache2 can use SqlCacheDependencies to invalidate cache regions when data in an underlying SQL Server
+ SysCache2 uses System.Web.Caching like SysCache, but can use SqlCacheDependencies
+ to invalidate cache regions when data in an underlying SQL Server
table or query changes. Query dependencies are only available for SQL Server 2005 or higher. To use the cache
provider, the application must be setup and configured to support SQL notifications as described in the
MSDN documentation.
+
+ This is a .Net Framework only library, since System.Web.Caching is available neither
+ in the .Net Standard nor in .Net Core.
+
+
The following NHibernate configuration settings are available:
@@ -615,6 +672,7 @@
Its configuration relies on the EnyimMemcached library own configuration, through its
enyim.com/memcached configuration section. See
project site.
+ This is a .Net Framework only library.
@@ -623,6 +681,9 @@
RtMemoryCache relies on System.Runtime.Caching.MemoryCache for the
underlying implementation.
+
+
+
The following NHibernate configuration settings are available:
@@ -664,6 +725,327 @@
]]>
+
+
+ The loading of this section can be customized with the
+ NHibernate.Caches.RtMemoryCache.ConfigurationProvider class. See
+ .
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis Configuration
+
+ NHibernate.Caches.StackExchangeRedis relies on StackExchange.Redis for the
+ underlying implementation.
+
+
+
+ The following NHibernate configuration settings are available (also defined in
+ NHibernate.Caches.StackExchangeRedis.RedisEnvironment):
+
+
+
+
+ cache.default_expiration
+
+ Number of seconds to wait before expiring each item.
+ Defaults to 300. It can also be set programmatically on the NHibernate
+ configuration object under the name expiration, which then takes precedence
+ over cache.default_expiration.
+
+
+
+ cache.use_sliding_expiration
+
+ Should the expiration be sliding? A sliding expiration is reinitialized at each get. Can be overriden for each region by using
+ sliding attribute.
+ Defaults to false.
+
+
+
+ cache.database
+
+ The default Redis database index, that can be overriden for each region by using database attribute.
+ Defaults to -1.
+
+
+
+ cache.strategy
+
+ The assembly qualified name of the region strategy, that can be overriden for each region by using strategy attribute.
+ NHibernate.Caches.StackExchangeRedis provides the following strategies:
+
+
+ NHibernate.Caches.StackExchangeRedis.DefaultRegionStrategy
+
+ Uses a special key that contains the region current version number which is appended after the region prefix.
+ Each time a clear operation is performed the version number is increased and an event is send to all clients
+ so that they can update their local versions. Even if the event was not sent to all clients, each operation has a
+ version check in order to prevent working with stale data. This strategy has additional settings:
+
+ cache.region_strategy.default.max_allowed_version
+
+ The max allowed version number. When the max value is reached, the next value will be reset to zero.
+ Defaults to 10000.
+
+
+
+ cache.region_strategy.default.use_pubsub
+
+ Whether to use Redis pub/sub mechanism in order to notify other cache instances when the clear operation was performed.
+ Defaults to true.
+
+
+
+ cache.region_strategy.default.retry_times
+
+ Total retry times for read and lock operations, when concurrent clear operations are performed.
+ Defaults to 1.
+
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis.FastRegionStrategy
+
+ Uses very simple read/write operations but does not support ICache.Clear operation.
+
+
+
+ NHibernate.Caches.StackExchangeRedis.TwoLayerCacheRegionStrategy
+
+ Extends NHibernate.Caches.StackExchangeRedis.DefaultRegionStrategy and uses
+ an additional local memory cache for faster readings. The local caches are invalidated by using Redis pub/sub mechanism.
+ This strategy should be used only for regions that have few write operations and a high expiration time.
+ This strategy inherits additional settings from DefaultRegionStrategy and also has its own settings:
+
+ cache.region_strategy.two_layer_cache.use_pipelining
+
+ Whether to use StackExchange.Redis pipelining feature.
+ Defaults to false.
+
+
+
+ cache.region_strategy.two_layer_cache.client_id
+
+ The client id used for cache invalidation.
+ Defaults to a random number.
+
+
+
+ cache.region_strategy.two_layer_cache.max_synchronization_time
+
+ The max synchronization time between caches in seconds.
+ Defaults to 10.
+
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis.FastTwoLayerCacheRegionStrategy
+
+ Extends NHibernate.Caches.StackExchangeRedis.FastRegionStrategy and uses
+ an additional local memory cache for faster readings. The local caches are invalidated by using Redis pub/sub mechanism.
+ This strategy does not support ICache.Clear operation and should be used only for regions that have
+ few write operations and a high expiration time. This strategy has additional settings:
+
+ cache.region_strategy.fast_two_layer_cache.use_pipelining
+
+ Whether to use StackExchange.Redis pipelining feature.
+ Defaults to false.
+
+
+
+ cache.region_strategy.fast_two_layer_cache.client_id
+
+ The client id used for cache invalidation.
+ Defaults to a random number.
+
+
+
+ cache.region_strategy.fast_two_layer_cache.max_synchronization_time
+
+ The max synchronization time between caches in seconds.
+ Defaults to 10.
+
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis.DistributedLocalCacheRegionStrategy
+
+ Uses only a memory cache to store the values and uses Redis pub/sub mechanism to synchronize data between other local caches.
+ The synchronization between caches is done by comparing the UTC DateTime.Ticks, which represent when the
+ operation was performed. When two operations have the same DateTime.Ticks, then the client with the highest
+ id wins. This strategy should be used only for regions that have few write operations and a high expiration time. It is recommended
+ to use NHibernate.Caches.StackExchangeRedis.TwoLayerCacheRegionStrategy, when the instances where the strategy
+ would run are often restarted/recycled. In order to use this strategy a custom ICacheRegionStrategyFactory
+ has to be provided (see cache.region_strategy_factory setting), where the strategy is created with a custom
+ RegionMemoryCacheBase implementation. This strategy has additional settings:
+
+ cache.region_strategy.distributed_local_cache.use_pipelining
+
+ Whether to use StackExchange.Redis pipelining feature.
+ Defaults to false.
+
+
+
+ cache.region_strategy.distributed_local_cache.client_id
+
+ The client id used for cache invalidation.
+ Defaults to a random number.
+
+
+
+ cache.region_strategy.distributed_local_cache.max_synchronization_time
+
+ The max synchronization time between caches in seconds.
+ Defaults to 10.
+
+
+
+
+
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultRegionStrategy.
+
+
+
+ cache.append_hashcode
+
+ Whether the hash code of the key should be added to the cache key. Can be overriden for each region by using append-hashcode attribute.
+ Defaults to false.
+
+
+
+ cache.key_prefix
+
+ The prefix that will be prepended before each cache key in order to avoid having collisions when multiple clients uses the same Redis database.
+ Defaults to NHibernate-Cache:.
+
+
+
+ cache.environment_name
+
+ The name of the environment that will be prepended before each cache key in order to allow having multiple environments on the same Redis database.
+ Defaults to null.
+
+
+
+ cache.serializer
+
+ The assembly qualified name of the serializer that is used to serialize/deserialize the key values. Optionally, a faster json serializer can be
+ used by installing NHibernate.Caches.Util.JsonSerializer package and setting
+ NHibernate.Caches.Util.JsonSerializer.JsonCacheSerializer, NHibernate.Caches.Util.JsonSerializer value instead.
+ Defaults to NHibernate.Caches.Common.BinaryCacheSerializer, NHibernate.Caches.Common.
+
+
+
+ cache.region_strategy_factory
+
+ The assembly qualified name of the region strategy factory.
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultCacheRegionStrategyFactory.
+
+
+
+ cache.connection_multiplexer_provider
+
+ The assembly qualified name of the connection multiplexer provider.
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultConnectionMultiplexerProvider.
+
+
+
+ cache.database_provider
+
+ The assembly qualified name of the database provider.
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultDatabaseProvider.
+
+
+
+ cache.lock.key_timeout
+
+ The timeout for a lock key to expire in seconds.
+ Defaults to 5.
+
+
+
+ cache.lock.acquire_timeout
+
+ The time limit to acquire the lock in seconds.
+ Defaults to 5.
+
+
+
+ cache.lock.retry_times
+
+ The number of retries for acquiring the lock.
+ Defaults to 3.
+
+
+
+ cache.lock.max_retry_delay
+
+ The maximum delay before retrying to acquire the lock in milliseconds.
+ Defaults to 400.
+
+
+
+ cache.lock.min_retry_delay
+
+ The minimum delay before retrying to acquire the lock in milliseconds.
+ Defaults to 10.
+
+
+
+ cache.lock.value_provider
+
+ The assembly qualified name of the lock value provider.
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultCacheLockValueProvider.
+
+
+
+ cache.lock.retry_delay_provider
+
+ The assembly qualified name of the lock retry delay provider.
+ Defaults to NHibernate.Caches.StackExchangeRedis.DefaultCacheLockRetryDelayProvider.
+
+
+
+ cache.lock.key_suffix
+
+ The suffix for the lock key.
+ Defaults to :lock.
+
+
+
+
+
+ NHibernate.Caches.StackExchangeRedis has a config file section handler to allow configuring different expirations for
+ different regions. Here is an example:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+ The loading of this section can be customized with the
+ NHibernate.Caches.StackExchangeRedis.ConfigurationProvider class. See
+ .
+
@@ -671,6 +1053,9 @@
CoreMemoryCache relies on Microsoft.Extensions.Caching.Memory.MemoryCache for the
underlying implementation.
+
+
+
The following NHibernate configuration settings are available:
@@ -714,6 +1099,12 @@
]]>
+
+
+ The loading of this section can be customized with the
+ NHibernate.Caches.CoreMemoryCache.ConfigurationProvider class. See
+ .
+
@@ -723,6 +1114,9 @@
implementations. The implementation has to be provided through an IDistributedCacheFactory, either
supplied through configuration or programmatically by affecting
CoreDistributedCacheProvider.CacheFactory before building a session factory.
+
+
+
The following NHibernate configuration settings are available:
@@ -743,6 +1137,16 @@
Defaults to false.
+
+ cache.serializer
+
+ The assembly qualified name of the serializer that is used to serialize/deserialize the key values. Optionally, a faster json serializer can be
+ used by installing NHibernate.Caches.Util.JsonSerializer package and setting
+ NHibernate.Caches.Util.JsonSerializer.JsonCacheSerializer, NHibernate.Caches.Util.JsonSerializer value instead.
+ Defaults to NHibernate.Caches.Common.BinaryCacheSerializer, NHibernate.Caches.Common.
+ This setting is available since the 5.7 version of CoreDistributedCache.
+
+
@@ -767,13 +1171,23 @@
00:10:001048576
+ NHibernate.Caches.Util.JsonSerializer.JsonCacheSerializer, NHibernate.Caches.Util.JsonSerializer
+
]]>
+
+ The loading of this section can be customized with the
+ NHibernate.Caches.CoreDistributedCache.ConfigurationProvider class. See
+ .
+
+
CoreDistributedCache does not support NHibernate.Cache.ICache.Clear. Clearing the NHibernate
cache has no effects with CoreDistributedCache.
diff --git a/doc/reference/modules/nhibernate_mapping_attributes.xml b/doc/reference/modules/nhibernate_mapping_attributes.xml
index baef69b80b3..7b6ae34deb3 100644
--- a/doc/reference/modules/nhibernate_mapping_attributes.xml
+++ b/doc/reference/modules/nhibernate_mapping_attributes.xml
@@ -2,59 +2,56 @@
NHibernate.Mapping.Attributes
-
What is NHibernate.Mapping.Attributes?
- NHibernate.Mapping.Attributes is an add-in for NHibernate contributed by Pierre Henri Kuaté (aka KPixel); the former implementation was made by John Morris.
+ NHibernate.Mapping.Attributes is an add-in for NHibernate contributed by Pierre Henri Kuaté
+ (aka KPixel); the former implementation was made by John Morris.NHibernate require mapping streams to bind your domain model to your database. Usually, they are written (and maintained) in separated hbm.xml files.With NHibernate.Mapping.Attributes, you can use .NET attributes to decorate your entities and these attributes will be used to generate these mapping .hbm.xml (as files or streams). So you will no longer have to bother with these nasty xml files ;).
-
- Content of this library
-
-
-
-
- NHibernate.Mapping.Attributes: That the only project you need (as end-user)
-
-
-
- Test: a working sample using attributes and HbmSerializer as NUnit TestFixture
-
-
-
- Generator: The program used to generate attributes and HbmWriter
-
-
-
-
- Refly
- : Thanks to Jonathan de Halleux for this library which make it so easy to generate code
-
-
-
-
+
+ Content of this library project:
+
+
+
+
+
+ NHibernate.Mapping.Attributes: that is the only assembly you need (as an end-user).
+
+
+
+ Test: a working sample using attributes and HbmSerializer for a NUnit TestFixture.
+
+
+
+ Generator: the program used to generate the attributes and the HbmWriter of
+ the end-user assembly.
+
+
+
+
+ Refly
+ : thanks to Jonathan de Halleux for this library which makes it so easy to generate code.
+
+
+
+
This library is generated using the file /src/NHibernate.Mapping.Attributes/nhibernate-mapping.xsd
(which is embedded in the assembly to be able to validate generated XML streams).
- As this file can change at each new release of NHibernate, you should regenerate it before using it
- with a different version (open the Generator solution, compile and run the Generator project).
- But, no test has been done with versions prior to 0.8.
+ As this file can change at each new release of NHibernate, a new release of NHibernate.Mapping.Attributes
+ should be regenerated before using it with a different version. It can be done by opening the Generator solution,
+ compiling and running the Generator project.
-
What's new?
-
- NHibernate
- introduces many new features, improvements and changes:
- It is possible to import classes by simply decorating them with [Import] class ImportedClass1 {}. Note that you must use HbmSerializer.Serialize(assembly); The <import/> mapping will be added before the classes mapping. If you prefer to keep these imports in the class using them, you can specify them all on the class: [Import(ClassType=typeof(ImportedClass1))] class Query {}.
@@ -69,17 +66,29 @@ public class Base {
[AttributeIdentifier(Name="Id.Column", Value="ID")] // Default value
public int Id { ... }
}
+
[AttributeIdentifier(Name="Id.Column", Value="SUB_ID")]
-[Class] public class MappedSubClass : Base { }
+[Class]
+public class MappedSubClass : Base { }
The idea is that, when you have a mapping which is shared by many subclasses but which has minor differences (like different column names), you can put the mapping in the base class with place holders on these fields and give their values in subclasses. Note that this is possible for any mapping field taking a string (column, name, type, access, etc.). And, instead of Value, you can use ValueType or ValueObject (if you use an enum, you can control its formatting with ValueObject).
The "place holder" is defined like this: {{XXX}}. If you don't want to use these double curly brackets, you can change them using the properties StartQuote and EndQuote of the class HbmWriter.
- It is possible to register patterns (using Regular Expressions) to automatically transform fully qualified names of properties types into something else. Eg: HbmSerializer.Default.HbmWriter.Patterns.Add(@"Namespace.(\S+), Assembly", "$1"); will map all properties with a not-qualified type name.
+
+ It is possible to register patterns (using Regular Expressions) to automatically transform fully qualified names of properties types
+ into something else. Eg: HbmSerializer.Default.HbmWriter.Patterns.Add(@"Namespace\.(\S+), Assembly", "$1"); will
+ map all properties with a not-qualified type name.
+
- Two methods have been added to allow writing: cfg.AddInputStream( HbmSerializer.Default.Serialize(typeof(XXX)) ) and cfg.AddInputStream( HbmSerializer.Default.Serialize(typeof(XXX).Assembly) ). So it is no longer required to create a MemoryStream for these simple cases.
+
+ Two methods have been added to the HbmSerializer class, allowing generating mappings from a type or an assembly:
+ HbmSerializer.Default.Serialize(typeof(XXX)) and
+ HbmSerializer.Default.Serialize(typeof(XXX).Assembly). So it is no longer required to create a MemoryStream for
+ these simple cases. The output of these call can be directly added to your NHibernate Configuration instance:
+ cfg.AddInputStream(HbmSerializer.Default.Serialize(typeof(XXX))).
+ Two WriteUserDefinedContent() methods have been added to HbmWriter. They improve the extensibility of this library; it is now very easy to create a .NET attribute and integrate it in the mapping.
@@ -91,57 +100,77 @@ public class Base {
Interfaces can be mapped (just like classes and structs).
- A notable "bug" fix is the re-ordering of (joined-)subclasses; This operation may be required when a subclass extends another subclass. In this case, the extended class mapping must come before the extending class mapping. Note that the re-ordering takes place only for "top-level" classes (that is not nested in other mapped classes). Anyway, it is quite unusual to put a interdependent mapped subclasses in a mapped class.
+
+ A notable "bug" fix is the re-ordering of (joined-)subclasses. This operation may be required when a subclass extends another subclass.
+ In this case, the extended class mapping must come before the extending class mapping. Note that the re-ordering takes place only for
+ "top-level" classes (that is not nested in other mapped classes). Anyway, it is quite unusual to put an interdependent mapped subclasses
+ in a mapped class.
+
- There are also many other little changes; refer to the release notes for more details.
+ There are also many other little changes: refer to the release notes for more details.
-
-
How to use it?The end-user class is NHibernate.Mapping.Attributes.HbmSerializer
- This class serialize your domain model to mapping streams. You can either serialize classes one by one or an assembly. Look at NHibernate.Mapping.Attributes.Test project for a working sample.
+
+ This class serialize your domain model to mapping streams. You can either serialize classes one by one,
+ or serialize a whole assembly. Look at NHibernate.Mapping.Attributes.Test project for a working sample.
+
- The first step is to decorate your entities with attributes; you can use: [Class], [Subclass], [JoinedSubclass] or [Component]. Then, you decorate your members (fields/properties); they can take as many attributes as required by your mapping. Eg:
+
+ The first step is to decorate your entities with attributes. You can use: [Class],
+ [Subclass], [JoinedSubclass] or [Component]. Then, you decorate
+ your members (fields/properties); they can take as many attributes as required by your mapping. Eg:
+
- [NHibernate.Mapping.Attributes.Class]
- public class Example
- {
- [NHibernate.Mapping.Attributes.Property]
- public string Name;
- }
- After this step, you use NHibernate.Mapping.Attributes.HbmSerializer: (here, we use Default which is an instance you can use if you don't need/want to create it yourself).
- NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();
- cfg.Configure();
- // Enable validation (optional)
- NHibernate.Mapping.Attributes.HbmSerializer.Default.Validate = true;
- // Here, we serialize all decorated classes (but you can also do it class by class)
- cfg.AddInputStream( NHibernate.Mapping.Attributes.HbmSerializer.Default.Serialize(
- System.Reflection.Assembly.GetExecutingAssembly() ); );
- // Now you can use this configuration to build your SessionFactory...
+[NHibernate.Mapping.Attributes.Class]
+public class Example
+{
+ [NHibernate.Mapping.Attributes.Property]
+ public string Name;
+}
+
+ After this step, you use NHibernate.Mapping.Attributes.HbmSerializer (here, we use its
+ Default property, which is an instance you can use if you don't need/want to create it yourself):
+
+ var cfg = new NHibernate.Cfg.Configuration();
+cfg.Configure();
+// Enable validation (optional)
+HbmSerializer.Default.Validate = true;
+// Here, we serialize all decorated classes (but you can also do it class by class)
+cfg.AddInputStream(HbmSerializer.Default.Serialize(
+ System.Reflection.Assembly.GetExecutingAssembly()));
+// Now you can use this configuration to build your SessionFactory...
- As you can see here: NHibernate.Mapping.Attributes is not (really) intrusive.
+ As you can see here, NHibernate.Mapping.Attributes is not (really) intrusive.
Setting attributes on your objects doesn't force you to use them with NHibernate and doesn't break any constraint on your architecture.
Attributes are purely informative (like documentation)!
-
Tips
- In production, it is recommended to generate a XML mapping file from NHibernate.Mapping.Attributes and use this file each time the SessionFactory need to be built. Use: HbmSerializer.Default.Serialize(typeof(XXX).Assembly, "DomainModel.hbm.xml"); It is slightly faster.
+
+ In production, you may want to generate a XML mapping file from NHibernate.Mapping.Attributes and use this file each time
+ the SessionFactory need to be built. Use: HbmSerializer.Default.Serialize(typeof(XXX).Assembly, "DomainModel.hbm.xml");.
+ It is slightly faster.
+
- Use HbmSerializer.Validate to enable/disable the validation of generated xml streams (against NHibernate mapping schema); this is useful to quickly find errors (they are written in StringBuilder HbmSerializer.Error). If the error is due to this library then see if it is a know issue and report it; you can contribute a solution if you solve the problem :)
+
+ Use HbmSerializer.Validate to enable/disable the validation of generated xml streams (against
+ NHibernate mapping schema). This is useful to quickly find errors. (They are written in the StringBuilder property
+ HbmSerializer.Error.) If the error is due to this library, then see if it is a known issue and report it.
+ You are welcome to contribute a solution if you solve the trouble :).Your classes, fields and properties (members) can be private; just make sure that you have the permission to access private members using reflection (ReflectionPermissionFlag.MemberAccess).
@@ -156,7 +185,12 @@ public class Base {
By default, .NET attributes don't keep the order of attributes; so you need to set it yourself when the order matter (using the first parameter of each attribute); it is highly recommended to set it when you have more than one attribute on the same member.
- As long as there is no ambiguity, you can decorate a member with many unrelated attributes. A good example is to put class-related attributes (like <discriminator>) on the identifier member. But don't forget that the order matters (the <discriminator> must be after the <id>). The order used comes from the order of elements in the NHibernate mapping schema. Personally, I prefer using negative numbers for these attributes (if they come before!).
+
+ As long as there is no ambiguity, you can decorate a member with many unrelated attributes. A good example is to put
+ class-related attributes (like <discriminator>) on the identifier member. But don't forget
+ that the order matters (the <discriminator> must be after the <id>).
+ The order to use comes from the order of elements in the NHibernate mapping schema. Personally, I prefer using negative
+ numbers for these attributes (if they come first!).You can add [HibernateMapping] on your classes to specify <hibernate-mapping> attributes (used when serializing the class in its stream). You can also use HbmSerializer.Hbm* properties (used when serializing an assembly or a type that is not decorated with [HibernateMapping]).
@@ -188,24 +222,23 @@ public class Base {
Use the property HbmSerializer.HbmWriter to change the writer used (you may set a subclass of HbmWriter).
- Example using some this tips: (0, 1 and 2 are position indexes)
+ Example using some of these tips: (0, 1 and 2 are position indexes)
// Don't put it after [ManyToOne] !!!
- [NHibernate.Mapping.Attributes.Id(0, TypeType=typeof(int))]
- [NHibernate.Mapping.Attributes.Generator(1, Class="uuid.hex")]
- [NHibernate.Mapping.Attributes.ManyToOne(2,
- ClassType=typeof(Foo), OuterJoin=OuterJoinStrategy.True)]
- private Foo Entity;
+[NHibernate.Mapping.Attributes.Id(0, TypeType=typeof(int))]
+ [NHibernate.Mapping.Attributes.Generator(1, Class="uuid.hex")]
+[NHibernate.Mapping.Attributes.ManyToOne(2,
+ ClassType=typeof(Foo), OuterJoin=OuterJoinStrategy.True)]
+private Foo Entity;
Generates:
-
-
-
+
+
+
+
]]>
-
Known issues and TODOsFirst, read TODOs in the source code ;)
@@ -213,17 +246,17 @@ public class Base {
A Position property has been added to all attributes to order them. But there is still a problem:When a parent element "p" has a child element "x" that is also the child element of another child element "c" of "p" (preceding "x") :D
Illustration:
-
-
-
+
+
+
]]>
In this case, when writing:
[Attributes.P(0)]
- [Attributes.C(1)]
- [Attributes.X(2)]
- [Attributes.X(3)]
+[Attributes.C(1)]
+ [Attributes.X(2)]
+[Attributes.X(3)]
public MyType MyProperty;
X(3) will always belong to C(1) ! (as X(2)).
@@ -232,8 +265,8 @@ public MyType MyProperty;
Anyway, the solution would be to add a int ParentNode property to BaseAttribute so that you can create a real graph...For now, you can fallback on [RawXml].
- Actually, there is no other know issue nor planned modification. This library should be stable and complete; but if you find a bug or think of an useful improvement, contact us!
- On side note, it would be nice to write a better TestFixture than NHibernate.Mapping.Attributes.Test :D
+ Actually, there is no other know issue nor planned modification. This library should be stable and complete. But if you find a bug or think of an useful improvement, contact us!
+ As a side note, it would be nice to write a better TestFixture than NHibernate.Mapping.Attributes.Test :D.
@@ -242,19 +275,33 @@ public MyType MyProperty;
Any change to the schema (nhibernate-mapping.xsd) implies:
- Checking if there is any change to do in the Generator (like updating KnowEnums / AllowMultipleValue / IsRoot / IsSystemType / IsSystemEnum / CanContainItself)
+
+ Checking if there is any change to do in the Generator (like updating KnowEnums /
+ AllowMultipleValue / IsRoot / IsSystemType /
+ IsSystemEnum / CanContainItself).
+
- Updating /src/NHibernate.Mapping.Attributes/nhibernate-mapping.xsd (copy/paste) and running the Generator again (even if it wasn't modified)
+
+ Updating /src/NHibernate.Mapping.Attributes/nhibernate-mapping.xsd (copy/paste)
+ and running the Generator again (even if it wasn't modified).
+
- Running the Test project and make sure that no exception is thrown. A class/property should be modified/added in this project to be sure that any new breaking change will be caught (=> update the reference hbm.xml files and/or the project NHibernate.Mapping.Attributes.csproj)
+
+ Running the Test project and make sure that no exception is thrown. A class/property should be modified/added
+ in this project to be sure that any new breaking change will be caught (=> update the reference hbm.xml files
+ and/or the project NHibernate.Mapping.Attributes.csproj).
+
- This implementation is based on NHibernate mapping schema; so there is probably lot of "standard schema features" that are not supported...
+ This implementation is based on NHibernate mapping schema. So there is probably lot of "standard schema features" that are not supported...The version of NHibernate.Mapping.Attributes should be the version of the NHibernate schema used to generate it (=> the version of NHibernate library).
- In the design of this project, performance is a (very) minor goal :) Easier implementation and maintenance are far more important because you can (and should) avoid to use this library in production (Cf. the first tip in ).
+
+ In the design of this project, performance is a (very) minor goal :). Easier implementation and maintenance
+ are far more important because you can use this library to generate statically the mapping files and use them instead in production.
+ (Cf. the first tip in .)
+
-
diff --git a/doc/reference/modules/preface.xml b/doc/reference/modules/preface.xml
index f8ed4cc4284..d282538f558 100644
--- a/doc/reference/modules/preface.xml
+++ b/doc/reference/modules/preface.xml
@@ -66,7 +66,7 @@
- The Community Area on the NHibernate website is a good source for
+ The Community Area on the NHibernate website is a good source for
design patterns and various integration solutions (ASP.NET, Windows Forms).
diff --git a/doc/reference/modules/quickstart.xml b/doc/reference/modules/quickstart.xml
index 1185ae2cdfa..f949f5c422e 100644
--- a/doc/reference/modules/quickstart.xml
+++ b/doc/reference/modules/quickstart.xml
@@ -154,6 +154,10 @@
Mapping the cat
+
+ This tutorial directly uses xml mapping files. This is just one among many mapping solutions
+ NHibernate provides, see .
+
The Cat.hbm.xml mapping file contains the metadata
required for the object/relational mapping. The metadata includes declaration
diff --git a/doc/reference/modules/toolset_guide.xml b/doc/reference/modules/toolset_guide.xml
index 1e885781bcf..023a3152294 100644
--- a/doc/reference/modules/toolset_guide.xml
+++ b/doc/reference/modules/toolset_guide.xml
@@ -370,7 +370,7 @@ new SchemaExport(cfg).Create(false, true);]]>
A more detailed guide of hbm2net is available in
- http://nhibernate.info/blog/2009/12/12/t4-hbm2net-alpha-2.html
+ https://nhibernate.info/blog/2009/12/12/t4-hbm2net-alpha-2.html
diff --git a/doc/reference/modules/transactions.xml b/doc/reference/modules/transactions.xml
index 47340ebb931..5a6a7c8dc5a 100644
--- a/doc/reference/modules/transactions.xml
+++ b/doc/reference/modules/transactions.xml
@@ -633,9 +633,11 @@ finally
will then fail to use it.
- As of NHibernate v5.0, session auto-enlistment can be disabled from the session builder
+ Session auto-enlistment can be controlled from the session builder
obtained with ISessionFactory.WithOptions(), using the
- AutoJoinTransaction option. The connection may still enlist itself
+ AutoJoinTransaction option. It can also be controlled at the configuration level,
+ see transaction.auto_join in .
+ When auto-join is disabled, the connection may still enlist itself
if connection string Enlist setting is not false.
A session can explicitly join the current system transaction by calling
ISession.JoinTransaction().
diff --git a/doc/reference/reference.build b/doc/reference/reference.build
index 9a07ff295bb..2a4c52aa851 100644
--- a/doc/reference/reference.build
+++ b/doc/reference/reference.build
@@ -8,7 +8,7 @@
-
+
diff --git a/releasenotes.txt b/releasenotes.txt
index 35275bdd3b3..92f92abb7a0 100644
--- a/releasenotes.txt
+++ b/releasenotes.txt
@@ -1,3 +1,459 @@
+Build 5.3.5
+=============================
+
+Release notes - NHibernate - Version 5.3.5
+
+2 issues were resolved in this release.
+
+** Bug
+
+ * #2599 WrongClassException in Linq query
+
+** Task
+
+ * #2606 Release 5.3.5
+
+Build 5.3.4
+=============================
+
+Release notes - NHibernate - Version 5.3.4
+
+6 issues were resolved in this release.
+
+** Bug
+
+ * #2580 InvalidWithClauseException when join polymorphic entity
+ * #2559 Regression in caching linq query with ThenFetchMany statement.
+ * #2549 ApplyFilter does not work on join statements in LINQ
+ * #2537 Unable to cast "System.Linq.Expressions.UnaryExpression" to "System.Linq.Expressions.LambdaExpression".
+
+** Task
+
+ * #2578 Add missing possible breaking changes for #2365
+ * #2587 Release 5.3.4
+
+As part of releasing 5.3.4, one missing 5.3.0 possible breaking change has been added, about
+custom method generators for Linq. See 5.3.0 possible breaking changes.
+
+Build 5.3.3
+=============================
+
+Release notes - NHibernate - Version 5.3.3
+
+16 issues were resolved in this release.
+
+** Bug
+
+ * #2519 Fix parameter caching for Linq provider
+ * #2515 InvalidCastException for Linq query with subquery
+ * #2514 Entity with field interceptor are not correctly passed as Linq parameters
+ * #2512 Linq queries with a condition after a projection on a collection fail
+ * #2511 Linq Fetch over component after fetching a many-to-one throws exception
+ * #2508 OnPreUpdateCollection - Passed entity instance X is not of expected type Y
+ * #2499 Cast operation fails when an enum is mapped as an AnsiString
+ * #2490 Unnecessary cast in sql with Linq are causing performance issues
+ * #2488 Fix parameter detection for Equals and CompareTo methods for Linq provider
+ * #2485 Throw entity not mapped exception for entity join in hql if possible
+ * #2484 Entity Joins are not polymorphic in hql
+ * #2476 Hashset add returns true instead of false
+ * #2474 Fetch all lazy properties when entity is already loaded fails
+ * #2471 AsQueryable() on collection throws if applied after Where statement
+
+** Task
+
+ * #2482 Add missing possible breaking changes for #2010
+ * #2527 Release 5.3.3
+
+As part of releasing 5.3.3, two missing 5.3.0 possible breaking changes have been added, about
+uninitialized extra lazy collections and SQLite schema validation. See 5.3.0 possible breaking changes.
+
+Build 5.3.2
+=============================
+
+Release notes - NHibernate - Version 5.3.2
+
+6 issues were resolved in this release.
+
+** Bug
+
+ * #2468 Null reference at NHibernate.Util.AsyncReaderWriterLock.ReadLock()
+ * #2465 Linq contains on a value collection is failing
+ * #2463 Path expected for join
+ * #2458 Evaluatable expressions with parameters are no more pre-evaluated
+ * #2453 Fail to cast enum as nvarchar for Linq Contains
+
+** Task
+
+ * #2472 Release 5.3.2
+
+Build 5.3.1
+=============================
+
+Release notes - NHibernate - Version 5.3.1
+
+7 issues were resolved in this release.
+
+** Bug
+
+ * #2445 LINQ queries with a cast from int to uint fail
+ * #2440 InvalidCastException for Future Criteria with aliased fetches
+ * #2439 Invalid parameter conversion for enums
+ * #2437 Invalid cast on nullable custom type with Linq
+
+** Task
+
+ * #2450 Release 5.3.1
+ * #2436 Fix old http://nhibernate.info URIs
+ * #2435 Fix iconUrl warning
+
+Build 5.3.0
+=============================
+
+Release notes - NHibernate - Version 5.3.0
+
+220 issues were resolved in this release.
+
+ ##### Possible Breaking Changes #####
+ * A distributed cache may hold conflicting timestamps after upgrade for as much as twelve hours.
+ Consider flushing a distributed cache after upgrade to avoid any issue. Do not share a distributed
+ cache with applications using an earlier version of NHibernate.
+ * The counter id generator may generate conflicting ids for as much as twelve hours after upgrade.
+ * `update` and `delete` statements will now take into account any enabled filter on the entities
+ they update or delete, while previously they were ignoring them. (`insert` statements will also take
+ them into account, but previously they were failing instead of ignoring enabled filters.)
+ * ISession.Persist will no more trigger immediate generation of identifier.
+ * Bags will no more be loaded with "null" entities, they will be filtered out.
+ * Setting the value of an uninitialized lazy property will no more trigger loading of all the lazy
+ properties of the entity.
+ * If an uninitialized lazy property has got its value set, without any other subsequent lazy property
+ load on the entity, a dynamic update will occur on flush, even if the entity has dynamic updates
+ disabled. This update will occur even if the set value is identical to the currently persisted
+ property value.
+ * Assigning an uninitialized proxy to a `no-proxy` property will no more trigger the proxy
+ initialization. Moreover, reading the property afterwards will no more unwrap the assigned proxy,
+ but will yield it.
+ * A class having an explicitly implemented interface declaring a member with the same name than the
+ class id will have its proxies trigger a lazy load if the interface "id" is accessed.
+ * SQLite: in order to avoid a floating point division bug losing the fractional part, decimal are now
+ stored as `REAL` instead of `NUMERIC`. Both are binary floating point types, excepted that `NUMERIC`
+ stores integral values as `INTEGER`. This change may cause big integral decimal values to lose more
+ precision in SQLite.
+ * SQLite: non supported SQL type names previously used by NHibernate, resulting in unexpected actual typing,
+ have been fixed. This causes databases generated by a previous NHibernate version to fail schema validation
+ by 5.3 or higher versions. See #2507 for more information.
+ * Custom dialects used for databases that do not support cross join will have to override
+ `SupportsCrossJoin` property and set it to `false`.
+ * `VisitorParameters.ConstantToParameterMap` may contain the same parameter for multiple constant
+ expressions.
+ * `ICache` caches yielded by the session factory will be `CacheBase` wrappers around the cache actually
+ provided by the cache provider, if it was not deriving from `CacheBase`.
+ * Calling `IList.RemoveAt` or `IList<>.RemoveAt` on an uninitialized list with a negative number
+ will now throw an `ArgumentOutOfRangeException`.
+ * Calling `IList.RemoveAt` or `IList<>.RemoveAt` on an uninitialized list mapped as `lazy="extra"`
+ with a number that is equal or higher that the current collection size will now throw an
+ `ArgumentOutOfRangeException`.
+ * Calling `IList.Insert` or `IList<>.Insert` on an uninitialized list with a negative number will
+ now throw an `ArgumentOutOfRangeException`.
+ * Calling `IList.Insert` or `IList<>.Insert` on an uninitialized list mapped as `lazy="extra"`
+ with a number that is higher that the current collection size will now throw an
+ `ArgumentOutOfRangeException`.
+ * Getting or setting a value with `IList.this[int index]` or `IList<>.this[int index]` on an uninitialized
+ list with a negative number will now throw an `ArgumentOutOfRangeException`.
+ * Setting a value with `IList.this[int index]` or `IList<>.this[int index]` on an uninitialized list
+ mapped as `lazy="extra"` with a number that is equal or higher that the current collection size will now
+ throw an `ArgumentOutOfRangeException`.
+ * Calling `IDictionary<,>.Add` or `ICollection<>.Add` on an uninitialized map mapped as `lazy="extra"` with
+ a key that already exists will now throw an `ArgumentException`.
+ * Calling `IDictionary<,>.Remove` or `ICollection<>.Remove` on an uninitialized map mapped as `lazy="extra"`
+ with a key that does not exist will now return false.
+ * Map dirtiness is now evaluated by `EqualityComparer.Default` when setting an existing key value
+ with `IDictionary<,>.this[]` on an initialized map.
+ * Calling `ISet<>.Add` on an uninitialized set mapped as `lazy="extra"` with a transient element that
+ already exists in the set will now return false.
+ * Calling `ISet<>.Add` or `ICollection<>.Add` on an uninitialized set mapped as `lazy="true"` with a
+ transient element that does not override `Equals` method will not initialize the collection.
+ * Linq custom generators deriving from `BaseHqlGeneratorForMethod` should override the
+ `TryGetCollectionParameter` method if they have to support parameter lists.
+
+** Bug
+
+ * #2425 NRE with nullable subselect value in Linq
+ * #2421 Chapter 26: Best Practices, error about identifier recommendations
+ * #2410 Second level cache failures with CoreMemoryCaches
+ * #2380 OData NotSupportedException MemberInit on base class member
+ * #2365 Add Linq parameter type detection
+ * #2346 Fix SQLite typing
+ * #2336 Intermittent null reference exception on CloseConnection
+ * #2324 Update IIsEntityDecider to use ExpressionsHelper.TryGetMappedType
+ * #2319 Upgrade AsyncGenerator to 0.18.1
+ * #2299 Proper query plan caching for DML LINQ queries
+ * #2286 Wrong sql if used joined-subclass with filters for key columns
+ * #2278 IInterceptor.OnPrepareStatement results not used in insert/update commands
+ * #2266 Fix comment for Restrictions.IsEmpty
+ * #2255 Fix a flaky test
+ * #2245 Add sqlite.binaryguid to configuration schema
+ * #2244 SelectMany Linq extension does not work correctly - subsequent FetchMany fails
+ * #2233 Fix possible issue with async code for delayed entity inserts
+ * #2231 Invalid alias name used in Linq Joins
+ * #2222 NHibernate query plan for Linq Dml is not cached
+ * #2219 Fix BuildTool output path
+ * #2215 Fix ShowBuildMenu.sh
+ * #2181 Skip null entities when bag is populated
+ * #2164 Do not call GC.SuppressFinalize from finalizer thread
+ * #2158 Proper support for IN clause for composite values in Criteria
+ * #2147 Improve async locking
+ * #2144 AdoTransaction memory leak (5.2.5)
+ * #2137 NullReferenceException in EntityEntry.GetLoadedValue on an update of a never loaded detached entity
+ * #2099 "Composite Index" not working with inheritance
+ * #2088 Fix cacheable CreateSQLQuery throws on query with AddJoin
+ * #2085 Duplicated methods generated in proxies
+ * #2067 Wrong proxy built for base class with interfaced sub-classes
+ * #2064 One-to-one properties not appearing in Select() projection result set
+ * #2053 Dml Style Update fails with static where sql in mapping
+ * #2038 Fix a typo on the memcached distributed cache description in the docs
+ * #2029 Incorrect SQL for cast inside an aggregate (MS SQL)
+ * #2019 Update symbol package format and add Sourcelink
+ * #2000 Fixed Equals method for transformers
+ * #1997 Fix criteria collection ordering
+ * #1994 Extra Select for every "outfiltered" Element
+ * #1993 InvalidCastException when merging a collection with a lazy property
+ * #1985 DateTime.xxxx are not supported in SelectGroup
+ * #1965 Fix code sample in docs, section 10.4.2
+ * #1956 Fix lazy property caching
+ * #1921 DML insert fails when a filter is enabled
+ * #1738 Refresh of locally removed collection item crashes with "instance was not in a valid state"
+ * #1480 Fix cache build for honoring mapped concurrency
+ * #1368 NH-3778 - Crash when performing a Linq query on a one-to-one mapped reference
+ * #1341 NH-3848 - Child collection fetched using left outer join with on clause or where clause restrictions on fetched collection shouldn’t be stored in second level cache.
+ * #1319 NH-3549 - BasicFormatter throws exceptions for certain types of data containing "signal words"
+ * #1312 NH-3493 - Cannot use alias between more than 1 level of nested queries
+ * #1310 NH-3478 - StatefulPersistenceContext.RemoveEntity KeyNotFoundException on Evict
+ * #1309 NH-3469 - Impossible to load one-to-one association with LINQ for composite-id
+ * #1274 NH-3117 - Query on one-to-one property returns incorrect results
+ * #1263 NH-2991 - Criteria withClause doesn't work in case of many to many collections
+ * #1228 NH-2648 - HQL with joins in sub-select creates wrong SQL
+ * #1206 NH-1761 - Criteria query inserts an extra order by expression when using JoinType.LeftOuterJoin and Projections
+ * #1158 NH-3492 - SqlClientBatchingBatcher incorrectly ignoring per-SessionFactory Settings properties
+ * #1128 NH-3210 - NHibernate Linq Provider does cross join or left outer join and not inner join (even if outer-join=false on many-to-one mapping)
+ * #1124 NH-3155 - Linq subquery with group is not supported
+ * #1125 NH-3178 - Exception when using one-to-one properties in a criteria projections
+ * #1117 NH-3079 - Cannot use a sql custom loader with a composite ID
+ * #1107 NH-2983 - Coalesce in projection doesn't work if there is more than 1 Coalesce
+ * #1103 NH-2926 - CriteriaQuery - Unable to sort by composite-id
+ * #1100 NH-2892 - The columns containing reserved words are not quoted
+ * #1059 NH-1001 - Select statement issued for each not-found=ignore
+ * #1047 NH-3865 - Swallowed ArgumentNullException with dynamic composite id
+ * #1015 NH-2951 - Missing alias in hql update (select) statement with joined subclasses
+ * #1006 NH-2714 - Properties mapped inside a group are not set when retrieving object
+
+** New Feature
+
+ * #2411 Add an option to register a custom pre-transformer for a Linq query
+ * #2392 Add locate support for SQLite
+ * #2362 Add support for lt, gt, le, ge oData operators on strings
+ * #2349 Add support for Oracle binary floating point types
+ * #2347 Support fetching individual lazy properties for Criteria EntityProjection
+ * #2327 Add cross join support for Hql and Linq query provider
+ * #2313 Add overloads to ISession.Get taking both an entityName and a lockMode
+ * #2259 Schema auto-update should throw errors
+ * #2221 Support MemberInit expression in group by
+ * #2216 Add a driver to support Microsoft.Data.SqlClient provider
+ * #2209 IN clause support in hql for composite keys on databases without row value constructor support
+ * #2156 Support basic arithmetic operations (+, -, *, /) in QueryOver
+ * #2135 Support OData GroupBy/Aggregate
+ * #2116 Ability to replace ConfigurationManager with a custom config provider
+ * #2108 Multi-Tenancy: Implement tenant per Database strategy
+ * #2107 Port Hibernate's Aggregate functions for subqueries
+ * #2106 Port Hibernate's support subqueries in HQL as CASE statement alternatives
+ * #2100 Allow to override default types with length or precision parameters
+ * #2097 Add support for fetching an individual lazy property with Criteria
+ * #2090 Add support for caching fetched relations with Criteria
+ * #2080 Add ability to set custom collection type as a string in mapping by code
+ * #2049 Fix property-ref ignoring not-found="exception" mapping
+ * #1949 Port Hibernate's lazy attribute fetch groups
+ * #1922 Add support for fetching an individual lazy property with hql and linq provider
+ * #1861 Lazy loading and Eager initialization for Component
+ * #1376 Composite id is incorrectly expanded in SQL
+ * #1195 NH-4078 - LINQ fetched collections aren't cached
+ * #981 NH-3873 - Explicit joins on unrelated classes
+ * #959 NH-4048 - Support non-deterministic/db-side-only methods in Linq
+ * #896 NH-1432 - Expression.Sql should support aliases other than {alias}
+
+** Improvement
+
+ * #2404 Allow overriding default CastFunction
+ * #2401 Optimize JoinWalker.WhereString method
+ * #2399 Optimize PersistentGenericBag.EqualsSnapshot
+ * #2394 Optimize PersistentGenericSet snapshot
+ * #2352 Improve performance of ReflectHelper.GetMethod/Definition
+ * #2350 Optimize LINQ batch item processing for queries with overridden result type
+ * #2316 Add multiple arguments support for ISQLFunction
+ * #2315 Add SetFlushMode for QueryOver and Linq
+ * #2295 Optimize filter applying logic
+ * #2287 Allow customizing 'alias to bean' property not found behavior
+ * #2284 Make persistent collection classes implement the IReadOnly* interfaces
+ * #2270 IQueryOver is lacking some options
+ * #2254 Add dev build version suffix
+ * #2249 Improve handling of SqlCeParameter.SqlDbType
+ * #2248 Remove most RemoveAsAliasesFromSql usages
+ * #2241 Avoid duplicating parameters in LINQ query
+ * #2238 Call generic query.List from Linq queries
+ * #2235 Configure log4net from embedded resource log4net.xml in tests
+ * #2232 Use SqlStringBuilder for batching Future/QueryBatch queries
+ * #2226 Use DateTime.UtcNow for timestamps
+ * #2225 Avoid unnecessary locking via MethodImplOptions.Synchronized
+ * #2223 Short-Circuit SessionFactoryImpl.Close() when already closed
+ * #2214 Allow configuring auto-join transaction globally
+ * #2213 Add a shortcut to reduce Transaction.Current reads
+ * #2211 Port SupportsRowValueConstructorSyntaxInInList values
+ * #2182 Upgrade AsyncGenerator to 0.17.1
+ * #2166 Optimize usages of SqlString.Append
+ * #2163 Add virtual DefaultQueryProvider.CreateWithOptions
+ * #2162 Use collection types for private members
+ * #2161 Optimize ToArray conversions
+ * #2159 Unify handling of composite values in hql and Criteria
+ * #2153 Use generic parameters in ActionQueue
+ * #2139 Add ability to set fetch for mapping in mapping by code
+ * #2131 Create Stopwatch only if stats is enabled
+ * #2126 Upgrade AsyncGenerator to 0.14.0
+ * #2125 Skip logger default initialization logic when logger provided by user
+ * #2123 Use Assert.Throws instead of try-catch in tests
+ * #2119 Obsolete interfaces for Loquacios configuration and use config classes directly
+ * #2117 Replace array concatenation with hand written append
+ * #2115 Statefull Session commit performance issue when nothing changed and second level cache with query cache enabled
+ * #2091 Obsolete StringHelper.Join
+ * #2084 Improve one-to-one handling in queries
+ * #2082 Use entities prepared by Loader in hql select projections
+ * #2078 Avoid unnecessary join for entity comparisons in with clause
+ * #2071 Support subclass mapping with EntityName based base class mapping
+ * #2061 Reduce cast usage for COUNT aggregate and add support for Mssql count_big
+ * #2058 DB2 dialect enhancements
+ * #2056 Optimize GetOrphans and remove wrong checks from IsNotTransientSlow
+ * #2041 Hql entity join fixes
+ * #2039 Use generic CollectingNodeVisitor in hql parser
+ * #2036 Reduce cast usage for aggregate functions
+ * #2032 Allow using ON instead of WITH in hql
+ * #2024 Refactor to simplify netfx retargeting
+ * #2022 Make CancellationToken optional for async Linq DML queries
+ * #2010 Add new collection operation queue mechanism
+ * #2009 Add support for IDictionary to IQuery.SetProperties
+ * #2007 Dispose session in cascade tests
+ * #2006 Skip Topological sorting if not required
+ * #2003 Avoid some cases of Type -> string -> Type conversion in Mapping By Code
+ * #2002 Refactor DependentAlias handling logic in JoinWalker
+ * #1999 Optimize DistinctRootEntityResultTransformer
+ * #1989 Optimize ProxyCacheEntry equality for the same instance
+ * #1988 Improve exception on user types lacking some interfaces
+ * #1984 Reduce SessionIdLoggingContext creation
+ * #1981 Remove AbstractLazyInitializer unused field
+ * #1979 Refactor sequential select
+ * #1977 Obsolete IDeserializationCallback from EntityKey
+ * #1972 Port Hibernate's EntityKey optimization
+ * #1968 Optimize StaticProxyFactory GetProxy and GetFieldInterceptionProxy methods
+ * #1955 Optimize batchable cache calls for cached queries
+ * #1947 Partially port Hibernate's current field interceptor mechanism
+ * #1946 Port Hibernate's BytecodeEnhancementMetadata
+ * #1944 Extend IAccessOptimizer to support getting/setting single property value
+ * #1943 Skip initialization of lazy properties when setting one
+ * #1923 Obsolete StringHelper.Replace
+ * #1860 LINQ "==" operator generates OR with IS NULL
+ * #1754 Delay entity insert on Persist until session is flushed
+ * #1627 Refactored session List method for Criteria
+ * #913 NH-3704 - Allow Setting Dynamic Component Templates From Dictionary
+ * #864 NH-2379 - Add support of Left Joins to Linq Provider
+ * #803 NH-2521 - Session.EnableFilter method should work for HQL-DML statement
+ * #780 NH-1200 - Exception occurs when using criteria exist queries
+ * #767 NH-3892 - Add ability to coalesce using a property instead of a constant
+ * #722 NH-1953 - Support Future for collection filters
+ * #476 Eliminated double Persister resolution in Loader.InstanceNotYetLoaded flow
+
+** Task
+
+ * #2433 Improve slightly mapping documentation
+ * #2432 Document the caches configuration providers
+ * #2430 Document cache.serializer setting of CoreDistributedCache
+ * #2397 Update GitReleaseManager
+ * #2391 Use latest Firebird for AppVeyor and Travis
+ * #2388 Release 5.3
+ * #2382 Refactor debug logging in AbstractBatcher
+ * #2381 Use optimized Dictionary.Remove(key, out value) in .NET Core
+ * #2379 Simplify swap items logic in LINQ Visitors
+ * #2377 Use dotnet to push packages to nuget
+ * #2376 Add MyGet gallery link to readme
+ * #2368 Replace SafetyEnumerable with OfType where applicable
+ * #2363 Upgrade AsyncGenerator to 0.18.2
+ * #2356 Obsolete IdentitySet class
+ * #2354 Do not require Mono to build on not Windows
+ * #2353 Update Microsoft.SourceLink.GitHub to 1.0.0
+ * #2351 Get rid of JoinedEnumerable and SingletonEnumerable
+ * #2348 Use static ReferenceComparer for reference comparisons
+ * #2308 Merge 5.2.7
+ * #2294 Add StackExchangeRedis cache provider documentation
+ * #2293 Update RtMemoryCache framework dependency
+ * #2265 Fix code style issues
+ * #2251 Publish development nightly builds on nuget
+ * #2205 Merge 5.2.6
+ * #2171 Upgrade NUnit
+ * #2122 Update AsyncGenerator to 0.13.3
+ * #2016 Avoid recursive calls in BatchFetchQueue
+ * #2014 Obsolete Environment.Properties
+ * #1973 Investigate licenseUrl deprecation
+ * #1971 Add SourceLink to allow NuGet package debugging
+ * #1940 Allow to provide dev specific properties in NHibernate.dev.props
+ * #1936 Upgrade AsyncGenerator to 0.13.1
+
+** Tests
+
+ * #2384 Tests to verify NH-2329 is obsolete
+ * #2360 Add OData test for single property $expand
+ * #2089 Bidirectional list fails if session only knows about child
+ * #2066 Tests for proxy interface handling
+ * #1966 Test duplicated join on some Linq queries
+
+Build 5.2.7
+=============================
+
+Release notes - NHibernate - Version 5.2.7
+
+4 issues were resolved in this release.
+
+** Bug
+
+ * #2302 Backport sqlite.binaryguid to configuration schema
+ * #2298 Dml Linq Update Produce Wrong Sql
+ * #2296 Missing Row Count in Debug Log for Future queries
+
+** Task
+
+ * #2303 Release 5.2.7
+
+Build 5.2.6
+=============================
+
+Release notes - NHibernate - Version 5.2.6
+
+11 issues were resolved in this release.
+
+** Bug
+
+ * #2190 Cannot instantiate a SessionFactory using Prevalence cache
+ * #2177 New Fetch() method in QueryOver returns IQueryOver<> instead of QueryOver<>
+ * #2172 Using DependentTransaction fails
+ * #2175 Subcriteria on component collection generates incorrect join alias
+ * #2173 Futures not batching correctly in NH 5.2.x
+ * #2141 Undefined call to Equals object in collection during flush just before commit
+ * #2127 StackExchangeRedisCache with PreferMultipleGet = true calls GetMany multiple times
+ * #2110 Wrong GUID to string conversion with SQLite BinaryGuid=False
+
+** Task
+
+ * #2200 Release 5.2.6
+ * #2199 Upgrade AsyncGenerator to 0.8.2.12
+
+** Tests
+
+ * #2132 Add GetMany for ReadWriteCache tests
+
Build 5.2.5
=============================
@@ -342,6 +798,22 @@ Release notes - NHibernate - Version 5.2.0
As part of releasing 5.2.0, a misnamed setting in 5.0.0 release notes has been fixed:
transaction.use_connection_on_system_events correct name is transaction.use_connection_on_system_prepare
+Build 5.1.7
+=============================
+
+Release notes - NHibernate - Version 5.1.7
+
+** Bug
+ * #2298 Dml Linq Update Produce Wrong Sql
+
+Build 5.1.6
+=============================
+
+Release notes - NHibernate - Version 5.1.6
+
+** Bug
+ * #2172 Using DependentTransaction fails
+
Build 5.1.5
=============================
@@ -605,6 +1077,14 @@ Release notes - NHibernate - Version 5.1.0
As part of releasing 5.1.0, a missing 5.0.0 possible breaking change has been added about inequality semantic in LINQ
queries. See 5.0.0 possible breaking changes.
+Build 5.0.8
+=============================
+
+Release notes - NHibernate - Version 5.0.8
+
+** Bug
+ * #2172 Using DependentTransaction fails
+
Build 5.0.7
=============================
diff --git a/src/AsyncGenerator.yml b/src/AsyncGenerator.yml
index 881e7096216..a8b58b1da6a 100644
--- a/src/AsyncGenerator.yml
+++ b/src/AsyncGenerator.yml
@@ -1,10 +1,16 @@
projects:
- filePath: NHibernate/NHibernate.csproj
- targetFramework: net461
+ targetFramework: netcoreapp2.0
concurrentRun: true
applyChanges: true
+ suppressDiagnosticFailures:
+ - pattern: ^.*(Hql\.g).*$
analyzation:
methodConversion:
+#TODO 6.0: Remove ignore rule for IQueryBatchItem.ProcessResults
+ - conversion: Ignore
+ name: ProcessResults
+ containingTypeName: IQueryBatchItem
- conversion: Ignore
name: PostProcessInsert
containingTypeName: HqlSqlWalker
@@ -104,6 +110,10 @@
- conversion: Ignore
name: GetEnumerator
containingTypeName: IFutureEnumerable
+# TODO 6.0: Consider if ComputeFlattenedParameters should remain ignored or not
+ - conversion: Ignore
+ name: ComputeFlattenedParameters
+ containingTypeName: SqlQueryImpl
- conversion: ToAsync
name: ExecuteReader
containingTypeName: IBatcher
@@ -115,7 +125,7 @@
- conversion: ToAsync
rule: Cache
- conversion: ToAsync
- rule: TransactionCompletion
+ rule: TransactionCompletion
typeConversion:
- conversion: Ignore
name: EnumerableImpl
@@ -150,9 +160,6 @@
transformation:
configureAwaitArgument: false
localFunctions: true
- asyncLock:
- type: NHibernate.Util.AsyncLock
- methodName: LockAsync
documentationComments:
addOrReplaceMethodSummary:
- name: Commit
@@ -166,45 +173,41 @@
- type: AsyncGenerator.Core.Plugins.EmptyRegionRemover
assemblyName: AsyncGenerator.Core
- filePath: NHibernate.DomainModel/NHibernate.DomainModel.csproj
- targetFramework: net461
+ targetFramework: netcoreapp2.0
concurrentRun: true
applyChanges: true
+ suppressDiagnosticFailures:
+ - pattern: ^.*(Hql\.g).*$
analyzation:
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
- filePath: NHibernate.Test/NHibernate.Test.csproj
- targetFramework: net461
+ targetFramework: netcoreapp2.0
concurrentRun: true
applyChanges: true
+ suppressDiagnosticFailures:
+ - pattern: ^.*(Hql\.g).*$
analyzation:
methodConversion:
+ - conversion: Ignore
+ name: CanUseDependentTransaction
+ containingTypeName: DistributedSystemTransactionFixture
+ - conversion: Ignore
+ name: CanUseSessionWithManyDependentTransaction
+ containingTypeName: DistributedSystemTransactionFixture
+ - conversion: Ignore
+ name: CanUseDependentTransaction
+ containingTypeName: SystemTransactionFixture
+ - conversion: Ignore
+ name: CanUseSessionWithManyDependentTransaction
+ containingTypeName: SystemTransactionFixture
- conversion: Copy
name: AfterTransactionCompletionProcess_EvictsFromCache
- - conversion: Copy
- hasAttributeName: OneTimeSetUpAttribute
- - conversion: Copy
- hasAttributeName: OneTimeTearDownAttribute
- - conversion: Copy
- hasAttributeName: SetUpAttribute
- - conversion: Copy
- hasAttributeName: TearDownAttribute
- - conversion: Smart
- hasAttributeName: TestAttribute
- - conversion: Smart
- hasAttributeName: TheoryAttribute
asyncExtensionMethods:
projectFiles:
- fileName: LinqExtensionMethods.cs
projectName: NHibernate
- preserveReturnType:
- - hasAttributeName: TestAttribute
- - hasAttributeName: TheoryAttribute
- alwaysAwait:
- - hasAttributeName: TestAttribute
- - hasAttributeName: TheoryAttribute
- - hasAttributeName: SetUpAttribute
- - hasAttributeName: TearDownAttribute
typeConversion:
- conversion: Ignore
name: ObjectAssert
@@ -214,32 +217,25 @@
name: MultiThreadRunner
- conversion: Ignore
name: PeVerifier
- - conversion: Ignore
- hasAttributeName: IgnoreAttribute
- - conversion: NewType
- hasAttributeName: TestFixtureAttribute
- - conversion: NewType
- anyBaseTypeRule: HasTestFixtureAttribute
- conversion: Ignore
rule: IsTestCase
- conversion: Ignore
anyBaseTypeRule: IsTestCase
- ignoreSearchForMethodReferences:
- - hasAttributeName: TheoryAttribute
- - hasAttributeName: TestAttribute
+ executionPhase: PostProviders
ignoreDocuments:
- filePathEndsWith: Linq/MathTests.cs
- filePathEndsWith: Linq/ExpressionSessionLeakTest.cs
- filePathEndsWith: Linq/NorthwindDbCreator.cs
cancellationTokens:
- withoutCancellationToken:
- - hasAttributeName: TestAttribute
- - hasAttributeName: TheoryAttribute
+ enabled: true
scanMethodBody: true
scanForMissingAsyncMembers:
- all: true
registerPlugin:
- - type: AsyncGenerator.Core.Plugins.NUnitAsyncCounterpartsFinder
+ - type: AsyncGenerator.Core.Plugins.NUnitPlugin
+ parameters:
+ - name: createNewTypes
+ value: true
assemblyName: AsyncGenerator.Core
- type: AsyncGenerator.Core.Plugins.TransactionScopeAsyncFlowAdder
assemblyName: AsyncGenerator.Core
@@ -281,7 +277,7 @@ methodRules:
- containingType: NHibernate.Action.IAfterTransactionCompletionProcess
- containingType: NHibernate.Action.IBeforeTransactionCompletionProcess
- containingType: NHibernate.Action.EntityAction
- name: BeforeTransactionCompletionProcessImpl
+ name: BeforeTransactionCompletionProcessImpl
name: TransactionCompletion
- filters:
- containingNamespace: NHibernate
@@ -291,6 +287,7 @@ methodRules:
- containingType: NHibernate.Linq.DmlExtensionMethods
- containingType: NHibernate.Linq.InsertBuilder
- containingType: NHibernate.Linq.UpdateBuilder
+ - containingType: NHibernate.Multi.IQueryBatch
name: PubliclyExposedType
- filters:
- hasAttributeName: ObsoleteAttribute
@@ -302,6 +299,3 @@ typeRules:
- filters:
- name: TestCase
name: IsTestCase
-- filters:
- - hasAttributeName: TestFixtureAttribute
- name: HasTestFixtureAttribute
diff --git a/src/NHibernate.DomainModel/Bar.cs b/src/NHibernate.DomainModel/Bar.cs
index dfbb9dde84b..262d9d512e3 100644
--- a/src/NHibernate.DomainModel/Bar.cs
+++ b/src/NHibernate.DomainModel/Bar.cs
@@ -12,7 +12,6 @@ public class Bar : Abstract, BarProxy, INamed
private string _name = "bar";
private object _object;
-
///
/// Gets or sets the X
///
@@ -31,7 +30,6 @@ public string BarString
set { _barString = value; }
}
-
///
/// Gets or sets the _barComponent
///
@@ -41,7 +39,6 @@ public FooComponent BarComponent
set { _barComponent = value; }
}
-
///
/// Gets or sets the _baz
///
@@ -51,7 +48,6 @@ public Baz Baz
set { _baz = value; }
}
-
///
/// Gets or sets the _name
///
@@ -61,7 +57,6 @@ public string Name
set { _name = value; }
}
-
///
/// Gets or sets the _object
///
@@ -71,4 +66,4 @@ public object Object
set { _object = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Baz.cs b/src/NHibernate.DomainModel/Baz.cs
index acb2c846dcd..8df1fa87dcc 100644
--- a/src/NHibernate.DomainModel/Baz.cs
+++ b/src/NHibernate.DomainModel/Baz.cs
@@ -260,7 +260,6 @@ public string[] StringArray
set { _stringArray = value; }
}
-
///
/// Gets or sets the fooArray
///
@@ -270,7 +269,6 @@ public FooProxy[] FooArray
set { _fooArray = value; }
}
-
///
/// Get/set for fooSet
///
@@ -453,4 +451,4 @@ public int CompareTo(object obj)
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Circular.cs b/src/NHibernate.DomainModel/Circular.cs
index 1684403c025..6c8386ae004 100644
--- a/src/NHibernate.DomainModel/Circular.cs
+++ b/src/NHibernate.DomainModel/Circular.cs
@@ -18,7 +18,6 @@ public string Id
set { _id = value; }
}
-
public System.Type Clazz
{
get { return _clazz; }
@@ -37,4 +36,4 @@ public object AnyEntity
set { _anyEntity = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/ComponentCollection.cs b/src/NHibernate.DomainModel/ComponentCollection.cs
index 037a04f0057..3465b5489e3 100644
--- a/src/NHibernate.DomainModel/ComponentCollection.cs
+++ b/src/NHibernate.DomainModel/ComponentCollection.cs
@@ -20,7 +20,6 @@ public IList Foos
set { _foos = value; }
}
-
///
/// Holds the _str
///
@@ -49,4 +48,4 @@ public IList Floats
set { _floats = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Container.cs b/src/NHibernate.DomainModel/Container.cs
index 9c397eb7f51..c1ead671661 100644
--- a/src/NHibernate.DomainModel/Container.cs
+++ b/src/NHibernate.DomainModel/Container.cs
@@ -80,7 +80,6 @@ public Glarch Glarch
}
}
-
private IList _oneToMany;
private IList _components;
private IList _manyToMany;
@@ -94,7 +93,6 @@ public Glarch Glarch
// mapping
private ISet _ternarySet;
-
public virtual IList OneToMany
{
get { return _oneToMany; }
@@ -155,4 +153,4 @@ public virtual ISet TernarySet
set { _ternarySet = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Detail.cs b/src/NHibernate.DomainModel/Detail.cs
index f5ae324c51a..6cd9242c8c2 100644
--- a/src/NHibernate.DomainModel/Detail.cs
+++ b/src/NHibernate.DomainModel/Detail.cs
@@ -26,7 +26,6 @@ public int I
set { _i = value; }
}
-
public ISet SubDetails
{
get { return _details; }
@@ -39,4 +38,4 @@ public int X
set { _x = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/DoubleStringType.cs b/src/NHibernate.DomainModel/DoubleStringType.cs
index 4c794cb6f3d..b2b6d2fd8c8 100644
--- a/src/NHibernate.DomainModel/DoubleStringType.cs
+++ b/src/NHibernate.DomainModel/DoubleStringType.cs
@@ -57,7 +57,6 @@ public Object NullSafeGet(DbDataReader rs, string[] names, ISessionImplementor s
return (first == null && second == null) ? null : new string[] {first, second};
}
-
public void NullSafeSet(DbCommand st, Object value, int index, bool[] settable, ISessionImplementor session)
{
string[] strings = (value == null) ? new string[2] : (string[]) value;
@@ -107,4 +106,4 @@ public object Replace(object original, object target, ISessionImplementor sessio
return DeepCopy(original);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Foo.cs b/src/NHibernate.DomainModel/Foo.cs
index b64c5c736d3..7edbc288126 100644
--- a/src/NHibernate.DomainModel/Foo.cs
+++ b/src/NHibernate.DomainModel/Foo.cs
@@ -347,8 +347,8 @@ public LifecycleVeto OnSave(ISession s)
_long = 696969696969696969L - count++;
_short = 42;
_float = 6666.66f;
- //_double = new Double( 1.33e-69 ); // this double is too big for the sap db jdbc driver
-// _double = 1.12e-36;
+ //_double = new Double( 1.33e-69 ); // this double is too big for the sap db jdbc driver
+ //_double = 1.12e-36;
_boolean = true;
_byte = 127;
_int = 2;
@@ -397,7 +397,6 @@ public bool EqualsFoo(Foo other)
}
}
-
return (_bool == other.Bool)
&& ((_boolean == other.Boolean) || (_boolean.Equals(other.Boolean)))
&& ((_byte == other.Byte) || (_byte.Equals(other.Byte)))
@@ -429,7 +428,6 @@ public bool EqualsFoo(Foo other)
// return key.GetHashCode() - _string.GetHashCode();
// }
-
private static int count = 0;
}
}
diff --git a/src/NHibernate.DomainModel/FooComponent.cs b/src/NHibernate.DomainModel/FooComponent.cs
index 4bd536eed96..e1c88c7b449 100644
--- a/src/NHibernate.DomainModel/FooComponent.cs
+++ b/src/NHibernate.DomainModel/FooComponent.cs
@@ -92,6 +92,8 @@ public Int32 Count
set { _count = value; }
}
+ public int NotMapped { get; set; }
+
public DateTime[] ImportantDates
{
get { return _importantDates; }
diff --git a/src/NHibernate.DomainModel/Fum.cs b/src/NHibernate.DomainModel/Fum.cs
index ddc1d7e1ee4..73c9aa85879 100644
--- a/src/NHibernate.DomainModel/Fum.cs
+++ b/src/NHibernate.DomainModel/Fum.cs
@@ -99,7 +99,6 @@ public ISet Friends
set { this._friends = value; }
}
-
public LifecycleVeto OnDelete(ISession s)
{
if (_friends == null) return LifecycleVeto.NoVeto;
@@ -117,12 +116,10 @@ public LifecycleVeto OnDelete(ISession s)
return LifecycleVeto.NoVeto;
}
-
public void OnLoad(ISession s, object id)
{
}
-
public LifecycleVeto OnSave(ISession s)
{
if (_friends == null) return LifecycleVeto.NoVeto;
@@ -140,7 +137,6 @@ public LifecycleVeto OnSave(ISession s)
return LifecycleVeto.NoVeto;
}
-
public LifecycleVeto OnUpdate(ISession s)
{
return LifecycleVeto.NoVeto;
@@ -158,4 +154,4 @@ public MapComponent MapComponent
set { _mapComponent = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Glarch.cs b/src/NHibernate.DomainModel/Glarch.cs
index 5a3036817c0..83d23397e47 100644
--- a/src/NHibernate.DomainModel/Glarch.cs
+++ b/src/NHibernate.DomainModel/Glarch.cs
@@ -38,7 +38,6 @@ public int Version
set { this._version = value; }
}
-
///
/// Gets or sets the _next
///
@@ -48,7 +47,6 @@ public GlarchProxy Next
set { _next = value; }
}
-
///
/// Gets or sets the _order
///
@@ -58,7 +56,6 @@ public short Order
set { _order = value; }
}
-
///
/// Gets or sets the _strings
///
@@ -68,7 +65,6 @@ public IList Strings
set { _strings = value; }
}
-
///
/// Gets or sets the _stringSets
///
@@ -79,7 +75,6 @@ public ISet StringSets
set { _stringSets = value; }
}
-
///
/// Gets or sets the _fooComponents
///
@@ -89,7 +84,6 @@ public IList FooComponents
set { _fooComponents = value; }
}
-
///
/// Gets or sets the _proxyArray
///
@@ -99,7 +93,6 @@ public GlarchProxy[] ProxyArray
set { _proxyArray = value; }
}
-
///
/// Gets or sets the _proxySet
///
@@ -188,4 +181,4 @@ public Multiplicity Multiple
set { _name = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/Location.cs b/src/NHibernate.DomainModel/Location.cs
index 6da9c7a0332..4559856996e 100644
--- a/src/NHibernate.DomainModel/Location.cs
+++ b/src/NHibernate.DomainModel/Location.cs
@@ -40,7 +40,6 @@ public string CountryCode
set { _countryCode = value; }
}
-
public string Description
{
get { return _description; }
@@ -76,4 +75,4 @@ public override int GetHashCode()
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/MoreStuff.cs b/src/NHibernate.DomainModel/MoreStuff.cs
index 238de291718..4e9238c4bc3 100644
--- a/src/NHibernate.DomainModel/MoreStuff.cs
+++ b/src/NHibernate.DomainModel/MoreStuff.cs
@@ -15,7 +15,6 @@ public class MoreStuff
private IList _stuffs;
private string _name;
-
public string StringId
{
get { return _stringId; }
@@ -52,7 +51,6 @@ public override bool Equals(object obj)
return (rhs.IntId == this.IntId && rhs.StringId.Equals(this.StringId));
}
-
public override int GetHashCode()
{
return _stringId.GetHashCode();
@@ -60,4 +58,4 @@ public override int GetHashCode()
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/NHSpecific/Child.cs b/src/NHibernate.DomainModel/NHSpecific/Child.cs
index 9c439a9237c..5eb941631c9 100644
--- a/src/NHibernate.DomainModel/NHSpecific/Child.cs
+++ b/src/NHibernate.DomainModel/NHSpecific/Child.cs
@@ -54,7 +54,6 @@ public Child FirstSibling
set { Siblings.Insert(0, value); }
}
-
public Child SecondSibling
{
get { return (Child) Siblings[1]; }
@@ -115,11 +114,10 @@ public Child[] Friends
set { _friends = value; }
}
-
public DateTime FavoriteDate
{
get { return _favoriteDate; }
set { _favoriteDate = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/NHibernate.DomainModel/NHSpecific/NullableInt32.cs b/src/NHibernate.DomainModel/NHSpecific/NullableInt32.cs
index 89d599183bf..95abf028f98 100644
--- a/src/NHibernate.DomainModel/NHSpecific/NullableInt32.cs
+++ b/src/NHibernate.DomainModel/NHSpecific/NullableInt32.cs
@@ -7,7 +7,7 @@ namespace NHibernate.DomainModel.NHSpecific
/// A nullable type that wraps an value.
///
[TypeConverter(typeof(NullableInt32Converter)), Serializable()]
- public struct NullableInt32 : IFormattable, IComparable
+ public struct NullableInt32 : IFormattable, IComparable, IConvertible
{
public static readonly NullableInt32 Default = new NullableInt32();
@@ -234,5 +234,94 @@ public static NullableInt32 Parse(string s)
// TODO: implement the rest of the Parse overloads found in Int32
#endregion
+
+ #region IConvertible
+
+ public TypeCode GetTypeCode()
+ {
+ return _value.GetTypeCode();
+ }
+
+ public bool ToBoolean(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToBoolean(provider);
+ }
+
+ public char ToChar(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToChar(provider);
+ }
+
+ public sbyte ToSByte(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToSByte(provider);
+ }
+
+ public byte ToByte(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToByte(provider);
+ }
+
+ public short ToInt16(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToInt16(provider);
+ }
+
+ public ushort ToUInt16(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToUInt16(provider);
+ }
+
+ public int ToInt32(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToInt32(provider);
+ }
+
+ public uint ToUInt32(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToUInt32(provider);
+ }
+
+ public long ToInt64(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToInt64(provider);
+ }
+
+ public ulong ToUInt64(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToUInt64(provider);
+ }
+
+ public float ToSingle(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToSingle(provider);
+ }
+
+ public double ToDouble(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToDouble(provider);
+ }
+
+ public decimal ToDecimal(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToDecimal(provider);
+ }
+
+ public DateTime ToDateTime(IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToDateTime(provider);
+ }
+
+ public string ToString(IFormatProvider provider)
+ {
+ return _value.ToString(provider);
+ }
+
+ public object ToType(System.Type conversionType, IFormatProvider provider)
+ {
+ return ((IConvertible) _value).ToType(conversionType, provider);
+ }
+
+ #endregion
}
}
diff --git a/src/NHibernate.DomainModel/NHSpecific/Parent.cs b/src/NHibernate.DomainModel/NHSpecific/Parent.cs
index 2e3cab577bd..0bb468d37b7 100644
--- a/src/NHibernate.DomainModel/NHSpecific/Parent.cs
+++ b/src/NHibernate.DomainModel/NHSpecific/Parent.cs
@@ -13,7 +13,6 @@ public class Parent
private ISet