Permalink
Browse files

Merge branch '3.3.x'

  • Loading branch information...
hazzik committed Mar 8, 2013
2 parents 7e32107 + 5979442 commit a70af4ed387fa8a5490f4a5826c2734511224153
Showing with 945 additions and 68 deletions.
  1. +7 −0 ReleaseProcedure.txt
  2. BIN Tools/NuGet.exe
  3. +1 −1 doc/reference/modules/performance.xml
  4. +1 −1 doc/reference/modules/quickstart.xml
  5. +57 −1 releasenotes.txt
  6. +146 −0 src/NHibernate.Test/DialectTest/LockHintAppenderFixture.cs
  7. +7 −0 src/NHibernate.Test/Linq/ProjectionsTests.cs
  8. +31 −0 src/NHibernate.Test/Linq/WhereTests.cs
  9. +2 −2 src/NHibernate.Test/MappingByCode/IntegrationTests/NH3105/Fixture.cs
  10. +20 −0 src/NHibernate.Test/MappingTest/ForeignKeyFixture.cs
  11. +10 −0 src/NHibernate.Test/NHSpecificTest/NH2297/CustomCompositeUserType.cs
  12. +11 −0 src/NHibernate.Test/NHSpecificTest/NH2297/Entity.cs
  13. +42 −0 src/NHibernate.Test/NHSpecificTest/NH2297/Fixture.cs
  14. +107 −0 src/NHibernate.Test/NHSpecificTest/NH2297/InvalidCustomCompositeUserTypeBase.cs
  15. +13 −0 src/NHibernate.Test/NHSpecificTest/NH2297/MappingsNames.hbm.xml
  16. +13 −0 src/NHibernate.Test/NHSpecificTest/NH2297/MappingsTypes.hbm.xml
  17. +26 −0 src/NHibernate.Test/NHSpecificTest/NH2408/Fixture.cs
  18. +20 −0 src/NHibernate.Test/NHSpecificTest/NH2408/Mappings.hbm.xml
  19. +17 −0 src/NHibernate.Test/NHSpecificTest/NH2408/Model.cs
  20. +13 −0 src/NHibernate.Test/NHSpecificTest/NH3324/ChildEntity.cs
  21. +17 −0 src/NHibernate.Test/NHSpecificTest/NH3324/Entity.cs
  22. +111 −0 src/NHibernate.Test/NHSpecificTest/NH3324/FixtureByCode.cs
  23. +53 −0 src/NHibernate.Test/NHSpecificTest/NH3408/Fixture.cs
  24. +19 −0 src/NHibernate.Test/NHSpecificTest/NH3408/Mappings.hbm.xml
  25. +15 −0 src/NHibernate.Test/NHSpecificTest/NH3408/Model.cs
  26. +16 −0 src/NHibernate.Test/NHibernate.Test.csproj
  27. +74 −40 src/NHibernate/Dialect/MsSql2000Dialect.cs
  28. +6 −4 src/NHibernate/Dialect/MySQL5Dialect.cs
  29. +18 −5 src/NHibernate/Dialect/MySQLDialect.cs
  30. +14 −0 src/NHibernate/Engine/Query/QueryPlanCache.cs
  31. +3 −3 src/NHibernate/Engine/QueryParameters.cs
  32. +2 −1 src/NHibernate/Impl/ExpressionQueryImpl.cs
  33. +6 −2 src/NHibernate/Impl/SessionFactoryObjectFactory.cs
  34. +16 −2 src/NHibernate/Linq/NestedSelects/NestedSelectDetector.cs
  35. +21 −2 src/NHibernate/Linq/NestedSelects/NestedSelectRewriter.cs
  36. +2 −2 src/NHibernate/Linq/NhLinqExpression.cs
  37. +2 −2 src/NHibernate/Mapping/ForeignKey.cs
  38. +6 −0 src/NHibernate/Type/CompositeCustomType.cs
View
@@ -15,6 +15,13 @@ These are the tasks typically needed to create an official NHibernate release.
* Perform the release build including running all tests (GaRelease.bat or
ShowBuildMenu.bat).
+ NOTE: If you prefer to keep your source code in a path like e.g.:
+ C:\Users\Something\Long\Projects\nhibernate-core
+ you may want to issue a command like:
+ subst P: C:\Users\Something\Long\Projects
+ And then change to P:\nhibernate-core before building. This will avoid
+ displaying a long user-specific path in public symbol files.
+
* If no error or other issue requiring further changes occured, tag the
current git HEAD with a tag according to version number. Don't forget to
push the tag to github.
View
Binary file not shown.
@@ -276,7 +276,7 @@ int accessLevel = (int) permissions["accounts"]; // Error!]]></programlisting>
of persistent collections. However, a different mechanism is needed for lazy
behavior in single-ended associations. The target entity of the association must
be proxied. NHibernate implements lazy initializing proxies for persistent objects
- using runtime bytecode enhancement (via the excellent Castle.DynamicProxy library).
+ using runtime bytecode enhancement.
</para>
<para>
@@ -165,7 +165,7 @@
No special interface has to be implemented for persistent classes nor do we have
to subclass from a special root persistent class. NHibernate also doesn't use any
build time processing, such as IL manipulation, it relies solely on
- .NET reflection and runtime class enhancement (through Castle.DynamicProxy library).
+ .NET reflection and runtime class enhancement.
So, without any dependency in the POCO class on NHibernate, we can map it to
a database table.
</para>
View
@@ -1,7 +1,7 @@
Build vNext
=============================
-** Known BREAKING CHANGES from NH3.3.2.GA to vNext
+** Known BREAKING CHANGES from NH3.3.3.CR1 to vNext
NHibernate now targets .Net 4.0. Many uses of set types from Iesi.Collections have
now been changed to use corresponding types from the BCL. The API for these types
@@ -26,6 +26,62 @@ Build vNext
* Oracle: The atan2 and power functions now return double (instead of single) for consistency with other dialects.
* Removed FirebirdDriver. It was the same as FirebirdClientDriver since 3.2, and the latter have been the default since then.
+Build 3.3.3.CR1
+=============================
+
+** Fix
+ * [NH-3148] - ComponentAsId properties do not maintain the Column specified using property mapper when component is from base class
+
+** Sub-task
+ * [NH-3052] - Projection of one-to-many generates invalid SQL
+ * [NH-3385] - Add ability to expand many subcollections with WCF Data Services
+
+** Bug
+ * [NH-2042] - Table per subclass, using a discriminator mappings with formula in child class error
+ * [NH-2539] - Contains/StartsWith fails when invoked via WCF Data Service.
+ * [NH-2566] - NotSupportedException when using Skip/Take/First/Single/Any on GroupBy
+ * [NH-2588] - NotSupportedException when using Skip/Take with Where clause
+ * [NH-2860] - Lazy property throwing casting exception
+ * [NH-2979] - MsSqlCe dialect doesn't give the correct SQL type for Decimal with Scale defined
+ * [NH-3039] - IndexOutOfRangeException thrown when web server is processing multiple sessionfactory creation requests
+ * [NH-3057] - Collection subquery constraint on joined-subclass inherited properties causes invalid sql (base classes are not joined in).
+ * [NH-3105] - ComponentAsId does not find property that belongs to a parent class
+ * [NH-3108] - OrderBy with Select throws exception
+ * [NH-3129] - Linq Provider doesn't recognize CompareTo method
+ * [NH-3241] - Linq: Mixing Fetch/FetchMany with Any() throws: ArgumentException: Expression of type 'System.Collections.IList' cannot be used for parameter of type 'System.Collections.Generic.IEnumerable`1[System.Object]'
+ * [NH-3261] - Linq Query throws when there is a conditional operator
+ * [NH-3305] - SybaseSQLAnywhere10Dialect defaults a numeric datatype to (19,255) precision, which is not compatible with the DB
+ * [NH-3318] - Composite-id does not allow superclass properties
+ * [NH-3320] - Exception in LINQ projection with OrderBy/Take - block using WCF Data Services projection's
+ * [NH-3326] - Exception in LINQ with pagination - block using WCF Data Services
+ * [NH-3330] - Exception in LINQ for nullable strings in Oracle - blocks using WCF Data Services
+ * [NH-3332] - The NH linq driver generates sql code that doesn't match the semantics of the original linq query
+ * [NH-3337] - Exception in LINQ for complex nullable conditionals - blocks using WCF Data Services
+ * [NH-3357] - System.NotSupportedException : Don't currently support idents of type DateTimeOffset
+ * [NH-3366] - LINQ query with various Compare() and CompareTo() fails (WCF Data Services)
+ * [NH-3369] - ToFuture/ToFutureValue should fall-back on dialects without MultiQuery support
+ * [NH-3378] - MySQLDialect incorrect handle DbType.Currency as MONEY
+ * [NH-3379] - Oracle8iDialect and FirebirdDialect incorrect handle DbType.Currency type
+
+** Improvement
+ * [NH-2297] - Configuration.BuildSessionFactory throws a NullReferenceException when loading an invalid ICompositeUserType
+ * [NH-3301] - Support SqlMethods.Like() in LINQ queries.
+ * [NH-3360] - Allow setting timeout on a LINQ query
+ * [NH-3367] - Support string.Equals()
+ * [NH-3368] - Add support for Equals method of sbyte, DateTimeOffset and unsigned numerics
+ * [NH-3371] - NHibernate should log LINQ expression trees to ease debugging
+
+** New Feature
+ * [NH-2986] - Add ability to include collections into projections
+ * [NH-3092] - Nhibernate Linq provider does not support Math functions like Math.Cos, Math.Sin, etc
+ * [NH-3180] - Could not select first element of the group
+ * [NH-3184] - Add ability to use ToFutureValue with aggregating queries
+ * [NH-3283] - New driver: Devart.Data.MySql
+ * [NH-3333] - Add ability to expand subcollections with WCF Data Services
+
+** Patch
+ * [NH-3255] - The IDbCommand that performs the cleanup of data in AbstractStatementExecutor.DropTemporaryTableIfNecessary does not have a connection.
+
Build 3.3.2.GA
=============================
@@ -0,0 +1,146 @@
+using System.Collections.Generic;
+using NHibernate.Dialect;
+using NHibernate.SqlCommand;
+using NUnit.Framework;
+
+namespace NHibernate.Test.DialectTest
+{
+ [TestFixture]
+ public class LockHintAppenderFixture
+ {
+ private const string MsSql2000LockHint = " with (updlock, rowlock)";
+ private MsSql2000Dialect.LockHintAppender _appender;
+
+ [SetUp]
+ public void SetUp()
+ {
+ _appender = new MsSql2000Dialect.LockHintAppender(new MsSql2000Dialect(), new Dictionary<string, LockMode> { {"person", LockMode.Upgrade} });
+ }
+
+ [Test]
+ public void AppendHintToSingleTableAlias()
+ {
+ const string expectedQuery1 = "select * from Person person with (updlock, rowlock)";
+ const string expectedQuery2 = "select * from Person as person with (updlock, rowlock)";
+
+ var result1 = _appender.AppendLockHint(new SqlString(expectedQuery1.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result1.ToString(), Is.EqualTo(expectedQuery1));
+
+ var result2 = _appender.AppendLockHint(new SqlString(expectedQuery2.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result2.ToString(), Is.EqualTo(expectedQuery2));
+ }
+
+ [Test]
+ public void AppendHintToJoinedTableAlias()
+ {
+ const string expectedQuery =
+ "select * from Person person with (updlock, rowlock) inner join Country country on person.Id = country.Id";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void AppendHintToUnionTableAlias()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, CONCAT(FirstName, LastName) from Employee with (updlock, rowlock) union all select Id, CONCAT(FirstName, LastName) from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldIgnoreCasing()
+ {
+ const string expectedQuery =
+ "select Id, Name FROM (select Id, Name FROM Employee with (updlock, rowlock) union all select Id, Name from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleExplicitSchemas()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name FROM dbo.Employee with (updlock, rowlock) union all select Id, Name from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleExplicitSchemasAndDbNames()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name FROM nhibernate.dbo.Employee with (updlock, rowlock) union all select Id, Name from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleExplicitDbNameWithoutSchemaName()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name FROM nhibernate..Employee with (updlock, rowlock) union all select Id, Name from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleExplicitSchemasAndDbNamesWithSpacesBetweenNameParts()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name FROM nhibernate .dbo. Employee with (updlock, rowlock) union all select Id, Name from Manager with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleEscapingInSubselect()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name from [Employee] with (updlock, rowlock) union all select Id, Name from [Manager] with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleEscapingWithWhitespacesInSubselect()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name from [Empl oyee] with (updlock, rowlock) union all select Id, Name from [Man ager] with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleEscapingWithSquareBracketsInSubselect()
+ {
+ const string expectedQuery =
+ "select Id, Name from (select Id, Name from [Empl ]]oyee] with (updlock, rowlock) union all select Id, Name from [Manager] with (updlock, rowlock)) as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+
+ [Test]
+ public void ShouldHandleMultilineQuery()
+ {
+ const string expectedQuery = @"
+select Id, Name from
+ (select Id, Name from Employee with (updlock, rowlock) union all
+ select Id, Name from Manager with (updlock, rowlock))
+as person";
+
+ var result = _appender.AppendLockHint(new SqlString(expectedQuery.Replace(MsSql2000LockHint, string.Empty)));
+ Assert.That(result.ToString(), Is.EqualTo(expectedQuery));
+ }
+ }
+}
@@ -438,13 +438,20 @@ private string FormatName(string name, DateTime? lastLoginDate)
return string.Format("User {0} logged in at {1}", name, lastLoginDate);
}
+
+ /// <summary>
+ /// This mimic classes in System.Data.Services.Internal.
+ /// </summary>
class ExpandedWrapper<TExpandedElement>
{
public TExpandedElement ExpandedElement { get; set; }
public string Description { get; set; }
public string ReferenceDescription { get; set; }
}
+ /// <summary>
+ /// This mimic classes in System.Data.Services.Internal.
+ /// </summary>
class ExpandedWrapper<TExpandedElement, TProperty0> : ExpandedWrapper<TExpandedElement>
{
public TProperty0 ProjectedProperty0 { get; set; }
@@ -1,7 +1,10 @@
using System;
+using System.Collections;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
+using NHibernate.Engine.Query;
using NHibernate.Linq;
using NHibernate.DomainModel.Northwind.Entities;
using NUnit.Framework;
@@ -440,6 +443,34 @@ where names.Contains(user.Name)
Assert.That(query.Count, Is.EqualTo(2));
}
+ [Test, Description("NH-3413")]
+ public void UsersWithListContains_MutatingListDoesNotBreakOtherSessions()
+ {
+ {
+ var names = new List<string> { "ayende", "rahien" };
+
+ var query = (from user in db.Users
+ where names.Contains(user.Name)
+ select user).ToList();
+
+ Assert.AreEqual(2, query.Count);
+
+ names.Clear();
+ }
+
+ {
+ var names = new List<string> { "ayende" };
+
+ var query = (from user in db.Users
+ where names.Contains(user.Name)
+ select user).ToList();
+
+ // This line fails with Expected: 1 But was: 0
+ // The SQL in NHProf shows that the where clause was executed as WHERE 1 = 0 as if names were empty
+ Assert.AreEqual(1, query.Count);
+ }
+ }
+
[Test]
public void UsersWithEmptyList_NH2400()
{
@@ -9,7 +9,7 @@ namespace NHibernate.Test.MappingByCode.IntegrationTests.NH3105
public class Fixture
{
[Test]
- public void CanMapComponentAsIdWhenComnponentIsDeclaredInBaseClass()
+ public void CanMapComponentAsIdWhenComponentIsDeclaredInBaseClass()
{
var mapper = new ModelMapper();
mapper.Class<Entity>(rc =>
@@ -48,7 +48,7 @@ public void CanMapIdWhenIdIsDeclaredInBaseClass()
}
[Test]
- public void CanMapComponentAsIdWhenComnponentIsDeclaredInClass()
+ public void CanMapComponentAsIdWhenComponentIsDeclaredInClass()
{
var mapper = new ModelMapper();
mapper.Class<EntityBase>(rc =>
@@ -39,5 +39,25 @@ public void UnmatchingColumns()
fk.ReferencedTable = primaryTable;
Assert.Throws<FKUnmatchingColumnsException>(() => fk.AlignColumns());
}
+
+ [Test]
+ public void ToStringDoesNotThrow()
+ {
+ var key = new ForeignKey
+ {
+ Table = new Table("TestTable"),
+ Name = "TestForeignKey"
+ };
+ key.AddColumn(new Column("TestColumn"));
+ key.AddReferencedColumns(new[] { new Column("ReferencedColumn") });
+
+ string toString = null;
+ Assert.DoesNotThrow(() =>
+ {
+ toString = key.ToString();
+ });
+
+ Assert.That(toString, Is.EqualTo("NHibernate.Mapping.ForeignKey(TestTableNHibernate.Mapping.Column(TestColumn) ref-columns:(NHibernate.Mapping.Column(ReferencedColumn)) as TestForeignKey"));
+ }
}
}
@@ -0,0 +1,10 @@
+using System;
+
+namespace NHibernate.Test.NHSpecificTest.NH2297
+{
+ public class CustomCompositeUserType
+ {
+ public virtual String Value1 { get; set; }
+ public virtual String Value2 { get; set; }
+ }
+}
@@ -0,0 +1,11 @@
+using System.Collections;
+
+namespace NHibernate.Test.NHSpecificTest.NH2297
+{
+ public class EntityNH2297
+ {
+ public virtual int Id { get; set; }
+
+ public virtual CustomCompositeUserType CustomTypeValue { get; set; }
+ }
+}
Oops, something went wrong.

0 comments on commit a70af4e

Please sign in to comment.