Skip to content

Commit 1a55b31

Browse files
authored
Merge pull request #105 from peetw/update-nhibernate
Update NHibernate dependency
2 parents 3cde64e + 4bc46d4 commit 1a55b31

File tree

12 files changed

+67
-51
lines changed

12 files changed

+67
-51
lines changed

NHibernate.Spatial.MsSql/Type/SqlGeographyType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
5050
return Get(rs, rs.GetOrdinal(name), session);
5151
}
5252

53+
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
5354
public override string ToString(object value)
5455
{
5556
return value.ToString();
@@ -65,6 +66,7 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
6566
return (SqlGeography)rs[index];
6667
}
6768

69+
[Obsolete("This method has no more usages and will be removed in a future version.")]
6870
public override object FromStringValue(string xml)
6971
{
7072
return SqlGeography.STGeomFromText(new SqlChars(xml), 0);

NHibernate.Spatial.MsSql/Type/SqlGeometryType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
5050
return Get(rs, rs.GetOrdinal(name), session);
5151
}
5252

53+
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
5354
public override string ToString(object value)
5455
{
5556
return value.ToString();
@@ -65,6 +66,7 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
6566
return (SqlGeometry)rs[index];
6667
}
6768

69+
[Obsolete("This method has no more usages and will be removed in a future version.")]
6870
public override object FromStringValue(string xml)
6971
{
7072
return SqlGeometry.STGeomFromText(new SqlChars(xml), 0);

NHibernate.Spatial.MySQL/Type/MySQL57GeometryAdapterType.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
4848
return Get(rs, rs.GetOrdinal(name), session);
4949
}
5050

51-
public override string ToString(object value)
51+
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
52+
public override string ToString(object value)
5253
{
5354
return value.ToString();
5455
}
@@ -63,7 +64,8 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
6364
return new MySqlGeometry(MySqlDbType.Geometry, (byte[])rs[index]);
6465
}
6566

66-
public override object FromStringValue(string xml)
67+
[Obsolete("This method has no more usages and will be removed in a future version.")]
68+
public override object FromStringValue(string xml)
6769
{
6870
return MySqlGeometry.Parse(xml);
6971
}

NHibernate.Spatial.MySQL/Type/MySQLGeometryStringType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ public object StringToObject(string xml)
117117
/// </summary>
118118
/// <param name="value"></param>
119119
/// <returns></returns>
120+
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
120121
public override string ToString(object value)
121122
{
122123
return (string)value;
123124
}
124125

126+
[Obsolete("This method has no more usages and will be removed in a future version.")]
125127
public override object FromStringValue(string xml)
126128
{
127129
return xml;

NHibernate.Spatial.PostGis/Type/PostGisGeometryType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ public override object Get(DbDataReader rs, string name, ISessionImplementor ses
165165
return Get(rs, rs.GetOrdinal(name), session);
166166
}
167167

168+
[Obsolete("This method has no more usages and will be removed in a future version. Override ToLoggableString instead.")]
168169
public override string ToString(object val)
169170
{
170171
return PostGisGeometryType.ToString((byte[])val);
171172
}
172173

174+
[Obsolete("This method has no more usages and will be removed in a future version.")]
173175
public override object FromStringValue(string xml)
174176
{
175177
return ToByteArray(xml);

NHibernate.Spatial/NHibernate.Spatial.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="NetTopologySuite" Version="1.15.1" />
10-
<PackageReference Include="NHibernate" Version="[5.1, 5.2)" />
10+
<PackageReference Include="NHibernate" Version="5.2.4" />
1111
</ItemGroup>
1212

1313
</Project>

Tests.NHibernate.Spatial.MsSql2008/TestConfiguration.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1+
using NHibernate.Bytecode;
12
using NHibernate.Cfg;
23
using NHibernate.Driver;
34
using NHibernate.Spatial.Dialect;
45
using System.Collections.Generic;
5-
using Environment = NHibernate.Cfg.Environment;
6-
using NHibernateFactory = NHibernate.Bytecode.DefaultProxyFactoryFactory;
76

87
namespace Tests.NHibernate.Spatial
98
{
109
internal static class TestConfiguration
1110
{
1211
public static void Configure(Configuration configuration)
1312
{
14-
IDictionary<string, string> properties = new Dictionary<string, string>();
15-
properties[Environment.ProxyFactoryFactoryClass] = typeof(NHibernateFactory).AssemblyQualifiedName;
16-
properties[Environment.Dialect] = typeof(MsSql2008GeometryDialect).AssemblyQualifiedName;
17-
properties[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName;
18-
properties[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName;
19-
properties[Environment.ConnectionString] = System.Configuration.ConfigurationManager.ConnectionStrings["SqlServer2008"].ConnectionString;
13+
IDictionary<string, string> properties = new Dictionary<string, string>
14+
{
15+
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
16+
[Environment.Dialect] = typeof(MsSql2008GeometryDialect).AssemblyQualifiedName,
17+
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
18+
[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName,
19+
[Environment.ConnectionString] = System.Configuration.ConfigurationManager.ConnectionStrings["SqlServer2008"].ConnectionString
20+
};
2021
configuration.SetProperties(properties);
2122
}
2223
}

Tests.NHibernate.Spatial.MsSql2012/TestConfiguration.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1+
using NHibernate.Bytecode;
12
using NHibernate.Cfg;
23
using NHibernate.Driver;
34
using NHibernate.Spatial.Dialect;
45
using System.Collections.Generic;
5-
using Environment = NHibernate.Cfg.Environment;
6-
using NHibernateFactory = NHibernate.Bytecode.DefaultProxyFactoryFactory;
76

87
namespace Tests.NHibernate.Spatial
98
{
109
internal static class TestConfiguration
1110
{
1211
public static void Configure(Configuration configuration)
1312
{
14-
IDictionary<string, string> properties = new Dictionary<string, string>();
15-
properties[Environment.ProxyFactoryFactoryClass] = typeof(NHibernateFactory).AssemblyQualifiedName;
16-
properties[Environment.Dialect] = typeof(MsSql2012GeometryDialect).AssemblyQualifiedName;
17-
properties[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName;
18-
properties[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName;
19-
properties[Environment.ConnectionString] = System.Configuration.ConfigurationManager.ConnectionStrings["SqlServer2012"].ConnectionString;
13+
IDictionary<string, string> properties = new Dictionary<string, string>
14+
{
15+
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
16+
[Environment.Dialect] = typeof(MsSql2012GeometryDialect).AssemblyQualifiedName,
17+
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
18+
[Environment.ConnectionDriver] = typeof(SqlClientDriver).AssemblyQualifiedName,
19+
[Environment.ConnectionString] = System.Configuration.ConfigurationManager.ConnectionStrings["SqlServer2012"].ConnectionString
20+
};
2021
configuration.SetProperties(properties);
2122
}
2223
}

Tests.NHibernate.Spatial.MySQL/TestConfiguration.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using Microsoft.Extensions.Configuration;
2+
using NHibernate.Bytecode;
23
using NHibernate.Cfg;
34
using NHibernate.Driver;
45
using NHibernate.Spatial.Dialect;
56
using System.Collections.Generic;
6-
using Environment = NHibernate.Cfg.Environment;
7-
using NHibernateFactory = NHibernate.Bytecode.DefaultProxyFactoryFactory;
87

98
namespace Tests.NHibernate.Spatial
109
{
@@ -21,12 +20,14 @@ static TestConfiguration()
2120

2221
public static void Configure(Configuration configuration)
2322
{
24-
IDictionary<string, string> properties = new Dictionary<string, string>();
25-
properties[Environment.ProxyFactoryFactoryClass] = typeof(NHibernateFactory).AssemblyQualifiedName;
26-
properties[Environment.Dialect] = typeof(MySQLSpatialDialect).AssemblyQualifiedName;
27-
properties[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName;
28-
properties[Environment.ConnectionDriver] = typeof(MySqlDataDriver).AssemblyQualifiedName;
29-
properties[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MySQL");
23+
IDictionary<string, string> properties = new Dictionary<string, string>
24+
{
25+
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
26+
[Environment.Dialect] = typeof(MySQLSpatialDialect).AssemblyQualifiedName,
27+
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
28+
[Environment.ConnectionDriver] = typeof(MySqlDataDriver).AssemblyQualifiedName,
29+
[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MySQL")
30+
};
3031
configuration.SetProperties(properties);
3132
}
3233
}

Tests.NHibernate.Spatial.MySQL57/TestConfiguration.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using Microsoft.Extensions.Configuration;
2+
using NHibernate.Bytecode;
23
using NHibernate.Cfg;
34
using NHibernate.Driver;
45
using NHibernate.Spatial.Dialect;
56
using System.Collections.Generic;
6-
using Environment = NHibernate.Cfg.Environment;
7-
using NHibernateFactory = NHibernate.Bytecode.DefaultProxyFactoryFactory;
87

98
namespace Tests.NHibernate.Spatial
109
{
@@ -21,12 +20,14 @@ static TestConfiguration()
2120

2221
public static void Configure(Configuration configuration)
2322
{
24-
IDictionary<string, string> properties = new Dictionary<string, string>();
25-
properties[Environment.ProxyFactoryFactoryClass] = typeof(NHibernateFactory).AssemblyQualifiedName;
26-
properties[Environment.Dialect] = typeof(MySQL57SpatialDialect).AssemblyQualifiedName;
27-
properties[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName;
28-
properties[Environment.ConnectionDriver] = typeof(MySqlDataDriver).AssemblyQualifiedName;
29-
properties[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MySQL57");
23+
IDictionary<string, string> properties = new Dictionary<string, string>
24+
{
25+
[Environment.ProxyFactoryFactoryClass] = typeof(StaticProxyFactoryFactory).AssemblyQualifiedName,
26+
[Environment.Dialect] = typeof(MySQL57SpatialDialect).AssemblyQualifiedName,
27+
[Environment.ConnectionProvider] = typeof(DebugConnectionProvider).AssemblyQualifiedName,
28+
[Environment.ConnectionDriver] = typeof(MySqlDataDriver).AssemblyQualifiedName,
29+
[Environment.ConnectionString] = _configurationRoot.GetConnectionString("MySQL57")
30+
};
3031
configuration.SetProperties(properties);
3132
}
3233
}

0 commit comments

Comments
 (0)