From: <fab...@us...> - 2009-06-14 21:03:16
|
Revision: 4469 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4469&view=rev Author: fabiomaulo Date: 2009-06-14 21:01:41 +0000 (Sun, 14 Jun 2009) Log Message: ----------- Refactoring with Breaking Change BRAKING CHANGE: - see IParameterizedType Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ResultSetMappingBinder.cs trunk/nhibernate/src/NHibernate/Mapping/SimpleValue.cs trunk/nhibernate/src/NHibernate/Type/CompositeCustomType.cs trunk/nhibernate/src/NHibernate/Type/CustomType.cs trunk/nhibernate/src/NHibernate/Type/TypeFactory.cs trunk/nhibernate/src/NHibernate/UserTypes/IParameterizedType.cs trunk/nhibernate/src/NHibernate.Test/TypeParameters/DefaultValueIntegerType.cs trunk/nhibernate/src/NHibernate.Test/UserCollection/Parameterized/DefaultableListType.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/releasenotes.txt 2009-06-14 21:01:41 UTC (rev 4469) @@ -31,6 +31,7 @@ * Obsolete ORACLE dialects was removed (new implementations are available) * ISQLExceptionConverter was changed in order to have more flexibility about information available for the conversion and followed management. * ADOException now use string instead SqlString + * IParameterizedType is using IDictionary<string, string> Build 2.1.0.Beta1 (rev4424) ============================= Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -1231,7 +1231,7 @@ { IType type; - IDictionary parameters = null; + IDictionary<string, string> parameters = null; XmlAttribute typeAttribute = node.Attributes["type"]; if (typeAttribute == null) @@ -1246,7 +1246,7 @@ return null; XmlAttribute nameAttribute = typeNode.Attributes["name"]; //we know it exists because the schema validate it typeName = nameAttribute.Value; - parameters = new Hashtable(); + parameters = new Dictionary<string, string>(); foreach (XmlNode childNode in typeNode.ChildNodes) parameters.Add(childNode.Attributes["name"].Value, childNode.InnerText.Trim()); Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ResultSetMappingBinder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ResultSetMappingBinder.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ResultSetMappingBinder.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -88,7 +88,7 @@ typeName = returnScalarSchema.type; } - IType type = TypeFactory.HeuristicType(typeName, (IDictionary) parameters); + IType type = TypeFactory.HeuristicType(typeName, parameters); if (type == null) throw new MappingException("could not interpret type: " + returnScalarSchema.type); Modified: trunk/nhibernate/src/NHibernate/Mapping/SimpleValue.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/SimpleValue.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Mapping/SimpleValue.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -228,7 +228,7 @@ { throw new MappingException("No type name specified"); } - type = TypeFactory.HeuristicType(typeName, (IDictionary)typeParameters); + type = TypeFactory.HeuristicType(typeName, typeParameters); if (type == null) { string msg = "Could not determine type for: " + typeName; Modified: trunk/nhibernate/src/NHibernate/Type/CompositeCustomType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/CompositeCustomType.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Type/CompositeCustomType.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -7,6 +7,7 @@ using NHibernate.Engine; using NHibernate.SqlTypes; using NHibernate.UserTypes; +using System.Collections.Generic; namespace NHibernate.Type { @@ -19,7 +20,7 @@ private readonly ICompositeUserType userType; private readonly string name; - public CompositeCustomType(System.Type userTypeClass, IDictionary parameters) + public CompositeCustomType(System.Type userTypeClass, IDictionary<string, string> parameters) { name = userTypeClass.FullName; Modified: trunk/nhibernate/src/NHibernate/Type/CustomType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/CustomType.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Type/CustomType.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -8,6 +8,7 @@ using NHibernate.SqlTypes; using NHibernate.UserTypes; using NHibernate.Util; +using System.Collections.Generic; namespace NHibernate.Type { @@ -28,7 +29,7 @@ get { return userType; } } - public CustomType(System.Type userTypeClass, IDictionary parameters) + public CustomType(System.Type userTypeClass, IDictionary<string, string> parameters) { name = userTypeClass.Name; Modified: trunk/nhibernate/src/NHibernate/Type/TypeFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/TypeFactory.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/Type/TypeFactory.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -363,7 +363,6 @@ return name + "(" + precision + ", " + scale + ")"; } - /// <summary> /// Uses heuristics to deduce a NHibernate type given a string naming the /// type. @@ -390,7 +389,7 @@ /// <param name="typeName">the type name</param> /// <param name="parameters">parameters for the type</param> /// <returns>An instance of <c>NHibernate.Type.IType</c></returns> - public static IType HeuristicType(string typeName, IDictionary parameters) + public static IType HeuristicType(string typeName, IDictionary<string, string> parameters) { IType type = Basic(typeName); @@ -1089,16 +1088,16 @@ CustomCollectionType result = new CustomCollectionType(typeClass, role, propertyRef, embedded); if (typeParameters != null) { - InjectParameters(result.UserType, (IDictionary)typeParameters); + InjectParameters(result.UserType, typeParameters); } return result; } - public static void InjectParameters(Object type, IDictionary parameters) + public static void InjectParameters(Object type, IDictionary<string, string> parameters) { if (type is IParameterizedType) { - ((IParameterizedType)type).SetParameterValues(parameters); + ((IParameterizedType) type).SetParameterValues(parameters); } else if (parameters != null && !(parameters.Count == 0)) { Modified: trunk/nhibernate/src/NHibernate/UserTypes/IParameterizedType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/UserTypes/IParameterizedType.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate/UserTypes/IParameterizedType.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -1,5 +1,4 @@ -using System; -using System.Collections; +using System.Collections.Generic; namespace NHibernate.UserTypes { @@ -14,6 +13,6 @@ /// Gets called by Hibernate to pass the configured type parameters to /// the implementation. /// </summary> - void SetParameterValues(IDictionary parameters); + void SetParameterValues(IDictionary<string, string> parameters); } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/TypeParameters/DefaultValueIntegerType.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypeParameters/DefaultValueIntegerType.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate.Test/TypeParameters/DefaultValueIntegerType.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -1,9 +1,9 @@ using System; -using System.Collections; using System.Data; using NHibernate.SqlTypes; using NHibernate.Type; using NHibernate.UserTypes; +using System.Collections.Generic; namespace NHibernate.Test.TypeParameters { @@ -12,9 +12,9 @@ private int defaultValue; private static NullableType _int32Type = NHibernateUtil.Int32; - public void SetParameterValues(IDictionary parameters) + public void SetParameterValues(IDictionary<string, string> parameters) { - defaultValue = int.Parse((string) parameters["default"]); + defaultValue = int.Parse(parameters["default"]); } #region IUserType Members Modified: trunk/nhibernate/src/NHibernate.Test/UserCollection/Parameterized/DefaultableListType.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/UserCollection/Parameterized/DefaultableListType.cs 2009-06-14 19:51:40 UTC (rev 4468) +++ trunk/nhibernate/src/NHibernate.Test/UserCollection/Parameterized/DefaultableListType.cs 2009-06-14 21:01:41 UTC (rev 4469) @@ -4,6 +4,7 @@ using NHibernate.Persister.Collection; using NHibernate.UserTypes; using System; +using System.Collections.Generic; namespace NHibernate.Test.UserCollection.Parameterized { @@ -68,9 +69,9 @@ #region Implementation of IParameterizedType - public void SetParameterValues(IDictionary parameters) + public void SetParameterValues(IDictionary<string, string> parameters) { - defaultValue = parameters["default"] as string; + defaultValue = parameters["default"]; } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |