From: <fab...@us...> - 2008-07-25 22:58:46
|
Revision: 3670 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3670&view=rev Author: fabiomaulo Date: 2008-07-25 22:58:54 +0000 (Fri, 25 Jul 2008) Log Message: ----------- - Update NUnit to 2.4.8 - Added forgotten test (NH1304) Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/nunit.core.dll trunk/nhibernate/lib/net/2.0/nunit.framework.dll trunk/nhibernate/lib/net/2.0/nunit.framework.license.txt trunk/nhibernate/src/NHibernate.Test/Assertions/HaveSerializableAttributeAsserter.cs trunk/nhibernate/src/NHibernate.Test/Assertions/InheritedAreMarkedSerializable.cs trunk/nhibernate/src/NHibernate.Test/Assertions/IsSerializable.cs trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Mappings.hbm.xml Modified: trunk/nhibernate/lib/net/2.0/nunit.framework.license.txt =================================================================== --- trunk/nhibernate/lib/net/2.0/nunit.framework.license.txt 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/lib/net/2.0/nunit.framework.license.txt 2008-07-25 22:58:54 UTC (rev 3670) @@ -1,5 +1,6 @@ -Copyright \xA9 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole -Copyright \xA9 2000-2003 Philip A. Craig +Copyright \xA9 2002-2007 Charlie Poole +Copyright \xA9 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright \xA9 2000-2002 Philip A. Craig This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. @@ -7,8 +8,8 @@ 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. -Portions Copyright \xA9 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole or Copyright \xA9 2000-2003 Philip A. Craig +Portions Copyright \xA9 2002-2007 Charlie Poole or Copyright \xA9 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright \xA9 2000-2002 Philip A. Craig 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. \ No newline at end of file +3. This notice may not be removed or altered from any source distribution. Modified: trunk/nhibernate/src/NHibernate.Test/Assertions/HaveSerializableAttributeAsserter.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Assertions/HaveSerializableAttributeAsserter.cs 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/src/NHibernate.Test/Assertions/HaveSerializableAttributeAsserter.cs 2008-07-25 22:58:54 UTC (rev 3670) @@ -30,9 +30,9 @@ get { if (clazz.IsInterface) - FailureMessage.AddLine(string.Format("The class {0} is an interface.", clazz.FullName)); + FailureMessage.WriteLine(string.Format("The class {0} is an interface.", clazz.FullName)); else - FailureMessage.AddLine(string.Format("The class {0} is not marked as Serializable.", clazz.FullName)); + FailureMessage.WriteLine(string.Format("The class {0} is not marked as Serializable.", clazz.FullName)); return FailureMessage.ToString(); } } Modified: trunk/nhibernate/src/NHibernate.Test/Assertions/InheritedAreMarkedSerializable.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Assertions/InheritedAreMarkedSerializable.cs 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/src/NHibernate.Test/Assertions/InheritedAreMarkedSerializable.cs 2008-07-25 22:58:54 UTC (rev 3670) @@ -25,7 +25,7 @@ object[] atts = tp.GetCustomAttributes(typeof(SerializableAttribute), false); if (atts.Length == 0) { - FailureMessage.AddLine(string.Format(" class {0} is not marked as Serializable", tp.FullName)); + FailureMessage.WriteLine(string.Format(" class {0} is not marked as Serializable", tp.FullName)); failedCount++; } } Modified: trunk/nhibernate/src/NHibernate.Test/Assertions/IsSerializable.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Assertions/IsSerializable.cs 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/src/NHibernate.Test/Assertions/IsSerializable.cs 2008-07-25 22:58:54 UTC (rev 3670) @@ -25,7 +25,7 @@ } catch (SerializationException e) { - FailureMessage.AddLine(string.Format("class {0} is not serializable: {1}", obj.GetType().FullName, e.Message)); + FailureMessage.WriteLine(string.Format("class {0} is not serializable: {1}", obj.GetType().FullName, e.Message)); result = false; } return result; Modified: trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/HQLFunctions.cs 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/HQLFunctions.cs 2008-07-25 22:58:54 UTC (rev 3670) @@ -534,13 +534,13 @@ hql = "select cast(a.BodyWeight as Double) from Animal a"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(1.3D, l[0]); + Assert.AreEqual(1.3f, l[0]); // Rendered in SELECT using a property in an operation with costant hql = "select cast(7+123-5*a.BodyWeight as Double) from Animal a"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(7D + 123D - 5D * 1.3D, l[0]); + Assert.AreEqual(7f + 123f - 5f * 1.3f, l[0]); // Rendered in SELECT using a property and nested functions hql = "select cast(cast(a.BodyWeight as string) as Double) from Animal a"; @@ -569,13 +569,13 @@ hql = "select cast(a.BodyWeight as Double) from Animal a group by cast(a.BodyWeight as Double)"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(1.3D, l[0]); + Assert.AreEqual(1.3f, l[0]); // Rendered in GROUP BY using a property in an operation with costant hql = "select cast(7+123-5*a.BodyWeight as Double) from Animal a group by cast(7+123-5*a.BodyWeight as Double)"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(7D + 123D - 5D * 1.3D, l[0]); + Assert.AreEqual(7f + 123f - 5f * 1.3f, l[0]); // Rendered in GROUP BY using a property and nested functions hql = "select cast(cast(a.BodyWeight as string) as Double) from Animal a group by cast(cast(a.BodyWeight as string) as Double)"; @@ -587,7 +587,7 @@ hql = "select cast(a.BodyWeight as Double) from Animal a group by cast(a.BodyWeight as Double) having cast(a.BodyWeight as Double)>0"; l = s.CreateQuery(hql).List(); Assert.AreEqual(1, l.Count); - Assert.AreEqual(1.3D, l[0]); + Assert.AreEqual(1.3f, l[0]); // Rendered in HAVING using a property in an operation with costants hql = "select cast(7+123.3-1*a.BodyWeight as int) from Animal a group by cast(7+123.3-1*a.BodyWeight as int) having cast(7+123.3-1*a.BodyWeight as int)>0"; Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Fixture.cs 2008-07-25 22:58:54 UTC (rev 3670) @@ -0,0 +1,28 @@ +using System.Text; +using log4net.Core; +using NHibernate.Tuple.Entity; +using NUnit.Framework; +namespace NHibernate.Test.NHSpecificTest.NH1304 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void BuildSessionFactory() + { + using (LogSpy ls = new LogSpy(typeof (AbstractEntityTuplizer))) + { + base.BuildSessionFactory(); + StringBuilder wholeMessage = new StringBuilder(); + foreach (LoggingEvent loggingEvent in ls.Appender.GetEvents()) + { + string singleMessage = loggingEvent.RenderedMessage; + if (singleMessage.IndexOf("AbstractEntityTuplizer") > 0) + Assert.Greater(singleMessage.IndexOf("No custom accessors found"), -1); + wholeMessage.Append(singleMessage); + } + string logs = wholeMessage.ToString(); + Assert.AreEqual(-1, logs.IndexOf("Custom accessors found")); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1304/Mappings.hbm.xml 2008-07-25 22:58:54 UTC (rev 3670) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + namespace="NHibernate.Test.NHSpecificTest.NH1304" + assembly="NHibernate.Test"> + + <class name="Funny"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="field" access="field"/> + <property name="FieldCamelcase" access="field.camelcase"/> + <property name="FieldCamelcaseUnderscore" access="field.camelcase-underscore"/> + <property name="FieldLowercase" access="field.lowercase"/> + <property name="FieldLowercaseUnderscore" access="field.lowercase-underscore"/> + <property name="FieldPascalcaseUnderscore" access="field.pascalcase-underscore"/> + <property name="FieldPascalcaseMUnderscore" access="field.pascalcase-m-underscore"/> + <property name="FieldPascalcaseM" access="field.pascalcase-m"/> + <property name="NosetterCamelcase" access="nosetter.camelcase"/> + <property name="NosetterCamelcaseUnderscore" access="nosetter.camelcase-underscore"/> + <property name="NosetterLowercase" access="nosetter.lowercase"/> + <property name="NosetterLowercaseUnderscore" access="nosetter.lowercase-underscore"/> + <property name="NosetterPascalcaseUnderscore" access="nosetter.pascalcase-underscore"/> + <property name="NosetterPascalcaseMUnderscore" access="nosetter.pascalcase-m-underscore"/> + <property name="NosetterPascalcase" access="nosetter.pascalcase-m"/> + </class> +</hibernate-mapping> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj 2008-07-25 19:46:18 UTC (rev 3669) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test-2.0.csproj 2008-07-25 22:58:54 UTC (rev 3670) @@ -382,6 +382,8 @@ <Compile Include="NHSpecificTest\NH1301\Fixture.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="NHSpecificTest\NH1304\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1304\Funny.cs" /> <Compile Include="NHSpecificTest\NH1313\A.cs" /> <Compile Include="NHSpecificTest\NH1313\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1324\Fixture.cs" /> @@ -1389,6 +1391,7 @@ <EmbeddedResource Include="Any\Person.hbm.xml" /> <EmbeddedResource Include="Any\Properties.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1304\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1408\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1393\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1394\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-10 12:31:21
|
Revision: 3830 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3830&view=rev Author: fabiomaulo Date: 2008-10-10 12:31:10 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Added methods to work with entity-name to ISession Possible Breaking change: - see ISession Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs trunk/nhibernate/src/NHibernate.sln Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/releasenotes.txt 2008-10-10 12:31:10 UTC (rev 3830) @@ -1,3 +1,9 @@ +Build 2.1.0.GA +======================== +** BREAKING CHANGES from NH2.0.xGA to NH2.1.0 + ##### Possible Breaking Changes for external frameworks ##### + * ISession interface have additional methods + Build 2.0.1.GA ======================== ** Bug Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -453,6 +453,17 @@ void Delete(object obj); /// <summary> + /// Remove a persistent instance from the datastore. The <b>object</b> argument may be + /// an instance associated with the receiving <see cref="ISession"/> or a transient + /// instance with an identifier associated with existing persistent state. + /// This operation cascades to associated instances if the association is mapped + /// with <tt>cascade="delete"</tt>. + /// </summary> + /// <param name="entityName">The entity name for the instance to be removed. </param> + /// <param name="obj">the instance to be removed </param> + void Delete(string entityName, object obj); + + /// <summary> /// Execute a query /// </summary> /// <param name="query">A query expressed in Hibernate's query language</param> @@ -716,8 +727,23 @@ /// <returns>An ICriteria object</returns> ICriteria CreateCriteria(System.Type persistentClass, string alias); + /// <summary> + /// Create a new <c>Criteria</c> instance, for the given entity name. + /// </summary> + /// <param name="entityName">The name of the entity to Query</param> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria(string entityName); /// <summary> + /// Create a new <c>Criteria</c> instance, for the given entity name, + /// with the given alias. + /// </summary> + /// <param name="entityName">The name of the entity to Query</param> + /// <param name="alias">The alias of the entity</param> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria(string entityName, string alias); + + /// <summary> /// Create a new instance of <c>Query</c> for the given query string /// </summary> /// <param name="queryString">A hibernate query string</param> Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -1476,6 +1476,18 @@ return new CriteriaImpl(persistentClass, alias, this); } + public ICriteria CreateCriteria(string entityName, string alias) + { + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, alias, this); + } + + public ICriteria CreateCriteria(string entityName) + { + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, this); + } + public override IList List(CriteriaImpl criteria) { ArrayList results = new ArrayList(); Modified: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -53,10 +53,10 @@ s = OpenSession(); t = s.BeginTransaction(); - //a = (XmlElement)s.CreateCriteria("A").UniqueResult(); + a = (XmlElement)s.CreateCriteria("A").UniqueResult(); Assert.AreEqual(a.GetElementsByTagName("b").Count, 2); Print(a); - //s.Delete("A", a); + s.Delete("A", a); t.Commit(); s.Close(); } Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate.sln 2008-10-10 12:31:10 UTC (rev 3830) @@ -3,6 +3,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{593DCEA7-C933-46F3-939F-D8172399AB05}" ProjectSection(SolutionItems) = preProject ..\default.build = ..\default.build + ..\releasenotes.txt = ..\releasenotes.txt EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate", "NHibernate\NHibernate.csproj", "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-11 13:00:10
|
Revision: 3842 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3842&view=rev Author: fabiomaulo Date: 2008-10-11 12:59:51 +0000 (Sat, 11 Oct 2008) Log Message: ----------- - Fix NH-1515 (BREAKING CHANGE) - Minor refactoring of proxy validation stuff Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs trunk/nhibernate/src/NHibernate/InvalidProxyTypeException.cs trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1408/DbResourceKey.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/releasenotes.txt 2008-10-11 12:59:51 UTC (rev 3842) @@ -4,6 +4,10 @@ ##### Possible Breaking Changes for external frameworks ##### * ISession interface have additional methods + ##### Initialization time ##### + * The ProxyTypeValidator check for "internal virtual" (to be proxied need "protected internal virtual") + + Build 2.0.1.GA ======================== ** Bug Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -25,6 +25,7 @@ using NHibernate.Tool.hbm2ddl; using NHibernate.Type; using NHibernate.Util; +using Array=System.Array; namespace NHibernate.Cfg { @@ -77,7 +78,7 @@ protected IDictionary<string, Mappings.TableDescription> tableNameBinding; protected IDictionary<Table, Mappings.ColumnNames> columnNameBindingPerTable; - private static readonly ILog log = LogManager.GetLogger(typeof(Configuration)); + private static readonly ILog log = LogManager.GetLogger(typeof (Configuration)); protected internal SettingsFactory settingsFactory; @@ -160,8 +161,7 @@ } } - [NonSerialized] - private IMapping mapping; + [NonSerialized] private IMapping mapping; protected Configuration(SettingsFactory settingsFactory) { @@ -183,10 +183,7 @@ /// <summary> /// Create a new Configuration object. /// </summary> - public Configuration() - : this(new SettingsFactory()) - { - } + public Configuration() : this(new SettingsFactory()) {} /// <summary> /// The class mappings @@ -260,7 +257,9 @@ private static void LogAndThrow(Exception exception) { if (log.IsErrorEnabled) + { log.Error(exception.Message, exception); + } throw exception; } @@ -393,7 +392,7 @@ try { - using (MemoryStream ms = new MemoryStream()) + using (var ms = new MemoryStream()) { doc.Save(ms); ms.Position = 0; @@ -425,7 +424,7 @@ // selects as their prefix in the document. It is the prefix we use to // build the XPath and the nsmgr takes care of translating our prefix into // the user defined prefix... - XmlNamespaceManager namespaceManager = new XmlNamespaceManager(doc.Document.NameTable); + var namespaceManager = new XmlNamespaceManager(doc.Document.NameTable); namespaceManager.AddNamespace(HbmConstants.nsPrefix, MappingSchemaXMLNS); Dialect.Dialect dialect = Dialect.Dialect.GetDialect(properties); @@ -446,26 +445,10 @@ /// </summary> public Mappings CreateMappings(Dialect.Dialect dialect) { - return new Mappings(classes, - collections, - tables, - namedQueries, - namedSqlQueries, - sqlResultSetMappings, - imports, - secondPasses, - propertyReferences, - namingStrategy, - typeDefs, - filterDefinitions, - extendsQueue, - auxiliaryDatabaseObjects, - tableNameBinding, - columnNameBindingPerTable, - defaultAssembly, - defaultNamespace, - dialect - ); + return new Mappings(classes, collections, tables, namedQueries, namedSqlQueries, sqlResultSetMappings, imports, + secondPasses, propertyReferences, namingStrategy, typeDefs, filterDefinitions, extendsQueue, + auxiliaryDatabaseObjects, tableNameBinding, columnNameBindingPerTable, defaultAssembly, + defaultNamespace, dialect); } /// <summary> @@ -555,7 +538,9 @@ finally { if (rsrc != null) + { rsrc.Close(); + } } } @@ -616,8 +601,8 @@ if (resourceNames.Count == 0) { log.Warn("No mapped documents found in assembly: " + assembly.FullName); - } - foreach (string name in resourceNames) + } + foreach (var name in resourceNames) { AddResource(name, assembly); } @@ -626,9 +611,9 @@ private static IList<string> GetAllHbmXmlResourceNames(Assembly assembly) { - List<string> result = new List<string>(); + var result = new List<string>(); - foreach (string resource in assembly.GetManifestResourceNames()) + foreach (var resource in assembly.GetManifestResourceNames()) { if (resource.EndsWith(".hbm.xml")) { @@ -646,12 +631,12 @@ /// <param name="dir">a directory</param> public Configuration AddDirectory(DirectoryInfo dir) { - foreach (DirectoryInfo subDirectory in dir.GetDirectories()) + foreach (var subDirectory in dir.GetDirectories()) { AddDirectory(subDirectory); } - foreach (FileInfo hbmXml in dir.GetFiles("*.hbm.xml")) + foreach (var hbmXml in dir.GetFiles("*.hbm.xml")) { AddFile(hbmXml); } @@ -670,7 +655,7 @@ string defaultCatalog = PropertiesHelper.GetString(Environment.DefaultCatalog, properties, null); string defaultSchema = PropertiesHelper.GetString(Environment.DefaultSchema, properties, null); - List<string> script = new List<string>(); + var script = new List<string>(); // drop them in reverse order in case db needs it done that way... for (int i = auxiliaryDatabaseObjects.Count - 1; i >= 0; i--) @@ -684,32 +669,36 @@ if (dialect.DropConstraints) { - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { if (table.IsPhysicalTable) { - foreach (ForeignKey fk in table.ForeignKeyIterator) + foreach (var fk in table.ForeignKeyIterator) { if (fk.HasPhysicalConstraint) + { script.Add(fk.SqlDropString(dialect, defaultCatalog, defaultSchema)); + } } } } } - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { if (table.IsPhysicalTable) + { script.Add(table.SqlDropString(dialect, defaultCatalog, defaultSchema)); + } } IEnumerable<IPersistentIdentifierGenerator> pIDg = IterateGenerators(dialect); - foreach (IPersistentIdentifierGenerator idGen in pIDg) + foreach (var idGen in pIDg) { string[] lines = idGen.SqlDropString(dialect); if (lines != null) { - foreach (string line in lines) + foreach (var line in lines) { script.Add(line); } @@ -730,9 +719,9 @@ string defaultCatalog = PropertiesHelper.GetString(Environment.DefaultCatalog, properties, null); string defaultSchema = PropertiesHelper.GetString(Environment.DefaultSchema, properties, null); - List<string> script = new List<string>(); + var script = new List<string>(); - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { if (table.IsPhysicalTable) { @@ -741,39 +730,47 @@ } } - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { if (table.IsPhysicalTable) { if (!dialect.SupportsUniqueConstraintInCreateAlterTable) { - foreach (UniqueKey uk in table.UniqueKeyIterator) + foreach (var uk in table.UniqueKeyIterator) { string constraintString = uk.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema); if (constraintString != null) + { script.Add(constraintString); + } } } - foreach (Index index in table.IndexIterator) + foreach (var index in table.IndexIterator) + { script.Add(index.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); + } if (dialect.HasAlterTable) { - foreach (ForeignKey fk in table.ForeignKeyIterator) + foreach (var fk in table.ForeignKeyIterator) { if (fk.HasPhysicalConstraint) + { script.Add(fk.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); + } } } } } IEnumerable<IPersistentIdentifierGenerator> pIDg = IterateGenerators(dialect); - foreach (IPersistentIdentifierGenerator idGen in pIDg) + foreach (var idGen in pIDg) + { script.AddRange(idGen.SqlCreateStrings(dialect)); + } - foreach (IAuxiliaryDatabaseObject auxDbObj in auxiliaryDatabaseObjects) + foreach (var auxDbObj in auxiliaryDatabaseObjects) { if (auxDbObj.AppliesToDialect(dialect)) { @@ -787,19 +784,19 @@ private void Validate() { bool validateProxy = PropertiesHelper.GetBoolean(Environment.UseProxyValidator, properties, true); - HashedSet allProxyErrors = null; + HashedSet<string> allProxyErrors = null; - foreach (PersistentClass clazz in classes.Values) + foreach (var clazz in classes.Values) { clazz.Validate(mapping); if (validateProxy) { - ICollection errors = ValidateProxyInterface(clazz); + ICollection<string> errors = ValidateProxyInterface(clazz); if (errors != null) { if (allProxyErrors == null) { - allProxyErrors = new HashedSet(errors); + allProxyErrors = new HashedSet<string>(errors); } else { @@ -814,13 +811,13 @@ throw new InvalidProxyTypeException(allProxyErrors); } - foreach (NHibernate.Mapping.Collection col in collections.Values) + foreach (var col in collections.Values) { col.Validate(mapping); } } - private static ICollection ValidateProxyInterface(PersistentClass persistentClass) + private static ICollection<string> ValidateProxyInterface(PersistentClass persistentClass) { if (!persistentClass.IsLazy) { @@ -857,7 +854,7 @@ log.Info("processing one-to-many association mappings"); - foreach (SecondPassCommand command in secondPasses) + foreach (var command in secondPasses) { command(classes); } @@ -866,7 +863,7 @@ log.Info("processing one-to-one association property references"); - foreach (Mappings.PropertyReference upr in propertyReferences) + foreach (var upr in propertyReferences) { PersistentClass clazz = GetClassMapping(upr.referencedClass); if (clazz == null) @@ -875,7 +872,7 @@ } Property prop = clazz.GetReferencedProperty(upr.propertyName); - ((SimpleValue)prop.Value).IsAlternateUniqueKey = true; + ((SimpleValue) prop.Value).IsAlternateUniqueKey = true; } //TODO: Somehow add the newly created foreign keys to the internal collection @@ -883,7 +880,7 @@ log.Info("processing foreign key constraints"); ISet done = new HashedSet(); - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { SecondPassCompileForeignKeys(table, done); } @@ -893,7 +890,7 @@ { table.CreateForeignKeys(); - foreach (ForeignKey fk in table.ForeignKeyIterator) + foreach (var fk in table.ForeignKeyIterator) { if (!done.Contains(fk)) { @@ -902,7 +899,8 @@ string referencedEntityName = fk.ReferencedEntityName; if (string.IsNullOrEmpty(referencedEntityName)) { - throw new MappingException(string.Format("An association from the table {0} does not specify the referenced entity", fk.Table.Name)); + throw new MappingException( + string.Format("An association from the table {0} does not specify the referenced entity", fk.Table.Name)); } if (log.IsDebugEnabled) @@ -913,8 +911,8 @@ PersistentClass referencedClass; if (!classes.TryGetValue(referencedEntityName, out referencedClass)) { - string message = string.Format("An association from the table {0} refers to an unmapped class: {1}", - fk.Table.Name, referencedEntityName); + string message = string.Format("An association from the table {0} refers to an unmapped class: {1}", fk.Table.Name, + referencedEntityName); LogAndThrow(new MappingException(message)); } @@ -962,11 +960,7 @@ /// located by specified id. This is mainly intended for EJB3 implementations to be able to /// control how proxy initialization errors should be handled... /// </remarks> - public IEntityNotFoundDelegate EntityNotFoundDelegate - { - get { return entityNotFoundDelegate; } - set { entityNotFoundDelegate = value; } - } + public IEntityNotFoundDelegate EntityNotFoundDelegate { get; set; } public EventListeners EventListeners { @@ -986,9 +980,10 @@ public ISessionFactory BuildSessionFactory() { #region Way for the user to specify their own ProxyFactory + //http://jira.nhibernate.org/browse/NH-975 - IInjectableProxyFactoryFactory ipff = Environment.BytecodeProvider as IInjectableProxyFactoryFactory; + var ipff = Environment.BytecodeProvider as IInjectableProxyFactoryFactory; string pffClassName; properties.TryGetValue(Environment.ProxyFactoryFactoryClass, out pffClassName); if (ipff != null && !string.IsNullOrEmpty(pffClassName)) @@ -1096,7 +1091,7 @@ /// </returns> public Configuration AddProperties(IDictionary<string, string> additionalProperties) { - foreach (KeyValuePair<string, string> de in additionalProperties) + foreach (var de in additionalProperties) { properties.Add(de.Key, de.Value); } @@ -1129,7 +1124,7 @@ private void AddProperties(IHibernateConfiguration hc) { - foreach (KeyValuePair<string, string> kvp in hc.SessionFactory.Properties) + foreach (var kvp in hc.SessionFactory.Properties) { if (log.IsDebugEnabled) { @@ -1157,7 +1152,7 @@ /// </remarks> public Configuration Configure() { - IHibernateConfiguration hc = ConfigurationManager.GetSection(CfgXmlHelper.CfgSectionName) as IHibernateConfiguration; + var hc = ConfigurationManager.GetSection(CfgXmlHelper.CfgSectionName) as IHibernateConfiguration; if (hc != null && hc.SessionFactory != null) { return DoConfigure(hc); @@ -1216,12 +1211,14 @@ public Configuration Configure(Assembly assembly, string resourceName) { if (assembly == null) - throw new HibernateException("Could not configure NHibernate.", - new ArgumentNullException("assembly")); + { + throw new HibernateException("Could not configure NHibernate.", new ArgumentNullException("assembly")); + } if (resourceName == null) - throw new HibernateException("Could not configure NHibernate.", - new ArgumentNullException("resourceName")); + { + throw new HibernateException("Could not configure NHibernate.", new ArgumentNullException("resourceName")); + } Stream stream = null; try @@ -1230,9 +1227,8 @@ if (stream == null) { // resource does not exist - throw appropriate exception - throw new HibernateException("A ManifestResourceStream could not be created for the resource " + - resourceName + - " in Assembly " + assembly.FullName); + throw new HibernateException("A ManifestResourceStream could not be created for the resource " + resourceName + + " in Assembly " + assembly.FullName); } return Configure(new XmlTextReader(stream)); @@ -1259,7 +1255,7 @@ if (textReader == null) { throw new HibernateConfigException("Could not configure NHibernate.", - new ArgumentException("A null value was passed in.", "textReader")); + new ArgumentException("A null value was passed in.", "textReader")); } try @@ -1286,10 +1282,12 @@ AddProperties(hc); // Load mappings - foreach (MappingConfiguration mc in hc.SessionFactory.Mappings) + foreach (var mc in hc.SessionFactory.Mappings) { if (mc.IsEmpty()) + { throw new HibernateConfigException("<mapping> element in configuration specifies no attributes"); + } if (!string.IsNullOrEmpty(mc.Resource)) { log.Debug(hc.SessionFactory.Name + "<-" + mc.Resource + " in " + mc.Assembly); @@ -1308,7 +1306,7 @@ } // Load class-cache - foreach (ClassCacheConfiguration ccc in hc.SessionFactory.ClassesCache) + foreach (var ccc in hc.SessionFactory.ClassesCache) { string region = string.IsNullOrEmpty(ccc.Region) ? ccc.Class : ccc.Region; bool includeLazy = (ccc.Include != ClassCacheInclude.NonLazy); @@ -1316,13 +1314,14 @@ } // Load collection-cache - foreach (CollectionCacheConfiguration ccc in hc.SessionFactory.CollectionsCache) + foreach (var ccc in hc.SessionFactory.CollectionsCache) { string role = ccc.Collection; NHibernate.Mapping.Collection collection = GetCollectionMapping(role); if (collection == null) { - throw new HibernateConfigException("collection-cache Configuration: Cannot configure cache for unknown collection role " + role); + throw new HibernateConfigException( + "collection-cache Configuration: Cannot configure cache for unknown collection role " + role); } string region = string.IsNullOrEmpty(ccc.Region) ? role : ccc.Region; @@ -1330,9 +1329,9 @@ } // Events - foreach (EventConfiguration ec in hc.SessionFactory.Events) + foreach (var ec in hc.SessionFactory.Events) { - string[] listenerClasses = new string[ec.Listeners.Count]; + var listenerClasses = new string[ec.Listeners.Count]; for (int i = 0; i < ec.Listeners.Count; i++) { listenerClasses[i] = ec.Listeners[i].Class; @@ -1341,10 +1340,10 @@ SetListeners(ec.Type, listenerClasses); } // Listeners - foreach (ListenerConfiguration lc in hc.SessionFactory.Listeners) + foreach (var lc in hc.SessionFactory.Listeners) { log.Debug("Event listener: " + lc.Type + "=" + lc.Class); - SetListeners(lc.Type, new string[] { lc.Class }); + SetListeners(lc.Type, new[] {lc.Class}); } if (!string.IsNullOrEmpty(hc.SessionFactory.Name)) @@ -1360,13 +1359,13 @@ { try { - return (RootClass)GetClassMapping(clazz); + return (RootClass) GetClassMapping(clazz); } catch (InvalidCastException) { throw new HibernateConfigException( - "class-cache Configuration: You may only specify a cache for root <class> mappings " - + "(cache was specified for " + clazz + ")"); + "class-cache Configuration: You may only specify a cache for root <class> mappings " + "(cache was specified for " + + clazz + ")"); } } @@ -1379,13 +1378,13 @@ throw new HibernateConfigException("class-cache Configuration: Cache specified for unmapped class " + clazz); } - RootClass rootClass = persistentClass as RootClass; + var rootClass = persistentClass as RootClass; if (rootClass == null) { throw new HibernateConfigException( - "class-cache Configuration: You may only specify a cache for root <class> mappings " - + "(cache was specified for " + clazz + ")"); + "class-cache Configuration: You may only specify a cache for root <class> mappings " + "(cache was specified for " + + clazz + ")"); } return rootClass; @@ -1417,7 +1416,6 @@ rootClass.SetLazyPropertiesCacheable(includeLazy); } - /// <summary> /// Set up a cache for a collection role /// </summary> @@ -1535,7 +1533,7 @@ try { - XmlDocument hbmDocument = new XmlDocument(); + var hbmDocument = new XmlDocument(); hbmDocument.Load(reader); return new NamedXmlDocument(name, hbmDocument); } @@ -1589,13 +1587,8 @@ private void ValidationHandler(object o, ValidationEventArgs args) { - string message = - string.Format( - "{0}({1},{2}): XML validation error: {3}", - currentDocumentName, - args.Exception.LineNumber, - args.Exception.LinePosition, - args.Exception.Message); + string message = string.Format("{0}({1},{2}): XML validation error: {3}", currentDocumentName, + args.Exception.LineNumber, args.Exception.LinePosition, args.Exception.Message); LogAndThrow(new MappingException(message, args.Exception)); } @@ -1610,7 +1603,6 @@ #endregion private XmlSchemas schemas; - private IEntityNotFoundDelegate entityNotFoundDelegate; private XmlSchemas Schemas { @@ -1639,8 +1631,7 @@ } else { - object[] listeners = - (object[])System.Array.CreateInstance(eventListeners.GetListenerClassFor(type), listenerClasses.Length); + var listeners = (object[]) Array.CreateInstance(eventListeners.GetListenerClassFor(type), listenerClasses.Length); for (int i = 0; i < listeners.Length; i++) { try @@ -1672,7 +1663,7 @@ } else { - object[] listeners = (object[])System.Array.CreateInstance(eventListeners.GetListenerClassFor(type), 1); + var listeners = (object[]) Array.CreateInstance(eventListeners.GetListenerClassFor(type), 1); listeners[0] = listener; SetListeners(type, listeners); } @@ -1683,106 +1674,106 @@ switch (type) { case ListenerType.Autoflush: - eventListeners.AutoFlushEventListeners = new IAutoFlushEventListener[] { }; + eventListeners.AutoFlushEventListeners = new IAutoFlushEventListener[] {}; break; case ListenerType.Merge: - eventListeners.MergeEventListeners = new IMergeEventListener[] { }; + eventListeners.MergeEventListeners = new IMergeEventListener[] {}; break; case ListenerType.Create: - eventListeners.PersistEventListeners = new IPersistEventListener[] { }; + eventListeners.PersistEventListeners = new IPersistEventListener[] {}; break; case ListenerType.CreateOnFlush: - eventListeners.PersistOnFlushEventListeners = new IPersistEventListener[] { }; + eventListeners.PersistOnFlushEventListeners = new IPersistEventListener[] {}; break; case ListenerType.Delete: - eventListeners.DeleteEventListeners = new IDeleteEventListener[] { }; + eventListeners.DeleteEventListeners = new IDeleteEventListener[] {}; break; case ListenerType.DirtyCheck: - eventListeners.DirtyCheckEventListeners = new IDirtyCheckEventListener[] { }; + eventListeners.DirtyCheckEventListeners = new IDirtyCheckEventListener[] {}; break; case ListenerType.Evict: - eventListeners.EvictEventListeners = new IEvictEventListener[] { }; + eventListeners.EvictEventListeners = new IEvictEventListener[] {}; break; case ListenerType.Flush: - eventListeners.FlushEventListeners = new IFlushEventListener[] { }; + eventListeners.FlushEventListeners = new IFlushEventListener[] {}; break; case ListenerType.FlushEntity: - eventListeners.FlushEntityEventListeners = new IFlushEntityEventListener[] { }; + eventListeners.FlushEntityEventListeners = new IFlushEntityEventListener[] {}; break; case ListenerType.Load: - eventListeners.LoadEventListeners = new ILoadEventListener[] { }; + eventListeners.LoadEventListeners = new ILoadEventListener[] {}; break; case ListenerType.LoadCollection: - eventListeners.InitializeCollectionEventListeners = new IInitializeCollectionEventListener[] { }; + eventListeners.InitializeCollectionEventListeners = new IInitializeCollectionEventListener[] {}; break; case ListenerType.Lock: - eventListeners.LockEventListeners = new ILockEventListener[] { }; + eventListeners.LockEventListeners = new ILockEventListener[] {}; break; case ListenerType.Refresh: - eventListeners.RefreshEventListeners = new IRefreshEventListener[] { }; + eventListeners.RefreshEventListeners = new IRefreshEventListener[] {}; break; case ListenerType.Replicate: - eventListeners.ReplicateEventListeners = new IReplicateEventListener[] { }; + eventListeners.ReplicateEventListeners = new IReplicateEventListener[] {}; break; case ListenerType.SaveUpdate: - eventListeners.SaveOrUpdateEventListeners = new ISaveOrUpdateEventListener[] { }; + eventListeners.SaveOrUpdateEventListeners = new ISaveOrUpdateEventListener[] {}; break; case ListenerType.Save: - eventListeners.SaveEventListeners = new ISaveOrUpdateEventListener[] { }; + eventListeners.SaveEventListeners = new ISaveOrUpdateEventListener[] {}; break; case ListenerType.PreUpdate: - eventListeners.PreUpdateEventListeners = new IPreUpdateEventListener[] { }; + eventListeners.PreUpdateEventListeners = new IPreUpdateEventListener[] {}; break; case ListenerType.Update: - eventListeners.UpdateEventListeners = new ISaveOrUpdateEventListener[] { }; + eventListeners.UpdateEventListeners = new ISaveOrUpdateEventListener[] {}; break; case ListenerType.PreLoad: - eventListeners.PreLoadEventListeners = new IPreLoadEventListener[] { }; + eventListeners.PreLoadEventListeners = new IPreLoadEventListener[] {}; break; case ListenerType.PreDelete: - eventListeners.PreDeleteEventListeners = new IPreDeleteEventListener[] { }; + eventListeners.PreDeleteEventListeners = new IPreDeleteEventListener[] {}; break; case ListenerType.PreInsert: - eventListeners.PreInsertEventListeners = new IPreInsertEventListener[] { }; + eventListeners.PreInsertEventListeners = new IPreInsertEventListener[] {}; break; case ListenerType.PostLoad: - eventListeners.PostLoadEventListeners = new IPostLoadEventListener[] { }; + eventListeners.PostLoadEventListeners = new IPostLoadEventListener[] {}; break; case ListenerType.PostInsert: - eventListeners.PostInsertEventListeners = new IPostInsertEventListener[] { }; + eventListeners.PostInsertEventListeners = new IPostInsertEventListener[] {}; break; case ListenerType.PostUpdate: - eventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] { }; + eventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] {}; break; case ListenerType.PostDelete: - eventListeners.PostDeleteEventListeners = new IPostDeleteEventListener[] { }; + eventListeners.PostDeleteEventListeners = new IPostDeleteEventListener[] {}; break; case ListenerType.PostCommitUpdate: - eventListeners.PostCommitUpdateEventListeners = new IPostUpdateEventListener[] { }; + eventListeners.PostCommitUpdateEventListeners = new IPostUpdateEventListener[] {}; break; case ListenerType.PostCommitInsert: - eventListeners.PostCommitInsertEventListeners = new IPostInsertEventListener[] { }; + eventListeners.PostCommitInsertEventListeners = new IPostInsertEventListener[] {}; break; case ListenerType.PostCommitDelete: - eventListeners.PostCommitDeleteEventListeners = new IPostDeleteEventListener[] { }; + eventListeners.PostCommitDeleteEventListeners = new IPostDeleteEventListener[] {}; break; case ListenerType.PreCollectionRecreate: - eventListeners.PreCollectionRecreateEventListeners = new IPreCollectionRecreateEventListener[] { }; + eventListeners.PreCollectionRecreateEventListeners = new IPreCollectionRecreateEventListener[] {}; break; case ListenerType.PreCollectionRemove: - eventListeners.PreCollectionRemoveEventListeners = new IPreCollectionRemoveEventListener[] { }; + eventListeners.PreCollectionRemoveEventListeners = new IPreCollectionRemoveEventListener[] {}; break; case ListenerType.PreCollectionUpdate: - eventListeners.PreCollectionUpdateEventListeners = new IPreCollectionUpdateEventListener[] { }; + eventListeners.PreCollectionUpdateEventListeners = new IPreCollectionUpdateEventListener[] {}; break; case ListenerType.PostCollectionRecreate: - eventListeners.PostCollectionRecreateEventListeners = new IPostCollectionRecreateEventListener[] { }; + eventListeners.PostCollectionRecreateEventListeners = new IPostCollectionRecreateEventListener[] {}; break; case ListenerType.PostCollectionRemove: - eventListeners.PostCollectionRemoveEventListeners = new IPostCollectionRemoveEventListener[] { }; + eventListeners.PostCollectionRemoveEventListeners = new IPostCollectionRemoveEventListener[] {}; break; case ListenerType.PostCollectionUpdate: - eventListeners.PostCollectionUpdateEventListeners = new IPostCollectionUpdateEventListener[] { }; + eventListeners.PostCollectionUpdateEventListeners = new IPostCollectionUpdateEventListener[] {}; break; default: log.Warn("Unrecognized listener type [" + type + "]"); @@ -1800,110 +1791,112 @@ public void SetListeners(ListenerType type, object[] listeners) { if (listeners == null) + { ClearListeners(type); + } switch (type) { case ListenerType.Autoflush: - eventListeners.AutoFlushEventListeners = (IAutoFlushEventListener[])listeners; + eventListeners.AutoFlushEventListeners = (IAutoFlushEventListener[]) listeners; break; case ListenerType.Merge: - eventListeners.MergeEventListeners = (IMergeEventListener[])listeners; + eventListeners.MergeEventListeners = (IMergeEventListener[]) listeners; break; case ListenerType.Create: - eventListeners.PersistEventListeners = (IPersistEventListener[])listeners; + eventListeners.PersistEventListeners = (IPersistEventListener[]) listeners; break; case ListenerType.CreateOnFlush: - eventListeners.PersistOnFlushEventListeners = (IPersistEventListener[])listeners; + eventListeners.PersistOnFlushEventListeners = (IPersistEventListener[]) listeners; break; case ListenerType.Delete: - eventListeners.DeleteEventListeners = (IDeleteEventListener[])listeners; + eventListeners.DeleteEventListeners = (IDeleteEventListener[]) listeners; break; case ListenerType.DirtyCheck: - eventListeners.DirtyCheckEventListeners = (IDirtyCheckEventListener[])listeners; + eventListeners.DirtyCheckEventListeners = (IDirtyCheckEventListener[]) listeners; break; case ListenerType.Evict: - eventListeners.EvictEventListeners = (IEvictEventListener[])listeners; + eventListeners.EvictEventListeners = (IEvictEventListener[]) listeners; break; case ListenerType.Flush: - eventListeners.FlushEventListeners = (IFlushEventListener[])listeners; + eventListeners.FlushEventListeners = (IFlushEventListener[]) listeners; break; case ListenerType.FlushEntity: - eventListeners.FlushEntityEventListeners = (IFlushEntityEventListener[])listeners; + eventListeners.FlushEntityEventListeners = (IFlushEntityEventListener[]) listeners; break; case ListenerType.Load: - eventListeners.LoadEventListeners = (ILoadEventListener[])listeners; + eventListeners.LoadEventListeners = (ILoadEventListener[]) listeners; break; case ListenerType.LoadCollection: - eventListeners.InitializeCollectionEventListeners = (IInitializeCollectionEventListener[])listeners; + eventListeners.InitializeCollectionEventListeners = (IInitializeCollectionEventListener[]) listeners; break; case ListenerType.Lock: - eventListeners.LockEventListeners = (ILockEventListener[])listeners; + eventListeners.LockEventListeners = (ILockEventListener[]) listeners; break; case ListenerType.Refresh: - eventListeners.RefreshEventListeners = (IRefreshEventListener[])listeners; + eventListeners.RefreshEventListeners = (IRefreshEventListener[]) listeners; break; case ListenerType.Replicate: - eventListeners.ReplicateEventListeners = (IReplicateEventListener[])listeners; + eventListeners.ReplicateEventListeners = (IReplicateEventListener[]) listeners; break; case ListenerType.SaveUpdate: - eventListeners.SaveOrUpdateEventListeners = (ISaveOrUpdateEventListener[])listeners; + eventListeners.SaveOrUpdateEventListeners = (ISaveOrUpdateEventListener[]) listeners; break; case ListenerType.Save: - eventListeners.SaveEventListeners = (ISaveOrUpdateEventListener[])listeners; + eventListeners.SaveEventListeners = (ISaveOrUpdateEventListener[]) listeners; break; case ListenerType.PreUpdate: - eventListeners.PreUpdateEventListeners = (IPreUpdateEventListener[])listeners; + eventListeners.PreUpdateEventListeners = (IPreUpdateEventListener[]) listeners; break; case ListenerType.Update: - eventListeners.UpdateEventListeners = (ISaveOrUpdateEventListener[])listeners; + eventListeners.UpdateEventListeners = (ISaveOrUpdateEventListener[]) listeners; break; case ListenerType.PreLoad: - eventListeners.PreLoadEventListeners = (IPreLoadEventListener[])listeners; + eventListeners.PreLoadEventListeners = (IPreLoadEventListener[]) listeners; break; case ListenerType.PreDelete: - eventListeners.PreDeleteEventListeners = (IPreDeleteEventListener[])listeners; + eventListeners.PreDeleteEventListeners = (IPreDeleteEventListener[]) listeners; break; case ListenerType.PreInsert: - eventListeners.PreInsertEventListeners = (IPreInsertEventListener[])listeners; + eventListeners.PreInsertEventListeners = (IPreInsertEventListener[]) listeners; break; case ListenerType.PostLoad: - eventListeners.PostLoadEventListeners = (IPostLoadEventListener[])listeners; + eventListeners.PostLoadEventListeners = (IPostLoadEventListener[]) listeners; break; case ListenerType.PostInsert: - eventListeners.PostInsertEventListeners = (IPostInsertEventListener[])listeners; + eventListeners.PostInsertEventListeners = (IPostInsertEventListener[]) listeners; break; case ListenerType.PostUpdate: - eventListeners.PostUpdateEventListeners = (IPostUpdateEventListener[])listeners; + eventListeners.PostUpdateEventListeners = (IPostUpdateEventListener[]) listeners; break; case ListenerType.PostDelete: - eventListeners.PostDeleteEventListeners = (IPostDeleteEventListener[])listeners; + eventListeners.PostDeleteEventListeners = (IPostDeleteEventListener[]) listeners; break; case ListenerType.PostCommitUpdate: - eventListeners.PostCommitUpdateEventListeners = (IPostUpdateEventListener[])listeners; + eventListeners.PostCommitUpdateEventListeners = (IPostUpdateEventListener[]) listeners; break; case ListenerType.PostCommitInsert: - eventListeners.PostCommitInsertEventListeners = (IPostInsertEventListener[])listeners; + eventListeners.PostCommitInsertEventListeners = (IPostInsertEventListener[]) listeners; break; case ListenerType.PostCommitDelete: - eventListeners.PostCommitDeleteEventListeners = (IPostDeleteEventListener[])listeners; + eventListeners.PostCommitDeleteEventListeners = (IPostDeleteEventListener[]) listeners; break; case ListenerType.PreCollectionRecreate: - eventListeners.PreCollectionRecreateEventListeners = (IPreCollectionRecreateEventListener[])listeners; + eventListeners.PreCollectionRecreateEventListeners = (IPreCollectionRecreateEventListener[]) listeners; break; case ListenerType.PreCollectionRemove: - eventListeners.PreCollectionRemoveEventListeners = (IPreCollectionRemoveEventListener[])listeners; + eventListeners.PreCollectionRemoveEventListeners = (IPreCollectionRemoveEventListener[]) listeners; break; case ListenerType.PreCollectionUpdate: - eventListeners.PreCollectionUpdateEventListeners = (IPreCollectionUpdateEventListener[])listeners; + eventListeners.PreCollectionUpdateEventListeners = (IPreCollectionUpdateEventListener[]) listeners; break; case ListenerType.PostCollectionRecreate: - eventListeners.PostCollectionRecreateEventListeners = (IPostCollectionRecreateEventListener[])listeners; + eventListeners.PostCollectionRecreateEventListeners = (IPostCollectionRecreateEventListener[]) listeners; break; case ListenerType.PostCollectionRemove: - eventListeners.PostCollectionRemoveEventListeners = (IPostCollectionRemoveEventListener[])listeners; + eventListeners.PostCollectionRemoveEventListeners = (IPostCollectionRemoveEventListener[]) listeners; break; case ListenerType.PostCollectionUpdate: - eventListeners.PostCollectionUpdateEventListeners = (IPostCollectionUpdateEventListener[])listeners; + eventListeners.PostCollectionUpdateEventListeners = (IPostCollectionUpdateEventListener[]) listeners; break; default: log.Warn("Unrecognized listener type [" + type + "]"); @@ -1922,13 +1915,13 @@ string defaultCatalog = PropertiesHelper.GetString(Environment.DefaultCatalog, properties, null); string defaultSchema = PropertiesHelper.GetString(Environment.DefaultSchema, properties, null); - List<string> script = new List<string>(50); - foreach (Table table in TableMappings) + var script = new List<string>(50); + foreach (var table in TableMappings) { if (table.IsPhysicalTable) { ITableMetadata tableInfo = databaseMetadata.GetTableMetadata(table.Name, table.Schema ?? defaultSchema, - table.Catalog ?? defaultCatalog, table.IsQuoted); + table.Catalog ?? defaultCatalog, table.IsQuoted); if (tableInfo == null) { script.Add(table.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); @@ -1941,27 +1934,26 @@ string[] comments = table.SqlCommentStrings(dialect, defaultCatalog, defaultSchema); script.AddRange(comments); - } } - foreach (Table table in TableMappings) + foreach (var table in TableMappings) { if (table.IsPhysicalTable) { - ITableMetadata tableInfo = - databaseMetadata.GetTableMetadata(table.Name, table.Schema, table.Catalog, table.IsQuoted); + ITableMetadata tableInfo = databaseMetadata.GetTableMetadata(table.Name, table.Schema, table.Catalog, + table.IsQuoted); if (dialect.HasAlterTable) { - foreach (ForeignKey fk in table.ForeignKeyIterator) + foreach (var fk in table.ForeignKeyIterator) { if (fk.HasPhysicalConstraint) { - bool create = tableInfo == null || ( - tableInfo.GetForeignKeyMetadata(fk.Name) == null && - (!(dialect is MySQLDialect) || tableInfo.GetIndexMetadata(fk.Name) == null) - ); + bool create = tableInfo == null + || + (tableInfo.GetForeignKeyMetadata(fk.Name) == null + && (!(dialect is MySQLDialect) || tableInfo.GetIndexMetadata(fk.Name) == null)); if (create) { script.Add(fk.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); @@ -1969,11 +1961,10 @@ } } } - } } - foreach (IPersistentIdentifierGenerator generator in IterateGenerators(dialect)) + foreach (var generator in IterateGenerators(dialect)) { string key = generator.GeneratorKey(); if (!databaseMetadata.IsSequence(key) && !databaseMetadata.IsTable(key)) @@ -1991,38 +1982,41 @@ private IEnumerable<IPersistentIdentifierGenerator> IterateGenerators(Dialect.Dialect dialect) { - Dictionary<string, IPersistentIdentifierGenerator> generators = - new Dictionary<string, IPersistentIdentifierGenerator>(); + var generators = new Dictionary<string, IPersistentIdentifierGenerator>(); string defaultCatalog = PropertiesHelper.GetString(Environment.DefaultCatalog, properties, null); string defaultSchema = PropertiesHelper.GetString(Environment.DefaultSchema, properties, null); - foreach (PersistentClass pc in classes.Values) + foreach (var pc in classes.Values) { if (!pc.IsInherited) { - IPersistentIdentifierGenerator ig = - pc.Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, (RootClass)pc) as + var ig = + pc.Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, (RootClass) pc) as IPersistentIdentifierGenerator; if (ig != null) + { generators[ig.GeneratorKey()] = ig; + } } } - foreach (NHibernate.Mapping.Collection collection in collections.Values) + foreach (var collection in collections.Values) { if (collection.IsIdentified) { - IPersistentIdentifierGenerator ig = - ((IdentifierCollection)collection).Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, - null) as IPersistentIdentifierGenerator; + var ig = + ((IdentifierCollection) collection).Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, + null) as IPersistentIdentifierGenerator; if (ig != null) + { generators[ig.GeneratorKey()] = ig; + } } } return generators.Values; } } -} +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/InvalidProxyTypeException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/InvalidProxyTypeException.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate/InvalidProxyTypeException.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -3,6 +3,7 @@ using System.Runtime.Serialization; using System.Security.Permissions; using System.Text; +using System.Collections.Generic; namespace NHibernate { @@ -14,22 +15,17 @@ [Serializable] public class InvalidProxyTypeException : MappingException { - private ICollection errors; - - public InvalidProxyTypeException(ICollection errors) + public InvalidProxyTypeException(ICollection<string> errors) : base(FormatMessage(errors)) { - this.errors = errors; + Errors = errors; } - public ICollection Errors - { - get { return errors; } - } + public ICollection<string> Errors { get; private set; } - private static string FormatMessage(ICollection errors) + private static string FormatMessage(IEnumerable<string> errors) { - StringBuilder result = new StringBuilder("The following types may not be used as proxies:"); + var result = new StringBuilder("The following types may not be used as proxies:"); foreach (string error in errors) { result.Append('\n').Append(error); @@ -42,7 +38,7 @@ public InvalidProxyTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { - this.errors = (ICollection) info.GetValue("errors", typeof(ICollection)); + Errors = (ICollection<string>)info.GetValue("errors", typeof(ICollection)); } [SecurityPermission(SecurityAction.LinkDemand, @@ -50,7 +46,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); - info.AddValue("errors", errors, typeof(ICollection)); + info.AddValue("errors", Errors, typeof(ICollection)); } #endregion Modified: trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -1,6 +1,5 @@ -using System; using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; using System.Reflection; using NHibernate.Util; @@ -8,9 +7,7 @@ { public class ProxyTypeValidator { - private ProxyTypeValidator() - { - } + private ProxyTypeValidator() {} /// <summary> /// Validates whether <paramref name="type"/> can be specified as the base class @@ -20,9 +17,9 @@ /// A collection of errors, if any, or <see langword="null" /> if none were found. /// </returns> /// <param name="type">The type to validate.</param> - public static ICollection ValidateType(System.Type type) + public static ICollection<string> ValidateType(System.Type type) { - StringCollection errors = new StringCollection(); + var errors = new List<string>(); if (type.IsInterface) { @@ -60,7 +57,7 @@ { if (member is PropertyInfo) { - PropertyInfo property = (PropertyInfo) member; + var property = (PropertyInfo) member; MethodInfo[] accessors = property.GetAccessors(false); foreach (MethodInfo accessor in accessors) @@ -70,8 +67,7 @@ } else if (member is MethodInfo) { - if (member.DeclaringType == typeof(object) - && member.Name == "GetType") + if (member.DeclaringType == typeof (object) && member.Name == "GetType") { // object.GetType is ignored continue; @@ -80,7 +76,7 @@ } else if (member is FieldInfo) { - FieldInfo memberField = (FieldInfo) member; + var memberField = (FieldInfo) member; if (memberField.IsPublic || memberField.IsAssembly || memberField.IsFamilyOrAssembly) { Error(errors, type, "field " + member.Name + " should not be public nor internal"); @@ -91,12 +87,12 @@ private static void CheckMethodIsVirtual(System.Type type, MethodInfo method, IList errors) { - if (method.DeclaringType != typeof(object) && !IsDisposeMethod(method) && - method.IsPublic || method.IsAssembly || method.IsFamilyOrAssembly) + if (method.DeclaringType != typeof (object) && !IsDisposeMethod(method) && method.IsPublic || method.IsAssembly + || method.IsFamilyOrAssembly) { - if (!method.IsVirtual || method.IsFinal) + if (!method.IsVirtual || method.IsFinal || (method.IsVirtual && method.IsAssembly)) { - Error(errors, type, "method " + method.Name + " should be virtual"); + Error(errors, type, "method " + method.Name + " should be 'public/protected virtual' or 'protected internal virtual'"); } } } @@ -108,12 +104,11 @@ private static bool HasVisibleDefaultConstructor(System.Type type) { - ConstructorInfo constructor = type.GetConstructor( - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, - null, System.Type.EmptyTypes, null); + ConstructorInfo constructor = + type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, + System.Type.EmptyTypes, null); - return constructor != null - && !constructor.IsPrivate; + return constructor != null && !constructor.IsPrivate; } private static void CheckNotSealed(System.Type type, IList errors) @@ -124,4 +119,4 @@ } } } -} +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -92,8 +92,7 @@ // determine the id getter and setter methods from the proxy interface (if any) // determine all interfaces needed by the resulting proxy - HashedSet<System.Type> proxyInterfaces = new HashedSet<System.Type>(); - proxyInterfaces.Add(typeof(INHibernateProxy)); + var proxyInterfaces = new HashedSet<System.Type> {typeof (INHibernateProxy)}; System.Type _mappedClass = persistentClass.MappedClass; System.Type _proxyInterface = persistentClass.ProxyInterface; @@ -167,20 +166,18 @@ private static void LogPropertyAccessorsErrors(PersistentClass persistentClass) { // This method work when Environment.UseProxyValidator is off - System.Type clazz = persistentClass.MappedClass; foreach (Mapping.Property property in persistentClass.PropertyIterator) { MethodInfo method = property.GetGetter(clazz).Method; - // In NET if IsVirtual is false or IsFinal is true, then the method cannot be overridden. - if (method != null && (!method.IsVirtual || method.IsFinal)) + if (ShouldLogError(method)) { log.Error( string.Format("Getters of lazy classes cannot be final: {0}.{1}", persistentClass.MappedClass.FullName, property.Name)); } method = property.GetSetter(clazz).Method; - if (method != null && (!method.IsVirtual || method.IsFinal)) + if (ShouldLogError(method)) { log.Error( string.Format("Setters of lazy classes cannot be final: {0}.{1}", persistentClass.MappedClass.FullName, @@ -189,6 +186,12 @@ } } + private static bool ShouldLogError(MethodBase method) + { + // In NET if IsVirtual is false or IsFinal is true, then the method cannot be overridden. + return method != null && (!method.IsVirtual || method.IsFinal || (method.IsVirtual && method.IsAssembly)); + } + protected virtual IProxyFactory BuildProxyFactoryInternal(PersistentClass @class, IGetter getter, ISetter setter) { return Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.BuildProxyFactory(); @@ -284,7 +287,7 @@ public override EntityMode EntityMode { - get { return NHibernate.EntityMode.Poco; } + get { return EntityMode.Poco; } } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1408/DbResourceKey.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1408/DbResourceKey.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1408/DbResourceKey.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -31,7 +31,7 @@ public virtual DbResource Resource { get { return resource; } - internal set { resource = value; } + protected internal set { resource = value; } } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -1,8 +1,8 @@ using System; -using System.Collections; using NHibernate.Proxy; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; +using System.Collections.Generic; namespace NHibernate.Test.NHSpecificTest.NH1464 { @@ -61,7 +61,7 @@ [Test] public void NoExceptionForDispose() { - ICollection errs = ProxyTypeValidator.ValidateType(typeof (CPPMimic)); + ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof (CPPMimic)); Assert.That(errs, Is.Null); errs = ProxyTypeValidator.ValidateType(typeof(Another)); Assert.That(errs, Is.Null); Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using NHibernate.Proxy; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; + +namespace NHibernate.Test.NHSpecificTest.NH1515 +{ + [TestFixture] + public class Fixture + { + public class ClassWithInternal + { + internal virtual void DoSomething() {} + } + + public class ClassWithInternalProperty + { + internal virtual string DoSomething { get; set; } + } + + [Test] + public void NoExceptionForMethod() + { + ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof(ClassWithInternal)); + Assert.That(errs, Is.Not.Null); + Assert.That(errs.Count, Is.EqualTo(1)); + } + + [Test] + public void NoExceptionForProperty() + { + ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof(ClassWithInternalProperty)); + Assert.That(errs, Is.Not.Null); + Assert.That(errs.Count, Is.EqualTo(2)); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs 2008-10-11 12:59:51 UTC (rev 3842) @@ -2,6 +2,7 @@ using System.Collections; using NHibernate.Proxy; using NUnit.Framework; +using System.Collections.Generic; namespace NHibernate.Test.NHSpecificTest.ProxyValidator { @@ -10,7 +11,7 @@ { private void Validate(System.Type type) { - ICollection errors = ProxyTypeValidator.ValidateType(type); + ICollection<string> errors = ProxyTypeValidator.ValidateType(type); if (errors != null) { throw new InvalidProxyTypeException(errors); Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-11 05:54:37 UTC (rev 3841) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-10-11 12:59:51 UTC (rev 3842) @@ -507,6 +507,7 @@ <Compile Include="NHSpecificTest\NH1508\Document.cs" /> <Compile Include="NHSpecificTest\NH1508\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1508\Person.cs" /> + <Compile Include="NHSpecificTest\NH1515\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Foo.cs" /> <Compile Include="NHSpecificTest\NH1018\Employee.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-11 17:17:19
|
Revision: 3844 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3844&view=rev Author: fabiomaulo Date: 2008-10-11 17:17:10 +0000 (Sat, 11 Oct 2008) Log Message: ----------- - proxy validation responsibility moved to IProxyFactoryFactory trough IProxyValidator - Rename DefaultProxyFactoryFactory to Castle.ProxyFactoryFactory - some Minor changes - Actualized BREAKING CHANGES in releasenotes.txt Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs trunk/nhibernate/src/NHibernate/Cfg/Environment.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CustomProxyFixture.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate/Bytecode/Castle/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs trunk/nhibernate/src/NHibernate/Proxy/IProxyValidator.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Bytecode/Castle/DefaultProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/releasenotes.txt 2008-10-11 17:17:10 UTC (rev 3844) @@ -3,10 +3,11 @@ ** BREAKING CHANGES from NH2.0.xGA to NH2.1.0 ##### Possible Breaking Changes for external frameworks ##### * ISession interface have additional methods - * DefaultProxyFactoryFactory moved to NHibernate.Bytecode.Castle + * DefaultProxyFactoryFactory moved to NHibernate.Bytecode.Castle.ProxyFactoryFactory + * IProxyFactoryFactory now provide the IProxyValidator implementation ##### Initialization time ##### - * The ProxyTypeValidator check for "internal virtual" (to be proxied need "protected internal virtual") + * The ProxyValidator check for "internal virtual" (to be intercepted by proxy need "protected internal virtual") Build 2.0.1.GA Deleted: trunk/nhibernate/src/NHibernate/Bytecode/Castle/DefaultProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/Castle/DefaultProxyFactoryFactory.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Bytecode/Castle/DefaultProxyFactoryFactory.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -1,17 +0,0 @@ -using NHibernate.Proxy; -using NHibernate.Proxy.Poco.Castle; - -namespace NHibernate.Bytecode.Castle -{ - public class DefaultProxyFactoryFactory : IProxyFactoryFactory - { - #region IProxyFactoryFactory Members - - public IProxyFactory BuildProxyFactory() - { - return new CastleProxyFactory(); - } - - #endregion - } -} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate/Bytecode/Castle/ProxyFactoryFactory.cs (from rev 3841, trunk/nhibernate/src/NHibernate/Bytecode/Castle/DefaultProxyFactoryFactory.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/Castle/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Bytecode/Castle/ProxyFactoryFactory.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -0,0 +1,22 @@ +using NHibernate.Proxy; +using NHibernate.Proxy.Poco.Castle; + +namespace NHibernate.Bytecode.Castle +{ + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new CastleProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Bytecode/IProxyFactoryFactory.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -6,7 +6,7 @@ /// An interface for factories of <see cref="IProxyFactory">proxy factory</see> instances. /// </summary> /// <remarks> - /// Currently used to abstract from the tupizer even if... + /// Used to abstract from the tupizer. /// </remarks> public interface IProxyFactoryFactory { @@ -16,6 +16,7 @@ /// </summary> /// <returns> The lazy-load proxy factory. </returns> IProxyFactory BuildProxyFactory(); + /* /// <summary> Build a proxy factory for basic proxy concerns. The return /// should be capable of properly handling newInstance() calls. @@ -27,14 +28,13 @@ /// Must pass in either superClass or interfaces (or both). /// /// </summary> - /// <param name="superClass">The abstract super class (or null if none). - /// </param> - /// <param name="interfaces">Interfaces to be proxied (or null if none). - /// </param> - /// <returns> The proxy class - /// </returns> + /// <param name="superClass">The abstract super class (or null if none).</param> + /// <param name="interfaces">Interfaces to be proxied (or null if none).</param> + /// <returns> The proxy class</returns> // TODO: H3.2 - //BasicProxyFactory buildBasicProxyFactory(System.Type superClass, System.Type[] interfaces); - */ + //BasicProxyFactory BuildBasicProxyFactory(System.Type superClass, System.Type[] interfaces); + */ + + IProxyValidator ProxyValidator { get; } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -785,13 +785,14 @@ { bool validateProxy = PropertiesHelper.GetBoolean(Environment.UseProxyValidator, properties, true); HashedSet<string> allProxyErrors = null; + IProxyValidator pvalidator = Environment.BytecodeProvider.ProxyFactoryFactory.ProxyValidator; foreach (var clazz in classes.Values) { clazz.Validate(mapping); if (validateProxy) { - ICollection<string> errors = ValidateProxyInterface(clazz); + ICollection<string> errors = ValidateProxyInterface(clazz, pvalidator); if (errors != null) { if (allProxyErrors == null) @@ -817,7 +818,7 @@ } } - private static ICollection<string> ValidateProxyInterface(PersistentClass persistentClass) + private static ICollection<string> ValidateProxyInterface(PersistentClass persistentClass, IProxyValidator validator) { if (!persistentClass.IsLazy) { @@ -831,7 +832,7 @@ return null; } - return ProxyTypeValidator.ValidateType(persistentClass.ProxyInterface); + return validator.ValidateType(persistentClass.ProxyInterface); } /// <summary> Modified: trunk/nhibernate/src/NHibernate/Cfg/Environment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Configuration; using System.Reflection; @@ -194,7 +193,7 @@ private static void SetDefaultProxyFactoryFactory() { // maitaining the optionality of set the proxyfactory.factory_class property - GlobalProperties[ProxyFactoryFactoryClass] = "NHibernate.Bytecode.Castle.DefaultProxyFactoryFactory, NHibernate"; + GlobalProperties[ProxyFactoryFactoryClass] = "NHibernate.Bytecode.Castle.ProxyFactoryFactory, NHibernate"; } private static void LoadGlobalPropertiesFromAppConfig() Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-10-11 17:17:10 UTC (rev 3844) @@ -303,7 +303,7 @@ <Compile Include="Proxy\IProxyFactory.cs" /> <Compile Include="Proxy\AbstractLazyInitializer.cs" /> <Compile Include="Proxy\NHibernateProxyHelper.cs" /> - <Compile Include="Proxy\ProxyTypeValidator.cs" /> + <Compile Include="Proxy\DynProxyTypeValidator.cs" /> <Compile Include="QueryException.cs" /> <Compile Include="ReplicationMode.cs" /> <Compile Include="SqlCommand\Alias.cs" /> @@ -452,7 +452,7 @@ <Compile Include="AdoNet\TooManyRowsAffectedException.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> - <Compile Include="Bytecode\Castle\DefaultProxyFactoryFactory.cs" /> + <Compile Include="Bytecode\Castle\ProxyFactoryFactory.cs" /> <Compile Include="Bytecode\IAccessOptimizer.cs" /> <Compile Include="Bytecode\IBytecodeProvider.cs" /> <Compile Include="Bytecode\IInjectableProxyFactoryFactory.cs" /> @@ -830,6 +830,7 @@ <Compile Include="Properties\IndexPropertyAccessor.cs" /> <Compile Include="Properties\MapAccessor.cs" /> <Compile Include="Properties\NoopAccessor.cs" /> + <Compile Include="Proxy\IProxyValidator.cs" /> <Compile Include="Proxy\IEntityNotFoundDelegate.cs" /> <Compile Include="Proxy\ILazyInitializer.cs" /> <Compile Include="Proxy\Map\MapLazyInitializer.cs" /> Copied: trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs (from rev 3842, trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -0,0 +1,123 @@ +using System.Collections.Generic; +using System.Reflection; +using NHibernate.Util; + +namespace NHibernate.Proxy +{ + public class DynProxyTypeValidator : IProxyValidator + { + private readonly List<string> errors = new List<string>(); + + /// <summary> + /// Validates whether <paramref name="type"/> can be specified as the base class + /// (or an interface) for a dynamically-generated proxy. + /// </summary> + /// <param name="type">The type to validate.</param> + /// <returns> + /// A collection of errors messages, if any, or <see langword="null" /> if none were found. + /// </returns> + public ICollection<string> ValidateType(System.Type type) + { + errors.Clear(); + if (type.IsInterface) + { + // Any interface is valid as a proxy + return null; + } + CheckHasVisibleDefaultConstructor(type); + CheckAccessibleMembersAreVirtual(type); + CheckNotSealed(type); + return errors.Count > 0 ? errors : null; + } + + protected void EnlistError(System.Type type, string text) + { + errors.Add(string.Format("{0}: {1}", type, text)); + } + + protected virtual void CheckHasVisibleDefaultConstructor(System.Type type) + { + if (!HasVisibleDefaultConstructor(type)) + { + EnlistError(type, "type should have a visible (public or protected) no-argument constructor"); + } + } + + protected virtual void CheckAccessibleMembersAreVirtual(System.Type type) + { + MemberInfo[] members = type.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + + foreach (var member in members) + { + if (member is PropertyInfo) + { + var property = (PropertyInfo) member; + MethodInfo[] accessors = property.GetAccessors(false); + + if (accessors != null) + { + foreach (var accessor in accessors) + { + CheckMethodIsVirtual(type, accessor); + } + } + } + else if (member is MethodInfo) + { + if (member.DeclaringType == typeof (object) && member.Name == "GetType") + { + // object.GetType is ignored + continue; + } + CheckMethodIsVirtual(type, (MethodInfo) member); + } + else if (member is FieldInfo) + { + var memberField = (FieldInfo) member; + if (memberField.IsPublic || memberField.IsAssembly || memberField.IsFamilyOrAssembly) + { + EnlistError(type, "field " + member.Name + " should not be public nor internal"); + } + } + } + } + + protected virtual void CheckMethodIsVirtual(System.Type type, MethodInfo method) + { + if (!IsProxeable(method)) + { + EnlistError(type, "method " + method.Name + " should be 'public/protected virtual' or 'protected internal virtual'"); + } + } + + public virtual bool IsProxeable(MethodInfo method) + { + // In NET if IsVirtual is false or IsFinal is true, then the method cannot be overridden. + return !(method.DeclaringType != typeof (object) && !IsDisposeMethod(method) + && (method.IsPublic || method.IsAssembly || method.IsFamilyOrAssembly) + && (!method.IsVirtual || method.IsFinal || (method.IsVirtual && method.IsAssembly))); + } + + protected static bool IsDisposeMethod(MethodBase method) + { + return method.Name.Equals("Dispose") && method.MemberType == MemberTypes.Method && method.GetParameters().Length == 0; + } + + protected virtual bool HasVisibleDefaultConstructor(System.Type type) + { + ConstructorInfo constructor = + type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, + System.Type.EmptyTypes, null); + + return constructor != null && !constructor.IsPrivate; + } + + protected void CheckNotSealed(System.Type type) + { + if (ReflectHelper.IsFinalClass(type)) + { + EnlistError(type, "type should not be sealed"); + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate/Proxy/DynProxyTypeValidator.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/nhibernate/src/NHibernate/Proxy/IProxyValidator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/IProxyValidator.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Proxy/IProxyValidator.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Reflection; + +namespace NHibernate.Proxy +{ + /// <summary> + /// Proxeability validator. + /// </summary> + public interface IProxyValidator + { + /// <summary> + /// Validates whether <paramref name="type"/> can be specified as the base class + /// (or an interface) for a dynamically-generated proxy. + /// </summary> + /// <param name="type">The type to validate.</param> + /// <returns> + /// A collection of errors messages, if any, or <see langword="null" /> if none were found. + /// </returns> + /// <remarks> + /// When the configuration property "use_proxy_validator" is set to true(default), the result of this method + /// is used to throw a detailed exception about the proxeability of the given <paramref name="type"/>. + /// </remarks> + ICollection<string> ValidateType(System.Type type); + + /// <summary> + /// Validate if a single method can be intercepted by proxy. + /// </summary> + /// <param name="method">The given method to check.</param> + /// <returns><see langword="true"/> if the method can be intercepted by proxy. + /// <see langword="false"/> otherwise. + /// </returns> + /// <remarks> + /// This method can be used internally by the <see cref="ValidateType"/> and is used + /// by <see cref="NHibernate.Tuple.Entity.PocoEntityTuplizer"/> to log errors when + /// a property accessor can't be intercepted by proxy. + /// The validation of property accessors is fairly enough if you ecampsulate each property. + /// </remarks> + bool IsProxeable(MethodInfo method); + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -77,7 +77,7 @@ { return Identifier; } - else if (methodName == "Finalize") + else if (methodName == "Dispose") { return null; } Deleted: trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Proxy/ProxyTypeValidator.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -1,122 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using NHibernate.Util; - -namespace NHibernate.Proxy -{ - public class ProxyTypeValidator - { - private ProxyTypeValidator() {} - - /// <summary> - /// Validates whether <paramref name="type"/> can be specified as the base class - /// (or an interface) for a dynamically-generated proxy. - /// </summary> - /// <returns> - /// A collection of errors, if any, or <see langword="null" /> if none were found. - /// </returns> - /// <param name="type">The type to validate.</param> - public static ICollection<string> ValidateType(System.Type type) - { - var errors = new List<string>(); - - if (type.IsInterface) - { - // Any interface is valid as a proxy - return null; - } - CheckHasVisibleDefaultConstructor(type, errors); - CheckAccessibleMembersAreVirtual(type, errors); - CheckNotSealed(type, errors); - if (errors.Count > 0) - { - return errors; - } - return null; - } - - private static void Error(IList errors, System.Type type, string text) - { - errors.Add(string.Format("{0}: {1}", type, text)); - } - - private static void CheckHasVisibleDefaultConstructor(System.Type type, IList errors) - { - if (!HasVisibleDefaultConstructor(type)) - { - Error(errors, type, "type should have a visible (public or protected) no-argument constructor"); - } - } - - private static void CheckAccessibleMembersAreVirtual(System.Type type, IList errors) - { - MemberInfo[] members = type.GetMembers(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - - foreach (MemberInfo member in members) - { - if (member is PropertyInfo) - { - var property = (PropertyInfo) member; - MethodInfo[] accessors = property.GetAccessors(false); - - foreach (MethodInfo accessor in accessors) - { - CheckMethodIsVirtual(type, accessor, errors); - } - } - else if (member is MethodInfo) - { - if (member.DeclaringType == typeof (object) && member.Name == "GetType") - { - // object.GetType is ignored - continue; - } - CheckMethodIsVirtual(type, (MethodInfo) member, errors); - } - else if (member is FieldInfo) - { - var memberField = (FieldInfo) member; - if (memberField.IsPublic || memberField.IsAssembly || memberField.IsFamilyOrAssembly) - { - Error(errors, type, "field " + member.Name + " should not be public nor internal"); - } - } - } - } - - private static void CheckMethodIsVirtual(System.Type type, MethodInfo method, IList errors) - { - if (method.DeclaringType != typeof (object) && !IsDisposeMethod(method) && method.IsPublic || method.IsAssembly - || method.IsFamilyOrAssembly) - { - if (!method.IsVirtual || method.IsFinal || (method.IsVirtual && method.IsAssembly)) - { - Error(errors, type, "method " + method.Name + " should be 'public/protected virtual' or 'protected internal virtual'"); - } - } - } - - private static bool IsDisposeMethod(MethodBase method) - { - return method.Name.Equals("Dispose") && method.MemberType == MemberTypes.Method && method.GetParameters().Length == 0; - } - - private static bool HasVisibleDefaultConstructor(System.Type type) - { - ConstructorInfo constructor = - type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, - System.Type.EmptyTypes, null); - - return constructor != null && !constructor.IsPrivate; - } - - private static void CheckNotSealed(System.Type type, IList errors) - { - if (ReflectHelper.IsFinalClass(type)) - { - Error(errors, type, "type should not be sealed"); - } - } - } -} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -23,6 +23,7 @@ private readonly bool isValidatableImplementor; private readonly HashedSet<string> lazyPropertyNames = new HashedSet<string>(); private readonly IReflectionOptimizer optimizer; + private readonly IProxyValidator proxyValidator; public PocoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) : base(entityMetamodel, mappedEntity) @@ -46,6 +47,8 @@ { optimizer = Cfg.Environment.BytecodeProvider.GetReflectionOptimizer(mappedClass, getters, setters); } + + proxyValidator = Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.ProxyValidator; } public override System.Type ConcreteProxyClass @@ -163,21 +166,26 @@ return pf; } - private static void LogPropertyAccessorsErrors(PersistentClass persistentClass) + private void LogPropertyAccessorsErrors(PersistentClass persistentClass) { + if (proxyValidator == null) + { + return; + } + // This method work when Environment.UseProxyValidator is off System.Type clazz = persistentClass.MappedClass; foreach (Mapping.Property property in persistentClass.PropertyIterator) { MethodInfo method = property.GetGetter(clazz).Method; - if (ShouldLogError(method)) + if (!proxyValidator.IsProxeable(method)) { log.Error( string.Format("Getters of lazy classes cannot be final: {0}.{1}", persistentClass.MappedClass.FullName, property.Name)); } method = property.GetSetter(clazz).Method; - if (ShouldLogError(method)) + if (!proxyValidator.IsProxeable(method)) { log.Error( string.Format("Setters of lazy classes cannot be final: {0}.{1}", persistentClass.MappedClass.FullName, @@ -186,12 +194,6 @@ } } - private static bool ShouldLogError(MethodBase method) - { - // In NET if IsVirtual is false or IsFinal is true, then the method cannot be overridden. - return method != null && (!method.IsVirtual || method.IsFinal || (method.IsVirtual && method.IsAssembly)); - } - protected virtual IProxyFactory BuildProxyFactoryInternal(PersistentClass @class, IGetter getter, ISetter setter) { return Cfg.Environment.BytecodeProvider.ProxyFactoryFactory.BuildProxyFactory(); Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -9,6 +9,8 @@ [TestFixture] public class Fixture { + private readonly IProxyValidator pv = new DynProxyTypeValidator(); + public class CPPMimicBase { public virtual void Dispose() @@ -61,11 +63,11 @@ [Test] public void NoExceptionForDispose() { - ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof (CPPMimic)); + ICollection<string> errs = pv.ValidateType(typeof (CPPMimic)); Assert.That(errs, Is.Null); - errs = ProxyTypeValidator.ValidateType(typeof(Another)); + errs = pv.ValidateType(typeof(Another)); Assert.That(errs, Is.Null); - errs = ProxyTypeValidator.ValidateType(typeof(OneMore)); + errs = pv.ValidateType(typeof(OneMore)); Assert.That(errs.Count, Is.EqualTo(1)); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -8,6 +8,8 @@ [TestFixture] public class Fixture { + private readonly IProxyValidator pv = new DynProxyTypeValidator(); + public class ClassWithInternal { internal virtual void DoSomething() {} @@ -21,7 +23,7 @@ [Test] public void NoExceptionForMethod() { - ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof(ClassWithInternal)); + ICollection<string> errs = pv.ValidateType(typeof(ClassWithInternal)); Assert.That(errs, Is.Not.Null); Assert.That(errs.Count, Is.EqualTo(1)); } @@ -29,7 +31,7 @@ [Test] public void NoExceptionForProperty() { - ICollection<string> errs = ProxyTypeValidator.ValidateType(typeof(ClassWithInternalProperty)); + ICollection<string> errs = pv.ValidateType(typeof(ClassWithInternalProperty)); Assert.That(errs, Is.Not.Null); Assert.That(errs.Count, Is.EqualTo(2)); } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -1,5 +1,4 @@ using System; -using System.Collections; using NHibernate.Proxy; using NUnit.Framework; using System.Collections.Generic; @@ -9,9 +8,11 @@ [TestFixture] public class Fixture { + private readonly IProxyValidator pv = new DynProxyTypeValidator(); + private void Validate(System.Type type) { - ICollection<string> errors = ProxyTypeValidator.ValidateType(type); + ICollection<string> errors = pv.ValidateType(type); if (errors != null) { throw new InvalidProxyTypeException(errors); Modified: trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CustomProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CustomProxyFixture.cs 2008-10-11 13:09:53 UTC (rev 3843) +++ trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CustomProxyFixture.cs 2008-10-11 17:17:10 UTC (rev 3844) @@ -72,6 +72,11 @@ return new DataBindingProxyFactory(); } + public IProxyValidator ProxyValidator + { + get { return new DynProxyTypeValidator(); } + } + #endregion } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-10-11 21:37:37
|
Revision: 3849 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3849&view=rev Author: fabiomaulo Date: 2008-10-11 21:37:31 +0000 (Sat, 11 Oct 2008) Log Message: ----------- Fixed file version number (because OrderedSet) and actualized common lib Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/Iesi.Collections.dll trunk/nhibernate/lib/net/2.0/Iesi.Collections.xml trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.build Modified: trunk/nhibernate/lib/net/2.0/Iesi.Collections.xml =================================================================== --- trunk/nhibernate/lib/net/2.0/Iesi.Collections.xml 2008-10-11 21:22:21 UTC (rev 3848) +++ trunk/nhibernate/lib/net/2.0/Iesi.Collections.xml 2008-10-11 21:37:31 UTC (rev 3849) @@ -152,42 +152,42 @@ </member> <member name="M:Iesi.Collections.Generic.ISet`1.ContainsAll(System.Collections.Generic.ICollection{`0})"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.ISet`1.Add(`0)"> <summary> Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.Generic.ISet`1.AddAll(System.Collections.Generic.ICollection{`0})"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.Generic.ISet`1.RemoveAll(System.Collections.Generic.ICollection{`0})"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.ISet`1.RetainAll(System.Collections.Generic.ICollection{`0})"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="P:Iesi.Collections.Generic.ISet`1.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="T:Iesi.Collections.ISet"> @@ -274,52 +274,52 @@ </member> <member name="M:Iesi.Collections.ISet.Contains(System.Object)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.ISet.ContainsAll(System.Collections.ICollection)"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.ISet.Add(System.Object)"> <summary> Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.ISet.AddAll(System.Collections.ICollection)"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.ISet.Remove(System.Object)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.ISet.RemoveAll(System.Collections.ICollection)"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.ISet.RetainAll(System.Collections.ICollection)"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.ISet.Clear"> <summary> @@ -328,7 +328,7 @@ </member> <member name="P:Iesi.Collections.ISet.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="M:Iesi.Collections.Generic.Set`1.Union(Iesi.Collections.Generic.ISet{`0})"> @@ -346,23 +346,23 @@ <summary> Performs a "union" of two sets, where all the elements in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. - The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <c>null</c>) with elements of the other set + The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set added in. Neither of the input sets is modified by the operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the union of the input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.op_BitwiseOr(Iesi.Collections.Generic.Set{`0},Iesi.Collections.Generic.Set{`0})"> <summary> Performs a "union" of two sets, where all the elements in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. - The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <c>null</c>) with elements of the other set + The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set added in. Neither of the input sets is modified by the operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the union of the input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Intersect(Iesi.Collections.Generic.ISet{`0})"> <summary> @@ -379,24 +379,24 @@ Performs an "intersection" of the two sets, where only the elements that are present in both sets remain. That is, the element is included only if it exists in both <c>a</c> and <c>b</c>. Neither input object is modified by the operation. - The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <c>null</c>) containing the + The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <see langword="null" />) containing the elements from the intersect operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>The intersection of the two input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>The intersection of the two input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.op_BitwiseAnd(Iesi.Collections.Generic.Set{`0},Iesi.Collections.Generic.Set{`0})"> <summary> Performs an "intersection" of the two sets, where only the elements that are present in both sets remain. That is, the element is included only if it exists in both <c>a</c> and <c>b</c>. Neither input object is modified by the operation. - The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <c>null</c>) containing the + The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <see langword="null" />) containing the elements from the intersect operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>The intersection of the two input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>The intersection of the two input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Minus(Iesi.Collections.Generic.ISet{`0})"> <summary> @@ -417,7 +417,7 @@ </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing <c>A - B</c> elements. <c>null</c> if <c>a</c> is <c>null</c>.</returns> + <returns>A set containing <c>A - B</c> elements. <see langword="null" /> if <c>a</c> is <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.op_Subtraction(Iesi.Collections.Generic.Set{`0},Iesi.Collections.Generic.Set{`0})"> <summary> @@ -428,7 +428,7 @@ </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing <c>A - B</c> elements. <c>null</c> if <c>a</c> is <c>null</c>.</returns> + <returns>A set containing <c>A - B</c> elements. <see langword="null" /> if <c>a</c> is <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.ExclusiveOr(Iesi.Collections.Generic.ISet{`0})"> <summary> @@ -445,38 +445,38 @@ Performs an "exclusive-or" of the two sets, keeping only the elements that are in one of the sets, but not in both. The original sets are not modified during this operation. The result set is a <c>Clone()</c> of one of the sets - (<c>a</c> if it is not <c>null</c>) containing + (<c>a</c> if it is not <see langword="null" />) containing the elements from the exclusive-or operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the result of <c>a ^ b</c>. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.op_ExclusiveOr(Iesi.Collections.Generic.Set{`0},Iesi.Collections.Generic.Set{`0})"> <summary> Performs an "exclusive-or" of the two sets, keeping only the elements that are in one of the sets, but not in both. The original sets are not modified during this operation. The result set is a <c>Clone()</c> of one of the sets - (<c>a</c> if it is not <c>null</c>) containing + (<c>a</c> if it is not <see langword="null" />) containing the elements from the exclusive-or operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the result of <c>a ^ b</c>. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Add(`0)"> <summary> Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.AddAll(System.Collections.Generic.ICollection{`0})"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Clear"> <summary> @@ -485,38 +485,38 @@ </member> <member name="M:Iesi.Collections.Generic.Set`1.Contains(`0)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.ContainsAll(System.Collections.Generic.ICollection{`0})"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Remove(`0)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.RemoveAll(System.Collections.Generic.ICollection{`0})"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.RetainAll(System.Collections.Generic.ICollection{`0})"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.Set`1.Clone"> <summary> @@ -576,7 +576,7 @@ </member> <member name="P:Iesi.Collections.Generic.Set`1.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.Generic.Set`1.Count"> @@ -586,7 +586,7 @@ </member> <member name="P:Iesi.Collections.Generic.Set`1.IsSynchronized"> <summary> - Returns <c>true</c> if the <c>Set</c> is synchronized across threads. Note that + Returns <see langword="true" /> if the <c>Set</c> is synchronized across threads. Note that enumeration is inherently not thread-safe. Use the <c>SyncRoot</c> to lock the object during enumeration. </summary> @@ -603,7 +603,7 @@ Indicates whether the given instance is read-only or not </summary> <value> - <c>true</c> if the ISet is read-only; otherwise, <c>false</c>. + <see langword="true" /> if the ISet is read-only; otherwise, <see langword="false" />. In the default implementation of Set, this property always returns false. </value> </member> @@ -619,14 +619,14 @@ Adds the specified element to this set if it is not already present. </summary> <param name="o">The <typeparamref name="T"/> to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.AddAll(System.Collections.Generic.ICollection{`0})"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.Clear"> <summary> @@ -635,38 +635,38 @@ </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.Contains(`0)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.ContainsAll(System.Collections.Generic.ICollection{`0})"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.Remove(`0)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.RemoveAll(System.Collections.Generic.ICollection{`0})"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.RetainAll(System.Collections.Generic.ICollection{`0})"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.DictionarySet`1.CopyTo(`0[],System.Int32)"> <summary> @@ -701,7 +701,7 @@ </member> <member name="P:Iesi.Collections.Generic.DictionarySet`1.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.Generic.DictionarySet`1.Count"> @@ -784,17 +784,17 @@ </member> <member name="M:Iesi.Collections.Generic.ImmutableSet`1.Contains(`0)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.ImmutableSet`1.ContainsAll(System.Collections.Generic.ICollection{`0})"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.ImmutableSet`1.Remove(`0)"> <summary> @@ -918,7 +918,7 @@ </member> <member name="P:Iesi.Collections.Generic.ImmutableSet`1.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.Generic.ImmutableSet`1.Count"> @@ -941,6 +941,22 @@ Indicates that the given instance is read-only </summary> </member> + <member name="T:Iesi.Collections.Generic.OrderedSet`1"> + <summary> + Implements an ordered <c>Set</c> based on a dictionary. + </summary> + </member> + <member name="M:Iesi.Collections.Generic.OrderedSet`1.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Iesi.Collections.Generic.OrderedSet`1"/> class. + </summary> + </member> + <member name="M:Iesi.Collections.Generic.OrderedSet`1.#ctor(System.Collections.Generic.ICollection{`0})"> + <summary> + Initializes a new instance of the <see cref="T:Iesi.Collections.Generic.OrderedSet`1"/> class. + </summary> + <param name="initialValues">A collection of elements that defines the initial set contents.</param> + </member> <member name="T:Iesi.Collections.Generic.SortedSet`1"> <summary> Implements a <c>Set</c> based on a sorted tree. This gives good performance for operations on very @@ -1001,14 +1017,14 @@ Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.AddAll(System.Collections.Generic.ICollection{`0})"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.Clear"> <summary> @@ -1017,38 +1033,38 @@ </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.Contains(`0)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.ContainsAll(System.Collections.Generic.ICollection{`0})"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.Remove(`0)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.RemoveAll(System.Collections.Generic.ICollection{`0})"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.RetainAll(System.Collections.Generic.ICollection{`0})"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Generic.SynchronizedSet`1.CopyTo(`0[],System.Int32)"> <summary> @@ -1080,7 +1096,7 @@ </member> <member name="P:Iesi.Collections.Generic.SynchronizedSet`1.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.Generic.SynchronizedSet`1.Count"> @@ -1090,7 +1106,7 @@ </member> <member name="P:Iesi.Collections.Generic.SynchronizedSet`1.IsSynchronized"> <summary> - Returns <c>true</c>, indicating that this object is thread-safe. The exception to this + Returns <see langword="true" />, indicating that this object is thread-safe. The exception to this is enumeration, which is inherently not thread-safe. Use the <c>SyncRoot</c> object to lock this object for the entire duration of the enumeration. </summary> @@ -1125,15 +1141,22 @@ </summary> </member> <member name="T:Iesi.Collections.Set"> - <summary><p>A collection that contains no duplicate elements. This class models the mathematical - <c>Set</c> abstraction, and is the base class for all other <c>Set</c> implementations. - The order of elements in a set is dependant on (a)the data-structure implementation, and - (b)the implementation of the various <c>Set</c> methods, and thus is not guaranteed.</p> - - <p>None of the <c>Set</c> implementations in this library are guranteed to be thread-safe - in any way unless wrapped in a <c>SynchronizedSet</c>.</p> - - <p>The following table summarizes the binary operators that are supported by the <c>Set</c> class.</p> + <summary>A collection that contains no duplicate elements.</summary> + <remarks> + <para> + This class models the mathematical set abstraction, and is the base class for all + other set implementations. The order of elements in a set is dependant on + (a) the data-structure implementation, and (b) the implementation of the various + methods, and thus is not guaranteed. + </para> + <para> + None of the <see cref="T:Iesi.Collections.ISet"/> implementations in this library are guranteed to be thread-safe + in any way unless wrapped in a <see cref="T:Iesi.Collections.SynchronizedSet"/>. + </para> + <para> + The following table summarizes the binary operators that are supported by the <see cref="T:Iesi.Collections.ISet"/> + type. + </para> <list type="table"> <listheader> <term>Operation</term> @@ -1167,40 +1190,40 @@ <term><c>-</c></term> </item> </list> - </summary> + </remarks> </member> <member name="M:Iesi.Collections.Set.Union(Iesi.Collections.ISet)"> <summary> Performs a "union" of the two sets, where all the elements in both sets are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. Neither this set nor the input set are modified during the operation. The return value - is a <c>Clone()</c> of this set with the extra elements added in. + is a clone of this set with the extra elements added in. </summary> <param name="a">A collection of elements.</param> - <returns>A new <c>Set</c> containing the union of this <c>Set</c> with the specified collection. + <returns>A new <see cref="T:Iesi.Collections.ISet"/> instance containing the union of this instance with the specified collection. Neither of the input objects is modified by the union.</returns> </member> <member name="M:Iesi.Collections.Set.Union(Iesi.Collections.ISet,Iesi.Collections.ISet)"> <summary> Performs a "union" of two sets, where all the elements in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. - The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <c>null</c>) with elements of the other set + The return value is a clone of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set added in. Neither of the input sets is modified by the operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the union of the input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.op_BitwiseOr(Iesi.Collections.Set,Iesi.Collections.Set)"> <summary> Performs a "union" of two sets, where all the elements in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. - The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <c>null</c>) with elements of the other set + The return value is a clone of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set added in. Neither of the input sets is modified by the operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the union of the input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.Intersect(Iesi.Collections.ISet)"> <summary> @@ -1217,24 +1240,24 @@ Performs an "intersection" of the two sets, where only the elements that are present in both sets remain. That is, the element is included only if it exists in both <c>a</c> and <c>b</c>. Neither input object is modified by the operation. - The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <c>null</c>) containing the + The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <see langword="null" />) containing the elements from the intersect operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>The intersection of the two input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>The intersection of the two input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.op_BitwiseAnd(Iesi.Collections.Set,Iesi.Collections.Set)"> <summary> Performs an "intersection" of the two sets, where only the elements that are present in both sets remain. That is, the element is included only if it exists in both <c>a</c> and <c>b</c>. Neither input object is modified by the operation. - The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <c>null</c>) containing the + The result object is a <c>Clone()</c> of one of the input objects (<c>a</c> if it is not <see langword="null" />) containing the elements from the intersect operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>The intersection of the two input sets. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>The intersection of the two input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.Minus(Iesi.Collections.ISet)"> <summary> @@ -1255,7 +1278,7 @@ </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing <c>A - B</c> elements. <c>null</c> if <c>a</c> is <c>null</c>.</returns> + <returns>A set containing <c>A - B</c> elements. <see langword="null" /> if <c>a</c> is <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.op_Subtraction(Iesi.Collections.Set,Iesi.Collections.Set)"> <summary> @@ -1266,13 +1289,13 @@ </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing <c>A - B</c> elements. <c>null</c> if <c>a</c> is <c>null</c>.</returns> + <returns>A set containing <c>A - B</c> elements. <see langword="null" /> if <c>a</c> is <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.ExclusiveOr(Iesi.Collections.ISet)"> <summary> Performs an "exclusive-or" of the two sets, keeping only the elements that are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a <c>Clone()</c> of this set containing + during this operation. The result set is a clone of this set containing the elements from the exclusive-or operation. </summary> <param name="a">A set of elements.</param> @@ -1282,39 +1305,39 @@ <summary> Performs an "exclusive-or" of the two sets, keeping only the elements that are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a <c>Clone()</c> of one of the sets - (<c>a</c> if it is not <c>null</c>) containing + during this operation. The result set is a clone of one of the sets + (<c>a</c> if it is not <see langword="null" />) containing the elements from the exclusive-or operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the result of <c>a ^ b</c>. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.op_ExclusiveOr(Iesi.Collections.Set,Iesi.Collections.Set)"> <summary> Performs an "exclusive-or" of the two sets, keeping only the elements that are in one of the sets, but not in both. The original sets are not modified - during this operation. The result set is a <c>Clone()</c> of one of the sets - (<c>a</c> if it is not <c>null</c>) containing + during this operation. The result set is a clone of one of the sets + (<c>a</c> if it is not <see langword="null" />) containing the elements from the exclusive-or operation. </summary> <param name="a">A set of elements.</param> <param name="b">A set of elements.</param> - <returns>A set containing the result of <c>a ^ b</c>. <c>null</c> if both sets are <c>null</c>.</returns> + <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> </member> <member name="M:Iesi.Collections.Set.Add(System.Object)"> <summary> Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.Set.AddAll(System.Collections.ICollection)"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.Set.Clear"> <summary> @@ -1323,63 +1346,65 @@ </member> <member name="M:Iesi.Collections.Set.Contains(System.Object)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Set.ContainsAll(System.Collections.ICollection)"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Set.Remove(System.Object)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.Set.RemoveAll(System.Collections.ICollection)"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Set.RetainAll(System.Collections.ICollection)"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.Set.Clone"> <summary> - Returns a clone of the <c>Set</c> instance. This will work for derived <c>Set</c> + Returns a clone of the set instance. This will work for derived set classes if the derived class implements a constructor that takes no arguments. </summary> <returns>A clone of this object.</returns> </member> <member name="M:Iesi.Collections.Set.CopyTo(System.Array,System.Int32)"> <summary> - Copies the elements in the <c>Set</c> to an array. The type of array needs - to be compatible with the objects in the <c>Set</c>, obviously. + Copies the elements in the set to an array. The type of array needs + to be compatible with the objects in the set, obviously. </summary> <param name="array">An array that will be the target of the copy operation.</param> <param name="index">The zero-based index where copying will start.</param> </member> <member name="M:Iesi.Collections.Set.GetEnumerator"> <summary> - Gets an enumerator for the elements in the <c>Set</c>. + Returns an enumerator that iterates through the set. </summary> - <returns>An <c>IEnumerator</c> over the elements in the <c>Set</c>.</returns> + <returns> + An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the set. + </returns> </member> <member name="P:Iesi.Collections.Set.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.Set.Count"> @@ -1389,16 +1414,17 @@ </member> <member name="P:Iesi.Collections.Set.IsSynchronized"> <summary> - Returns <c>true</c> if the <c>Set</c> is synchronized across threads. Note that - enumeration is inherently not thread-safe. Use the <c>SyncRoot</c> to lock the + Returns <see langword="true"/> if the set is synchronized across threads. Note that + enumeration is inherently not thread-safe. Use the <see cref="P:Iesi.Collections.Set.SyncRoot"/> to lock the object during enumeration. </summary> </member> <member name="P:Iesi.Collections.Set.SyncRoot"> <summary> An object that can be used to synchronize this collection to make it thread-safe. - When implementing this, if your object uses a base object, like an <c>IDictionary</c>, - or anything that has a <c>SyncRoot</c>, return that object instead of "<c>this</c>". + When implementing this, if your object uses a base object, like an <see cref="T:System.Collections.IDictionary"/>, + or anything that has a <see cref="P:Iesi.Collections.Set.SyncRoot"/>, return that object instead + of <see langword="this"/>. </summary> </member> <member name="F:Iesi.Collections.DictionarySet.InternalDictionary"> @@ -1413,14 +1439,14 @@ Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.AddAll(System.Collections.ICollection)"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.Clear"> <summary> @@ -1429,38 +1455,38 @@ </member> <member name="M:Iesi.Collections.DictionarySet.Contains(System.Object)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.ContainsAll(System.Collections.ICollection)"> <summary> - Returns <c>true</c> if the set contains all the elements in the specified collection. + Returns <see langword="true" /> if the set contains all the elements in the specified collection. </summary> <param name="c">A collection of objects.</param> - <returns><c>true</c> if the set contains all the elements in the specified collection, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.Remove(System.Object)"> <summary> Removes the specified element from the set. </summary> <param name="o">The element to be removed.</param> - <returns><c>true</c> if the set contained the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.RemoveAll(System.Collections.ICollection)"> <summary> Remove all the specified elements from this set, if they exist in this set. </summary> <param name="c">A collection of elements to remove.</param> - <returns><c>true</c> if the set was modified as a result of this operation.</returns> + <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.RetainAll(System.Collections.ICollection)"> <summary> Retains only the elements in this set that are contained in the specified collection. </summary> <param name="c">Collection that defines the set of elements to be retained.</param> - <returns><c>true</c> if this set changed as a result of this operation.</returns> + <returns><see langword="true" /> if this set changed as a result of this operation.</returns> </member> <member name="M:Iesi.Collections.DictionarySet.CopyTo(System.Array,System.Int32)"> <summary> @@ -1486,7 +1512,7 @@ </member> <member name="P:Iesi.Collections.DictionarySet.IsEmpty"> <summary> - Returns <c>true</c> if this set contains no elements. + Returns <see langword="true" /> if this set contains no elements. </summary> </member> <member name="P:Iesi.Collections.DictionarySet.Count"> @@ -1566,14 +1592,14 @@ Adds the specified element to this set if it is not already present. </summary> <param name="o">The object to add to the set.</param> - <returns><c>true</c> is the object was added, <c>false</c> if it was already present.</returns> + <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> </member> <member name="M:Iesi.Collections.ImmutableSet.AddAll(System.Collections.ICollection)"> <summary> Adds all the elements in the specified collection to the set if they are not already present. </summary> <param name="c">A collection of objects to add to the set.</param> - <returns><c>true</c> is the set changed as a result of this operation, <c>false</c> if not.</returns> + <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> </member> <member name="M:Iesi.Collections.ImmutableSet.Clear"> <summary> @@ -1582,38 +1608,38 @@ </member> <member name="M:Iesi.Collections.ImmutableSet.Contains(System.Object)"> <summary> - Returns <c>true</c> if this set contains the specified element. + Returns <see langword="true" /> if this set contains the specified element. </summary> <param name="o">The element to look for.</param> - <returns><c>true</c> if this set contains the specified element, <c>false</c> otherwise.</returns> + <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> </member> <member name="M:Iesi.Collections.ImmutableSet.ContainsAll(System.Collections.ICollection)"> <summary> ... [truncated message content] |
From: <fab...@us...> - 2008-10-11 22:25:52
|
Revision: 3850 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3850&view=rev Author: fabiomaulo Date: 2008-10-11 22:25:44 +0000 (Sat, 11 Oct 2008) Log Message: ----------- - Removed dependency from Castle.DynamicProxy2 in the Core codeBase. - New project NHibernate.ProxyGenerators.CastleDynamicProxy to use as Default in NH Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Cfg/Environment.cs trunk/nhibernate/src/NHibernate/NHibernate.build trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs trunk/nhibernate/src/NHibernate.Everything.sln trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/AssemblyInfo.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/NHibernate.ProxyGenerators.CastleDynamicProxy.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/AssemblyInfo.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CustomProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/TestConfigurationHelper.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Bytecode/Castle/ trunk/nhibernate/src/NHibernate/Proxy/Poco/Castle/ trunk/nhibernate/src/NHibernate.Test/ProxyInterface/ Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/default.build 2008-10-11 22:25:44 UTC (rev 3850) @@ -23,10 +23,11 @@ <fileset id="buildfiles.all" basedir="src"> <!-- Files have to be in dependency order --> - <!--<include name="HashCodeProvider/HashCodeProvider.build" />--> <include name="Iesi.Collections/Iesi.Collections.build" /> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate/NHibernate.build" /> + <include name="NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build" /> + <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> @@ -36,6 +37,7 @@ <fileset id="buildfiles.tests" basedir="src"> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> + <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" if="${run.performance.tests}" /> @@ -84,6 +86,8 @@ --> <exclude name="Iesi.Collections.dll" /> <exclude name="Iesi.Collections.xml" /> + <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.dll" /> + <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.xml" /> <include name="*.dll" /> <include name="*.xml" /> <include name="*.license.txt" /> @@ -229,6 +233,7 @@ <!-- exclude ReSharper stuff --> <exclude name="**/_ReSharper*/**" /> <exclude name="**/*.resharperoptions" /> + <exclude name="**/*resharper*" /> <!-- exclude VS.NET stuff --> <exclude name="**/*.suo" /> @@ -259,7 +264,7 @@ <target name="copy-xml-schemas" depends="init"> <!-- TODO: Probably need to think of a better place for the XML schemas since - they are used by NHibernate, NHMA, and this build file. + they are used by NHibernate and this build file. --> <copy todir="${build.dir}"> <fileset basedir="src/NHibernate"> Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/releasenotes.txt 2008-10-11 22:25:44 UTC (rev 3850) @@ -1,6 +1,9 @@ Build 2.1.0.GA ======================== ** BREAKING CHANGES from NH2.0.xGA to NH2.1.0 + ##### Run time ##### + * If you want work using lazy loading with Castle.DynamicProxy2 now you must deploy NHibernate.ProxyGenerators.CastleDynamicProxy.dll + ##### Possible Breaking Changes for external frameworks ##### * ISession interface have additional methods * DefaultProxyFactoryFactory moved to NHibernate.Bytecode.Castle.ProxyFactoryFactory Modified: trunk/nhibernate/src/NHibernate/Cfg/Environment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -193,7 +193,7 @@ private static void SetDefaultProxyFactoryFactory() { // maitaining the optionality of set the proxyfactory.factory_class property - GlobalProperties[ProxyFactoryFactoryClass] = "NHibernate.Bytecode.Castle.ProxyFactoryFactory, NHibernate"; + GlobalProperties[ProxyFactoryFactoryClass] = "NHibernate.ProxyGenerators.CastleDynamicProxy.ProxyFactoryFactory, NHibernate.ProxyGenerators.CastleDynamicProxy"; } private static void LoadGlobalPropertiesFromAppConfig() Modified: trunk/nhibernate/src/NHibernate/NHibernate.build =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.build 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/src/NHibernate/NHibernate.build 2008-10-11 22:25:44 UTC (rev 3850) @@ -24,8 +24,6 @@ <include name="System.Web.dll" /> <include name="Iesi.Collections.dll" /> <include name="log4net.dll" /> - <include name="Castle.Core.dll" /> - <include name="Castle.DynamicProxy2.dll" /> </assemblyfileset> <resourcefileset id="project.resources" prefix="NHibernate" dynamicprefix="true"> Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2008-10-11 22:25:44 UTC (rev 3850) @@ -40,14 +40,6 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Castle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> - </Reference> - <Reference Include="Castle.DynamicProxy2, Version=2.0.0.1, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> - </Reference> <Reference Include="Iesi.Collections, Version=1.0.0.1, Culture=neutral, PublicKeyToken=154fdcb44c4484fc"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> @@ -297,8 +289,6 @@ <Compile Include="Properties\PascalCaseMUnderscoreStrategy.cs" /> <Compile Include="Properties\PascalCaseUnderscoreStrategy.cs" /> <Compile Include="Properties\PropertyAccessorFactory.cs" /> - <Compile Include="Proxy\Poco\Castle\CastleLazyInitializer.cs" /> - <Compile Include="Proxy\Poco\Castle\CastleProxyFactory.cs" /> <Compile Include="Proxy\INHibernateProxy.cs" /> <Compile Include="Proxy\IProxyFactory.cs" /> <Compile Include="Proxy\AbstractLazyInitializer.cs" /> @@ -452,7 +442,6 @@ <Compile Include="AdoNet\TooManyRowsAffectedException.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> - <Compile Include="Bytecode\Castle\ProxyFactoryFactory.cs" /> <Compile Include="Bytecode\IAccessOptimizer.cs" /> <Compile Include="Bytecode\IBytecodeProvider.cs" /> <Compile Include="Bytecode\IInjectableProxyFactoryFactory.cs" /> Modified: trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/src/NHibernate/Proxy/Map/MapProxyFactory.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.Reflection; -using System.Text; using Iesi.Collections.Generic; using NHibernate.Engine; using NHibernate.Type; Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2008-10-11 21:37:31 UTC (rev 3849) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2008-10-11 22:25:44 UTC (rev 3850) @@ -99,6 +99,12 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.HbmXsd", "NHibernate.Tool.HbmXsd\NHibernate.Tool.HbmXsd.csproj", "{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default proxy generator", "Default proxy generator", "{D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy", "NHibernate.ProxyGenerators.CastleDynamicProxy\NHibernate.ProxyGenerators.CastleDynamicProxy.csproj", "{31C3F0EA-0FED-4A2F-B68D-96CE29844487}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests", "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests\NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -200,6 +206,26 @@ {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Release|Any CPU.Build.0 = Release|Any CPU {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|.NET.ActiveCfg = Debug|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|.NET.ActiveCfg = Release|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Any CPU.Build.0 = Release|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|.NET.ActiveCfg = Debug|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|.NET.ActiveCfg = Release|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.Build.0 = Release|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -211,6 +237,7 @@ {094F74CD-2DD7-496F-BC48-A6D357BF33FD} = {28EA2C84-8295-49ED-BC67-803B7778513E} {92509065-DAEA-4457-8300-C7B64CD0E9F4} = {28EA2C84-8295-49ED-BC67-803B7778513E} {C91E7018-3C67-4830-963A-C388C75E1BD5} = {28EA2C84-8295-49ED-BC67-803B7778513E} + {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} = {28EA2C84-8295-49ED-BC67-803B7778513E} {5909BFE7-93CF-4E5F-BE22-6293368AF01D} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} {5C649B55-1B3F-4C38-9998-1B043E94A244} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} {7AEE5B37-C552-4E59-9B6F-88755BCB5070} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} @@ -219,6 +246,8 @@ {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4} {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344} = {C91E7018-3C67-4830-963A-C388C75E1BD5} {58CE4584-31B9-4E74-A7FB-5D40BFAD0876} = {C91E7018-3C67-4830-963A-C388C75E1BD5} + {31C3F0EA-0FED-4A2F-B68D-96CE29844487} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} EndGlobalSection GlobalSection(TextTemplating) = postSolution TextTemplating = 1 Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/AssemblyInfo.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/AssemblyInfo.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/AssemblyInfo.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,27 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Security; + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +[assembly: CLSCompliantAttribute(true)] +[assembly: AssemblyTitleAttribute("NHibernate.ProxyGenerators.CastleDynamicProxy")] +[assembly: AssemblyDescriptionAttribute("Castle Dynamic proxy generator adapters for NHibernate.")] +[assembly: AssemblyCompanyAttribute("NHibernate.org")] +[assembly: AssemblyProductAttribute("NHibernate.ProxyGenerators.CastleDynamicProxy")] +[assembly: AssemblyCopyrightAttribute("Licensed under LGPL.")] +[assembly: AssemblyVersionAttribute("2.1.0.1001")] +[assembly: AssemblyInformationalVersionAttribute("2.1.0.1001")] +[assembly: AssemblyFileVersionAttribute("2.1.0.1001")] +[assembly: AssemblyDelaySignAttribute(false)] +[assembly: AllowPartiallyTrustedCallersAttribute()] + Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs (from rev 3844, trunk/nhibernate/src/NHibernate/Proxy/Poco/Castle/CastleLazyInitializer.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,86 @@ +using System; +using System.Reflection; +using Castle.Core.Interceptor; +using NHibernate.Proxy; +using NHibernate.Proxy.Poco; +using NHibernate.Type; +using NHibernate.Engine; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy +{ + /// <summary> + /// A <see cref="ILazyInitializer"/> for use with the Castle Dynamic Class Generator. + /// </summary> + [Serializable] + [CLSCompliant(false)] + public class LazyInitializer : BasicLazyInitializer, Castle.Core.Interceptor.IInterceptor + { + private static readonly MethodInfo Exception_InternalPreserveStackTrace = + typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + + #region Instance + + public bool _constructed; + + /// <summary> + /// Initializes a new <see cref="LazyInitializer"/> object. + /// </summary> + /// <param name="entityName"></param> + /// <param name="persistentClass">The Class to Proxy.</param> + /// <param name="id">The Id of the Object we are Proxying.</param> + /// <param name="getIdentifierMethod"></param> + /// <param name="setIdentifierMethod"></param> + /// <param name="componentIdType"></param> + /// <param name="session">The ISession this Proxy is in.</param> + public LazyInitializer(string entityName, System.Type persistentClass, object id, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType, ISessionImplementor session) + :base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session) + { + } + + /// <summary> + /// Invoke the actual Property/Method using the Proxy or instantiate the actual + /// object and use it when the Proxy can't handle the method. + /// </summary> + /// <param name="invocation">The <see cref="IInvocation"/> from the generated Castle.DynamicProxy.</param> + public virtual void Intercept(IInvocation invocation) + { + try + { + if (_constructed) + { + // let the generic LazyInitializer figure out if this can be handled + // with the proxy or if the real class needs to be initialized + invocation.ReturnValue = base.Invoke(invocation.Method, invocation.Arguments, invocation.Proxy); + + // the base LazyInitializer could not handle it so we need to Invoke + // the method/property against the real class + if (invocation.ReturnValue == InvokeImplementation) + { + invocation.ReturnValue = invocation.Method.Invoke(GetImplementation(), invocation.Arguments); + return; + } + else + { + return; + } + } + else + { + // TODO: Find out equivalent to CGLIB's 'method.invokeSuper'. + return; + } + } + catch (TargetInvocationException tie) + { + // Propagate the inner exception so that the proxy throws the same exception as + // the real object would + Exception_InternalPreserveStackTrace.Invoke(tie.InnerException, new Object[] { }); + throw tie.InnerException; + } + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/LazyInitializer.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/NHibernate.ProxyGenerators.CastleDynamicProxy.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/NHibernate.ProxyGenerators.CastleDynamicProxy.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/NHibernate.ProxyGenerators.CastleDynamicProxy.csproj 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{31C3F0EA-0FED-4A2F-B68D-96CE29844487}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.CastleDynamicProxy</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.CastleDynamicProxy</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> + </Reference> + <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\log4net.dll</HintPath> + </Reference> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="LazyInitializer.cs" /> + <Compile Include="ProxyFactory.cs" /> + <Compile Include="ProxyFactoryFactory.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="ProxyGenerators.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs (from rev 3844, trunk/nhibernate/src/NHibernate/Proxy/Poco/Castle/CastleProxyFactory.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,105 @@ +using System; +using System.Reflection; +using Castle.DynamicProxy; +using Iesi.Collections.Generic; +using log4net; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy +{ + public class ProxyFactory : IProxyFactory + { + protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + private static readonly ProxyGenerator _proxyGenerator = new ProxyGenerator(); + + private System.Type _persistentClass; + private System.Type[] _interfaces; + private MethodInfo _getIdentifierMethod; + private MethodInfo _setIdentifierMethod; + private string _entityName; + private IAbstractComponentType _componentIdType; + + public virtual void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType) + { + _entityName = entityName; + _persistentClass = persistentClass; + _interfaces = new System.Type[interfaces.Count]; + interfaces.CopyTo(_interfaces, 0); + _getIdentifierMethod = getIdentifierMethod; + _setIdentifierMethod = setIdentifierMethod; + _componentIdType = componentIdType; + } + + protected static ProxyGenerator DefaultProxyGenerator + { + get { return _proxyGenerator; } + } + + protected System.Type PersistentClass + { + get { return _persistentClass; } + } + + protected System.Type[] Interfaces + { + get { return _interfaces; } + } + + protected MethodInfo GetIdentifierMethod + { + get { return _getIdentifierMethod; } + } + + protected MethodInfo SetIdentifierMethod + { + get { return _setIdentifierMethod; } + } + + protected bool IsClassProxy + { + get { return _interfaces.Length == 1; } + } + + public string EntityName + { + get { return _entityName; } + } + + public IAbstractComponentType ComponentIdType + { + get { return _componentIdType; } + } + + /// <summary> + /// Build a proxy using the Castle.DynamicProxy library. + /// </summary> + /// <param name="id">The value for the Id.</param> + /// <param name="session">The Session the proxy is in.</param> + /// <returns>A fully built <c>INHibernateProxy</c>.</returns> + public virtual INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + var initializer = new LazyInitializer(EntityName, _persistentClass, id, _getIdentifierMethod, + _setIdentifierMethod, ComponentIdType, session); + + object generatedProxy = IsClassProxy + ? _proxyGenerator.CreateClassProxy(_persistentClass, _interfaces, initializer) + : _proxyGenerator.CreateInterfaceProxyWithoutTarget(_interfaces[0], _interfaces, + initializer); + + initializer._constructed = true; + return (INHibernateProxy) generatedProxy; + } + catch (Exception e) + { + log.Error("Creating a proxy instance failed", e); + throw new HibernateException("Creating a proxy instance failed", e); + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactory.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs (from rev 3844, trunk/nhibernate/src/NHibernate/Bytecode/Castle/ProxyFactoryFactory.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyFactoryFactory.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,22 @@ +using NHibernate.Bytecode; +using NHibernate.Proxy; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy +{ + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new ProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build (from rev 3844, trunk/nhibernate/src/Iesi.Collections/Iesi.Collections.build) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,37 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.CastleDynamicProxy" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="true" /> + <property name="assembly.description" + value="Castle Dynamic proxy generator adapters for NHibernate." /> + <property name="assembly.copyright" + value="Licensed under LGPL." /> + <property name="assembly.allow-partially-trusted-callers" value="true" /> + + <property name="clover.instrument" value="true" /> + + <assemblyfileset basedir="${bin.dir}" id="project.references"> + <include name="System.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="Castle.Core.dll" /> + <include name="Castle.DynamicProxy2.dll" /> + <include name="NHibernate.dll" /> + </assemblyfileset> + + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build Castle ProxyGenerators" /> + +</project> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* hibernate.cfg.xml Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config (from rev 3844, trunk/nhibernate/src/NHibernate.Test/App.config) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <configSections> + <section name="hibernate-configuration" + type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> + <section name="log4net" + type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> + </configSections> + + <!-- + hibernate-configuration section + + You don't need to change this section for your own use. + You can write your own hibernate.cfg.xml to override all session-factory configuration. + Templates are available in NHibernate.Config.Templates folder. + --> + <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> + <bytecode-provider type="lcg"/> + <reflection-optimizer use="true"/> + <session-factory name="NHibernate.Test"> + <property name="connection.provider">NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.DebugConnectionProvider, NHibernate.ProxyGenerators.CastleDynamicProxy.Tests</property> + <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property> + <property name="cache.use_query_cache">true</property> + <property name="prepare_sql">false</property> + <property name="query.startup_check">false</property> + <property name="connection.isolation">ReadCommitted</property> + <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> + <property name="connection.connection_string"> + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + </property> + <property name="show_sql">false</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="use_outer_join">true</property> + <property name="command_timeout">10</property> + <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="adonet.wrap_result_sets">false</property> + + <!-- This property is the default value in NH Core --> + <property name="proxyfactory.factory_class">NHibernate.ProxyGenerators.CastleDynamicProxy.ProxyFactoryFactory, NHibernate.ProxyGenerators.CastleDynamicProxy</property> + + </session-factory> + </hibernate-configuration> + + <!-- This section contains the log4net configuration settings --> + <log4net debug="false"> + + <!-- Define some output appenders --> + <appender name="trace" + type="log4net.Appender.TraceAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" + value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n" /> + </layout> + </appender> + + <appender name="console" + type="log4net.Appender.ConsoleAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" + value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n" /> + </layout> + </appender> + + <appender name="rollingFile" + type="log4net.Appender.RollingFileAppender,log4net" > + + <param name="File" + value="log.txt" /> + <param name="AppendToFile" + value="false" /> + <param name="RollingStyle" + value="Date" /> + <param name="DatePattern" + value="yyyy.MM.dd" /> + <param name="StaticLogFileName" + value="true" /> + + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" + value="%d [%t] %-5p %c - %m%n" /> + </layout> + </appender> + + <root> + <priority value="WARN" /> + <appender-ref ref="console" /> + </root> + + <logger name="NHibernate"> + <priority value="ERROR" /> + </logger> + + <logger name="NHibernate.Tool.hbm2ddl.SchemaExport"> + <level value="ERROR" /> + </logger> + </log4net> + + +</configuration> + + + Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/App.config ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/AssemblyInfo.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/AssemblyInfo.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/AssemblyInfo.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +[assembly: CLSCompliantAttribute(false)] +[assembly: AssemblyTitleAttribute("NHibernate.ProxyGenerators.CastleDynamicProxy.Tests")] +[assembly: AssemblyDescriptionAttribute("The Unit Tests for Castle ProxyGenerators.")] +[assembly: AssemblyCompanyAttribute("NHibernate.org")] +[assembly: AssemblyProductAttribute("NHibernate.ProxyGenerators.CastleDynamicProxy.Tests")] +[assembly: AssemblyCopyrightAttribute("Licensed under LGPL.")] +[assembly: AssemblyVersionAttribute("1.0.0.1")] +[assembly: AssemblyInformationalVersionAttribute("1.0")] +[assembly: AssemblyFileVersionAttribute("2.1.0.1001")] +[assembly: AssemblyDelaySignAttribute(false)] + Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs (from rev 3844, trunk/nhibernate/src/NHibernate.Test/DebugConnectionProvider.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,72 @@ +using System.Collections; +using System.Data; +using Iesi.Collections; +using NHibernate.Connection; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy.Tests +{ + /// <summary> + /// This connection provider keeps a list of all open connections, + /// it is used when testing to check that tests clean up after themselves. + /// </summary> + public class DebugConnectionProvider : DriverConnectionProvider + { + private readonly ISet connections = new ListSet(); + + public override IDbConnection GetConnection() + { + IDbConnection connection = base.GetConnection(); + connections.Add(connection); + return connection; + } + + public override void CloseConnection(IDbConnection conn) + { + base.CloseConnection(conn); + connections.Remove(conn); + } + + public bool HasOpenConnections + { + get + { + // check to see if all connections that were at one point opened + // have been closed through the CloseConnection + // method + if (connections.IsEmpty) + { + // there are no connections, either none were opened or + // all of the closings went through CloseConnection. + return false; + } + else + { + // Disposing of an ISession does not call CloseConnection (should it???) + // so a Diposed of ISession will leave an IDbConnection in the list but + // the IDbConnection will be closed (atleast with MsSql it works this way). + foreach (IDbConnection conn in connections) + { + if (conn.State != ConnectionState.Closed) + { + return true; + } + } + + // all of the connections have been Disposed and were closed that way + // or they were Closed through the CloseConnection method. + return false; + } + } + } + + public void CloseAllConnections() + { + while (!connections.IsEmpty) + { + IEnumerator en = connections.GetEnumerator(); + en.MoveNext(); + CloseConnection(en.Current as IDbConnection); + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/DebugConnectionProvider.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.CastleDynamicProxy.Tests</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.CastleDynamicProxy.Tests</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> + </Reference> + <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\log4net.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="DebugConnectionProvider.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="ProxyInterface\CastleProxy.cs" /> + <Compile Include="ProxyInterface\CastleProxyFixture.cs" /> + <Compile Include="ProxyInterface\CastleProxyImpl.cs" /> + <Compile Include="ProxyInterface\Classes.cs" /> + <Compile Include="ProxyInterface\CustomProxyFixture.cs" /> + <Compile Include="TestCase.cs" /> + <Compile Include="TestConfigurationHelper.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.ProxyGenerators.CastleDynamicProxy\NHibernate.ProxyGenerators.CastleDynamicProxy.csproj"> + <Project>{31C3F0EA-0FED-4A2F-B68D-96CE29844487}</Project> + <Name>NHibernate.ProxyGenerators.CastleDynamicProxy</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\CastleProxyImpl.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\Mappings.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="ProxyGenerators.Test.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>if exist hibernate.cfg.xml (del hibernate.cfg.xml) +if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml")</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build (from rev 3844, trunk/nhibernate/src/Iesi.Collections.Test/Iesi.Collections.Test.build) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,41 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="false" /> + <property name="assembly.description" value="The Unit Tests for Castle ProxyGenerators." /> + <property name="assembly.version" value="1.0.0.1" /> + <property name="assembly.version.informational" value="1.0" /> + + <property name="clover.instrument" value="false" /> + + <assemblyfileset id="project.references" basedir="${bin.dir}"> + <include name="System.dll" /> + <include name="System.XML.dll" /> + <include name="System.Data.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="Castle.Core.dll" /> + <include name="Castle.DynamicProxy2.dll" /> + <include name="NHibernate.dll" /> + <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.dll" /> + <include name="nunit.framework.dll"/> + </assemblyfileset> + + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-tests" /> + <target name="test" depends="init build common.run-tests" /> + +</project> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs (from rev 3844, trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CastleProxy.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,14 @@ +namespace NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxy. + /// </summary> + public interface CastleProxy + { + int Id { get; set; } + + string Name { get; set; } + + void ThrowDeepException(); + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxy.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs (from rev 3844, trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CastleProxyFixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,144 @@ +using System; +using System.Collections; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxyFixture. + /// </summary> + [TestFixture] + public class CastleProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"ProxyInterface.CastleProxyImpl.hbm.xml"}; } + } + + [Test] + public void Proxy() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap)); + int id = ap.Id; + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "get id should not have initialized it."); + string name = ap.Name; + Assert.IsTrue(NHibernateUtil.IsInitialized(ap), "get name should have initialized it."); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + private void SerializeAndDeserialize(ref ISession s) + { + // Serialize the session + using (Stream stream = new MemoryStream()) + { + IFormatter formatter = new BinaryFormatter(); + formatter.Serialize(stream, s); + + // Close the original session + s.Close(); + + // Deserialize the session + stream.Position = 0; + s = (ISession) formatter.Deserialize(stream); + } + } + + [Test] + public void ProxySerialize() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl(); + ap.Id = 1; + ap.Name = "first proxy"; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), ap.Id); + Assert.AreEqual(1, ap.Id); + s.Disconnect(); + + SerializeAndDeserialize(ref s); + + s.Reconnect(); + s.Disconnect(); + + // serialize and then deserialize the session again - make sure Castle.DynamicProxy + // has no problem with serializing two times - earlier versions of it did. + SerializeAndDeserialize(ref s); + + s.Close(); + + s = OpenSession(); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void SerializeNotFoundProxy() + { + ISession s = OpenSession(); + // this does not actually exists in db + var notThere = (CastleProxy) s.Load(typeof (CastleProxyImpl), 5); + Assert.AreEqual(5, notThere.Id); + s.Disconnect(); + + // serialize and then deserialize the session. + SerializeAndDeserialize(ref s); + + Assert.IsNotNull(s.Load(typeof (CastleProxyImpl), 5), "should be proxy - even though it doesn't exists in db"); + s.Close(); + } + + [Test] + public void ExceptionStackTrace() + { + ISession s = OpenSession(); + CastleProxy ap = new CastleProxyImpl(); + ap.Id = 1; + ap.Name = "first proxy"; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (CastleProxy) s.Load(typeof (CastleProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "check we have a proxy"); + + try + { + ap.ThrowDeepException(); + Assert.Fail("Exception not thrown"); + } + catch (ArgumentException ae) + { + Assert.AreEqual("thrown from Level2", ae.Message); + + string[] stackTraceLines = ae.StackTrace.Split('\n'); + Assert.IsTrue(stackTraceLines[0].Contains("Level2"), "top of exception stack is Level2()"); + Assert.IsTrue(stackTraceLines[1].Contains("Level1"), "next on exception stack is Level1()"); + } + finally + { + s.Delete(ap); + s.Flush(); + s.Close(); + } + } + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyFixture.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs (from rev 3844, trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CastleProxyImpl.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,35 @@ +using System; +using NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface +{ + /// <summary> + /// Summary description for CastleProxyImpl. + /// </summary> + [Serializable] + public class CastleProxyImpl : CastleProxy + { + private static void Level1() + { + Level2(); + } + + private static void Level2() + { + throw new ArgumentException("thrown from Level2"); + } + + #region CastleProxy Members + + public int Id { get; set; } + + public string Name { get; set; } + + public void ThrowDeepException() + { + Level1(); + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.cs ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml (from rev 3844, trunk/nhibernate/src/NHibernate.Test/ProxyInterface/CastleProxyImpl.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests" + namespace="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface"> + <class name="CastleProxyImpl" proxy="CastleProxy" table="avalon_p"> + <id name="Id"> + <generator class="assigned" /> + </id> + + <property name="Name" /> + </class> +</hibernate-mapping> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/CastleProxyImpl.hbm.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs (from rev 3844, trunk/nhibernate/src/NHibernate.Test/ExpressionTest/SubQueries/Classes.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyInterface/Classes.cs 2008-10-11 22:25:44 UTC (rev 3850) @@ -0,0 +1,212 @@ +using System.Collections; +using Iesi.Collections; + +namespace NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.ProxyInterface +{ + public class Blog + { + private ISet _posts; + private ISet _users; + + private int blog_id; + + public virtual int BlogID + { + get { return blog_id; } + set { blog_id = value; } + } + + private string blog_name; + + public virtual string BlogName + { + get { return blog_name; } + set { blog_name = value; } + } + + public virtual ISet Posts + { + get { return _posts; } + set { _posts = value; } + } + + public virtual ISet Users + { + get { return _users; } + set { _users = value; } + } + + public Blog() + { + _posts = new HashedSet(); + _users = new HashedSet(); + } + + public Blog(string name) : this() + { + blog_name = name; + } + } + + public class Comment + { + private Comment() {} + + public Comment(string text) : this() + { + _text = text; + } + + private int _id; + private int _indexInPost; + private string _text; + private Post _post; + private User commenter; + + public User Commenter + { + get { return commenter; } + set { commenter = value; } + } + + public virtual int IndexInPost + { + get { return _indexInPost; } + set { _indexInPost = value; } + } + + public virtual Post Post + { + get { return _post; } + set { _post = value; } + } + + public virtual int CommentId + { + get { return _id; } + set { _id = value; } + } + + public virtual string Text + { + get { return _text; } + set { _text = value; } + } + } + + public class Post + { + private int post_id; + private Blog _blog; + private string post_title; + private IList _comments; + private ISet categories = new HashedSet(); + + public ISet Categories + { + get { return c... [truncated message content] |
From: <fab...@us...> - 2008-11-07 04:49:47
|
Revision: 3891 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3891&view=rev Author: fabiomaulo Date: 2008-11-07 04:49:41 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Created NHibernate.ProxyGenerators.LinFuDynamicProxy Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/src/NHibernate.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/Properties/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2008-11-07 04:47:41 UTC (rev 3890) +++ trunk/nhibernate/default.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -26,6 +26,8 @@ <include name="Iesi.Collections/Iesi.Collections.build" /> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate/NHibernate.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> @@ -37,6 +39,7 @@ <fileset id="buildfiles.tests" basedir="src"> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" @@ -86,6 +89,8 @@ --> <exclude name="Iesi.Collections.dll" /> <exclude name="Iesi.Collections.xml" /> + <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.dll" /> + <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.xml" /> <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.dll" /> <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.xml" /> <include name="*.dll" /> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* AssemblyInfo.cs Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/LazyInitializer.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,49 @@ +using System; +using System.Reflection; +using LinFu.DynamicProxy; +using NHibernate.Engine; +using NHibernate.Proxy.Poco; +using NHibernate.Type; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + [Serializable] + public class LazyInitializer : BasicLazyInitializer, LinFu.DynamicProxy.IInterceptor + { + private static readonly MethodInfo exceptionInternalPreserveStackTrace = + typeof (Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + + public LazyInitializer(string entityName, System.Type persistentClass, object id, MethodInfo getIdentifierMethod, + MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType, + ISessionImplementor session) + : base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session) {} + + #region Implementation of IInterceptor + + public object Intercept(InvocationInfo info) + { + object returnValue; + try + { + returnValue = base.Invoke(info.TargetMethod, info.Arguments, info.Target); + + // Avoid invoking the actual implementation, if possible + if (returnValue != InvokeImplementation) + { + return returnValue; + } + + returnValue = info.TargetMethod.Invoke(GetImplementation(), info.Arguments); + } + catch (TargetInvocationException ex) + { + exceptionInternalPreserveStackTrace.Invoke(ex.InnerException, new Object[] {}); + throw ex.InnerException; + } + + return returnValue; + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.LinFuDynamicProxy</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.LinFuDynamicProxy</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="LinFu.DynamicProxy, Version=1.0.3232.29886, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\LinFu.DynamicProxy.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="LazyInitializer.cs" /> + <Compile Include="ProxyFactory.cs" /> + <Compile Include="ProxyFactoryFactory.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + <None Include="ProxyGenerators.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactory.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,74 @@ +using System; +using System.Reflection; +using Iesi.Collections.Generic; +using log4net; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + public class ProxyFactory : IProxyFactory + { + private static readonly LinFu.DynamicProxy.ProxyFactory factory = new LinFu.DynamicProxy.ProxyFactory(); + protected static readonly ILog log = LogManager.GetLogger(typeof (ProxyFactory)); + + protected System.Type PersistentClass { get; private set; } + + protected System.Type[] Interfaces { get; private set; } + + protected MethodInfo GetIdentifierMethod { get; private set; } + + public MethodInfo SetIdentifierMethod { get; private set; } + + protected IAbstractComponentType ComponentIdType { get; private set; } + + protected string EntityName { get; private set; } + + protected bool IsClassProxy + { + get { return Interfaces.Length == 1; } + } + + #region IProxyFactory Members + + public void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType) + { + EntityName = entityName; + PersistentClass = persistentClass; + Interfaces = new System.Type[interfaces.Count]; + + if (interfaces.Count > 0) + { + interfaces.CopyTo(Interfaces, 0); + } + + GetIdentifierMethod = getIdentifierMethod; + SetIdentifierMethod = setIdentifierMethod; + ComponentIdType = componentIdType; + } + + public INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + var initializer = new LazyInitializer(EntityName, PersistentClass, id, GetIdentifierMethod, SetIdentifierMethod, + ComponentIdType, session); + + object proxyInstance = IsClassProxy ? factory.CreateProxy(PersistentClass, initializer, Interfaces) + : factory.CreateProxy(Interfaces[0], initializer, Interfaces); + + return (INHibernateProxy) proxyInstance; + } + catch (Exception ex) + { + log.Error("Creating a proxy instance failed", ex); + throw new HibernateException("Creating a proxy instance failed", ex); + } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyFactoryFactory.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,23 @@ +using NHibernate.Bytecode; +using NHibernate.Proxy; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy +{ + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new ProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + // TODO : LinFu need a specific proxy validator because need virtual methods even when we are using an interface as proxy + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,36 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.LinFuDynamicProxy" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="true" /> + <property name="assembly.description" + value="LinFu Dynamic proxy generator adapters for NHibernate." /> + <property name="assembly.copyright" + value="Licensed under LGPL." /> + <property name="assembly.allow-partially-trusted-callers" value="true" /> + + <property name="clover.instrument" value="true" /> + + <assemblyfileset basedir="${bin.dir}" id="project.references"> + <include name="System.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="LinFu.DynamicProxy.dll" /> + <include name="NHibernate.dll" /> + </assemblyfileset> + + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-dll" description="Build LinFu ProxyGenerators" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/app.config 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto *resharper* hibernate.cfg.xml AssemblyInfo.cs Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/App.config 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<configuration> + <configSections> + <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/> + <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> + </configSections> + + <!-- + hibernate-configuration section + + You don't need to change this section for your own use. + You can write your own hibernate.cfg.xml to override all session-factory configuration. + Templates are available in NHibernate.Config.Templates folder. + --> + <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> + <bytecode-provider type="lcg"/> + <reflection-optimizer use="true"/> + <session-factory name="NHibernate.Test"> + <property name="connection.provider">NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.DebugConnectionProvider, NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</property> + <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property> + <property name="cache.use_query_cache">true</property> + <property name="prepare_sql">false</property> + <property name="query.startup_check">false</property> + <property name="connection.isolation">ReadCommitted</property> + <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> + <property name="connection.connection_string"> + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + </property> + <property name="show_sql">false</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="use_outer_join">true</property> + <property name="command_timeout">10</property> + <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="adonet.wrap_result_sets">false</property> + + <property name="proxyfactory.factory_class">NHibernate.ProxyGenerators.LinFuDynamicProxy.ProxyFactoryFactory, NHibernate.ProxyGenerators.LinFuDynamicProxy</property> + + </session-factory> + </hibernate-configuration> + + <!-- This section contains the log4net configuration settings --> + <log4net debug="false"> + + <!-- Define some output appenders --> + <appender name="trace" type="log4net.Appender.TraceAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="console" type="log4net.Appender.ConsoleAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net"> + + <param name="File" value="log.txt"/> + <param name="AppendToFile" value="false"/> + <param name="RollingStyle" value="Date"/> + <param name="DatePattern" value="yyyy.MM.dd"/> + <param name="StaticLogFileName" value="true"/> + + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/> + </layout> + </appender> + + <root> + <priority value="WARN"/> + <appender-ref ref="console"/> + </root> + <logger name="NHibernate.Proxy.Poco"> + <priority value="DEBUG"/> + </logger> + + <logger name="NHibernate.ProxyGenerators.LinFuDynamicProxy"> + <priority value="DEBUG"/> + </logger> + </log4net> + + +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/DebugConnectionProvider.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,68 @@ +using System.Collections; +using System.Data; +using Iesi.Collections; +using NHibernate.Connection; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public class DebugConnectionProvider : DriverConnectionProvider + { + private readonly ISet connections = new ListSet(); + + public override IDbConnection GetConnection() + { + IDbConnection connection = base.GetConnection(); + connections.Add(connection); + return connection; + } + + public override void CloseConnection(IDbConnection conn) + { + base.CloseConnection(conn); + connections.Remove(conn); + } + + public bool HasOpenConnections + { + get + { + // check to see if all connections that were at one point opened + // have been closed through the CloseConnection + // method + if (connections.IsEmpty) + { + // there are no connections, either none were opened or + // all of the closings went through CloseConnection. + return false; + } + else + { + // Disposing of an ISession does not call CloseConnection (should it???) + // so a Diposed of ISession will leave an IDbConnection in the list but + // the IDbConnection will be closed (atleast with MsSql it works this way). + foreach (IDbConnection conn in connections) + { + if (conn.State != ConnectionState.Closed) + { + return true; + } + } + + // all of the connections have been Disposed and were closed that way + // or they were Closed through the CloseConnection method. + return false; + } + } + } + + public void CloseAllConnections() + { + while (!connections.IsEmpty) + { + IEnumerator en = connections.GetEnumerator(); + en.MoveNext(); + CloseConnection(en.Current as IDbConnection); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{94FDD99B-8275-4E51-8F43-958B2C632120}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</RootNamespace> + <AssemblyName>NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="LinFu.DynamicProxy, Version=1.0.3232.29886, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\LinFu.DynamicProxy.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.XML" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="DebugConnectionProvider.cs" /> + <Compile Include="ProxyInterface\IMyProxy.cs" /> + <Compile Include="ProxyInterface\MyProxyImpl.cs" /> + <Compile Include="ProxyInterface\ProxyFixture.cs" /> + <Compile Include="TestCase.cs" /> + <Compile Include="TestConfigurationHelper.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.ProxyGenerators.LinFuDynamicProxy\NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj"> + <Project>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</Project> + <Name>NHibernate.ProxyGenerators.LinFuDynamicProxy</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\ProxyImpl.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="ProxyGenerators.Test.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>if exist hibernate.cfg.xml (del hibernate.cfg.xml) +if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml")</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,44 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + + <property name="root.dir" value="../.." /> + + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="false" /> + <property name="assembly.description" value="The Unit Tests for LinFu ProxyGenerators." /> + <property name="assembly.version" value="1.0.0.1" /> + <property name="assembly.version.informational" value="1.0" /> + + <property name="clover.instrument" value="false" /> + + <assemblyfileset id="project.references" basedir="${bin.dir}"> + <include name="System.dll" /> + <include name="System.XML.dll" /> + <include name="System.Data.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="LinFu.DynamicProxy.dll" /> + <include name="NHibernate.dll" /> + <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.dll" /> + <include name="nunit.framework.dll"/> + </assemblyfileset> + + <resourcefileset id="project.resources" prefix="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" dynamicprefix="true"> + <include name="**/*.xml" /> + <exclude name="bin/**/*.xml" /> + </resourcefileset> + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-tests" /> + <target name="test" depends="init build common.run-tests" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/IMyProxy.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,11 @@ +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + public interface IMyProxy + { + int Id { get; set; } + + string Name { get; set; } + + void ThrowDeepException(); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,30 @@ +using System; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + public class MyProxyImpl: IMyProxy + { + private static void Level1() + { + Level2(); + } + + private static void Level2() + { + throw new ArgumentException("thrown from Level2"); + } + + #region CastleProxy Members + + public int Id { get; set; } + + public string Name { get; set; } + + public void ThrowDeepException() + { + Level1(); + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/MyProxyImpl.cs ___________________________________________________________________ Added: svn:mergeinfo + Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyFixture.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,137 @@ +using System; +using System.Collections; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface +{ + [TestFixture] + public class ProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"ProxyInterface.ProxyImpl.hbm.xml"}; } + } + + private void SerializeAndDeserialize(ref ISession s) + { + // Serialize the session + using (Stream stream = new MemoryStream()) + { + IFormatter formatter = new BinaryFormatter(); + formatter.Serialize(stream, s); + + // Close the original session + s.Close(); + + // Deserialize the session + stream.Position = 0; + s = (ISession) formatter.Deserialize(stream); + } + } + + [Test] + public void ExceptionStackTrace() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "check we have a proxy"); + + try + { + ap.ThrowDeepException(); + Assert.Fail("Exception not thrown"); + } + catch (ArgumentException ae) + { + Assert.AreEqual("thrown from Level2", ae.Message); + + string[] stackTraceLines = ae.StackTrace.Split('\n'); + Assert.IsTrue(stackTraceLines[0].Contains("Level2"), "top of exception stack is Level2()"); + Assert.IsTrue(stackTraceLines[1].Contains("Level1"), "next on exception stack is Level1()"); + } + finally + { + s.Delete(ap); + s.Flush(); + s.Close(); + } + } + + [Test] + public void Proxy() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap)); + int id = ap.Id; + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "get id should not have initialized it."); + string name = ap.Name; + Assert.IsTrue(NHibernateUtil.IsInitialized(ap), "get name should have initialized it."); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void ProxySerialize() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.AreEqual(1, ap.Id); + s.Disconnect(); + + SerializeAndDeserialize(ref s); + + s.Reconnect(); + s.Disconnect(); + + // serialize and then deserialize the session again - make sure Castle.DynamicProxy + // has no problem with serializing two times - earlier versions of it did. + SerializeAndDeserialize(ref s); + + s.Close(); + + s = OpenSession(); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void SerializeNotFoundProxy() + { + ISession s = OpenSession(); + // this does not actually exists in db + var notThere = (IMyProxy) s.Load(typeof (MyProxyImpl), 5); + Assert.AreEqual(5, notThere.Id); + s.Disconnect(); + + // serialize and then deserialize the session. + SerializeAndDeserialize(ref s); + + Assert.IsNotNull(s.Load(typeof (MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db"); + s.Close(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyInterface/ProxyImpl.hbm.xml 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests" + namespace="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.ProxyInterface"> + <class name="MyProxyImpl" proxy="IMyProxy"> + <id name="Id"> + <generator class="assigned" /> + </id> + + <property name="Name" /> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestCase.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,323 @@ +using System; +using System.Collections; +using System.Data; +using System.Reflection; +using log4net; +using log4net.Config; +using NHibernate.Cfg; +using NHibernate.Connection; +using NHibernate.Engine; +using NHibernate.Mapping; +using NHibernate.Tool.hbm2ddl; +using NHibernate.Type; +using NUnit.Framework; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public abstract class TestCase + { + private const bool OutputDdl = false; + protected Configuration cfg; + protected ISessionFactoryImplementor sessions; + + private static readonly ILog log = LogManager.GetLogger(typeof(TestCase)); + + protected Dialect.Dialect Dialect + { + get { return NHibernate.Dialect.Dialect.GetDialect(cfg.Properties); } + } + + protected ISession lastOpenedSession; + private DebugConnectionProvider connectionProvider; + + /// <summary> + /// Mapping files used in the TestCase + /// </summary> + protected abstract IList Mappings { get; } + + /// <summary> + /// Assembly to load mapping files from (default is NHibernate.DomainModel). + /// </summary> + protected virtual string MappingsAssembly + { + get { return "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests"; } + } + + static TestCase() + { + // Configure log4net here since configuration through an attribute doesn't always work. + XmlConfigurator.Configure(); + } + + /// <summary> + /// Creates the tables used in this TestCase + /// </summary> + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + try + { + Configure(); + if (!AppliesTo(Dialect)) + { + Assert.Ignore(GetType() + " does not apply to " + Dialect); + } + + CreateSchema(); + BuildSessionFactory(); + } + catch (Exception e) + { + log.Error("Error while setting up the test fixture", e); + throw; + } + } + + /// <summary> + /// Removes the tables used in this TestCase. + /// </summary> + /// <remarks> + /// If the tables are not cleaned up sometimes SchemaExport runs into + /// Sql errors because it can't drop tables because of the FKs. This + /// will occur if the TestCase does not have the same hbm.xml files + /// included as a previous one. + /// </remarks> + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + DropSchema(); + Cleanup(); + } + + protected virtual void OnSetUp() + { + } + + /// <summary> + /// Set up the test. This method is not overridable, but it calls + /// <see cref="OnSetUp" /> which is. + /// </summary> + [SetUp] + public void SetUp() + { + OnSetUp(); + } + + protected virtual void OnTearDown() + { + } + + /// <summary> + /// Checks that the test case cleans up after itself. This method + /// is not overridable, but it calls <see cref="OnTearDown" /> which is. + /// </summary> + [TearDown] + public void TearDown() + { + OnTearDown(); + + bool wasClosed = CheckSessionWasClosed(); + bool wasCleaned = CheckDatabaseWasCleaned(); + bool wereConnectionsClosed = CheckConnectionsWereClosed(); + bool fail = !wasClosed || !wasCleaned || !wereConnectionsClosed; + + if (fail) + { + Assert.Fail("Test didn't clean up after itself"); + } + } + + private bool CheckSessionWasClosed() + { + if (lastOpenedSession != null && lastOpenedSession.IsOpen) + { + log.Error("Test case didn't close a session, closing"); + lastOpenedSession.Close(); + return false; + } + + return true; + } + + private bool CheckDatabaseWasCleaned() + { + if (sessions.GetAllClassMetadata().Count == 0) + { + // Return early in the case of no mappings, also avoiding + // a warning when executing the HQL below. + return true; + } + + bool empty; + using (ISession s = sessions.OpenSession()) + { + IList objects = s.CreateQuery("from System.Object o").List(); + empty = objects.Count == 0; + } + + if (!empty) + { + log.Error("Test case didn't clean up the database after itself, re-creating the schema"); + DropSchema(); + CreateSchema(); + } + + return empty; + } + + private bool CheckConnectionsWereClosed() + { + if (connectionProvider == null || !connectionProvider.HasOpenConnections) + { + return true; + } + + log.Error("Test case didn't close all open connections, closing"); + connectionProvider.CloseAllConnections(); + return false; + } + + private void Configure() + { + cfg = new Configuration(); + if (TestConfigurationHelper.hibernateConfigFile != null) + cfg.Configure(TestConfigurationHelper.hibernateConfigFile); + + Assembly assembly = Assembly.Load(MappingsAssembly); + + foreach (string file in Mappings) + { + cfg.AddResource(MappingsAssembly + "." + file, assembly); + } + + Configure(cfg); + + ApplyCacheSettings(cfg); + } + + private void CreateSchema() + { + new SchemaExport(cfg).Create(OutputDdl, true); + } + + private void DropSchema() + { + new SchemaExport(cfg).Drop(OutputDdl, true); + } + + protected virtual void BuildSessionFactory() + { + sessions = (ISessionFactoryImplementor)cfg.BuildSessionFactory(); + connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider; + } + + private void Cleanup() + { + sessions.Close(); + sessions = null; + connectionProvider = null; + lastOpenedSession = null; + cfg = null; + } + + public int ExecuteStatement(string sql) + { + if (cfg == null) + { + cfg = new Configuration(); + } + + using (IConnectionProvider prov = ConnectionProviderFactory.NewConnectionProvider(cfg.Properties)) + { + IDbConnection conn = prov.GetConnection(); + + try + { + using (IDbTransaction tran = conn.BeginTransaction()) + using (IDbCommand comm = conn.CreateCommand()) + { + comm.CommandText = sql; + comm.Transaction = tran; + comm.CommandType = CommandType.Text; + int result = comm.ExecuteNonQuery(); + tran.Commit(); + return result; + } + } + finally + { + prov.CloseConnection(conn); + } + } + } + + protected ISessionFactoryImplementor Sfi + { + get { return sessions; } + } + + protected virtual ISession OpenSession() + { + lastOpenedSession = sessions.OpenSession(); + return lastOpenedSession; + } + + protected virtual ISession OpenSession(IInterceptor sessionLocalInterceptor) + { + lastOpenedSession = sessions.OpenSession(sessionLocalInterceptor); + return lastOpenedSession; + } + + protected void ApplyCacheSettings(Configuration configuration) + { + if (CacheConcurrencyStrategy == null) + { + return; + } + + foreach (PersistentClass clazz in configuration.ClassMappings) + { + bool hasLob = false; + foreach (Property prop in clazz.PropertyClosureIterator) + { + if (prop.Value.IsSimpleValue) + { + IType type = ((SimpleValue)prop.Value).Type; + if (type == NHibernateUtil.BinaryBlob) + { + hasLob = true; + } + } + } + if (!hasLob && !clazz.IsInherited) + { + configuration.SetCacheConcurrencyStrategy(clazz.EntityName, CacheConcurrencyStrategy); + } + } + + foreach (Mapping.Collection coll in configuration.CollectionMappings) + { + configuration.SetCollectionCacheConcurrencyStrategy(coll.Role, CacheConcurrencyStrategy); + } + } + + #region Properties overridable by subclasses + + protected virtual bool AppliesTo(Dialect.Dialect dialect) + { + return true; + } + + protected virtual void Configure(Configuration configuration) + { + } + + protected virtual string CacheConcurrencyStrategy + { + get { return "nonstrict-read-write"; } + //get { return null; } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/TestConfigurationHelper.cs 2008-11-07 04:49:41 UTC (rev 3891) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests +{ + public static class TestConfigurationHelper + { + public static readonly string hibernateConfigFile; + + static TestConfigurationHelper() + { + // Verify if hibernate.cfg.xml exists + hibernateConfigFile = GetDefaultConfigurationFilePath(); + } + + public static string GetDefaultConfigurationFilePath() + { + string baseDir = AppDomain.CurrentDomain.BaseDirectory; + string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath; + string binPath = relativeSearchPath == null ? baseDir : Path.Combine(baseDir, relativeSearchPath); + string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName); + return File.Exists(fullPath) ? fullPath : null; + } + + /// <summary> + /// Standar Configuration for tests. + /// </summary> + /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns> + public static Configuration GetDefaultConfiguration() + { + var result = new Configuration(); + if (hibernateConfigFile != null) + { + result.Configure(hibernateConfigFile); + } + return result; + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2008-11-07 04:47:41 UTC (rev 3890) +++ trunk/nhibernate/src/NHibernate.sln 2008-11-07 04:49:41 UTC (rev 3891) @@ -16,6 +16,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests", "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests\NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy", "NHibernate.ProxyGenerators.LinFuDynamicProxy\NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj", "{8289D6AD-9714-42D3-A94D-D4D9814D1281}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests", "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests\NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,6 +46,14 @@ {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.Build.0 = Debug|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.ActiveCfg = Release|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.Build.0 = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.Build.0 = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2008-11-07 21:44:04
|
Revision: 3893 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3893&view=rev Author: fabiomaulo Date: 2008-11-07 21:41:22 +0000 (Fri, 07 Nov 2008) Log Message: ----------- Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate.Config.Templates/FireBird.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Config.Templates/MySql.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Config.Templates/Oracle.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Config.Templates/PostgreSQL.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Config.Templates/SQLite.cfg.xml.tmpl trunk/nhibernate/src/NHibernate.Everything.sln trunk/nhibernate/src/NHibernate.Example.Web/Web.Config trunk/nhibernate/src/NHibernate.Test/App.config trunk/nhibernate/src/NHibernate.Test/DynamicEntity/DataProxyHandler.cs trunk/nhibernate/src/NHibernate.Test/DynamicEntity/ProxyHelper.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.sln Removed Paths: ------------- trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy/ trunk/nhibernate/src/NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy/ trunk/nhibernate/src/NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/default.build 2008-11-07 21:41:22 UTC (rev 3893) @@ -26,10 +26,10 @@ <include name="Iesi.Collections/Iesi.Collections.build" /> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate/NHibernate.build" /> - <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy/ProxyGenerators.build" /> - <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> - <include name="NHibernate.ProxyGenerators.CastleDynamicProxy/ProxyGenerators.build" /> - <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> + <include name="NHibernate.ByteCode.LinFu/ByteCode.build" /> + <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Castle/ByteCode.build" /> + <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> @@ -39,8 +39,8 @@ <fileset id="buildfiles.tests" basedir="src"> <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> - <include name="NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests/ProxyGenerators.Test.build" /> - <include name="NHibernate.ProxyGenerators.CastleDynamicProxy.Tests/ProxyGenerators.Test.build" /> + <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" if="${run.performance.tests}" /> @@ -89,10 +89,10 @@ --> <exclude name="Iesi.Collections.dll" /> <exclude name="Iesi.Collections.xml" /> - <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.dll" /> - <exclude name="NHibernate.ProxyGenerators.LinFuDynamicProxy.xml" /> - <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.dll" /> - <exclude name="NHibernate.ProxyGenerators.CastleDynamicProxy.xml" /> + <exclude name="NHibernate.ByteCode.LinFuDynamicProxy.dll" /> + <exclude name="NHibernate.ByteCode.LinFuDynamicProxy.xml" /> + <exclude name="NHibernate.ByteCode.CastleDynamicProxy.dll" /> + <exclude name="NHibernate.ByteCode.CastleDynamicProxy.xml" /> <include name="*.dll" /> <include name="*.xml" /> <include name="*.license.txt" /> Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/releasenotes.txt 2008-11-07 21:41:22 UTC (rev 3893) @@ -2,15 +2,17 @@ ======================== ** BREAKING CHANGES from NH2.0.xGA to NH2.1.0 ##### Run time ##### - * If you want work using lazy loading with Castle.DynamicProxy2 now you must deploy NHibernate.ProxyGenerators.CastleDynamicProxy.dll + * If you want work using lazy loading with LinFu.DynamicProxy now you must deploy NHibernate.ByteCode.LinFu.dll + * If you want work using lazy loading with Castle.DynamicProxy2 now you must deploy NHibernate.ByteCode.Castle.dll ##### Possible Breaking Changes for external frameworks ##### * ISession interface have additional methods - * DefaultProxyFactoryFactory moved to NHibernate.Bytecode.Castle.ProxyFactoryFactory + * DefaultProxyFactoryFactory removed * IProxyFactoryFactory now provide the IProxyValidator implementation ##### Initialization time ##### * The ProxyValidator check for "internal virtual" (to be intercepted by proxy need "protected internal virtual") + * The session-factory configuration property "proxyfactory.factory_class" is mandatory; You must choose one of the availables NHibernate.ByteCode Build 2.0.1.GA Modified: trunk/nhibernate/src/NHibernate.Config.Templates/FireBird.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/FireBird.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/FireBird.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -24,7 +24,8 @@ </property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.FirebirdDialect</property> - <property name="command_timeout">444</property> + <property name="command_timeout">60</property> <property name="query.substitutions">true 1, false 0, yes 1, no 0</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -15,7 +15,8 @@ <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> <property name="use_outer_join">true</property> - <property name="command_timeout">444</property> + <property name="command_timeout">60</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Config.Templates/MySql.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/MySql.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/MySql.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -12,5 +12,6 @@ Database=test;Data Source=someip;User Id=blah;Password=blah </property> <property name="dialect">NHibernate.Dialect.MySQLDialect</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Config.Templates/Oracle.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/Oracle.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/Oracle.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -14,5 +14,6 @@ <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.OracleDialect</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Config.Templates/PostgreSQL.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/PostgreSQL.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/PostgreSQL.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -11,5 +11,6 @@ Server=localhost;initial catalog=nhibernate;User ID=nhibernate;Password=nhibernate; </property> <property name="dialect">NHibernate.Dialect.PostgreSQLDialect</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Config.Templates/SQLite.cfg.xml.tmpl =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/SQLite.cfg.xml.tmpl 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Config.Templates/SQLite.cfg.xml.tmpl 2008-11-07 21:41:22 UTC (rev 3893) @@ -12,5 +12,6 @@ </property> <property name="dialect">NHibernate.Dialect.SQLiteDialect</property> <property name="query.substitutions">true=1;false=0</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2008-11-07 21:41:22 UTC (rev 3893) @@ -99,12 +99,16 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.HbmXsd", "NHibernate.Tool.HbmXsd\NHibernate.Tool.HbmXsd.csproj", "{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default proxy generator", "Default proxy generator", "{D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ByteCode providers", "ByteCode providers", "{D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy", "NHibernate.ProxyGenerators.CastleDynamicProxy\NHibernate.ProxyGenerators.CastleDynamicProxy.csproj", "{31C3F0EA-0FED-4A2F-B68D-96CE29844487}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.Castle", "NHibernate.ByteCode.Castle\NHibernate.ByteCode.Castle.csproj", "{31C3F0EA-0FED-4A2F-B68D-96CE29844487}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests", "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests\NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.Castle.Tests", "NHibernate.ByteCode.Castle.Tests\NHibernate.ByteCode.Castle.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.LinFu", "NHibernate.ByteCode.LinFu\NHibernate.ByteCode.LinFu.csproj", "{8289D6AD-9714-42D3-A94D-D4D9814D1281}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.LinFu.Tests", "NHibernate.ByteCode.LinFu.Tests\NHibernate.ByteCode.LinFu.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -226,6 +230,26 @@ {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.Build.0 = Release|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|.NET.ActiveCfg = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|.NET.ActiveCfg = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.Build.0 = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|.NET.ActiveCfg = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|.NET.ActiveCfg = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.Build.0 = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -246,8 +270,10 @@ {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4} {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344} = {C91E7018-3C67-4830-963A-C388C75E1BD5} {58CE4584-31B9-4E74-A7FB-5D40BFAD0876} = {C91E7018-3C67-4830-963A-C388C75E1BD5} + {4972EE96-2417-4D47-9FF1-3B1D6B1D3191} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} + {8289D6AD-9714-42D3-A94D-D4D9814D1281} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} + {94FDD99B-8275-4E51-8F43-958B2C632120} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} {31C3F0EA-0FED-4A2F-B68D-96CE29844487} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} - {4972EE96-2417-4D47-9FF1-3B1D6B1D3191} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} EndGlobalSection GlobalSection(TextTemplating) = postSolution TextTemplating = 1 Modified: trunk/nhibernate/src/NHibernate.Example.Web/Web.Config =================================================================== --- trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2008-11-07 21:41:22 UTC (rev 3893) @@ -61,6 +61,7 @@ </property> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> <property name="current_session_context_class">managed_web</property> + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Test/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Test/App.config 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Test/App.config 2008-11-07 21:41:22 UTC (rev 3893) @@ -66,6 +66,8 @@ <property name="command_timeout">444</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> <property name="adonet.wrap_result_sets">false</property> + + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Test/DynamicEntity/DataProxyHandler.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/DynamicEntity/DataProxyHandler.cs 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Test/DynamicEntity/DataProxyHandler.cs 2008-11-07 21:41:22 UTC (rev 3893) @@ -1,9 +1,9 @@ using System.Collections; -using Castle.Core.Interceptor; +using LinFu.DynamicProxy; namespace NHibernate.Test.DynamicEntity { - public sealed class DataProxyHandler : Castle.Core.Interceptor.IInterceptor + public sealed class DataProxyHandler : LinFu.DynamicProxy.IInterceptor { private readonly Hashtable data = new Hashtable(); private readonly string entityName; @@ -26,32 +26,32 @@ #region IInterceptor Members - public void Intercept(IInvocation invocation) + public object Intercept(InvocationInfo info) { - invocation.ReturnValue = null; - string methodName = invocation.Method.Name; + string methodName = info.TargetMethod.Name; if ("get_DataHandler".Equals(methodName)) { - invocation.ReturnValue = this; + return this; } else if (methodName.StartsWith("set_")) { string propertyName = methodName.Substring(4); - data[propertyName] = invocation.Arguments[0]; + data[propertyName] = info.Arguments[0]; } else if (methodName.StartsWith("get_")) { string propertyName = methodName.Substring(4); - invocation.ReturnValue = data[propertyName]; + return data[propertyName]; } else if ("ToString".Equals(methodName)) { - invocation.ReturnValue = entityName + "#" + data["Id"]; + return entityName + "#" + data["Id"]; } else if ("GetHashCode".Equals(methodName)) { - invocation.ReturnValue = GetHashCode(); + return GetHashCode(); } + return null; } #endregion Modified: trunk/nhibernate/src/NHibernate.Test/DynamicEntity/ProxyHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/DynamicEntity/ProxyHelper.cs 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Test/DynamicEntity/ProxyHelper.cs 2008-11-07 21:41:22 UTC (rev 3893) @@ -1,65 +1,56 @@ -using Castle.DynamicProxy; +using LinFu.DynamicProxy; namespace NHibernate.Test.DynamicEntity { public class ProxyHelper { - private static readonly ProxyGenerator proxyGenerator = new ProxyGenerator(); + private static readonly ProxyFactory proxyGenerator = new ProxyFactory(); + private static T NewProxy<T>(object id) + { + return proxyGenerator.CreateProxy<T>(new DataProxyHandler(typeof (T).FullName, id), + new[] {typeof (IProxyMarker), typeof (T)}); + + } + public static Person NewPersonProxy() { - return NewPersonProxy(0L); + return NewProxy<Person>(0L); } public static Person NewPersonProxy(object id) { - return - (Person) - proxyGenerator.CreateInterfaceProxyWithoutTarget(typeof (Person), - new System.Type[] {typeof (IProxyMarker), typeof (Person)}, - new DataProxyHandler(typeof (Person).FullName, id)); + return NewProxy<Person>(id); } public static Customer NewCustomerProxy() { - return NewCustomerProxy(0L); + return NewProxy<Customer>(0L); } public static Customer NewCustomerProxy(object id) { - return - (Customer) - proxyGenerator.CreateInterfaceProxyWithoutTarget(typeof (Customer), - new System.Type[] {typeof (IProxyMarker), typeof (Customer)}, - new DataProxyHandler(typeof (Customer).FullName, id)); + return NewProxy<Customer>(id); } public static Company NewCompanyProxy() { - return NewCompanyProxy(0L); + return NewProxy<Company>(0L); } public static Company NewCompanyProxy(object id) { - return - (Company) - proxyGenerator.CreateInterfaceProxyWithoutTarget(typeof (Company), - new System.Type[] {typeof (IProxyMarker), typeof (Company)}, - new DataProxyHandler(typeof (Company).FullName, id)); + return NewProxy<Company>(id); } public static Address NewAddressProxy() { - return NewAddressProxy(0L); + return NewProxy<Address>(0L); } public static Address NewAddressProxy(object id) { - return - (Address) - proxyGenerator.CreateInterfaceProxyWithoutTarget(typeof (Address), - new System.Type[] {typeof (IProxyMarker), typeof (Address)}, - new DataProxyHandler(typeof (Address).FullName, id)); + return NewProxy<Address>(id); } public static string ExtractEntityName(object obj) Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2008-11-07 21:41:22 UTC (rev 3893) @@ -11,14 +11,13 @@ <include name="System.dll" /> <include name="System.Transactions.dll" /> <include name="System.Configuration.dll" /> - <include name="System.XML.dll" /> + <include name="System.Xml.dll" /> <include name="System.Data.dll" /> <include name="Iesi.Collections.dll" /> <include name="log4net.dll" /> <include name="NHibernate.DomainModel.dll" /> <include name="NHibernate.dll" /> - <include name="Castle.DynamicProxy2.dll" /> - <include name="Castle.Core.dll" /> + <include name="LinFu.DynamicProxy.dll" /> <include name="nunit.framework.dll" /> </assemblyfileset> <resourcefileset id="project.resources" prefix="NHibernate.Test" dynamicprefix="true"> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2008-11-07 21:41:22 UTC (rev 3893) @@ -39,18 +39,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> - <Reference Include="Castle.Core, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.Core.dll</HintPath> - </Reference> - <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\lib\net\2.0\Castle.DynamicProxy2.dll</HintPath> - </Reference> <Reference Include="Iesi.Collections, Version=1.0.0.1, Culture=neutral, PublicKeyToken=154fdcb44c4484fc"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\2.0\Iesi.Collections.dll</HintPath> </Reference> + <Reference Include="LinFu.DynamicProxy, Version=1.0.3233.760, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\2.0\LinFu.DynamicProxy.dll</HintPath> + </Reference> <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\lib\net\2.0\log4net.dll</HintPath> @@ -1026,14 +1022,14 @@ <None Include="NHibernate.Test.nunit" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\NHibernate.ByteCode.LinFu\NHibernate.ByteCode.LinFu.csproj"> + <Project>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</Project> + <Name>NHibernate.ByteCode.LinFu</Name> + </ProjectReference> <ProjectReference Include="..\NHibernate.DomainModel\NHibernate.DomainModel.csproj"> <Project>{5C649B55-1B3F-4C38-9998-1B043E94A244}</Project> <Name>NHibernate.DomainModel</Name> </ProjectReference> - <ProjectReference Include="..\NHibernate.ProxyGenerators.CastleDynamicProxy\NHibernate.ProxyGenerators.CastleDynamicProxy.csproj"> - <Project>{31C3F0EA-0FED-4A2F-B68D-96CE29844487}</Project> - <Name>NHibernate.ProxyGenerators.CastleDynamicProxy</Name> - </ProjectReference> <ProjectReference Include="..\NHibernate\NHibernate.csproj"> <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> <Name>NHibernate</Name> Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2008-11-07 07:37:36 UTC (rev 3892) +++ trunk/nhibernate/src/NHibernate.sln 2008-11-07 21:41:22 UTC (rev 3893) @@ -12,14 +12,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Test", "NHibernate.Test\NHibernate.Test.csproj", "{7AEE5B37-C552-4E59-9B6F-88755BCB5070}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy", "NHibernate.ProxyGenerators.CastleDynamicProxy\NHibernate.ProxyGenerators.CastleDynamicProxy.csproj", "{31C3F0EA-0FED-4A2F-B68D-96CE29844487}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.LinFu", "NHibernate.ByteCode.LinFu\NHibernate.ByteCode.LinFu.csproj", "{8289D6AD-9714-42D3-A94D-D4D9814D1281}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests", "NHibernate.ProxyGenerators.CastleDynamicProxy.Tests\NHibernate.ProxyGenerators.CastleDynamicProxy.Tests.csproj", "{4972EE96-2417-4D47-9FF1-3B1D6B1D3191}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.LinFu.Tests", "NHibernate.ByteCode.LinFu.Tests\NHibernate.ByteCode.LinFu.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy", "NHibernate.ProxyGenerators.LinFuDynamicProxy\NHibernate.ProxyGenerators.LinFuDynamicProxy.csproj", "{8289D6AD-9714-42D3-A94D-D4D9814D1281}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests", "NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests\NHibernate.ProxyGenerators.LinFuDynamicProxy.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,14 +34,6 @@ {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Debug|Any CPU.Build.0 = Debug|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.ActiveCfg = Release|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.Build.0 = Release|Any CPU - {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31C3F0EA-0FED-4A2F-B68D-96CE29844487}.Release|Any CPU.Build.0 = Release|Any CPU - {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4972EE96-2417-4D47-9FF1-3B1D6B1D3191}.Release|Any CPU.Build.0 = Release|Any CPU {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Debug|Any CPU.Build.0 = Debug|Any CPU {8289D6AD-9714-42D3-A94D-D4D9814D1281}.Release|Any CPU.ActiveCfg = Release|Any CPU This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-05 14:13:22
|
Revision: 3978 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3978&view=rev Author: ayenderahien Date: 2009-01-05 14:13:16 +0000 (Mon, 05 Jan 2009) Log Message: ----------- Adding test to see that generated stats and 2nd level cache works together Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Stats/SessionStatsFixture.cs Property Changed: ---------------- trunk/nhibernate/lib/net/2.0/ Property changes on: trunk/nhibernate/lib/net/2.0 ___________________________________________________________________ Added: svn:ignore + NHibernate.dll Modified: trunk/nhibernate/src/NHibernate.Test/Stats/SessionStatsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Stats/SessionStatsFixture.cs 2009-01-05 12:57:44 UTC (rev 3977) +++ trunk/nhibernate/src/NHibernate.Test/Stats/SessionStatsFixture.cs 2009-01-05 14:13:16 UTC (rev 3978) @@ -5,6 +5,8 @@ namespace NHibernate.Test.Stats { + using Criterion; + [TestFixture] public class SessionStatsFixture : TestCase { @@ -38,6 +40,32 @@ } [Test] + public void Can_use_cached_query_that_return_no_results() + { + Assert.IsTrue(sessions.Settings.IsQueryCacheEnabled); + + using(ISession s = OpenSession()) + { + IList list = s.CreateCriteria(typeof (Country)) + .Add(Restrictions.Eq("Name", "Narnia")) + .SetCacheable(true) + .List(); + + Assert.AreEqual(0, list.Count); + } + + using (ISession s = OpenSession()) + { + IList list = s.CreateCriteria(typeof(Country)) + .Add(Restrictions.Eq("Name", "Narnia")) + .SetCacheable(true) + .List(); + + Assert.AreEqual(0, list.Count); + } + } + + [Test] public void SessionStatistics() { ISession s = OpenSession(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-02-20 20:18:33
|
Revision: 4090 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4090&view=rev Author: fabiomaulo Date: 2009-02-20 20:18:28 +0000 (Fri, 20 Feb 2009) Log Message: ----------- Fix NH-1678 and NH-1686 Possible breaking change (see release notes) Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/IStatelessSession.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs trunk/nhibernate/src/NHibernate.Test/Stateless/StatelessSessionFixture.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/releasenotes.txt 2009-02-20 20:18:28 UTC (rev 4090) @@ -7,7 +7,8 @@ * compatible only with .NET2.0 SP1 or above (System.DateTimeOffset) ##### Possible Breaking Changes for external frameworks ##### - * ISession interface have additional methods + * ISession interface has additional methods + * IStatelessSession interface has additional methods * DefaultProxyFactoryFactory removed * IProxyFactoryFactory now provide the IProxyValidator implementation Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -739,6 +739,21 @@ /// <summary> /// Creates a new <c>Criteria</c> for the entity class. /// </summary> + /// <typeparam name="T">The entity class</typeparam> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria<T>() where T : class; + + /// <summary> + /// Creates a new <c>Criteria</c> for the entity class with a specific alias + /// </summary> + /// <typeparam name="T">The entity class</typeparam> + /// <param name="alias">The alias of the entity</param> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria<T>(string alias) where T : class; + + /// <summary> + /// Creates a new <c>Criteria</c> for the entity class. + /// </summary> /// <param name="persistentClass">The class to Query</param> /// <returns>An ICriteria object</returns> ICriteria CreateCriteria(System.Type persistentClass); Modified: trunk/nhibernate/src/NHibernate/IStatelessSession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IStatelessSession.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate/IStatelessSession.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -130,7 +130,7 @@ /// <typeparam name="T">A class, which is persistent, or has persistent subclasses</typeparam> /// <returns> The <see cref="ICriteria"/>. </returns> /// <remarks>Entities returned by the query are detached.</remarks> - ICriteria CreateCriteria<T>(); + ICriteria CreateCriteria<T>() where T: class; /// <summary> /// Create a new <see cref="ICriteria"/> instance, for the given entity class, @@ -140,8 +140,27 @@ /// <param name="alias">The alias of the entity</param> /// <returns> The <see cref="ICriteria"/>. </returns> /// <remarks>Entities returned by the query are detached.</remarks> - ICriteria CreateCriteria<T>(string alias); + ICriteria CreateCriteria<T>(string alias) where T : class; + /// <summary> + /// Create a new <see cref="ICriteria"/> instance, for the given entity class, + /// or a superclass of an entity class. + /// </summary> + /// <param name="entityType">A class, which is persistent, or has persistent subclasses</param> + /// <returns> The <see cref="ICriteria"/>. </returns> + /// <remarks>Entities returned by the query are detached.</remarks> + ICriteria CreateCriteria(System.Type entityType); + + /// <summary> + /// Create a new <see cref="ICriteria"/> instance, for the given entity class, + /// or a superclass of an entity class, with the given alias. + /// </summary> + /// <param name="entityType">A class, which is persistent, or has persistent subclasses</param> + /// <param name="alias">The alias of the entity</param> + /// <returns> The <see cref="ICriteria"/>. </returns> + /// <remarks>Entities returned by the query are detached.</remarks> + ICriteria CreateCriteria(System.Type entityType, string alias); + /// <summary> /// Create a new <see cref="ICriteria"/> instance, for the given entity name. /// </summary> Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -1515,6 +1515,11 @@ return plan.PerformIterate<T>(queryParameters, this); } + public ICriteria CreateCriteria<T>() where T: class + { + return CreateCriteria(typeof (T)); + } + public ICriteria CreateCriteria(System.Type persistentClass) { CheckAndUpdateSessionStatus(); @@ -1522,6 +1527,11 @@ return new CriteriaImpl(persistentClass, this); } + public ICriteria CreateCriteria<T>(string alias) where T : class + { + return CreateCriteria(typeof (T), alias); + } + public ICriteria CreateCriteria(System.Type persistentClass, string alias) { CheckAndUpdateSessionStatus(); Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -664,10 +664,9 @@ /// <typeparam name="T">A class, which is persistent, or has persistent subclasses</typeparam> /// <returns> The <see cref="ICriteria"/>. </returns> /// <remarks>Entities returned by the query are detached.</remarks> - public ICriteria CreateCriteria<T>() + public ICriteria CreateCriteria<T>() where T: class { - CheckAndUpdateSessionStatus(); - return new CriteriaImpl(typeof(T), this); + return CreateCriteria(typeof (T)); } /// <summary> @@ -678,12 +677,23 @@ /// <param name="alias">The alias of the entity</param> /// <returns> The <see cref="ICriteria"/>. </returns> /// <remarks>Entities returned by the query are detached.</remarks> - public ICriteria CreateCriteria<T>(string alias) + public ICriteria CreateCriteria<T>(string alias) where T : class { + return CreateCriteria(typeof(T), alias); + } + + public ICriteria CreateCriteria(System.Type entityType) + { CheckAndUpdateSessionStatus(); - return new CriteriaImpl(typeof(T), alias, this); + return new CriteriaImpl(entityType, this); } + public ICriteria CreateCriteria(System.Type entityType, string alias) + { + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityType, alias, this); + } + /// <summary> /// Create a new <see cref="ICriteria"/> instance, for the given entity name. /// </summary> @@ -692,7 +702,8 @@ /// <remarks>Entities returned by the query are detached.</remarks> public ICriteria CreateCriteria(string entityName) { - throw new NotImplementedException(); + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, this); } /// <summary> @@ -705,7 +716,8 @@ /// <remarks>Entities returned by the query are detached.</remarks> public ICriteria CreateCriteria(string entityName, string alias) { - throw new NotImplementedException(); + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, alias, this); } /// <summary> Begin a NHibernate transaction.</summary> Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -1274,7 +1274,7 @@ ITransaction t = s.BeginTransaction(); // HQL: from Animal a where a.mother.class = Reptile - ICriteria c = s.CreateCriteria(typeof(Animal), "a") + ICriteria c = s.CreateCriteria<Animal>("a") .CreateAlias("mother", "m") .Add(Property.ForName("m.class").Eq(typeof(Reptile))); c.List(); @@ -1298,7 +1298,7 @@ { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); - s.CreateCriteria(typeof(Course)).SetProjection(Projections.Property("CourseCode")).List(); + s.CreateCriteria<Course>().SetProjection(Projections.Property("CourseCode")).List(); CriteriaTransformer.Clone(s.CreateCriteria(typeof(Course)).SetProjection(Projections.Id())).List(); t.Rollback(); s.Close(); Modified: trunk/nhibernate/src/NHibernate.Test/Stateless/StatelessSessionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Stateless/StatelessSessionFixture.cs 2009-02-20 19:48:11 UTC (rev 4089) +++ trunk/nhibernate/src/NHibernate.Test/Stateless/StatelessSessionFixture.cs 2009-02-20 20:18:28 UTC (rev 4090) @@ -77,10 +77,14 @@ Assert.AreEqual("Blahs", doc2.Name); Assert.AreEqual(doc.Text, doc2.Text); - doc2 = (Document)ss.CreateCriteria<Document>().UniqueResult(); + doc2 = ss.CreateCriteria<Document>().UniqueResult<Document>(); Assert.AreEqual("Blahs", doc2.Name); Assert.AreEqual(doc.Text, doc2.Text); + doc2 = (Document)ss.CreateCriteria(typeof(Document)).UniqueResult(); + Assert.AreEqual("Blahs", doc2.Name); + Assert.AreEqual(doc.Text, doc2.Text); + using (tx = ss.BeginTransaction()) { ss.Delete(doc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-03-03 19:55:10
|
Revision: 4106 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4106&view=rev Author: fabiomaulo Date: 2009-03-03 19:55:08 +0000 (Tue, 03 Mar 2009) Log Message: ----------- ByteCode provider of Spring.NET Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/src/NHibernate.Everything.sln Added Paths: ----------- trunk/nhibernate/src/NHibernate.ByteCode.Spring/ trunk/nhibernate/src/NHibernate.ByteCode.Spring/AbstractProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build trunk/nhibernate/src/NHibernate.ByteCode.Spring/LazyInitializer.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj trunk/nhibernate/src/NHibernate.ByteCode.Spring/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactoryFactory.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/DebugConnectionProvider.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/NHibernate.ByteCode.Spring.Tests.csproj trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/Properties/ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/IMyProxy.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyImpl.hbm.xml trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestCase.cs trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2009-03-03 07:06:19 UTC (rev 4105) +++ trunk/nhibernate/default.build 2009-03-03 19:55:08 UTC (rev 4106) @@ -30,6 +30,8 @@ <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> <include name="NHibernate.ByteCode.Castle/ByteCode.build" /> <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Spring/ByteCode.build" /> + <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> @@ -41,6 +43,7 @@ <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" if="${run.performance.tests}" /> @@ -89,10 +92,12 @@ --> <exclude name="Iesi.Collections.dll" /> <exclude name="Iesi.Collections.xml" /> - <exclude name="NHibernate.ByteCode.LinFuDynamicProxy.dll" /> - <exclude name="NHibernate.ByteCode.LinFuDynamicProxy.xml" /> - <exclude name="NHibernate.ByteCode.CastleDynamicProxy.dll" /> - <exclude name="NHibernate.ByteCode.CastleDynamicProxy.xml" /> + <exclude name="NHibernate.ByteCode.LinFu.dll" /> + <exclude name="NHibernate.ByteCode.LinFu.xml" /> + <exclude name="NHibernate.ByteCode.Castle.dll" /> + <exclude name="NHibernate.ByteCode.Castle.xml" /> + <exclude name="NHibernate.ByteCode.Spring.dll" /> + <exclude name="NHibernate.ByteCode.Spring.xml" /> <include name="*.dll" /> <include name="*.xml" /> <include name="*.license.txt" /> Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: svn:ignore + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/AbstractProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/AbstractProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/AbstractProxyFactory.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,51 @@ +using System.Reflection; +using Common.Logging; +using Iesi.Collections.Generic; +using NHibernate.Engine; +using NHibernate.Proxy; +using NHibernate.Type; + +namespace NHibernate.ByteCode.Spring +{ + /// <summary> + /// Convenience base class for <see cref="IProxyFactory"/> implementations, + /// providing common functionality. + /// </summary> + /// <author>Erich Eichinger (Spring.NET Team)</author> + public abstract class AbstractProxyFactory : IProxyFactory + { + protected readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected string EntityName { get; private set; } + protected System.Type PersistentClass { get; private set; } + protected System.Type[] Interfaces { get; private set; } + protected MethodInfo GetIdentifierMethod { get; private set; } + protected MethodInfo SetIdentifierMethod { get; private set; } + protected IAbstractComponentType ComponentIdType { get; private set; } + + protected bool IsClassProxy + { + get { return Interfaces.Length == 1; } + } + + public virtual void PostInstantiate(string entityName, System.Type persistentClass, ISet<System.Type> interfaces, + MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, + IAbstractComponentType componentIdType) + { + EntityName = entityName; + PersistentClass = persistentClass; + Interfaces = new System.Type[interfaces.Count]; + + if (interfaces.Count > 0) + { + interfaces.CopyTo(Interfaces, 0); + } + + GetIdentifierMethod = getIdentifierMethod; + SetIdentifierMethod = setIdentifierMethod; + ComponentIdType = componentIdType; + } + + public abstract INHibernateProxy GetProxy(object id, ISessionImplementor session); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ByteCode.build ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/LazyInitializer.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/LazyInitializer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/LazyInitializer.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,105 @@ +using System; +using System.Reflection; +using AopAlliance.Intercept; +using NHibernate.Engine; +using NHibernate.Proxy.Poco; +using NHibernate.Type; +using Spring.Aop; +using Spring.Reflection.Dynamic; + +namespace NHibernate.ByteCode.Spring +{ + [Serializable] + public class LazyInitializer : BasicLazyInitializer, IMethodInterceptor, ITargetSource + { + private static readonly object NULL = new object(); + + private static readonly MethodInfo exceptionInternalPreserveStackTrace = + typeof (Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); + + private static MethodInfo MapInterfaceMethodToImplementationIfNecessary(MethodInfo methodInfo, + System.Type implementingType) + { + MethodInfo concreteMethodInfo = methodInfo; + + if (methodInfo!= null && methodInfo.DeclaringType.IsInterface) + { + InterfaceMapping interfaceMapping = implementingType.GetInterfaceMap(methodInfo.DeclaringType); + int methodIndex = Array.IndexOf(interfaceMapping.InterfaceMethods, methodInfo); + concreteMethodInfo = interfaceMapping.TargetMethods[methodIndex]; + } + + return concreteMethodInfo; + } + + public LazyInitializer(string entityName, System.Type persistentClass, object id, MethodInfo getIdentifierMethod, + MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType, + ISessionImplementor session) + : base( + entityName, persistentClass, id, MapInterfaceMethodToImplementationIfNecessary(getIdentifierMethod, persistentClass), + MapInterfaceMethodToImplementationIfNecessary(setIdentifierMethod, persistentClass), componentIdType, session) + { + InterceptCalls = true; + } + + public bool InterceptCalls { get; set; } + + #region Implementation of IInterceptor + + public object Invoke(IMethodInvocation info) + { + object returnValue; + try + { + returnValue = base.Invoke(info.Method, info.Arguments, info.Target); + + if (returnValue != InvokeImplementation) + { + return returnValue; + } + if (InterceptCalls) + { + var method = new SafeMethod(info.Method); + return method.Invoke(GetImplementation(), info.Arguments); + } + } + catch (TargetInvocationException ex) + { + exceptionInternalPreserveStackTrace.Invoke(ex.InnerException, new Object[] { }); + throw ex.InnerException; + } + + return returnValue; + } + + #endregion + + #region Implementation of ITargetSource + + object ITargetSource.GetTarget() + { + if (!IsUninitialized) + { + return Target; + } + return NULL; + } + + void ITargetSource.ReleaseTarget(object target) + { + //throw new System.NotImplementedException(); + } + + System.Type ITargetSource.TargetType + { + get { return base.PersistentClass; } + } + + bool ITargetSource.IsStatic + { + get { return false; } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/NHibernate.ByteCode.Spring.csproj 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{946BCA10-109A-4472-8521-76616174AD4D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ByteCode.Spring</RootNamespace> + <AssemblyName>NHibernate.ByteCode.Spring</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\antlr.runtime.dll</HintPath> + </Reference> + <Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Common.Logging.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="Spring.Aop, Version=1.2.0.20001, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Spring.Aop.dll</HintPath> + </Reference> + <Reference Include="Spring.Core, Version=1.2.0.20001, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Spring.Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AbstractProxyFactory.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="LazyInitializer.cs" /> + <Compile Include="ProxyFactory.cs" /> + <Compile Include="ProxyFactoryFactory.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="ByteCode.build" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring/Properties ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactory.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,55 @@ +using System; +using NHibernate.Engine; +using NHibernate.Proxy; + +namespace NHibernate.ByteCode.Spring +{ + /// <summary> + /// A Spring for .NET backed <see cref="IProxyFactory"/> implementation for creating + /// NHibernate proxies. + /// </summary> + /// <seealso cref="ProxyFactoryFactory"/> + /// <author>Erich Eichinger (Spring.NET Team)</author> + public class ProxyFactory : AbstractProxyFactory + { + [Serializable] + private class SerializableProxyFactory : global::Spring.Aop.Framework.ProxyFactory + { + // ensure proxy types are generated as Serializable + public override bool IsSerializable + { + get { return true; } + } + } + + #region IProxyFactory Members + + public override INHibernateProxy GetProxy(object id, ISessionImplementor session) + { + try + { + var initializer = new LazyInitializer(EntityName, PersistentClass, id, GetIdentifierMethod, SetIdentifierMethod, + ComponentIdType, session); + + var proxyFactory = new SerializableProxyFactory(); + proxyFactory.Interfaces = Interfaces; + proxyFactory.TargetSource = initializer; + proxyFactory.ProxyTargetType = IsClassProxy; + proxyFactory.AddAdvice(initializer); + + object proxyInstance = proxyFactory.GetProxy(); + + initializer.InterceptCalls = true; + + return (INHibernateProxy) proxyInstance; + } + catch (Exception ex) + { + log.Error("Creating a proxy instance failed", ex); + throw new HibernateException("Creating a proxy instance failed", ex); + } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactoryFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactoryFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring/ProxyFactoryFactory.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,30 @@ +using NHibernate.Bytecode; +using NHibernate.Proxy; + +namespace NHibernate.ByteCode.Spring +{ + /// <summary> + /// Creates a Spring for .NET backed <see cref="IProxyFactory"/> instance. + /// </summary> + /// <remarks> + /// TODO: mention how to configure + /// </remarks> + /// <author>Erich Eichinger</author> + public class ProxyFactoryFactory : IProxyFactoryFactory + { + #region IProxyFactoryFactory Members + + public IProxyFactory BuildProxyFactory() + { + return new ProxyFactory(); + } + + public IProxyValidator ProxyValidator + { + // TODO : check what this validator does? + get { return new DynProxyTypeValidator(); } + } + + #endregion + } +} \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: svn:ignore + obj .#* *.user *.xsx *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* AssemblyInfo.cs hibernate.cfg.xml Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/App.config 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<configuration> + <configSections> + <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/> + <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> + </configSections> + + <!-- + hibernate-configuration section + + You don't need to change this section for your own use. + You can write your own hibernate.cfg.xml to override all session-factory configuration. + Templates are available in NHibernate.Config.Templates folder. + --> + <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> + <bytecode-provider type="lcg"/> + <reflection-optimizer use="true"/> + <session-factory name="NHibernate.Test"> + <property name="connection.provider">NHibernate.ByteCode.Spring.Tests.DebugConnectionProvider, NHibernate.ByteCode.Spring.Tests</property> + <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property> + <property name="cache.use_query_cache">true</property> + <property name="prepare_sql">false</property> + <property name="query.startup_check">false</property> + <property name="connection.isolation">ReadCommitted</property> + <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> + <property name="connection.connection_string"> + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + </property> + <property name="show_sql">false</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="use_outer_join">true</property> + <property name="command_timeout">10</property> + <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + <property name="adonet.wrap_result_sets">false</property> + + <property name="proxyfactory.factory_class">NHibernate.ByteCode.Spring.ProxyFactoryFactory, NHibernate.ByteCode.Spring</property> + + </session-factory> + </hibernate-configuration> + + <!-- This section contains the log4net configuration settings --> + <log4net debug="false"> + + <!-- Define some output appenders --> + <appender name="trace" type="log4net.Appender.TraceAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="console" type="log4net.Appender.ConsoleAppender, log4net"> + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/> + </layout> + </appender> + + <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net"> + + <param name="File" value="log.txt"/> + <param name="AppendToFile" value="false"/> + <param name="RollingStyle" value="Date"/> + <param name="DatePattern" value="yyyy.MM.dd"/> + <param name="StaticLogFileName" value="true"/> + + <layout type="log4net.Layout.PatternLayout,log4net"> + <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/> + </layout> + </appender> + + <root> + <priority value="WARN"/> + <appender-ref ref="console"/> + </root> + <logger name="NHibernate.Proxy.Poco"> + <priority value="DEBUG"/> + </logger> + + <logger name="NHibernate.ByteCode.Spring"> + <priority value="DEBUG"/> + </logger> + </log4net> + + +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,47 @@ +<?xml version="1.0" ?> + +<project + name="NHibernate.ByteCode.Spring.Tests" + default="build" + xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd" +> + <property name="root.dir" value="../.." /> + + <include buildfile="${root.dir}/build-common/common-project.xml" /> + + <target name="init" depends="common.init"> + + <property name="assembly.is-cls-compliant" value="false" /> + <property name="assembly.description" value="The Unit Tests for Spring ByteCode." /> + <property name="assembly.version" value="1.0.0.1" /> + <property name="assembly.version.informational" value="1.0" /> + + <property name="clover.instrument" value="false" /> + + <assemblyfileset id="project.references" basedir="${bin.dir}"> + <include name="System.dll" /> + <include name="System.XML.dll" /> + <include name="System.Data.dll" /> + <include name="System.Core.dll" /> + <include name="Common.Logging.dll" /> + <include name="Iesi.Collections.dll" /> + <include name="log4net.dll" /> + <include name="antlr.runtime.dll" /> + <include name="Spring.Aop.dll" /> + <include name="Spring.Core.dll" /> + <include name="NHibernate.dll" /> + <include name="NHibernate.ByteCode.Spring.dll" /> + <include name="nunit.framework.dll"/> + </assemblyfileset> + + <resourcefileset id="project.resources" prefix="NHibernate.ByteCode.Spring.Tests" dynamicprefix="true"> + <include name="**/*.xml" /> + <exclude name="bin/**/*.xml" /> + </resourcefileset> + </target> + + <target name="generate-assemblyinfo" depends="init common.generate-assemblyinfo" /> + <target name="build" depends="init generate-assemblyinfo common.compile-tests" /> + <target name="test" depends="init build common.run-tests" /> + +</project> Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/DebugConnectionProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/DebugConnectionProvider.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/DebugConnectionProvider.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,68 @@ +using System.Collections; +using System.Data; +using Iesi.Collections; +using NHibernate.Connection; + +namespace NHibernate.ByteCode.Spring.Tests +{ + public class DebugConnectionProvider : DriverConnectionProvider + { + private readonly ISet connections = new ListSet(); + + public override IDbConnection GetConnection() + { + IDbConnection connection = base.GetConnection(); + connections.Add(connection); + return connection; + } + + public override void CloseConnection(IDbConnection conn) + { + base.CloseConnection(conn); + connections.Remove(conn); + } + + public bool HasOpenConnections + { + get + { + // check to see if all connections that were at one point opened + // have been closed through the CloseConnection + // method + if (connections.IsEmpty) + { + // there are no connections, either none were opened or + // all of the closings went through CloseConnection. + return false; + } + else + { + // Disposing of an ISession does not call CloseConnection (should it???) + // so a Diposed of ISession will leave an IDbConnection in the list but + // the IDbConnection will be closed (atleast with MsSql it works this way). + foreach (IDbConnection conn in connections) + { + if (conn.State != ConnectionState.Closed) + { + return true; + } + } + + // all of the connections have been Disposed and were closed that way + // or they were Closed through the CloseConnection method. + return false; + } + } + } + + public void CloseAllConnections() + { + while (!connections.IsEmpty) + { + IEnumerator en = connections.GetEnumerator(); + en.MoveNext(); + CloseConnection(en.Current as IDbConnection); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/NHibernate.ByteCode.Spring.Tests.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/NHibernate.ByteCode.Spring.Tests.csproj (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/NHibernate.ByteCode.Spring.Tests.csproj 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7EFC4549-3761-4B68-B81F-12AA51D78E92}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NHibernate.ByteCode.Spring.Tests</RootNamespace> + <AssemblyName>NHibernate.ByteCode.Spring.Tests</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\antlr.runtime.dll</HintPath> + </Reference> + <Reference Include="Common.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Common.Logging.dll</HintPath> + </Reference> + <Reference Include="Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Iesi.Collections.dll</HintPath> + </Reference> + <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\log4net.dll</HintPath> + </Reference> + <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\nunit.framework.dll</HintPath> + </Reference> + <Reference Include="Spring.Aop, Version=1.2.0.20001, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Spring.Aop.dll</HintPath> + </Reference> + <Reference Include="Spring.Core, Version=1.2.0.20001, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\lib\net\3.5\Spring.Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.XML" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="DebugConnectionProvider.cs" /> + <Compile Include="ProxyInterface\IMyProxy.cs" /> + <Compile Include="ProxyInterface\MyProxyImpl.cs" /> + <Compile Include="ProxyInterface\ProxyFixture.cs" /> + <Compile Include="TestCase.cs" /> + <Compile Include="TestConfigurationHelper.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ProxyInterface\ProxyImpl.hbm.xml" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + <None Include="ByteCode.Test.build" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\NHibernate.ByteCode.Spring\NHibernate.ByteCode.Spring.csproj"> + <Project>{946BCA10-109A-4472-8521-76616174AD4D}</Project> + <Name>NHibernate.ByteCode.Spring</Name> + </ProjectReference> + <ProjectReference Include="..\NHibernate\NHibernate.csproj"> + <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> + <Name>NHibernate</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>if exist hibernate.cfg.xml (del hibernate.cfg.xml) +if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml")</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/Properties ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Property changes on: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: svn:ignore + obj .#* *.user *.xsx AssemblyInfo.cs *.aps *.eto [Bb]in [Dd]ebug [Rr]elease *resharper* Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/IMyProxy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/IMyProxy.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/IMyProxy.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,11 @@ +namespace NHibernate.ByteCode.Spring.Tests.ProxyInterface +{ + public interface IMyProxy + { + int Id { get; set; } + + string Name { get; set; } + + void ThrowDeepException(); + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/MyProxyImpl.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,30 @@ +using System; + +namespace NHibernate.ByteCode.Spring.Tests.ProxyInterface +{ + public class MyProxyImpl: IMyProxy + { + private static void Level1() + { + Level2(); + } + + private static void Level2() + { + throw new ArgumentException("thrown from Level2"); + } + + #region IMyProxy Members + + public int Id { get; set; } + + public string Name { get; set; } + + public void ThrowDeepException() + { + Level1(); + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyFixture.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,137 @@ +using System; +using System.Collections; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using NUnit.Framework; + +namespace NHibernate.ByteCode.Spring.Tests.ProxyInterface +{ + [TestFixture] + public class ProxyFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"ProxyInterface.ProxyImpl.hbm.xml"}; } + } + + private void SerializeAndDeserialize(ref ISession s) + { + // Serialize the session + using (Stream stream = new MemoryStream()) + { + IFormatter formatter = new BinaryFormatter(); + formatter.Serialize(stream, s); + + // Close the original session + s.Close(); + + // Deserialize the session + stream.Position = 0; + s = (ISession) formatter.Deserialize(stream); + } + } + + [Test] + public void Proxy() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap)); + int id = ap.Id; + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "get id should not have initialized it."); + string name = ap.Name; + Assert.IsTrue(NHibernateUtil.IsInitialized(ap), "get name should have initialized it."); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void ExceptionStackTrace() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.IsFalse(NHibernateUtil.IsInitialized(ap), "check we have a proxy"); + + try + { + ap.ThrowDeepException(); + Assert.Fail("Exception not thrown"); + } + catch (ArgumentException ae) + { + Assert.AreEqual("thrown from Level2", ae.Message); + + string[] stackTraceLines = ae.StackTrace.Split('\n'); + Assert.IsTrue(stackTraceLines[0].Contains("Level2"), "top of exception stack is Level2()"); + Assert.IsTrue(stackTraceLines[1].Contains("Level1"), "next on exception stack is Level1()"); + } + finally + { + s.Delete(ap); + s.Flush(); + s.Close(); + } + } + + [Test] + public void ProxySerialize() + { + ISession s = OpenSession(); + IMyProxy ap = new MyProxyImpl {Id = 1, Name = "first proxy"}; + s.Save(ap); + s.Flush(); + s.Close(); + + s = OpenSession(); + ap = (IMyProxy) s.Load(typeof (MyProxyImpl), ap.Id); + Assert.AreEqual(1, ap.Id); + s.Disconnect(); + + SerializeAndDeserialize(ref s); + + s.Reconnect(); + s.Disconnect(); + + // serialize and then deserialize the session again - make sure Castle.DynamicProxy + // has no problem with serializing two times - earlier versions of it did. + SerializeAndDeserialize(ref s); + + s.Close(); + + s = OpenSession(); + s.Delete(ap); + s.Flush(); + s.Close(); + } + + [Test] + public void SerializeNotFoundProxy() + { + ISession s = OpenSession(); + // this does not actually exists in db + var notThere = (IMyProxy) s.Load(typeof (MyProxyImpl), 5); + Assert.AreEqual(5, notThere.Id); + s.Disconnect(); + + // serialize and then deserialize the session. + SerializeAndDeserialize(ref s); + + Assert.IsNotNull(s.Load(typeof (MyProxyImpl), 5), "should be proxy - even though it doesn't exists in db"); + s.Close(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyImpl.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyImpl.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/ProxyInterface/ProxyImpl.hbm.xml 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.ByteCode.Spring.Tests" + namespace="NHibernate.ByteCode.Spring.Tests.ProxyInterface"> + <class name="MyProxyImpl" proxy="IMyProxy"> + <id name="Id"> + <generator class="assigned" /> + </id> + + <property name="Name" /> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestCase.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestCase.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,323 @@ +using System; +using System.Collections; +using System.Data; +using System.Reflection; +using log4net; +using log4net.Config; +using NHibernate.Cfg; +using NHibernate.Connection; +using NHibernate.Engine; +using NHibernate.Mapping; +using NHibernate.Tool.hbm2ddl; +using NHibernate.Type; +using NUnit.Framework; + +namespace NHibernate.ByteCode.Spring.Tests +{ + public abstract class TestCase + { + private const bool OutputDdl = false; + protected Configuration cfg; + protected ISessionFactoryImplementor sessions; + + private static readonly ILog log = LogManager.GetLogger(typeof(TestCase)); + + protected Dialect.Dialect Dialect + { + get { return NHibernate.Dialect.Dialect.GetDialect(cfg.Properties); } + } + + protected ISession lastOpenedSession; + private DebugConnectionProvider connectionProvider; + + /// <summary> + /// Mapping files used in the TestCase + /// </summary> + protected abstract IList Mappings { get; } + + /// <summary> + /// Assembly to load mapping files from (default is NHibernate.DomainModel). + /// </summary> + protected virtual string MappingsAssembly + { + get { return typeof(TestCase).Namespace; } + } + + static TestCase() + { + // Configure log4net here since configuration through an attribute doesn't always work. + XmlConfigurator.Configure(); + } + + /// <summary> + /// Creates the tables used in this TestCase + /// </summary> + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + try + { + Configure(); + if (!AppliesTo(Dialect)) + { + Assert.Ignore(GetType() + " does not apply to " + Dialect); + } + + CreateSchema(); + BuildSessionFactory(); + } + catch (Exception e) + { + log.Error("Error while setting up the test fixture", e); + throw; + } + } + + /// <summary> + /// Removes the tables used in this TestCase. + /// </summary> + /// <remarks> + /// If the tables are not cleaned up sometimes SchemaExport runs into + /// Sql errors because it can't drop tables because of the FKs. This + /// will occur if the TestCase does not have the same hbm.xml files + /// included as a previous one. + /// </remarks> + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + DropSchema(); + Cleanup(); + } + + protected virtual void OnSetUp() + { + } + + /// <summary> + /// Set up the test. This method is not overridable, but it calls + /// <see cref="OnSetUp" /> which is. + /// </summary> + [SetUp] + public void SetUp() + { + OnSetUp(); + } + + protected virtual void OnTearDown() + { + } + + /// <summary> + /// Checks that the test case cleans up after itself. This method + /// is not overridable, but it calls <see cref="OnTearDown" /> which is. + /// </summary> + [TearDown] + public void TearDown() + { + OnTearDown(); + + bool wasClosed = CheckSessionWasClosed(); + bool wasCleaned = CheckDatabaseWasCleaned(); + bool wereConnectionsClosed = CheckConnectionsWereClosed(); + bool fail = !wasClosed || !wasCleaned || !wereConnectionsClosed; + + if (fail) + { + Assert.Fail("Test didn't clean up after itself"); + } + } + + private bool CheckSessionWasClosed() + { + if (lastOpenedSession != null && lastOpenedSession.IsOpen) + { + log.Error("Test case didn't close a session, closing"); + lastOpenedSession.Close(); + return false; + } + + return true; + } + + private bool CheckDatabaseWasCleaned() + { + if (sessions.GetAllClassMetadata().Count == 0) + { + // Return early in the case of no mappings, also avoiding + // a warning when executing the HQL below. + return true; + } + + bool empty; + using (ISession s = sessions.OpenSession()) + { + IList objects = s.CreateQuery("from System.Object o").List(); + empty = objects.Count == 0; + } + + if (!empty) + { + log.Error("Test case didn't clean up the database after itself, re-creating the schema"); + DropSchema(); + CreateSchema(); + } + + return empty; + } + + private bool CheckConnectionsWereClosed() + { + if (connectionProvider == null || !connectionProvider.HasOpenConnections) + { + return true; + } + + log.Error("Test case didn't close all open connections, closing"); + connectionProvider.CloseAllConnections(); + return false; + } + + private void Configure() + { + cfg = new Configuration(); + if (TestConfigurationHelper.hibernateConfigFile != null) + cfg.Configure(TestConfigurationHelper.hibernateConfigFile); + + Assembly assembly = Assembly.Load(MappingsAssembly); + + foreach (string file in Mappings) + { + cfg.AddResource(MappingsAssembly + "." + file, assembly); + } + + Configure(cfg); + + ApplyCacheSettings(cfg); + } + + private void CreateSchema() + { + new SchemaExport(cfg).Create(OutputDdl, true); + } + + private void DropSchema() + { + new SchemaExport(cfg).Drop(OutputDdl, true); + } + + protected virtual void BuildSessionFactory() + { + sessions = (ISessionFactoryImplementor)cfg.BuildSessionFactory(); + connectionProvider = sessions.ConnectionProvider as DebugConnectionProvider; + } + + private void Cleanup() + { + sessions.Close(); + sessions = null; + connectionProvider = null; + lastOpenedSession = null; + cfg = null; + } + + public int ExecuteStatement(string sql) + { + if (cfg == null) + { + cfg = new Configuration(); + } + + using (IConnectionProvider prov = ConnectionProviderFactory.NewConnectionProvider(cfg.Properties)) + { + IDbConnection conn = prov.GetConnection(); + + try + { + using (IDbTransaction tran = conn.BeginTransaction()) + using (IDbCommand comm = conn.CreateCommand()) + { + comm.CommandText = sql; + comm.Transaction = tran; + comm.CommandType = CommandType.Text; + int result = comm.ExecuteNonQuery(); + tran.Commit(); + return result; + } + } + finally + { + prov.CloseConnection(conn); + } + } + } + + protected ISessionFactoryImplementor Sfi + { + get { return sessions; } + } + + protected virtual ISession OpenSession() + { + lastOpenedSession = sessions.OpenSession(); + return lastOpenedSession; + } + + protected virtual ISession OpenSession(IInterceptor sessionLocalInterceptor) + { + lastOpenedSession = sessions.OpenSession(sessionLocalInterceptor); + return lastOpenedSession; + } + + protected void ApplyCacheSettings(Configuration configuration) + { + if (CacheConcurrencyStrategy == null) + { + return; + } + + foreach (PersistentClass clazz in configuration.ClassMappings) + { + bool hasLob = false; + foreach (Property prop in clazz.PropertyClosureIterator) + { + if (prop.Value.IsSimpleValue) + { + IType type = ((SimpleValue)prop.Value).Type; + if (type == NHibernateUtil.BinaryBlob) + { + hasLob = true; + } + } + } + if (!hasLob && !clazz.IsInherited) + { + configuration.SetCacheConcurrencyStrategy(clazz.EntityName, CacheConcurrencyStrategy); + } + } + + foreach (Mapping.Collection coll in configuration.CollectionMappings) + { + configuration.SetCollectionCacheConcurrencyStrategy(coll.Role, CacheConcurrencyStrategy); + } + } + + #region Properties overridable by subclasses + + protected virtual bool AppliesTo(Dialect.Dialect dialect) + { + return true; + } + + protected virtual void Configure(Configuration configuration) + { + } + + protected virtual string CacheConcurrencyStrategy + { + get { return "nonstrict-read-write"; } + //get { return null; } + } + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.ByteCode.Spring.Tests/TestConfigurationHelper.cs 2009-03-03 19:55:08 UTC (rev 4106) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.ByteCode.Spring.Tests +{ + public static class TestConfigurationHelper + { + public static readonly string hibernateConfigFile; + + static TestConfigurationHelper() + { + // Verify if hibernate.cfg.xml exists + hibernateConfigFile = GetDefaultConfigurationFilePath(); + } + + public static string GetDefaultConfigurationFilePath() + { + string baseDir = AppDomain.CurrentDomain.BaseDirectory; + string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath; + string binPath = relativeSearchPath == null ? baseDir : Path.Combine(baseDir, relativeSearchPath); + string fullPath = Path.Combine(binPath, Configuration.DefaultHibernateCfgFileName); + return File.Exists(fullPath) ? fullPath : null; + } + + /// <summary> + /// Standard Configuration for tests. + /// </summary> + /// <returns>The configuration using merge between App.Config and hibernate.cfg.xml if present.</returns> + public static Configuration GetDefaultConfiguration() + { + var result = new Configuration(); + if (hibernateConfigFile != null) + { + result.Configure(hibernateConfigFile); + } + return result; + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2009-03-03 07:06:19 UTC (rev 4105) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2009-03-03 19:55:08 UTC (rev 4106) @@ -109,6 +109,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.LinFu.Tests", "NHibernate.ByteCode.LinFu.Tests\NHibernate.ByteCode.LinFu.Tests.csproj", "{94FDD99B-8275-4E51-8F43-958B2C632120}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.Spring", "NHibernate.ByteCode.Spring\NHibernate.ByteCode.Spring.csproj", "{946BCA10-109A-4472-8521-76616174AD4D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.ByteCode.Spring.Tests", "NHibernate.ByteCode.Spring.Tests\NHibernate.ByteCode.Spring.Tests.csproj", "{7EFC4549-3761-4B68-B81F-12AA51D78E92}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -250,6 +254,26 @@ {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Any CPU.Build.0 = Release|Any CPU {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {94FDD99B-8275-4E51-8F43-958B2C632120}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Debug|.NET.ActiveCfg = Debug|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Release|.NET.ActiveCfg = Release|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Release|Any CPU.Build.0 = Release|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {946BCA10-109A-4472-8521-76616174AD4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Debug|.NET.ActiveCfg = Debug|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Release|.NET.ActiveCfg = Release|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Release|Any CPU.Build.0 = Release|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7EFC4549-3761-4B68-B81F-12AA51D78E92}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -270,10 +294,12 @@ {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4} {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344} = {C91E7018-3C67-4830-963A-C388C75E1BD5} {58CE4584-31B9-4E74-A7FB-5D40BFAD0876} = {C91E7018-3C67-4830-963A-C388C75E1BD5} + {31C3F0EA-0FED-4A2F-B68D-96CE29844487} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} {4972EE96-2417-4D47-9FF1-3B1D6B1D3191} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} {8289D6AD-9714-42D3-A94D-D4D9814D1281} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} {94FDD99B-8275-4E51-8F43-958B2C632120} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} - {31C3F0EA-0FED-4A2F-B68D-96CE29844487} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} + {946BCA10-109A-4472-8521-76616174AD4D} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} + {7EFC4549-3761-4B68-B81F-12AA51D78E92} = {D2E4E87F-2531-4C7A-BBE9-FE8BFEDECECE} EndGlobalSection GlobalSection(TextTemplating) = postSolution TextTemplating = 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-03-14 03:26:31
|
Revision: 4126 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4126&view=rev Author: fabiomaulo Date: 2009-03-14 03:26:18 +0000 (Sat, 14 Mar 2009) Log Message: ----------- Update Castle.DynamicProxy2 2.1.0.5579 last release; as requested by Jonathon Rossi (Castle team) Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/Castle.Core.dll trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.dll trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml trunk/nhibernate/lib/net/3.5/Castle.Core.dll trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.dll trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml trunk/nhibernate/src/NHibernate.ByteCode.Castle/NHibernate.ByteCode.Castle.csproj trunk/nhibernate/src/NHibernate.ByteCode.Castle.Tests/NHibernate.ByteCode.Castle.Tests.csproj Modified: trunk/nhibernate/lib/net/2.0/Castle.Core.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml =================================================================== --- trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml 2009-03-14 03:09:32 UTC (rev 4125) +++ trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml 2009-03-14 03:26:18 UTC (rev 4126) @@ -245,6 +245,14 @@ <param name="targetType"></param> <returns></returns> </member> + <member name="M:Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.IsMethodEquivalent(System.Reflection.MethodInfo,System.Reflection.MethodInfo)"> + <summary> + Checks whether the given methods are the same. + </summary> + <param name="methodInfo"></param> + <param name="methodOnInterface"></param> + <returns>True if the methods are the same.</returns> + </member> <member name="T:Castle.DynamicProxy.Generators.InterfaceGeneratorType"> <summary> This is used by the ProxyObjectReference class durin de-serialiation, to know @@ -319,71 +327,119 @@ Applied to the assemblies saved by <see cref="T:Castle.DynamicProxy.ModuleScope"/> in order to persist the cache data included in the persisted assembly. </summary> </member> + <member name="T:Castle.DynamicProxy.DefaultProxyBuilder"> + <summary> + Default implementation of <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> interface producing in-memory proxy assemblies. + </summary> + </member> <member name="T:Castle.DynamicProxy.IProxyBuilder"> <summary> - Abstracts the implementation of proxy constructions + Abstracts the implementation of proxy type construction. </summary> </member> <member name="M:Castle.DynamicProxy.IProxyBuilder.CreateClassProxy(System.Type,Castle.DynamicProxy.ProxyGenerationOptions)"> <summary> - Implementors should return a proxy for the specified type. + Creates a proxy type for given <paramref name="classToProxy"/>, using <paramref name="options"/> provided. </summary> - <param name="theClass">The proxy base class.</param> + <param name="classToProxy">The class type to proxy.</param> <param name="options">The proxy generation options.</param> <returns>The generated proxy type.</returns> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="classToProxy"/> is a generic type definition.</exception> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="classToProxy"/> is not public. + Note that to avoid this exception, you can mark offending type internal, and define <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute"/> + pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate.</exception> + <seealso cref="T:Castle.DynamicProxy.Generators.ClassProxyGenerator"/> </member> <member name="M:Castle.DynamicProxy.IProxyBuilder.CreateClassProxy(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)"> <summary> - Implementors should return a proxy for the specified - type and interfaces. The interfaces must be only "mark" interfaces + Creates a proxy type for given <paramref name="classToProxy"/>, implementing <paramref name="additionalInterfacesToProxy"/>, using <paramref name="options"/> provided. </summary> - <param name="theClass"></param> - <param name="interfaces"></param> - <param name="options"></param> - <returns></returns> + <param name="classToProxy">The class type to proxy.</param> + <param name="additionalInterfacesToProxy">Additional interface types to proxy.</param> + <param name="options">The proxy generation options.</param> + <returns>The generated proxy type.</returns> + <remarks> + Implementers should return a proxy type for the specified class and interfaces. + Additional interfaces should be only 'mark' interfaces, that is, they should work like interface proxy without target. (See <see cref="M:Castle.DynamicProxy.IProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)"/> method.) + </remarks> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="classToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="classToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is not public. + Note that to avoid this exception, you can mark offending type internal, and define <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute"/> + pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate.</exception> + <seealso cref="T:Castle.DynamicProxy.Generators.ClassProxyGenerator"/> </member> <member name="M:Castle.DynamicProxy.IProxyBuilder.CreateInterfaceProxyTypeWithTarget(System.Type,System.Type[],System.Type,Castle.DynamicProxy.ProxyGenerationOptions)"> <summary> - Implementors should return a proxy for the specified - interface that 'proceeds' executions to the - specified target. + Creates a proxy type that proxies calls to <paramref name="interfaceToProxy"/> members on <paramref name="targetType"/>, implementing <paramref name="additionalInterfacesToProxy"/>, using <paramref name="options"/> provided. </summary> - <param name="theInterface"></param> - <param name="interfaces"></param> - <param name="targetType"></param> - <param name="options"></param> - <returns></returns> + <param name="interfaceToProxy">The interface type to proxy.</param> + <param name="additionalInterfacesToProxy">Additional interface types to proxy.</param> + <param name="targetType">Type implementing <paramref name="interfaceToProxy"/> on which calls to the interface members should be intercepted.</param> + <param name="options">The proxy generation options.</param> + <returns>The generated proxy type.</returns> + <remarks> + Implementers should return a proxy type for the specified interface that 'proceeds' executions to the specified target. + Additional interfaces should be only 'mark' interfaces, that is, they should work like interface proxy without target. (See <see cref="M:Castle.DynamicProxy.IProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)"/> method.) + </remarks> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is not public. + Note that to avoid this exception, you can mark offending type internal, and define <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute"/> + pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate.</exception> + <seealso cref="T:Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator"/> </member> <member name="M:Castle.DynamicProxy.IProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)"> <summary> - Implementors should return a proxy for the specified - interface that delegate all executions to the - specified interceptor(s). + Creates a proxy type for given <paramref name="interfaceToProxy"/> that delegates all calls to the provided interceptors. </summary> - <param name="theInterface"></param> - <param name="interfaces"></param> - <param name="options"></param> - <returns></returns> + <param name="interfaceToProxy">The interface type to proxy.</param> + <param name="additionalInterfacesToProxy">Additional interface types to proxy.</param> + <param name="options">The proxy generation options.</param> + <returns>The generated proxy type.</returns> + <remarks> + Implementers should return a proxy type for the specified interface and additional interfaces that delegate all executions to the specified interceptors. + </remarks> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is not public. + Note that to avoid this exception, you can mark offending type internal, and define <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute"/> + pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate.</exception> + <seealso cref="T:Castle.DynamicProxy.Generators.InterfaceProxyWithoutTargetGenerator"/> </member> <member name="M:Castle.DynamicProxy.IProxyBuilder.CreateInterfaceProxyTypeWithTargetInterface(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions)"> <summary> - Implementors should return a proxy for the specified - interface(s) that delegate all executions to the - specified interceptor(s) and uses an instance of the interface - as their targets, rather than a class. All IInvocation's - should then implement IChangeProxyTarget. + Creates a proxy type for given <paramref name="interfaceToProxy"/> and <parmaref name="additionalInterfacesToProxy"/> that delegates all calls to the provided interceptors and allows interceptors to switch the actual target of invocation. </summary> - <param name="theInterface"></param> - <param name="interfaces"></param> - <param name="options"></param> - <returns></returns> + <param name="interfaceToProxy">The interface type to proxy.</param> + <param name="additionalInterfacesToProxy">Additional interface types to proxy.</param> + <param name="options">The proxy generation options.</param> + <returns>The generated proxy type.</returns> + <remarks> + Implementers should return a proxy type for the specified interface(s) that delegate all executions to the specified interceptors + and uses an instance of the interface as their targets (i.e. <see cref="P:Castle.Core.Interceptor.IInvocation.InvocationTarget"/>), rather than a class. All <see cref="T:Castle.Core.Interceptor.IInvocation"/> classes should then implement <see cref="T:Castle.Core.Interceptor.IChangeProxyTarget"/> interface, + to allow interceptors to switch invocation target with instance of another type implementing called interface. + </remarks> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:Castle.DynamicProxy.Generators.GeneratorException">Thrown when <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is not public. + Note that to avoid this exception, you can mark offending type internal, and define <see cref="T:System.Runtime.CompilerServices.InternalsVisibleToAttribute"/> + pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate.</exception> + <seealso cref="T:Castle.DynamicProxy.Generators.InterfaceProxyWithTargetInterfaceGenerator"/> </member> <member name="P:Castle.DynamicProxy.IProxyBuilder.ModuleScope"> <summary> - Gets the module scope used by this builder for generating code. + Gets the <see cref="P:Castle.DynamicProxy.IProxyBuilder.ModuleScope"/> associated with this builder. </summary> - <value>The module scope used by this builder.</value> + <value>The module scope associated with this builder.</value> </member> + <member name="M:Castle.DynamicProxy.DefaultProxyBuilder.#ctor"> + <summary> + Initializes a new instance of the <see cref="T:Castle.DynamicProxy.DefaultProxyBuilder"/> class with new <see cref="T:Castle.DynamicProxy.ModuleScope"/>. + </summary> + </member> + <member name="M:Castle.DynamicProxy.DefaultProxyBuilder.#ctor(Castle.DynamicProxy.ModuleScope)"> + <summary> + Initializes a new instance of the <see cref="T:Castle.DynamicProxy.DefaultProxyBuilder"/> class. + </summary> + <param name="scope">The module scope for generated proxy types.</param> + </member> <member name="M:Castle.DynamicProxy.InternalsHelper.IsInternalToDynamicProxy(System.Reflection.Assembly)"> <summary> Determines whether this assembly has internals visible to dynamic proxy. @@ -612,58 +668,535 @@ Initializes a new instance of the <see cref="T:Castle.DynamicProxy.ProxyGenerationOptions"/> class. </summary> </member> + <member name="T:Castle.DynamicProxy.ProxyGenerator"> + <summary> + Provides proxy objects for classes and interfaces. + </summary> + </member> <member name="M:Castle.DynamicProxy.ProxyGenerator.#ctor(Castle.DynamicProxy.IProxyBuilder)"> <summary> Initializes a new instance of the <see cref="T:Castle.DynamicProxy.ProxyGenerator"/> class. </summary> - <param name="builder">The builder.</param> + <param name="builder">Proxy types builder.</param> </member> <member name="M:Castle.DynamicProxy.ProxyGenerator.#ctor"> <summary> Initializes a new instance of the <see cref="T:Castle.DynamicProxy.ProxyGenerator"/> class. </summary> </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget``1(``0,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <typeparamref name="TInterface"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <typeparam name="TInterface">Type of the interface implemented by <paramref name="target"/> which will be proxied.</typeparam> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns>Object proxying calls to members of <typeparamref name="TInterface"/> on <paramref name="target"/> object.</returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <typeparamref name="TInterface"/>is not an interface type.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget``1(System.Object,Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <typeparamref name="TInterface"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <typeparam name="TInterface">Type of the interface implemented by <paramref name="target"/> which will be proxied.</typeparam> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <typeparamref name="TInterface"/> on <paramref name="target"/> object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <typeparamref name="TInterface"/>is not an interface type.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget(System.Type,System.Object,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on <paramref name="target"/> object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget(System.Type,System.Object,Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on <paramref name="target"/> object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget(System.Type,System.Type[],System.Object,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types on <paramref name="target"/> object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTarget(System.Type,System.Type[],System.Object,Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types on <paramref name="target"/> object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTargetInterface(System.Type,System.Object,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + Interceptors can use <see cref="T:Castle.Core.Interceptor.IChangeProxyTarget"/> interface to provide other target for method invocation than default <paramref name="target"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on <paramref name="target"/> object or alternative implementation swapped at runtime by an interceptor. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTargetInterface(System.Type,System.Object,Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + Interceptors can use <see cref="T:Castle.Core.Interceptor.IChangeProxyTarget"/> interface to provide other target for method invocation than default <paramref name="target"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on <paramref name="target"/> object or alternative implementation swapped at runtime by an interceptor. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithTargetInterface(System.Type,System.Type[],System.Object,Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on <paramref name="target"/> object with given <paramref name="interceptors"/>. + Interceptors can use <see cref="T:Castle.Core.Interceptor.IChangeProxyTarget"/> interface to provide other target for method invocation than default <paramref name="target"/>. + </summary> + <param name="interfaceToProxy">Type of the interface implemented by <paramref name="target"/> which will be proxied.</param> + <param name="target">The target object, calls to which will be intercepted.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types on <paramref name="target"/> object or alternative implementation swapped at runtime by an interceptor. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="target"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="target"/> does not implement <paramref name="interfaceToProxy"/> interface.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on actual type of <paramref name="target"/> object.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of actual type of <paramref name="target"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget``1(Castle.Core.Interceptor.IInterceptor)"> + <summary> + Creates proxy object intercepting calls to members of interface <typeparamref name="TInterface"/> on target object generated at runtime with given <paramref name="interceptor"/>. + </summary> + <typeparam name="TInterface">Type of the interface which will be proxied.</typeparam> + <param name="interceptor">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <typeparamref name="TInterface"/> types on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptor"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <typeparamref name="TInterface"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget``1(Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <typeparamref name="TInterface"/> on target object generated at runtime with given <paramref name="interceptors"/>. + </summary> + <typeparam name="TInterface">Type of the interface which will be proxied.</typeparam> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <typeparamref name="TInterface"/> types on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <typeparamref name="TInterface"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + As a result of that also at least one <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementation must be provided. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(System.Type,Castle.Core.Interceptor.IInterceptor)"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on target object generated at runtime with given <paramref name="interceptor"/>. + </summary> + <param name="interfaceToProxy">Type of the interface which will be proxied.</param> + <param name="interceptor">The interceptor called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptor"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(System.Type,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on target object generated at runtime with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface which will be proxied.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> type on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(System.Type,System.Type[],Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on target object generated at runtime with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface which will be proxied.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(System.Type,System.Type[],Castle.DynamicProxy.ProxyGenerationOptions,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to members of interface <paramref name="interfaceToProxy"/> on target object generated at runtime with given <paramref name="interceptors"/>. + </summary> + <param name="interfaceToProxy">Type of the interface which will be proxied.</param> + <param name="options">The proxy generation options used to influence generated proxy type and object.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + Object proxying calls to members of <paramref name="interfaceToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types on generated target object. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interfaceToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="interceptors"/> array is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="interfaceToProxy"/> is not an interface type.</exception> + <remarks> + Since this method uses an empty-shell implementation of <paramref name="additionalInterfacesToProxy"/> to proxy generated at runtime, the actual implementation of proxied methods must be provided by given <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations. + They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call <see cref="M:Castle.Core.Interceptor.IInvocation.Proceed"/>, since there's no actual implementation to proceed with. + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateClassProxy``1(Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to virtual members of type <typeparamref name="TClass"/> on newly created instance of that type with given <paramref name="interceptors"/>. + </summary> + <typeparam name="TClass">Type of class which will be proxied.</typeparam> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + New object of type <typeparamref name="TClass"/> proxying calls to virtual members of <typeparamref name="TClass"/> type. + </returns> + <exception cref="T:System.ArgumentException">Thrown when given <typeparamref name="TClass"/> is not a class type.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on type <typeparamref name="TClass"/>.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of type <typeparamref name="TClass"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> + <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(System.Type,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Creates proxy object intercepting calls to virtual members of type <paramref name="classToProxy"/> on newly created instance of that type with given <paramref name="interceptors"/>. + </summary> + <param name="classToProxy">Type of class which will be proxied.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + New object of type <paramref name="classToProxy"/> proxying calls to virtual members of <paramref name="classToProxy"/> type. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="classToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="classToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="classToProxy"/> is not a class type.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on type <paramref name="classToProxy"/>.</exception> + <exception cref="T:System.Reflection.TargetInvocationException">Thrown when default constructor of type <paramref name="classToProxy"/> throws an exception.</exception> + <remarks> + This method uses <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation to generate a proxy type. + As such caller should expect any type of exception that given <see cref="T:Castle.DynamicProxy.IProxyBuilder"/> implementation may throw. + </remarks> + </member> <member name="M:Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(System.Type,System.Type[],Castle.Core.Interceptor.IInterceptor[])"> <summary> - Creates the class proxy. + Creates proxy object intercepting calls to virtual members of type <paramref name="classToProxy"/> on newly created instance of that type with given <paramref name="interceptors"/>. </summary> - <param name="targetType">Type of the target.</param> - <param name="interfaces">The interfaces.</param> - <param name="interceptors">The interceptors.</param> - <returns></returns> + <param name="classToProxy">Type of class which will be proxied.</param> + <param name="additionalInterfacesToProxy">Additional interface types. Calls to their members will be proxied as well.</param> + <param name="interceptors">The interceptors called during the invocation of proxied methods.</param> + <returns> + New object of type <paramref name="classToProxy"/> proxying calls to virtual members of <paramref name="classToProxy"/> and <paramref name="additionalInterfacesToProxy"/> types. + </returns> + <exception cref="T:System.ArgumentNullException">Thrown when given <paramref name="classToProxy"/> object is a null reference (Nothing in Visual Basic).</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="classToProxy"/> or any of <paramref name="additionalInterfacesToProxy"/> is a generic type definition.</exception> + <exception cref="T:System.ArgumentException">Thrown when given <paramref name="classToProxy"/> is not a class type.</exception> + <exception cref="T:System.MissingMethodException">Thrown when no default constructor exists on type <paramref name="classToProxy"/>.</exception> + <exception... [truncated message content] |
From: <fab...@us...> - 2009-03-31 03:39:03
|
Revision: 4171 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4171&view=rev Author: fabiomaulo Date: 2009-03-31 03:38:58 +0000 (Tue, 31 Mar 2009) Log Message: ----------- - Version Actualized to Alpha3 (waiting for new HQL parser) - Last available version of LinFu DynamicProxy Modified Paths: -------------- trunk/nhibernate/build-common/common.xml trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll Modified: trunk/nhibernate/build-common/common.xml =================================================================== --- trunk/nhibernate/build-common/common.xml 2009-03-31 03:06:56 UTC (rev 4170) +++ trunk/nhibernate/build-common/common.xml 2009-03-31 03:38:58 UTC (rev 4171) @@ -76,7 +76,7 @@ effectively SP0). --> - <property name="project.version" value="2.1.0.Alpha2" overwrite="false" /> + <property name="project.version" value="2.1.0.Alpha3" overwrite="false" /> <!-- Compute short project version (major.minor) using a regex --> <regex input="${project.version}" pattern="^(?'shortversion'\d+\.\d+)" /> Modified: trunk/nhibernate/lib/net/2.0/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/LinFu.DynamicProxy.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-04-17 18:01:48
|
Revision: 4185 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4185&view=rev Author: fabiomaulo Date: 2009-04-17 18:01:35 +0000 (Fri, 17 Apr 2009) Log Message: ----------- Fix NH-1701 BREAKING CHANGES : see releasenotes.txt Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Cfg/Environment.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/WithColumnTagFixture.cs trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaUpdate/MigrationFixture.cs trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate/Pretty/ trunk/nhibernate/src/NHibernate/Pretty/DdlFormatter.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/releasenotes.txt 2009-04-17 18:01:35 UTC (rev 4185) @@ -6,6 +6,7 @@ * If you want work using lazy loading with Castle.DynamicProxy2 now you must deploy NHibernate.ByteCode.Castle.dll * If you want work using lazy loading with Spring.Aop now you must deploy NHibernate.ByteCode.Spring.dll * compatible only with .NET2.0 SP1 or above (System.DateTimeOffset) + * In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true) ##### Possible Breaking Changes for external frameworks ##### * ISession interface has additional methods Modified: trunk/nhibernate/src/NHibernate/Cfg/Environment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate/Cfg/Environment.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -95,6 +95,9 @@ public const string CurrentSessionContextClass = "current_session_context_class"; public const string UseSqlComments = "use_sql_comments"; + /// <summary> Enable formatting of SQL logged to the console</summary> + public const string FormatSql = "format_sql"; + // Unused, Java-specific public const string UseGetGeneratedKeys = "jdbc.use_get_generated_keys"; Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-04-17 18:01:35 UTC (rev 4185) @@ -479,6 +479,7 @@ <Compile Include="Impl\FutureQueryBatch.cs" /> <Compile Include="Impl\FutureCriteriaBatch.cs" /> <Compile Include="Impl\FutureValue.cs" /> + <Compile Include="Pretty\DdlFormatter.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> <Compile Include="Bytecode\IAccessOptimizer.cs" /> Added: trunk/nhibernate/src/NHibernate/Pretty/DdlFormatter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Pretty/DdlFormatter.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Pretty/DdlFormatter.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -0,0 +1,157 @@ +using System.Collections.Generic; +using System.Text; +using NHibernate.Util; + +namespace NHibernate.Pretty +{ + public class DdlFormatter + { + private const string Indent1 = "\n "; + private const string Indent2 = "\n "; + private const string Indent3 = "\n "; + + private readonly string sql; + + public DdlFormatter(string sql) + { + this.sql = sql; + } + + /// <summary> Format an SQL statement using simple rules: + /// a) Insert newline after each comma; + /// b) Indent three spaces after each inserted newline; + /// If the statement contains single/double quotes return unchanged, + /// it is too complex and could be broken by simple formatting. + /// </summary> + public virtual string Format() + { + if (sql.ToLowerInvariant().StartsWith("create table")) + { + return FormatCreateTable(); + } + else if (sql.ToLowerInvariant().StartsWith("alter table")) + { + return FormatAlterTable(); + } + else if (sql.ToLowerInvariant().StartsWith("comment on")) + { + return FormatCommentOn(); + } + else + { + return Indent1 + sql; + } + } + + private string FormatCommentOn() + { + StringBuilder result = new StringBuilder(60).Append(Indent1); + IEnumerator<string> tokens = (new StringTokenizer(sql, " '[]\"", true)).GetEnumerator(); + + bool quoted = false; + while (tokens.MoveNext()) + { + string token = tokens.Current; + result.Append(token); + if (IsQuote(token)) + { + quoted = !quoted; + } + else if (!quoted) + { + if ("is".Equals(token)) + { + result.Append(Indent2); + } + } + } + + return result.ToString(); + } + + private string FormatAlterTable() + { + StringBuilder result = new StringBuilder(60).Append(Indent1); + IEnumerator<string> tokens = (new StringTokenizer(sql, " (,)'[]\"", true)).GetEnumerator(); + + bool quoted = false; + while (tokens.MoveNext()) + { + string token = tokens.Current; + if (IsQuote(token)) + { + quoted = !quoted; + } + else if (!quoted) + { + if (IsBreak(token)) + { + result.Append(Indent3); + } + } + result.Append(token); + } + + return result.ToString(); + } + + private string FormatCreateTable() + { + StringBuilder result = new StringBuilder(60).Append(Indent1); + IEnumerator<string> tokens = (new StringTokenizer(sql, "(,)'[]\"", true)).GetEnumerator(); + + int depth = 0; + bool quoted = false; + while (tokens.MoveNext()) + { + string token = tokens.Current; + if (IsQuote(token)) + { + quoted = !quoted; + result.Append(token); + } + else if (quoted) + { + result.Append(token); + } + else + { + if (")".Equals(token)) + { + depth--; + if (depth == 0) + { + result.Append(Indent1); + } + } + result.Append(token); + if (",".Equals(token) && depth == 1) + { + result.Append(Indent2); + } + if ("(".Equals(token)) + { + depth++; + if (depth == 1) + { + result.Append(Indent3); + } + } + } + } + + return result.ToString(); + } + + private static bool IsBreak(string token) + { + return "drop".Equals(token) || "add".Equals(token) || "references".Equals(token) || "foreign".Equals(token) + || "on".Equals(token); + } + + private static bool IsQuote(string token) + { + return "\"".Equals(token) || "`".Equals(token) || "]".Equals(token) || "[".Equals(token) || "'".Equals(token); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.Data; using System.IO; -using System.Text; using log4net; using NHibernate.Cfg; using NHibernate.Connection; +using NHibernate.Pretty; using NHibernate.Util; +using Environment=NHibernate.Cfg.Environment; namespace NHibernate.Tool.hbm2ddl { @@ -20,12 +21,13 @@ public class SchemaExport { private static readonly ILog log = LogManager.GetLogger(typeof (SchemaExport)); - private readonly IDictionary<string, string> connectionProperties; + private readonly IDictionary<string, string> configProperties; private readonly string[] createSQL; private readonly Dialect.Dialect dialect; private readonly string[] dropSQL; private string delimiter; private string outputFile; + private readonly bool format; /// <summary> /// Create a schema exported for a given Configuration @@ -38,13 +40,14 @@ /// database connection properties /// </summary> /// <param name="cfg">The NHibernate Configuration to generate the schema from.</param> - /// <param name="connectionProperties">The Properties to use when connecting to the Database.</param> - public SchemaExport(Configuration cfg, IDictionary<string, string> connectionProperties) + /// <param name="configProperties">The Properties to use when connecting to the Database.</param> + public SchemaExport(Configuration cfg, IDictionary<string, string> configProperties) { - this.connectionProperties = connectionProperties; - dialect = Dialect.Dialect.GetDialect(connectionProperties); + this.configProperties = configProperties; + dialect = Dialect.Dialect.GetDialect(configProperties); dropSQL = cfg.GenerateDropSchemaScript(dialect); createSQL = cfg.GenerateSchemaCreationScript(dialect); + format = PropertiesHelper.GetBoolean(Environment.FormatSql, configProperties, true); } /// <summary> @@ -75,17 +78,17 @@ /// <param name="script"><see langword="true" /> if the ddl should be outputted in the Console.</param> /// <param name="export"><see langword="true" /> if the ddl should be executed against the Database.</param> /// <remarks> - /// This is a convenience method that calls <see cref="Execute(bool, bool, bool, bool)"/> and sets - /// the justDrop parameter to false and the format parameter to true. + /// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets + /// the justDrop parameter to false. /// </remarks> public void Create(bool script, bool export) { - Execute(script, export, false, true); + Execute(script, export, false); } public void Create(Action<string> scriptAction, bool export) { - Execute(scriptAction, export, false, true); + Execute(scriptAction, export, false); } /// <summary> @@ -94,28 +97,20 @@ /// <param name="script"><see langword="true" /> if the ddl should be outputted in the Console.</param> /// <param name="export"><see langword="true" /> if the ddl should be executed against the Database.</param> /// <remarks> - /// This is a convenience method that calls <see cref="Execute(bool, bool, bool, bool)"/> and sets - /// the justDrop and format parameter to true. + /// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets + /// the justDrop parameter to true. /// </remarks> public void Drop(bool script, bool export) { - Execute(script, export, true, true); + Execute(script, export, true); } - private void Execute(Action<string> scriptAction, bool export, bool format, bool throwOnError, TextWriter exportOutput, + private void Execute(Action<string> scriptAction, bool export, bool throwOnError, TextWriter exportOutput, IDbCommand statement, string sql) { try { - string formatted; - if (format) - { - formatted = Format(sql); - } - else - { - formatted = sql; - } + string formatted = Format(sql); if (delimiter != null) { @@ -154,7 +149,6 @@ /// <param name="script"><see langword="true" /> if the ddl should be outputted in the Console.</param> /// <param name="export"><see langword="true" /> if the ddl should be executed against the Database.</param> /// <param name="justDrop"><see langword="true" /> if only the ddl to drop the Database objects should be executed.</param> - /// <param name="format"><see langword="true" /> if the ddl should be nicely formatted instead of one statement per line.</param> /// <param name="connection"> /// The connection to use when executing the commands when export is <see langword="true" />. /// Must be an opened connection. The method doesn't close the connection. @@ -165,20 +159,20 @@ /// This overload is provided mainly to enable use of in memory databases. /// It does NOT close the given connection! /// </remarks> - public void Execute(bool script, bool export, bool justDrop, bool format, IDbConnection connection, + public void Execute(bool script, bool export, bool justDrop, IDbConnection connection, TextWriter exportOutput) { if (script) { - Execute(Console.WriteLine, export, justDrop, format, connection, exportOutput); + Execute(Console.WriteLine, export, justDrop, connection, exportOutput); } else { - Execute(null, export, justDrop, format, connection, exportOutput); + Execute(null, export, justDrop, connection, exportOutput); } } - public void Execute(Action<string> scriptAction, bool export, bool justDrop, bool format, IDbConnection connection, + public void Execute(Action<string> scriptAction, bool export, bool justDrop, IDbConnection connection, TextWriter exportOutput) { IDbCommand statement = null; @@ -196,14 +190,14 @@ { for (int i = 0; i < dropSQL.Length; i++) { - Execute(scriptAction, export, format, false, exportOutput, statement, dropSQL[i]); + Execute(scriptAction, export, false, exportOutput, statement, dropSQL[i]); } if (!justDrop) { for (int j = 0; j < createSQL.Length; j++) { - Execute(scriptAction, export, format, true, exportOutput, statement, createSQL[j]); + Execute(scriptAction, export, true, exportOutput, statement, createSQL[j]); } } } @@ -240,23 +234,22 @@ /// <param name="script"><see langword="true" /> if the ddl should be outputted in the Console.</param> /// <param name="export"><see langword="true" /> if the ddl should be executed against the Database.</param> /// <param name="justDrop"><see langword="true" /> if only the ddl to drop the Database objects should be executed.</param> - /// <param name="format"><see langword="true" /> if the ddl should be nicely formatted instead of one statement per line.</param> /// <remarks> /// This method allows for both the drop and create ddl script to be executed. /// </remarks> - public void Execute(bool script, bool export, bool justDrop, bool format) + public void Execute(bool script, bool export, bool justDrop) { if (script) { - Execute(Console.WriteLine, export, justDrop, format); + Execute(Console.WriteLine, export, justDrop); } else { - Execute(null, export, justDrop, format); + Execute(null, export, justDrop); } } - public void Execute(Action<string> scriptAction, bool export, bool justDrop, bool format) + public void Execute(Action<string> scriptAction, bool export, bool justDrop) { IDbConnection connection = null; StreamWriter fileOutput = null; @@ -268,9 +261,9 @@ props[de.Key] = de.Value; } - if (connectionProperties != null) + if (configProperties != null) { - foreach (var de in connectionProperties) + foreach (var de in configProperties) { props[de.Key] = de.Value; } @@ -289,7 +282,7 @@ connection = connectionProvider.GetConnection(); } - Execute(scriptAction, export, justDrop, format, connection, fileOutput); + Execute(scriptAction, export, justDrop, connection, fileOutput); } catch (HibernateException) { @@ -312,76 +305,13 @@ } /// <summary> - /// Format an SQL statement using simple rules + /// Format an SQL statement. /// </summary> /// <param name="sql">The string containing the sql to format.</param> /// <returns>A string that contains formatted sql.</returns> - /// <remarks> - /// The simple rules to used when formatting are: - /// <list type="number"> - /// <item> - /// <description>Insert a newline after each comma</description> - /// </item> - /// <item> - /// <description>Indent three spaces after each inserted newline</description> - /// </item> - /// <item> - /// <description> - /// If the statement contains single/double quotes return unchanged because - /// it is too complex and could be broken by simple formatting. - /// </description> - /// </item> - /// </list> - /// </remarks> - private static string Format(string sql) + private string Format(string sql) { - if (sql.IndexOf("\"") > 0 || sql.IndexOf("'") > 0) - { - return sql; - } - - string formatted; - - if (StringHelper.StartsWithCaseInsensitive(sql, "create table")) - { - var result = new StringBuilder(60); - var tokens = new StringTokenizer(sql, "(,)", true); - - int depth = 0; - - foreach (string tok in tokens) - { - if (StringHelper.ClosedParen.Equals(tok)) - { - depth--; - if (depth == 0) - { - result.Append("\n"); - } - } - result.Append(tok); - if (StringHelper.Comma.Equals(tok) && depth == 1) - { - result.Append("\n "); - } - if (StringHelper.OpenParen.Equals(tok)) - { - depth++; - if (depth == 1) - { - result.Append("\n "); - } - } - } - - formatted = result.ToString(); - } - else - { - formatted = sql; - } - - return formatted; + return format ? new DdlFormatter(sql).Format() : sql; } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd =================================================================== --- trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate/nhibernate-configuration.xsd 2009-04-17 18:01:35 UTC (rev 4185) @@ -98,7 +98,8 @@ <xs:enumeration value="adonet.factory_class" /> <xs:enumeration value="default_batch_fetch_size" /> <xs:enumeration value="default_entity_mode" /> - <xs:enumeration value="use_sql_comments" /> + <xs:enumeration value="use_sql_comments" /> + <xs:enumeration value="format_sql" /> </xs:restriction> </xs:simpleType> </xs:attribute> Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -37,7 +37,7 @@ Assert.That(cfg, Is.Not.Null); var export = new SchemaExport(cfg); - export.Execute(true, true, false, true); + export.Execute(true, true, false); ISessionFactory sf = cfg.BuildSessionFactory(); using (ISession session = sf.OpenSession()) { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -13,7 +13,7 @@ { var su = new SchemaExport(cfg); var sb = new StringBuilder(500); - su.Execute(x => sb.AppendLine(x), false, false, true); + su.Execute(x => sb.AppendLine(x), false, false); string script = sb.ToString(); Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -20,7 +20,7 @@ { var su = new SchemaExport(configuration); var sb = new StringBuilder(500); - su.Execute(x => sb.AppendLine(x), false, false, true); + su.Execute(x => sb.AppendLine(x), false, false); string script = sb.ToString(); Assert.That(script, Text.Contains("if exists (select * from dbo.sysobjects where id = object_id(N'nhibernate.dbo.Aclass') and OBJECTPROPERTY(id, N'IsUserTable') = 1)")); } Modified: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/WithColumnTagFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/WithColumnTagFixture.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/WithColumnTagFixture.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -20,7 +20,7 @@ Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(mapping)) cfg.AddInputStream(stream); - new SchemaExport(cfg).Execute(s => script.AppendLine(s), false, false, false); + new SchemaExport(cfg).Execute(s => script.AppendLine(s), false, false); string wholeScript = script.ToString(); Assert.That(wholeScript, Text.Contains("default SYSTEM_USER")); Modified: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaUpdate/MigrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaUpdate/MigrationFixture.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaUpdate/MigrationFixture.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -19,7 +19,7 @@ Configuration v1cfg = TestConfigurationHelper.GetDefaultConfiguration(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource1)) v1cfg.AddInputStream(stream); - new SchemaExport(v1cfg).Execute(false, true, true, false); + new SchemaExport(v1cfg).Execute(false, true, true); Tool.hbm2ddl.SchemaUpdate v1schemaUpdate = new Tool.hbm2ddl.SchemaUpdate(v1cfg); v1schemaUpdate.Execute(true, true); Modified: trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs 2009-04-17 15:18:39 UTC (rev 4184) +++ trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs 2009-04-17 18:01:35 UTC (rev 4185) @@ -19,7 +19,7 @@ string resource1 = "NHibernate.Test.Tools.hbm2ddl.SchemaValidator.1_Version.hbm.xml"; Configuration v1cfg = TestConfigurationHelper.GetDefaultConfiguration(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource1)) - new NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true,true,false,true); + new NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true,true,false); var v1schemaValidator = new NHibernate.Tool.hbm2ddl.SchemaValidator((v1cfg)); v1schemaValidator.Validate(); @@ -37,7 +37,7 @@ v1cfg.AddInputStream(stream); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource2)) v2cfg.AddInputStream(stream); - new NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true, true, false, true); + new NHibernate.Tool.hbm2ddl.SchemaExport(v1cfg).Execute(true, true, false); var v2schemaValidator = new NHibernate.Tool.hbm2ddl.SchemaValidator((v2cfg)); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-04-22 19:10:07
|
Revision: 4197 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4197&view=rev Author: fabiomaulo Date: 2009-04-22 19:09:39 +0000 (Wed, 22 Apr 2009) Log Message: ----------- First approximation to integration with new AST parser Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Hql/Classic/QueryTranslator.cs trunk/nhibernate/src/NHibernate/Loader/Collection/CollectionLoader.cs trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaLoader.cs trunk/nhibernate/src/NHibernate/Loader/Custom/CustomLoader.cs trunk/nhibernate/src/NHibernate/Loader/Loader.cs trunk/nhibernate/src/NHibernate/Loader/OuterJoinLoader.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/SqlCommand/JoinFragment.cs trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/lib/net/2.0/Antlr3.Runtime.dll trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CollectionProperties.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/DetailedSemanticException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlSqlWalker.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/SqlGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlLexer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlToken.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IErrorReporter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/IParseErrorHandler.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/InvalidPathException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/InvalidWithClauseException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Loader/QueryLoader.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/AbstractExplicitParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/AggregatedIndexCollectionSelectorParameterSpecifications.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/CollectionFilterKeyParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/DynamicFilterParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/ExplicitParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/IParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/NamedParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/ParameterTranslationsImpl.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Parameters/PositionalParameterSpecification.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QuerySyntaxException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/QueryTranslatorImpl.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SemanticException.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SessionFactoryHelperExtensions.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/TODO.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractNullnessCheckNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractRestrictableStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractSelectExpression.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AbstractStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/AggregateNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BetweenOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryArithmeticOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BinaryLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/BooleanLiteralNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/Case2Node.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CaseNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CollectionFunction.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ConstructorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/CountNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/DotNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromElementType.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/FromReferenceNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerTreeAdapter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerTreeNodeStream.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlTreeAdapter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IASTFactory.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IASTNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IBinaryOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IDisplayableNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IExpectedTypeAwareNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IInitializableNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IParameterContainer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IPathNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IResolvableNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IRestrictableStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ISelectExpression.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ISessionFactoryAwareNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IStatement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IUnaryOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IdentNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ImpliedFromElement.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/InLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IndexNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IntoClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IsNotNullLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/IsNullLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/JavaConstantNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/LiteralNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/MethodNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/OrderByClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ParameterNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/QueryNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectClause.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectExpressionImpl.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SelectExpressionList.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SqlFragment.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/SqlNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/UnaryArithmeticNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/UnaryLogicOperatorNode.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTAppender.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTIterator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTPrinter.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ASTUtil.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/AliasGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/CollectingNodeVisitor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/ColumnHelper.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/IVisitationStrategy.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/JoinProcessor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/NodeTraverser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/NullableDictionary.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/PathHelper.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/SyntheticAndFactory.cs trunk/nhibernate/src/NHibernate.Test/HQL/Ast/ParsingFixture.cs trunk/nhibernate/src/NHibernate.Test/HQL/Ast/TestQueries.xml trunk/nhibernate/src/NHibernate.Test/HQL/Ast/TestQueriesWithResults.xml Added: trunk/nhibernate/lib/net/2.0/Antlr3.Runtime.dll =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/lib/net/2.0/Antlr3.Runtime.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll =================================================================== (Binary files differ) Property changes on: trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ASTQueryTranslatorFactory.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using NHibernate.Engine; + +namespace NHibernate.Hql.Ast.ANTLR +{ + /// <summary> + /// Generates translators which uses the Antlr-based parser to perform + /// the translation. + /// + /// Author: Gavin King + /// Ported by: Steve Strong + /// </summary> + public class ASTQueryTranslatorFactory : IQueryTranslatorFactory + { + public IQueryTranslator CreateQueryTranslator(string queryIdentifier, string queryString, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory) + { + return new QueryTranslatorImpl(queryIdentifier, queryString, filters, factory); + } + + public IFilterTranslator CreateFilterTranslator(string queryIdentifier, string queryString, IDictionary<string, IFilter> filters, ISessionFactoryImplementor factory) + { + return new QueryTranslatorImpl(queryIdentifier, queryString, filters, factory); + } + } +} Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CaseInsensitiveStringStream.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,39 @@ +using System; +using Antlr.Runtime; + +namespace NHibernate.Hql.Ast.ANTLR +{ + /// <summary> + /// Look ahead for tokenizing is all lowercase, whereas the original case of an input stream is preserved. + /// Copied from http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782 + ///</summary> + public class CaseInsensitiveStringStream : ANTLRStringStream + { + public CaseInsensitiveStringStream(char[] data, int numberOfActualCharsInArray) : base(data, numberOfActualCharsInArray) { } + + public CaseInsensitiveStringStream() { } + + public CaseInsensitiveStringStream(string input) : base(input) { } + + // Only the lookahead is converted to lowercase. The original case is preserved in the stream. + public override int LA(int i) + { + if (i == 0) + { + return 0; + } + + if (i < 0) + { + i++; + } + + if (((p + i) - 1) >= n) + { + return (int)CharStreamConstants.EOF; + } + + return Char.ToLowerInvariant(data[(p + i) - 1]); // This is how "case insensitive" is defined, i.e., could also use a special culture... + } + } +} Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CollectionProperties.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CollectionProperties.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/CollectionProperties.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using NHibernate.Persister.Collection; + +namespace NHibernate.Hql.Ast.ANTLR +{ + /// <summary> + /// Provides a map of collection function names to the corresponding property names. + /// Authoer: josh + /// Ported by: Steve Strong + /// </summary> + public static class CollectionProperties + { + + public static Dictionary<string, string> HQL_COLLECTION_PROPERTIES; + + private static readonly string COLLECTION_INDEX_LOWER = CollectionPropertyNames.Index.ToLowerInvariant(); + + static CollectionProperties() + { + HQL_COLLECTION_PROPERTIES = new Dictionary<string, string>(); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.Elements.ToLowerInvariant(), CollectionPropertyNames.Elements); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.Indices.ToLowerInvariant(), CollectionPropertyNames.Indices); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.Size.ToLowerInvariant(), CollectionPropertyNames.Size); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.MaxIndex.ToLowerInvariant(), CollectionPropertyNames.MaxIndex); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.MinIndex.ToLowerInvariant(), CollectionPropertyNames.MinIndex); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.MaxElement.ToLowerInvariant(), CollectionPropertyNames.MaxElement); + HQL_COLLECTION_PROPERTIES.Add(CollectionPropertyNames.MinElement.ToLowerInvariant(), CollectionPropertyNames.MinElement); + HQL_COLLECTION_PROPERTIES.Add(COLLECTION_INDEX_LOWER, CollectionPropertyNames.Index); + } + + public static bool IsCollectionProperty(string name) + { + string key = name.ToLowerInvariant(); + // CollectionPropertyMapping processes everything except 'index'. + if (COLLECTION_INDEX_LOWER == key) + { + return false; + } + else + { + return HQL_COLLECTION_PROPERTIES.ContainsKey(key); + } + } + + public static string GetNormalizedPropertyName(string name) + { + return (string)HQL_COLLECTION_PROPERTIES[name]; + } + + public static bool IsAnyCollectionProperty(string name) + { + string key = name.ToLowerInvariant(); + return HQL_COLLECTION_PROPERTIES.ContainsKey(key); + } + } +} Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/DetailedSemanticException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/DetailedSemanticException.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/DetailedSemanticException.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,16 @@ +using System; + +namespace NHibernate.Hql.Ast.ANTLR +{ + public class DetailedSemanticException : SemanticException + { + public DetailedSemanticException(string message) : base(message) + { + } + + public DetailedSemanticException(string message, Exception inner) + : base(message, inner) + { + } + } +} Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/ErrorCounter.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,86 @@ +using System.Collections.Generic; +using System.Text; +using Antlr.Runtime; +using log4net; + +namespace NHibernate.Hql.Ast.ANTLR +{ + /// <summary> + /// An error handler that counts parsing errors and warnings. + /// </summary> + public class ErrorCounter : IParseErrorHandler + { + private static readonly ILog log = LogManager.GetLogger(typeof(ErrorCounter)); + private static readonly ILog hqlLog = LogManager.GetLogger("NHibernate.Hql.Parser"); + + private readonly List<string> _errorList = new List<string>(); + private readonly List<string> _warningList = new List<string>(); + private readonly List<RecognitionException> _recognitionExceptions = new List<RecognitionException>(); + + public void ReportError(RecognitionException e) + { + ReportError( e.ToString() ); + _recognitionExceptions.Add( e ); + if ( log.IsDebugEnabled ) { + log.Debug( e.ToString(), e ); + } + } + + public void ReportError(string message) + { + hqlLog.Error( message ); + _errorList.Add( message ); + } + + public int GetErrorCount() + { + return _errorList.Count; + } + + public void ReportWarning(string message) + { + hqlLog.Debug( message ); + _warningList.Add( message ); + } + + private string GetErrorString() + { + bool first = true; + StringBuilder buf = new StringBuilder(); + foreach (string error in _errorList) + { + buf.Append(error); + + if (!first) buf.Append('\n'); + + first = false; + + } + return buf.ToString(); + } + + public void ThrowQueryException() + { + if ( GetErrorCount() > 0 ) + { + if ( _recognitionExceptions.Count > 0 ) + { + throw QuerySyntaxException.Convert(_recognitionExceptions[0] ); + } + else + { + throw new QueryException( GetErrorString() ); + } + } + else + { + // all clear + if ( log.IsDebugEnabled ) + { + log.Debug( "throwQueryException() : no errors" ); + } + } + } + } + +} Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2009-04-22 19:09:39 UTC (rev 4197) @@ -0,0 +1,4586 @@ +// $ANTLR 3.1.2 /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g 2009-04-17 11:12:37 + +// The variable 'variable' is assigned but its value is never used. +#pragma warning disable 168, 219 +// Unreachable code detected. +#pragma warning disable 162 +namespace NHibernate.Hql.Ast.ANTLR +{ + +using System; +using Antlr.Runtime; +using IList = System.Collections.IList; +using ArrayList = System.Collections.ArrayList; +using Stack = Antlr.Runtime.Collections.StackList; + +using IDictionary = System.Collections.IDictionary; +using Hashtable = System.Collections.Hashtable; + +public partial class HqlLexer : Lexer { + public const int EXPR_LIST = 73; + public const int EXISTS = 19; + public const int COMMA = 98; + public const int FETCH = 21; + public const int MINUS = 110; + public const int AS = 7; + public const int END = 56; + public const int INTO = 30; + public const int FALSE = 20; + public const int ELEMENTS = 17; + public const int THEN = 58; + public const int ALIAS = 70; + public const int ON = 60; + public const int DOT = 15; + public const int ORDER = 41; + public const int AND = 6; + public const int CONSTANT = 92; + public const int UNARY_MINUS = 88; + public const int METHOD_CALL = 79; + public const int RIGHT = 44; + public const int CONCAT = 108; + public const int PROPERTIES = 43; + public const int SELECT = 45; + public const int LE = 106; + public const int BETWEEN = 10; + public const int NUM_INT = 93; + public const int BOTH = 62; + public const int PLUS = 109; + public const int VERSIONED = 52; + public const int MEMBER = 65; + public const int UNION = 50; + public const int DISTINCT = 16; + public const int RANGE = 85; + public const int FILTER_ENTITY = 74; + public const int IDENT = 118; + public const int WHEN = 59; + public const int DESCENDING = 14; + public const int WS = 122; + public const int NEW = 37; + public const int EQ = 99; + public const int LT = 104; + public const int ESCqs = 121; + public const int OF = 67; + public const int UPDATE = 51; + public const int SELECT_FROM = 87; + public const int LITERAL_by = 54; + public const int FLOAT_SUFFIX = 124; + public const int ANY = 5; + public const int UNARY_PLUS = 89; + public const int NUM_FLOAT = 95; + public const int GE = 107; + public const int CASE = 55; + public const int OPEN_BRACKET = 113; + public const int ELSE = 57; + public const int OPEN = 100; + public const int COUNT = 12; + public const int NULL = 39; + public const int COLON = 115; + public const int DIV = 112; + public const int HAVING = 25; + public const int ALL = 4; + public const int SET = 46; + public const int INSERT = 29; + public const int TRUE = 49; + public const int CASE2 = 72; + public const int IS_NOT_NULL = 77; + public const int WHERE = 53; + public const int AGGREGATE = 69; + public const int VECTOR_EXPR = 90; + public const int LEADING = 64; + public const int CLOSE_BRACKET = 114; + public const int NUM_DOUBLE = 94; + public const int T__126 = 126; + public const int INNER = 28; + public const int QUERY = 84; + public const int ORDER_ELEMENT = 83; + public const int OR = 40; + public const int FULL = 23; + public const int INDICES = 27; + public const int IS_NULL = 78; + public const int GROUP = 24; + public const int ESCAPE = 18; + public const int T__127 = 127; + public const int PARAM = 116; + public const int ID_LETTER = 120; + public const int INDEX_OP = 76; + public const int HEX_DIGIT = 125; + public const int LEFT = 33; + public const int TRAILING = 68; + public const int JOIN = 32; + public const int NOT_BETWEEN = 80; + public const int SUM = 48; + public const int ROW_STAR = 86; + public const int OUTER = 42; + public const int NOT_IN = 81; + public const int FROM = 22; + public const int DELETE = 13; + public const int OBJECT = 66; + public const int MAX = 35; + public const int NOT_LIKE = 82; + public const int EMPTY = 63; + public const int QUOTED_String = 117; + public const int ASCENDING = 8; + public const int NUM_LONG = 96; + public const int IS = 31; + public const int SQL_NE = 103; + public const int IN_LIST = 75; + public const int WEIRD_IDENT = 91; + public const int NE = 102; + public const int GT = 105; + public const int MIN = 36; + public const int LIKE = 34; + public const int WITH = 61; + public const int IN = 26; + public const int CONSTRUCTOR = 71; + public const int SOME = 47; + public const int CLASS = 11; + public const int EXPONENT = 123; + public const int ID_START_LETTER = 119; + public const int EOF = -1; + public const int CLOSE = 101; + public const int AVG = 9; + public const int STAR = 111; + public const int NOT = 38; + public const int JAVA_CONSTANT = 97; + + // delegates + // delegators + + public HqlLexer() + { + InitializeCyclicDFAs(); + } + public HqlLexer(ICharStream input) + : this(input, null) { + } + public HqlLexer(ICharStream input, RecognizerSharedState state) + : base(input, state) { + InitializeCyclicDFAs(); + + } + + override public string GrammarFileName + { + get { return "/Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g";} + } + + // $ANTLR start "ALL" + public void mALL() // throws RecognitionException [2] + { + try + { + int _type = ALL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:9:5: ( 'all' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:9:7: 'all' + { + Match("all"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ALL" + + // $ANTLR start "ANY" + public void mANY() // throws RecognitionException [2] + { + try + { + int _type = ANY; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:10:5: ( 'any' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:10:7: 'any' + { + Match("any"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ANY" + + // $ANTLR start "AND" + public void mAND() // throws RecognitionException [2] + { + try + { + int _type = AND; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:11:5: ( 'and' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:11:7: 'and' + { + Match("and"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "AND" + + // $ANTLR start "AS" + public void mAS() // throws RecognitionException [2] + { + try + { + int _type = AS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:12:4: ( 'as' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:12:6: 'as' + { + Match("as"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "AS" + + // $ANTLR start "ASCENDING" + public void mASCENDING() // throws RecognitionException [2] + { + try + { + int _type = ASCENDING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:13:11: ( 'asc' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:13:13: 'asc' + { + Match("asc"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ASCENDING" + + // $ANTLR start "AVG" + public void mAVG() // throws RecognitionException [2] + { + try + { + int _type = AVG; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:14:5: ( 'avg' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:14:7: 'avg' + { + Match("avg"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "AVG" + + // $ANTLR start "BETWEEN" + public void mBETWEEN() // throws RecognitionException [2] + { + try + { + int _type = BETWEEN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:15:9: ( 'between' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:15:11: 'between' + { + Match("between"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "BETWEEN" + + // $ANTLR start "CLASS" + public void mCLASS() // throws RecognitionException [2] + { + try + { + int _type = CLASS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:16:7: ( 'class' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:16:9: 'class' + { + Match("class"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "CLASS" + + // $ANTLR start "COUNT" + public void mCOUNT() // throws RecognitionException [2] + { + try + { + int _type = COUNT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:17:7: ( 'count' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:17:9: 'count' + { + Match("count"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "COUNT" + + // $ANTLR start "DELETE" + public void mDELETE() // throws RecognitionException [2] + { + try + { + int _type = DELETE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:18:8: ( 'delete' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:18:10: 'delete' + { + Match("delete"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "DELETE" + + // $ANTLR start "DESCENDING" + public void mDESCENDING() // throws RecognitionException [2] + { + try + { + int _type = DESCENDING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:19:12: ( 'desc' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:19:14: 'desc' + { + Match("desc"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "DESCENDING" + + // $ANTLR start "DISTINCT" + public void mDISTINCT() // throws RecognitionException [2] + { + try + { + int _type = DISTINCT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:20:10: ( 'distinct' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:20:12: 'distinct' + { + Match("distinct"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "DISTINCT" + + // $ANTLR start "ELEMENTS" + public void mELEMENTS() // throws RecognitionException [2] + { + try + { + int _type = ELEMENTS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:21:10: ( 'elements' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:21:12: 'elements' + { + Match("elements"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ELEMENTS" + + // $ANTLR start "ESCAPE" + public void mESCAPE() // throws RecognitionException [2] + { + try + { + int _type = ESCAPE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:22:8: ( 'escape' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:22:10: 'escape' + { + Match("escape"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ESCAPE" + + // $ANTLR start "EXISTS" + public void mEXISTS() // throws RecognitionException [2] + { + try + { + int _type = EXISTS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:23:8: ( 'exists' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:23:10: 'exists' + { + Match("exists"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "EXISTS" + + // $ANTLR start "FALSE" + public void mFALSE() // throws RecognitionException [2] + { + try + { + int _type = FALSE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:24:7: ( 'false' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:24:9: 'false' + { + Match("false"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "FALSE" + + // $ANTLR start "FETCH" + public void mFETCH() // throws RecognitionException [2] + { + try + { + int _type = FETCH; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:25:7: ( 'fetch' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:25:9: 'fetch' + { + Match("fetch"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "FETCH" + + // $ANTLR start "FROM" + public void mFROM() // throws RecognitionException [2] + { + try + { + int _type = FROM; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:26:6: ( 'from' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:26:8: 'from' + { + Match("from"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "FROM" + + // $ANTLR start "FULL" + public void mFULL() // throws RecognitionException [2] + { + try + { + int _type = FULL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:27:6: ( 'full' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:27:8: 'full' + { + Match("full"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "FULL" + + // $ANTLR start "GROUP" + public void mGROUP() // throws RecognitionException [2] + { + try + { + int _type = GROUP; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:28:7: ( 'group' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:28:9: 'group' + { + Match("group"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "GROUP" + + // $ANTLR start "HAVING" + public void mHAVING() // throws RecognitionException [2] + { + try + { + int _type = HAVING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:29:8: ( 'having' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:29:10: 'having' + { + Match("having"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "HAVING" + + // $ANTLR start "IN" + public void mIN() // throws RecognitionException [2] + { + try + { + int _type = IN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:30:4: ( 'in' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:30:6: 'in' + { + Match("in"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "IN" + + // $ANTLR start "INDICES" + public void mINDICES() // throws RecognitionException [2] + { + try + { + int _type = INDICES; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:31:9: ( 'indices' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:31:11: 'indices' + { + Match("indices"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "INDICES" + + // $ANTLR start "INNER" + public void mINNER() // throws RecognitionException [2] + { + try + { + int _type = INNER; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:32:7: ( 'inner' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:32:9: 'inner' + { + Match("inner"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "INNER" + + // $ANTLR start "INSERT" + public void mINSERT() // throws RecognitionException [2] + { + try + { + int _type = INSERT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:33:8: ( 'insert' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:33:10: 'insert' + { + Match("insert"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "INSERT" + + // $ANTLR start "INTO" + public void mINTO() // throws RecognitionException [2] + { + try + { + int _type = INTO; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:34:6: ( 'into' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:34:8: 'into' + { + Match("into"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "INTO" + + // $ANTLR start "IS" + public void mIS() // throws RecognitionException [2] + { + try + { + int _type = IS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:35:4: ( 'is' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:35:6: 'is' + { + Match("is"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "IS" + + // $ANTLR start "JOIN" + public void mJOIN() // throws RecognitionException [2] + { + try + { + int _type = JOIN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:36:6: ( 'join' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:36:8: 'join' + { + Match("join"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "JOIN" + + // $ANTLR start "LEFT" + public void mLEFT() // throws RecognitionException [2] + { + try + { + int _type = LEFT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:37:6: ( 'left' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:37:8: 'left' + { + Match("left"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "LEFT" + + // $ANTLR start "LIKE" + public void mLIKE() // throws RecognitionException [2] + { + try + { + int _type = LIKE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:38:6: ( 'like' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:38:8: 'like' + { + Match("like"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "LIKE" + + // $ANTLR start "MAX" + public void mMAX() // throws RecognitionException [2] + { + try + { + int _type = MAX; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:39:5: ( 'max' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:39:7: 'max' + { + Match("max"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "MAX" + + // $ANTLR start "MIN" + public void mMIN() // throws RecognitionException [2] + { + try + { + int _type = MIN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:40:5: ( 'min' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:40:7: 'min' + { + Match("min"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "MIN" + + // $ANTLR start "NEW" + public void mNEW() // throws RecognitionException [2] + { + try + { + int _type = NEW; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:41:5: ( 'new' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:41:7: 'new' + { + Match("new"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "NEW" + + // $ANTLR start "NOT" + public void mNOT() // throws RecognitionException [2] + { + try + { + int _type = NOT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:42:5: ( 'not' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:42:7: 'not' + { + Match("not"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "NOT" + + // $ANTLR start "NULL" + public void mNULL() // throws RecognitionException [2] + { + try + { + int _type = NULL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:43:6: ( 'null' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:43:8: 'null' + { + Match("null"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "NULL" + + // $ANTLR start "OR" + public void mOR() // throws RecognitionException [2] + { + try + { + int _type = OR; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:44:4: ( 'or' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:44:6: 'or' + { + Match("or"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "OR" + + // $ANTLR start "ORDER" + public void mORDER() // throws RecognitionException [2] + { + try + { + int _type = ORDER; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:45:7: ( 'order' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:45:9: 'order' + { + Match("order"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ORDER" + + // $ANTLR start "OUTER" + public void mOUTER() // throws RecognitionException [2] + { + try + { + int _type = OUTER; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:46:7: ( 'outer' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:46:9: 'outer' + { + Match("outer"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "OUTER" + + // $ANTLR start "PROPERTIES" + public void mPROPERTIES() // throws RecognitionException [2] + { + try + { + int _type = PROPERTIES; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:47:12: ( 'properties' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:47:14: 'properties' + { + Match("properties"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "PROPERTIES" + + // $ANTLR start "RIGHT" + public void mRIGHT() // throws RecognitionException [2] + { + try + { + int _type = RIGHT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:48:7: ( 'right' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:48:9: 'right' + { + Match("right"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "RIGHT" + + // $ANTLR start "SELECT" + public void mSELECT() // throws RecognitionException [2] + { + try + { + int _type = SELECT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:49:8: ( 'select' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:49:10: 'select' + { + Match("select"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "SELECT" + + // $ANTLR start "SET" + public void mSET() // throws RecognitionException [2] + { + try + { + int _type = SET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:50:5: ( 'set' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:50:7: 'set' + { + Match("set"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "SET" + + // $ANTLR start "SOME" + public void mSOME() // throws RecognitionException [2] + { + try + { + int _type = SOME; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:51:6: ( 'some' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:51:8: 'some' + { + Match("some"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "SOME" + + // $ANTLR start "SUM" + public void mSUM() // throws RecognitionException [2] + { + try + { + int _type = SUM; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:52:5: ( 'sum' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:52:7: 'sum' + { + Match("sum"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "SUM" + + // $ANTLR start "TRUE" + public void mTRUE() // throws RecognitionException [2] + { + try + { + int _type = TRUE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:53:6: ( 'true' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:53:8: 'true' + { + Match("true"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "TRUE" + + // $ANTLR start "UNION" + public void mUNION() // throws RecognitionException [2] + { + try + { + int _type = UNION; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:54:7: ( 'union' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:54:9: 'union' + { + Match("union"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "UNION" + + // $ANTLR start "UPDATE" + public void mUPDATE() // throws RecognitionException [2] + { + try + { + int _type = UPDATE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:55:8: ( 'update' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:55:10: 'update' + { + Match("update"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "UPDATE" + + // $ANTLR start "VERSIONED" + public void mVERSIONED() // throws RecognitionException [2] + { + try + { + int _type = VERSIONED; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:56:11: ( 'versioned' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:56:13: 'versioned' + { + Match("versioned"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "VERSIONED" + + // $ANTLR start "WHERE" + public void mWHERE() // throws RecognitionException [2] + { + try + { + int _type = WHERE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:57:7: ( 'where' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:57:9: 'where' + { + Match("where"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "WHERE" + + // $ANTLR start "LITERAL_by" + public void mLITERAL_by() // throws RecognitionException [2] + { + try + { + int _type = LITERAL_by; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:58:12: ( 'by' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:58:14: 'by' + { + Match("by"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "LITERAL_by" + + // $ANTLR start "CASE" + public void mCASE() // throws RecognitionException [2] + { + try + { + int _type = CASE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:59:6: ( 'case' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:59:8: 'case' + { + Match("case"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "CASE" + + // $ANTLR start "END" + public void mEND() // throws RecognitionException [2] + { + try + { + int _type = END; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:60:5: ( 'end' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:60:7: 'end' + { + Match("end"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "END" + + // $ANTLR start "ELSE" + public void mELSE() // throws RecognitionException [2] + { + try + { + int _type = ELSE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:61:6: ( 'else' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:61:8: 'else' + { + Match("else"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ELSE" + + // $ANTLR start "THEN" + public void mTHEN() // throws RecognitionException [2] + { + try + { + int _type = THEN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:62:6: ( 'then' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:62:8: 'then' + { + Match("then"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "THEN" + + // $ANTLR start "WHEN" + public void mWHEN() // throws RecognitionException [2] + { + try + { + int _type = WHEN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:63:6: ( 'when' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:63:8: 'when' + { + Match("when"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "WHEN" + + // $ANTLR start "ON" + public void mON() // throws RecognitionException [2] + { + try + { + int _type = ON; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:64:4: ( 'on' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:64:6: 'on' + { + Match("on"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "ON" + + // $ANTLR start "WITH" + public void mWITH() // throws RecognitionException [2] + { + try + { + int _type = WITH; + int _channel = DEFAULT_TOKEN_CHANNEL; + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:65:6: ( 'with' ) + // /Users/Steve/Projects/uNhAddins/Trunk/ANTLR-HQL/ANTLR-HQL/Hql.g:65:8: 'with' + { + Match("with"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "WITH" + + // $ANTLR start "BOTH" + public void mBOTH() // throws RecognitionException [2] ... [truncated message content] |
From: <fab...@us...> - 2009-04-22 19:29:33
|
Revision: 4198 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4198&view=rev Author: fabiomaulo Date: 2009-04-22 19:29:26 +0000 (Wed, 22 Apr 2009) Log Message: ----------- Fixed NAnt files Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/NHibernate.build trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-04-22 19:09:39 UTC (rev 4197) +++ trunk/nhibernate/releasenotes.txt 2009-04-22 19:29:26 UTC (rev 4198) @@ -7,6 +7,7 @@ * If you want work using lazy loading with Spring.Aop now you must deploy NHibernate.ByteCode.Spring.dll * compatible only with .NET2.0 SP1 or above (System.DateTimeOffset) * In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true) + * Antlr3.Runtime.dll is required ##### Possible Breaking Changes for external frameworks ##### * ISession interface has additional methods Modified: trunk/nhibernate/src/NHibernate/NHibernate.build =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.build 2009-04-22 19:09:39 UTC (rev 4197) +++ trunk/nhibernate/src/NHibernate/NHibernate.build 2009-04-22 19:29:26 UTC (rev 4198) @@ -24,6 +24,7 @@ <include name="System.Web.dll" /> <include name="Iesi.Collections.dll" /> <include name="log4net.dll" /> + <include name="Antlr3.Runtime.dll" /> </assemblyfileset> <resourcefileset id="project.resources" prefix="NHibernate" dynamicprefix="true"> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-04-22 19:09:39 UTC (rev 4197) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.build 2009-04-22 19:29:26 UTC (rev 4198) @@ -19,6 +19,7 @@ <include name="NHibernate.dll" /> <include name="LinFu.DynamicProxy.dll" /> <include name="nunit.framework.dll" /> + <include name="Antlr3.Runtime.dll" /> </assemblyfileset> <resourcefileset id="project.resources" prefix="NHibernate.Test" dynamicprefix="true"> <include name="**/*.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2009-04-23 20:32:12
|
Revision: 4208 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4208&view=rev Author: steverstrong Date: 2009-04-23 20:31:58 +0000 (Thu, 23 Apr 2009) Log Message: ----------- Modifications to remove .elements & .indices syntax. Now use elements(xxx) & indices(xxx) instead Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/FumTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/MasterDetailTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/MultiTableTest.cs trunk/nhibernate/src/NHibernate.Test/TestCase.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-04-23 16:05:01 UTC (rev 4207) +++ trunk/nhibernate/releasenotes.txt 2009-04-23 20:31:58 UTC (rev 4208) @@ -8,6 +8,7 @@ * compatible only with .NET2.0 SP1 or above (System.DateTimeOffset) * In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true) * Antlr3.Runtime.dll is required + * the syntax foo.bar.baz.elements or foo.bar.baz.indices is not longer supported. Use the alternative syntax of elements(foo.bar.baz) or indices(foo.bar.baz) instead ##### Possible Breaking Changes for external frameworks ##### * ISession interface has additional methods Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2009-04-23 16:05:01 UTC (rev 4207) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2009-04-23 20:31:58 UTC (rev 4208) @@ -1,4 +1,4 @@ -// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-04-23 17:07:34 +// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-04-23 21:03:14 // The variable 'variable' is assigned but its value is never used. #pragma warning disable 168, 219 @@ -1755,8 +1755,8 @@ { int _type = EQ; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:746:3: ( '=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:746:5: '=' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:741:3: ( '=' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:741:5: '=' { Match('='); if (state.failed) return ; @@ -1778,8 +1778,8 @@ { int _type = LT; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:747:3: ( '<' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:747:5: '<' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:742:3: ( '<' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:742:5: '<' { Match('<'); if (state.failed) return ; @@ -1801,8 +1801,8 @@ { int _type = GT; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:748:3: ( '>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:748:5: '>' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:743:3: ( '>' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:743:5: '>' { Match('>'); if (state.failed) return ; @@ -1824,8 +1824,8 @@ { int _type = SQL_NE; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:749:7: ( '<>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:749:9: '<>' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:744:7: ( '<>' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:744:9: '<>' { Match("<>"); if (state.failed) return ; @@ -1848,7 +1848,7 @@ { int _type = NE; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:750:3: ( '!=' | '^=' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:745:3: ( '!=' | '^=' ) int alt1 = 2; int LA1_0 = input.LA(1); @@ -1871,7 +1871,7 @@ switch (alt1) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:750:5: '!=' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:745:5: '!=' { Match("!="); if (state.failed) return ; @@ -1879,7 +1879,7 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:750:12: '^=' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:745:12: '^=' { Match("^="); if (state.failed) return ; @@ -1904,8 +1904,8 @@ { int _type = LE; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:751:3: ( '<=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:751:5: '<=' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:746:3: ( '<=' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:746:5: '<=' { Match("<="); if (state.failed) return ; @@ -1928,8 +1928,8 @@ { int _type = GE; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:752:3: ( '>=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:752:5: '>=' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:747:3: ( '>=' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:747:5: '>=' { Match(">="); if (state.failed) return ; @@ -1952,8 +1952,8 @@ { int _type = COMMA; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:754:6: ( ',' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:754:8: ',' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:749:6: ( ',' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:749:8: ',' { Match(','); if (state.failed) return ; @@ -1975,8 +1975,8 @@ { int _type = OPEN; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:756:5: ( '(' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:756:7: '(' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:751:5: ( '(' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:751:7: '(' { Match('('); if (state.failed) return ; @@ -1998,8 +1998,8 @@ { int _type = CLOSE; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:757:6: ( ')' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:757:8: ')' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:752:6: ( ')' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:752:8: ')' { Match(')'); if (state.failed) return ; @@ -2021,8 +2021,8 @@ { int _type = OPEN_BRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:758:13: ( '[' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:758:15: '[' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:753:13: ( '[' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:753:15: '[' { Match('['); if (state.failed) return ; @@ -2044,8 +2044,8 @@ { int _type = CLOSE_BRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:759:14: ( ']' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:759:16: ']' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:754:14: ( ']' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:754:16: ']' { Match(']'); if (state.failed) return ; @@ -2067,8 +2067,8 @@ { int _type = CONCAT; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:761:7: ( '||' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:761:9: '||' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:756:7: ( '||' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:756:9: '||' { Match("||"); if (state.failed) return ; @@ -2091,8 +2091,8 @@ { int _type = PLUS; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:762:5: ( '+' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:762:7: '+' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:757:5: ( '+' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:757:7: '+' { Match('+'); if (state.failed) return ; @@ -2114,8 +2114,8 @@ { int _type = MINUS; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:763:6: ( '-' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:763:8: '-' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:758:6: ( '-' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:758:8: '-' { Match('-'); if (state.failed) return ; @@ -2137,8 +2137,8 @@ { int _type = STAR; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:764:5: ( '*' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:764:7: '*' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:759:5: ( '*' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:759:7: '*' { Match('*'); if (state.failed) return ; @@ -2160,8 +2160,8 @@ { int _type = DIV; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:4: ( '/' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:6: '/' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:760:4: ( '/' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:760:6: '/' { Match('/'); if (state.failed) return ; @@ -2183,8 +2183,8 @@ { int _type = COLON; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:766:6: ( ':' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:766:8: ':' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:761:6: ( ':' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:761:8: ':' { Match(':'); if (state.failed) return ; @@ -2206,8 +2206,8 @@ { int _type = PARAM; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:767:6: ( '?' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:767:8: '?' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:762:6: ( '?' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:762:8: '?' { Match('?'); if (state.failed) return ; @@ -2229,11 +2229,11 @@ { int _type = IDENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:770:2: ( ID_START_LETTER ( ID_LETTER )* ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:770:4: ID_START_LETTER ( ID_LETTER )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:2: ( ID_START_LETTER ( ID_LETTER )* ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:4: ID_START_LETTER ( ID_LETTER )* { mID_START_LETTER(); if (state.failed) return ; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:770:20: ( ID_LETTER )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:20: ( ID_LETTER )* do { int alt2 = 2; @@ -2248,7 +2248,7 @@ switch (alt2) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:770:22: ID_LETTER + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:765:22: ID_LETTER { mID_LETTER(); if (state.failed) return ; @@ -2280,7 +2280,7 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:775:5: ( '_' | '$' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0080' .. '\\ufffe' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:770:5: ( '_' | '$' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0080' .. '\\ufffe' ) // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g: { if ( input.LA(1) == '$' || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u0080' && input.LA(1) <= '\uFFFE') ) @@ -2310,7 +2310,7 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:5: ( ID_START_LETTER | '0' .. '9' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:779:5: ( ID_START_LETTER | '0' .. '9' ) // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g: { if ( input.LA(1) == '$' || (input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u0080' && input.LA(1) <= '\uFFFE') ) @@ -2342,11 +2342,11 @@ { int _type = QUOTED_String; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:4: ( '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:6: '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:4: ( '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:6: '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' { Match('\''); if (state.failed) return ; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:11: ( ( ESCqs )=> ESCqs | ~ '\\'' )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:11: ( ( ESCqs )=> ESCqs | ~ '\\'' )* do { int alt3 = 3; @@ -2372,14 +2372,14 @@ switch (alt3) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:13: ( ESCqs )=> ESCqs + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:13: ( ESCqs )=> ESCqs { mESCqs(); if (state.failed) return ; } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:31: ~ '\\'' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:31: ~ '\\'' { if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '&') || (input.LA(1) >= '(' && input.LA(1) <= '\uFFFF') ) { @@ -2423,8 +2423,8 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:794:2: ( '\\'' '\\'' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:795:3: '\\'' '\\'' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:2: ( '\\'' '\\'' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:790:3: '\\'' '\\'' { Match('\''); if (state.failed) return ; Match('\''); if (state.failed) return ; @@ -2445,10 +2445,10 @@ { int _type = WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:798:5: ( ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:798:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:793:5: ( ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:793:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:798:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:793:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) int alt4 = 5; switch ( input.LA(1) ) { @@ -2491,21 +2491,21 @@ switch (alt4) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:798:13: ' ' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:793:13: ' ' { Match(' '); if (state.failed) return ; } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:799:7: '\\t' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:794:7: '\\t' { Match('\t'); if (state.failed) return ; } break; case 3 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:800:7: '\\r' '\\n' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:795:7: '\\r' '\\n' { Match('\r'); if (state.failed) return ; Match('\n'); if (state.failed) return ; @@ -2513,14 +2513,14 @@ } break; case 4 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:801:7: '\\n' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:796:7: '\\n' { Match('\n'); if (state.failed) return ; } break; case 5 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:802:7: '\\r' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:797:7: '\\r' { Match('\r'); if (state.failed) return ; @@ -2558,7 +2558,7 @@ IToken f4 = null; bool isDecimal=false; IToken t=null; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:811:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:806:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? ) int alt20 = 2; int LA20_0 = input.LA(1); @@ -2581,14 +2581,14 @@ switch (alt20) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:811:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:806:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? { Match('.'); if (state.failed) return ; if ( (state.backtracking==0) ) { _type = DOT; } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? int alt8 = 2; int LA8_0 = input.LA(1); @@ -2599,9 +2599,9 @@ switch (alt8) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:6: ( '0' .. '9' )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:6: ( '0' .. '9' )+ int cnt5 = 0; do { @@ -2617,7 +2617,7 @@ switch (alt5) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:7: '0' .. '9' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:7: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -2637,7 +2637,7 @@ loop5: ; // Stops C# compiler whinging that label 'loop5' has no statements - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:18: ( EXPONENT )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:18: ( EXPONENT )? int alt6 = 2; int LA6_0 = input.LA(1); @@ -2648,7 +2648,7 @@ switch (alt6) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:19: EXPONENT + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:19: EXPONENT { mEXPONENT(); if (state.failed) return ; @@ -2657,7 +2657,7 @@ } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:30: (f1= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:30: (f1= FLOAT_SUFFIX )? int alt7 = 2; int LA7_0 = input.LA(1); @@ -2668,7 +2668,7 @@ switch (alt7) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:812:31: f1= FLOAT_SUFFIX + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:807:31: f1= FLOAT_SUFFIX { int f1Start992 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; @@ -2706,9 +2706,9 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:824:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:819:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:824:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:819:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) int alt13 = 2; int LA13_0 = input.LA(1); @@ -2731,14 +2731,14 @@ switch (alt13) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:824:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:819:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? { Match('0'); if (state.failed) return ; if ( (state.backtracking==0) ) { isDecimal = true; } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:825:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:820:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? int alt11 = 3; int LA11_0 = input.LA(1); @@ -2753,16 +2753,16 @@ switch (alt11) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:825:6: ( 'x' ) ( HEX_DIGIT )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:820:6: ( 'x' ) ( HEX_DIGIT )+ { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:825:6: ( 'x' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:825:7: 'x' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:820:6: ( 'x' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:820:7: 'x' { Match('x'); if (state.failed) return ; } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:826:5: ( HEX_DIGIT )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:821:5: ( HEX_DIGIT )+ int cnt9 = 0; do { @@ -2828,7 +2828,7 @@ switch (alt9) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:833:7: HEX_DIGIT + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:828:7: HEX_DIGIT { mHEX_DIGIT(); if (state.failed) return ; @@ -2852,9 +2852,9 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:835:6: ( '0' .. '7' )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:830:6: ( '0' .. '7' )+ { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:835:6: ( '0' .. '7' )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:830:6: ( '0' .. '7' )+ int cnt10 = 0; do { @@ -2870,7 +2870,7 @@ switch (alt10) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:835:7: '0' .. '7' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:830:7: '0' .. '7' { MatchRange('0','7'); if (state.failed) return ; @@ -2900,16 +2900,16 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:5: ( '1' .. '9' ) ( '0' .. '9' )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:832:5: ( '1' .. '9' ) ( '0' .. '9' )* { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:5: ( '1' .. '9' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:6: '1' .. '9' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:832:5: ( '1' .. '9' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:832:6: '1' .. '9' { MatchRange('1','9'); if (state.failed) return ; } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:16: ( '0' .. '9' )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:832:16: ( '0' .. '9' )* do { int alt12 = 2; @@ -2924,7 +2924,7 @@ switch (alt12) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:17: '0' .. '9' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:832:17: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -2949,7 +2949,7 @@ } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:834:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? int alt19 = 3; int LA19_0 = input.LA(1); @@ -2964,10 +2964,10 @@ switch (alt19) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:5: ( 'l' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:834:5: ( 'l' ) { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:5: ( 'l' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:6: 'l' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:834:5: ( 'l' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:834:6: 'l' { Match('l'); if (state.failed) return ; @@ -2981,14 +2981,14 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:842:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:837:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) { if ( !((isDecimal)) ) { if ( state.backtracking > 0 ) {state.failed = true; return ;} throw new FailedPredicateException(input, "NUM_INT", "isDecimal"); } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) int alt18 = 3; switch ( input.LA(1) ) { @@ -3019,10 +3019,10 @@ switch (alt18) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? { Match('.'); if (state.failed) return ; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:12: ( '0' .. '9' )* + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:12: ( '0' .. '9' )* do { int alt14 = 2; @@ -3037,7 +3037,7 @@ switch (alt14) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:13: '0' .. '9' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:13: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -3052,7 +3052,7 @@ loop14: ; // Stops C# compiler whining that label 'loop14' has no statements - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:24: ( EXPONENT )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:24: ( EXPONENT )? int alt15 = 2; int LA15_0 = input.LA(1); @@ -3063,7 +3063,7 @@ switch (alt15) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:25: EXPONENT + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:25: EXPONENT { mEXPONENT(); if (state.failed) return ; @@ -3072,7 +3072,7 @@ } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:36: (f2= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:36: (f2= FLOAT_SUFFIX )? int alt16 = 2; int LA16_0 = input.LA(1); @@ -3083,7 +3083,7 @@ switch (alt16) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:843:37: f2= FLOAT_SUFFIX + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:838:37: f2= FLOAT_SUFFIX { int f2Start1194 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; @@ -3102,10 +3102,10 @@ } break; case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:844:8: EXPONENT (f3= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:8: EXPONENT (f3= FLOAT_SUFFIX )? { mEXPONENT(); if (state.failed) return ; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:844:17: (f3= FLOAT_SUFFIX )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:17: (f3= FLOAT_SUFFIX )? int alt17 = 2; int LA17_0 = input.LA(1); @@ -3116,7 +3116,7 @@ switch (alt17) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:844:18: f3= FLOAT_SUFFIX + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:839:18: f3= FLOAT_SUFFIX { int f3Start1212 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; @@ -3135,7 +3135,7 @@ } break; case 3 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:845:8: f4= FLOAT_SUFFIX + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:840:8: f4= FLOAT_SUFFIX { int f4Start1227 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; @@ -3188,8 +3188,8 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:863:2: ( ( '0' .. '9' | 'a' .. 'f' ) ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:863:4: ( '0' .. '9' | 'a' .. 'f' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:858:2: ( ( '0' .. '9' | 'a' .. 'f' ) ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:858:4: ( '0' .. '9' | 'a' .. 'f' ) { if ( (input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { @@ -3218,17 +3218,17 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:4: ( 'e' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:5: 'e' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:4: ( 'e' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:5: 'e' { Match('e'); if (state.failed) return ; } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:10: ( '+' | '-' )? + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:10: ( '+' | '-' )? int alt21 = 2; int LA21_0 = input.LA(1); @@ -3259,7 +3259,7 @@ } - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:21: ( '0' .. '9' )+ + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:21: ( '0' .. '9' )+ int cnt22 = 0; do { @@ -3275,7 +3275,7 @@ switch (alt22) { case 1 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:22: '0' .. '9' + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:864:22: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -3310,7 +3310,7 @@ { try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:874:2: ( 'f' | 'd' ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:869:2: ( 'f' | 'd' ) // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g: { if ( input.LA(1) == 'd' || input.LA(1) == 'f' ) @@ -3972,8 +3972,8 @@ // $ANTLR start "synpred1_Hql" public void synpred1_Hql_fragment() { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:13: ( ESCqs ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:789:14: ESCqs + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:13: ( ESCqs ) + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:784:14: ESCqs { mESCqs(); if (state.failed) return ; Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs 2009-04-23 16:05:01 UTC (rev 4207) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs 2009-04-23 20:31:58 UTC (rev 4208) @@ -1,4 +1,4 @@ -// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-04-23 17:07:33 +// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-04-23 21:03:14 // The variable 'variable' is assigned but its value is never used. #pragma warning disable 168, 219 @@ -2205,7 +2205,7 @@ // AST REWRITE - // elements: path, selectedPropertiesList + // elements: selectedPropertiesList, path // token labels: // rule labels: retval // token list labels: @@ -3331,7 +3331,62 @@ { // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:300:2: ( fromClassOrOuterQueryPath | inClassDeclaration | inCollectionDeclaration | inCollectionElementsDeclaration ) int alt31 = 4; - alt31 = dfa31.Predict(input); + switch ( input.LA(1) ) + { + case IDENT: + { + int LA31_1 = input.LA(2); + + if ( (LA31_1 == IN) ) + { + int LA31_4 = input.LA(3); + + if ( (LA31_4 == ELEMENTS) ) + { + alt31 = 4; + } + else if ( (LA31_4 == CLASS || LA31_4 == IDENT) ) + { + alt31 = 2; + } + else + { + NoViableAltException nvae_d31s4 = + new NoViableAltException("", 31, 4, input); + + throw nvae_d31s4; + } + } + else if ( (LA31_1 == EOF || LA31_1 == AS || LA31_1 == DOT || LA31_1 == FETCH || (LA31_1 >= FULL && LA31_1 <= GROUP) || LA31_1 == INNER || (LA31_1 >= JOIN && LA31_1 <= LEFT) || LA31_1 == ORDER || LA31_1 == RIGHT || LA31_1 == UNION || LA31_1 == WHERE || LA31_1 == COMMA || LA31_1 == CLOSE || LA31_1 == IDENT) ) + { + alt31 = 1; + } + else + { + NoViableAltException nvae_d31s1 = + new NoViableAltException("", 31, 1, input); + + throw nvae_d31s1; + } + } + break; + case IN: + { + alt31 = 3; + } + break; + case ELEMENTS: + { + alt31 = 4; + } + break; + default: + NoViableAltException nvae_d31s0 = + new NoViableAltException("", 31, 0, input); + + throw nvae_d31s0; + } + switch (alt31) { case 1 : @@ -3499,7 +3554,7 @@ // AST REWRITE - // elements: propertyFetch, asAlias, path + // elements: asAlias, path, propertyFetch // token labels: // rule labels: retval // token list labels: @@ -3635,7 +3690,7 @@ // AST REWRITE - // elements: path, alias + // elements: alias, path // token labels: // rule labels: retval // token list labels: @@ -3805,7 +3860,7 @@ }; // $ANTLR start "inCollectionElementsDeclaration" - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:321:1: inCollectionElementsDeclaration : ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | alias IN path DOT ELEMENTS -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) ); + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:321:1: inCollectionElementsDeclaration : ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) ); public HqlParser.inCollectionElementsDeclaration_return inCollectionElementsDeclaration() // throws RecognitionException [1] { HqlParser.inCollectionElementsDeclaration_return retval = new HqlParser.inCollectionElementsDeclaration_return(); @@ -3821,9 +3876,6 @@ IToken OPEN110 = null; IToken CLOSE112 = null; IToken AS113 = null; - IToken IN116 = null; - IToken DOT118 = null; - IToken ELEMENTS119 = null; HqlParser.alias_return alias103 = default(HqlParser.alias_return); HqlParser.path_return path107 = default(HqlParser.path_return); @@ -3832,11 +3884,7 @@ HqlParser.alias_return alias114 = default(HqlParser.alias_return); - HqlParser.alias_return alias115 = default(HqlParser.alias_return); - HqlParser.path_return path117 = default(HqlParser.path_return); - - IASTNode IN104_tree=null; IASTNode ELEMENTS105_tree=null; IASTNode OPEN106_tree=null; @@ -3845,54 +3893,22 @@ IASTNode OPEN110_tree=null; IASTNode CLOSE112_tree=null; IASTNode AS113_tree=null; - IASTNode IN116_tree=null; - IASTNode DOT118_tree=null; - IASTNode ELEMENTS119_tree=null; RewriteRuleTokenStream stream_CLOSE = new RewriteRuleTokenStream(adaptor,"token CLOSE"); RewriteRuleTokenStream stream_ELEMENTS = new RewriteRuleTokenStream(adaptor,"token ELEMENTS"); RewriteRuleTokenStream stream_AS = new RewriteRuleTokenStream(adaptor,"token AS"); RewriteRuleTokenStream stream_OPEN = new RewriteRuleTokenStream(adaptor,"token OPEN"); - RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor,"token DOT"); RewriteRuleTokenStream stream_IN = new RewriteRuleTokenStream(adaptor,"token IN"); RewriteRuleSubtreeStream stream_path = new RewriteRuleSubtreeStream(adaptor,"rule path"); RewriteRuleSubtreeStream stream_alias = new RewriteRuleSubtreeStream(adaptor,"rule alias"); try { - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:322:2: ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | alias IN path DOT ELEMENTS -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) ) - int alt35 = 3; + // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:322:2: ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) ) + int alt35 = 2; int LA35_0 = input.LA(1); if ( (LA35_0 == IDENT) ) { - int LA35_1 = input.LA(2); - - if ( (LA35_1 == IN) ) - { - int LA35_3 = input.LA(3); - - if ( (LA35_3 == ELEMENTS) ) - { - alt35 = 1; - } - else if ( (LA35_3 == IDENT) ) - { - alt35 = 3; - } - else - { - NoViableAltException nvae_d35s3 = - new NoViableAltException("", 35, 3, input); - - throw nvae_d35s3; - } - } - else - { - NoViableAltException nvae_d35s1 = - new NoViableAltException("", 35, 1, input); - - throw nvae_d35s1; - } +... [truncated message content] |
From: <fab...@us...> - 2009-04-24 16:07:52
|
Revision: 4212 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4212&view=rev Author: fabiomaulo Date: 2009-04-24 16:07:40 +0000 (Fri, 24 Apr 2009) Log Message: ----------- - last available Spring libraries (now signed) - inclusion of Spring stuff in default build Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/lib/net/3.5/Spring.Aop.dll trunk/nhibernate/lib/net/3.5/Spring.Aop.xml trunk/nhibernate/lib/net/3.5/Spring.Core.dll trunk/nhibernate/lib/net/3.5/Spring.Core.xml Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2009-04-24 06:46:40 UTC (rev 4211) +++ trunk/nhibernate/default.build 2009-04-24 16:07:40 UTC (rev 4212) @@ -30,6 +30,8 @@ <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> <include name="NHibernate.ByteCode.Castle/ByteCode.build" /> <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Spring/ByteCode.build" /> + <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> @@ -41,6 +43,7 @@ <include name="Iesi.Collections.Test/Iesi.Collections.Test.build" /> <include name="NHibernate.ByteCode.LinFu.Tests/ByteCode.Test.build" /> <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> + <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" if="${run.performance.tests}" /> Modified: trunk/nhibernate/lib/net/3.5/Spring.Aop.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/Spring.Aop.xml =================================================================== --- trunk/nhibernate/lib/net/3.5/Spring.Aop.xml 2009-04-24 06:46:40 UTC (rev 4211) +++ trunk/nhibernate/lib/net/3.5/Spring.Aop.xml 2009-04-24 16:07:40 UTC (rev 4212) @@ -4,885 +4,1020 @@ <name>Spring.Aop</name> </assembly> <members> - <member name="T:Spring.Aop.Target.AbstractPoolingTargetSource"> + <member name="T:Spring.Aop.Config.AopNamespaceParser"> <summary> - Abstract superclass for pooling <see cref="T:Spring.Aop.ITargetSource"/>s. + Namespace parser for the aop namespace. </summary> <remarks> - <p> - Maintains a pool of target instances, acquiring and releasing a target - object from the pool for each method invocation. - </p> - <p> - This class is independent of pooling technology. - </p> - <p> - Subclasses must implement the - <see cref="M:Spring.Aop.Target.AbstractPoolingTargetSource.GetTarget"/> and - <see cref="M:Spring.Aop.Target.AbstractPoolingTargetSource.ReleaseTarget(System.Object)"/> - methods to work with their chosen pool. The - <see cref="M:Spring.Aop.Target.AbstractPrototypeTargetSource.NewPrototypeInstance"/> - method inherited from the - <see cref="T:Spring.Aop.Target.AbstractPrototypeTargetSource"/> base class - can be used to create objects to put in the pool. Subclasses must also - implement some of the monitoring methods from the - <see cref="T:Spring.Aop.Target.PoolingConfig"/> interface. This class - provides the - <see cref="M:Spring.Aop.Target.AbstractPoolingTargetSource.GetPoolingConfigMixin"/> - method to return an <see cref="T:Spring.Aop.IIntroductionAdvisor"/> - making these statistics available on proxied objects. - </p> - <p> - This class implements the <see cref="T:System.IDisposable"/> interface in - order to force subclasses to implement the - <see cref="M:System.IDisposable.Dispose"/> method to cleanup and close - down their pool. - </p> + Using the <code>advisor</code> tag you can configure an <see cref="T:Spring.Aop.IAdvisor"/> and have it + applied to all the relevant objects in your application context automatically. The + <code>advisor</code> tag supports only referenced <see cref="T:Spring.Aop.IPointcut"/>s. </remarks> + <author>Rob harrop</author> + <author>Adrian Colyer</author> <author>Rod Johnson</author> - <author>Federico Spinazzi (.NET)</author> + <author>Mark Pollack (.NET)</author> </member> - <member name="T:Spring.Aop.Target.AbstractPrototypeTargetSource"> + <member name="M:Spring.Aop.Config.AopNamespaceParser.Init"> <summary> - Base class for dynamic <see cref="T:Spring.Aop.ITargetSource"/> - implementations that can create new prototype object instances to - support a pooling or new-instance-per-invocation strategy. + Register the <see cref="T:Spring.Objects.Factory.Xml.IObjectDefinitionParser"/> for the '<code>config</code>' tag. </summary> - <remarks> - <p> - All such <see cref="T:Spring.Aop.ITargetSource"/>s must run in an - <see cref="T:Spring.Objects.Factory.IObjectFactory"/>, as they need to - call the <see cref="M:Spring.Objects.Factory.IObjectFactory.GetObject(System.String)"/> - method to create a new prototype instance. - </p> - </remarks> - <author>Rod Johnson</author> - <author>Federico Spinazzi (.NET)</author> </member> - <member name="T:Spring.Aop.ITargetSource"> + <member name="T:Spring.Aop.Config.AopNamespaceUtils"> <summary> - Used to obtain the current "target" of an AOP invocation + Utility class for handling registration of auto-proxy creators used internally by the + <code>aop</code> namespace tags. </summary> - <remarks> - <p> - This target will be invoked via reflection if no around advice chooses - to end the interceptor chain itself. - </p> - <p> - If an <see cref="T:Spring.Aop.ITargetSource"/> is <c>"static"</c>, it - will always return the same target, allowing optimizations in the AOP - framework. Dynamic target sources can support pooling, hot swapping etc. - </p> - <p> - Application developers don't usually need to work with target sources - directly: this is an AOP framework interface. - </p> - </remarks> - <author>Rod Johnson</author> - <author>Aleksandar Seovic (.NET)</author> + <author>Rob Harrop</author> + <author>Juergen Hoeller</author> + <author>Mark Pollack (.NET)</author> </member> - <member name="M:Spring.Aop.ITargetSource.GetTarget"> + <member name="F:Spring.Aop.Config.AopNamespaceUtils.AUTO_PROXY_CREATOR_OBJECT_NAME"> <summary> - Returns the target object. + The object name of the internally managed auto-proxy creator. </summary> - <returns>The target object.</returns> - <exception cref="T:System.Exception"> - If unable to obtain the target object. - </exception> </member> - <member name="M:Spring.Aop.ITargetSource.ReleaseTarget(System.Object)"> + <member name="M:Spring.Aop.Config.AopNamespaceUtils.RegisterAutoProxyCreatorIfNecessary(Spring.Objects.Factory.Xml.ParserContext,System.Xml.XmlElement)"> <summary> - Releases the target object. + Registers the auto proxy creator if necessary. </summary> - <param name="target">The target object to release.</param> + <param name="parserContext">The parser context.</param> + <param name="sourceElement">The source element.</param> </member> - <member name="P:Spring.Aop.ITargetSource.TargetType"> + <member name="M:Spring.Aop.Config.AopNamespaceUtils.RegisterApcAsRequired(System.Type,Spring.Objects.Factory.Xml.ParserContext)"> <summary> - The <see cref="T:System.Type"/> of the target object. + Registries the or escalate apc as required. </summary> + <param name="type">The type.</param> + <param name="parserContext">The parser context.</param> </member> - <member name="P:Spring.Aop.ITargetSource.IsStatic"> + <member name="M:Spring.Aop.Config.AopNamespaceUtils.ForceAutoProxyCreatorToUseDecoratorProxy(Spring.Objects.Factory.Support.IObjectDefinitionRegistry)"> <summary> - Is the target source static? + Forces the auto proxy creator to use decorator proxy. </summary> - <value> - <see langword="true"/> if the target source is static. - </value> + <param name="registry">The registry.</param> </member> - <member name="M:Spring.Aop.Target.AbstractPrototypeTargetSource.#ctor"> + <member name="T:Spring.Aop.Config.ConfigObjectDefinitionParser"> <summary> - Creates a new instance of the - <see cref="T:Spring.Aop.Target.AbstractPrototypeTargetSource"/> - class. + The <see cref="T:Spring.Objects.Factory.Xml.IObjectDefinitionParser"/> for the <code><aop:config></code> tag. </summary> - <remarks> - <p> - This is an <see langword="abstract"/> class, and as such exposes no - public constructors. - </p> - </remarks> + <author>Mark Pollack (.NET)</author> </member> - <member name="M:Spring.Aop.Target.AbstractPrototypeTargetSource.NewPrototypeInstance"> + <member name="F:Spring.Aop.Config.ConfigObjectDefinitionParser.PROXY_TARGET_TYPE"> <summary> - Subclasses should use this method to create a new prototype instance. + The '<code>proxy-target-type</code>' attribute </summary> </member> - <member name="M:Spring.Aop.Target.AbstractPrototypeTargetSource.GetTarget"> + <member name="M:Spring.Aop.Config.ConfigObjectDefinitionParser.ParseElement(System.Xml.XmlElement,Spring.Objects.Factory.Xml.ParserContext)"> <summary> - Returns the target object. + Parse the specified XmlElement and register the resulting + ObjectDefinitions with the <see cref="P:Spring.Objects.Factory.Xml.ParserContext.Registry"/> IObjectDefinitionRegistry + embedded in the supplied <see cref="T:Spring.Objects.Factory.Xml.ParserContext"/> </summary> - <returns>The target object.</returns> - <exception cref="T:System.Exception"> - If unable to obtain the target object. - </exception> + <param name="element">The element to be parsed.</param> + <param name="parserContext">The object encapsulating the current state of the parsing process. + Provides access to a IObjectDefinitionRegistry</param> + <returns>The primary object definition.</returns> + <remarks> + <p> + This method is never invoked if the parser is namespace aware + and was called to process the root node. + </p> + </remarks> </member> - <member name="M:Spring.Aop.Target.AbstractPrototypeTargetSource.ReleaseTarget(System.Object)"> + <member name="M:Spring.Aop.Config.ConfigObjectDefinitionParser.ParseAdvisor(System.Xml.XmlElement,Spring.Objects.Factory.Xml.ParserContext)"> <summary> - Releases the target object. + Parses the supplied advisor element and registers the resulting <see cref="T:Spring.Aop.IAdvisor"/> </summary> - <param name="target">The target object to release.</param> + <param name="advisorElement">The advisor element.</param> + <param name="parserContext">The parser context.</param> </member> - <member name="M:Spring.Aop.Target.AbstractPrototypeTargetSource.AfterPropertiesSet"> + <member name="T:Spring.Aop.Framework.Adapter.AdvisorAdapterRegistrationManager"> <summary> - Invoked by an <see cref="T:Spring.Objects.Factory.IObjectFactory"/> - after it has set all object properties supplied - (and satisfied the - <see cref="T:Spring.Objects.Factory.IObjectFactoryAware"/> - and <see cref="T:Spring.Context.IApplicationContextAware"/> - interfaces). + <see cref="T:Spring.Objects.Factory.Config.IObjectPostProcessor"/> implementation + that registers instances of any non-default + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> instances with the + <see cref="T:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry"/> + singleton. </summary> <remarks> <p> - Ensures that the <see cref="P:Spring.Aop.Target.AbstractPrototypeTargetSource.TargetObjectName"/> property has been - set to a valid value (i.e. is not <see langword="null"/> or a string - that consists solely of whitespace). + The only requirement for it to work is that it needs to be defined + in an application context along with any arbitrary "non-native" Spring.NET + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> instances that need + to be recognized by Spring.NET's AOP framework. </p> </remarks> - <exception cref="T:System.Exception"> - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - </exception> - <seealso cref="M:Spring.Objects.Factory.IInitializingObject.AfterPropertiesSet"/> + <author>Dmitriy Kopylenko</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="F:Spring.Aop.Target.AbstractPrototypeTargetSource.logger"> + <member name="M:Spring.Aop.Framework.Adapter.AdvisorAdapterRegistrationManager.PostProcessBeforeInitialization(System.Object,System.String)"> <summary> - The shared <see cref="T:Common.Logging.ILog"/> instance for this class (and derived classes). + Apply this <see cref="T:Spring.Objects.Factory.Config.IObjectPostProcessor"/> + to the given new object instance <i>before</i> any object initialization callbacks. </summary> + <remarks> + <p> + Does nothing, simply returns the supplied <paramref name="instance"/> as is. + </p> + </remarks> + <param name="instance"> + The new object instance. + </param> + <param name="name"> + The name of the object. + </param> + <returns> + The object instance to use, either the original or a wrapped one. + </returns> + <exception cref="T:Spring.Objects.ObjectsException"> + In case of errors. + </exception> </member> - <member name="P:Spring.Aop.Target.AbstractPrototypeTargetSource.TargetObjectName"> + <member name="M:Spring.Aop.Framework.Adapter.AdvisorAdapterRegistrationManager.PostProcessAfterInitialization(System.Object,System.String)"> <summary> - The name of the target object to be created on each invocation. + Apply this <see cref="T:Spring.Objects.Factory.Config.IObjectPostProcessor"/> to the + given new object instance <i>after</i> any object initialization callbacks. </summary> <remarks> <p> - This object should be a prototype, or the same instance will always - be obtained from the owning <see cref="P:Spring.Aop.Target.AbstractPrototypeTargetSource.ObjectFactory"/>. + Registers the supplied <paramref name="instance"/> with the + <see cref="T:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry"/> + singleton if it is an <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> + instance. </p> </remarks> + <param name="instance"> + The new object instance. + </param> + <param name="objectName"> + The name of the object. + </param> + <returns> + The object instance to use, either the original or a wrapped one. + </returns> + <exception cref="T:Spring.Objects.ObjectsException"> + In case of errors. + </exception> </member> - <member name="P:Spring.Aop.Target.AbstractPrototypeTargetSource.TargetType"> + <member name="T:Spring.Aop.Framework.Adapter.AfterReturningAdviceAdapter"> <summary> - The <see cref="T:System.Type"/> of the target object. + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> implementation + to enable <see cref="T:Spring.Aop.IAfterReturningAdvice"/> to be used in the + Spring.NET AOP framework. </summary> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="P:Spring.Aop.Target.AbstractPrototypeTargetSource.IsStatic"> + <member name="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"> <summary> - Is the target source static? + Permits the handling of new advisors and advice types as extensions to + the Spring AOP framework. </summary> - <value> - <see langword="true"/> if the target source is static. - </value> + <remarks> + <p> + Implementors can create AOP Alliance + <see cref="T:AopAlliance.Intercept.IInterceptor"/>s from custom advice + types, enabling these advice types to be used in the Spring.NET AOP + framework, which uses interception under the covers. + </p> + <p> + There is no need for most Spring.NET users to implement this interface; + do so only if you need to introduce more + <see cref="T:Spring.Aop.IAdvisor"/> or <see cref="T:AopAlliance.Aop.IAdvice"/> + types to Spring.NET. + </p> + </remarks> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="P:Spring.Aop.Target.AbstractPrototypeTargetSource.ObjectFactory"> + <member name="M:Spring.Aop.Framework.Adapter.IAdvisorAdapter.SupportsAdvice(AopAlliance.Aop.IAdvice)"> <summary> - The target factory that will be used to perform the lookup - of the object referred to by the <see cref="P:Spring.Aop.Target.AbstractPrototypeTargetSource.TargetObjectName"/> - property. + Does this adapter understand the supplied <paramref name="advice"/>? </summary> <remarks> <p> - Needed so that prototype instances can be created as necessary. + Is it valid to invoke the + <see cref="M:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry.Wrap(System.Object)"/> + method with the given advice as an argument? </p> </remarks> - <value> - The owning <see cref="T:Spring.Objects.Factory.IObjectFactory"/> - (will never be <see langword="null"/>). - </value> - <exception cref="T:Spring.Objects.ObjectsException"> - In case of initialization errors. - </exception> - <seealso cref="P:Spring.Objects.Factory.IObjectFactoryAware.ObjectFactory"/> + <param name="advice"> + <see cref="T:AopAlliance.Aop.IAdvice"/> such as + <see cref="T:Spring.Aop.IBeforeAdvice"/>. + </param> + <returns><see langword="true"/> if this adapter understands the + supplied <paramref name="advice"/>. + </returns> </member> - <member name="T:Spring.Aop.Target.PoolingConfig"> + <member name="M:Spring.Aop.Framework.Adapter.IAdvisorAdapter.GetInterceptor(Spring.Aop.IAdvisor)"> <summary> - Configuration interface for a pooling invoker. + Return an AOP Alliance + <see cref="T:AopAlliance.Intercept.IInterceptor"/> exposing the + behaviour of the given advice to an interception-based AOP + framework. </summary> - <author>Rod Johnson</author> - <author>Aleksandar Seovic (.NET)</author> + <remarks> + <p> + Don't worry about any <see cref="T:Spring.Aop.IPointcut"/> + contained in the supplied <see cref="T:Spring.Aop.IAdvisor"/>; + the AOP framework will take care of checking the pointcut. + </p> + </remarks> + <param name="advisor"> + The advice. The + <see cref="M:Spring.Aop.Framework.Adapter.IAdvisorAdapter.SupportsAdvice(AopAlliance.Aop.IAdvice)"/> + method must have previously returned <see langword="true"/> on the + supplied <paramref name="advisor"/>. + </param> + <returns> + An AOP Alliance + <see cref="T:AopAlliance.Intercept.IInterceptor"/> exposing the + behaviour of the given advice to an interception-based AOP + framework. + </returns> </member> - <member name="P:Spring.Aop.Target.PoolingConfig.Active"> + <member name="M:Spring.Aop.Framework.Adapter.AfterReturningAdviceAdapter.SupportsAdvice(AopAlliance.Aop.IAdvice)"> <summary> - The number of active object instances in a pool. + Returns <see langword="true"/> if the supplied + <paramref name="advice"/> is an instance of the + <see cref="T:Spring.Aop.IAfterReturningAdvice"/> interface. </summary> + <param name="advice">The advice to check.</param> + <returns> + <see langword="true"/> if the supplied <paramref name="advice"/> is + an instance of the <see cref="T:Spring.Aop.IAfterReturningAdvice"/> interface; + <see langword="false"/> if not or if the supplied + <paramref name="advice"/> is <cref lang="null"/>. + </returns> </member> - <member name="P:Spring.Aop.Target.PoolingConfig.Free"> + <member name="M:Spring.Aop.Framework.Adapter.AfterReturningAdviceAdapter.GetInterceptor(Spring.Aop.IAdvisor)"> <summary> - The number of free object instances in a pool. + Wraps the supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> within a + <see cref="T:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor"/> + instance. </summary> + <param name="advisor"> + The advisor exposing the <see cref="T:AopAlliance.Aop.IAdvice"/> that + is to be wrapped. + </param> + <returns> + The supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> wrapped within a + <see cref="T:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor"/> + instance. + </returns> </member> - <member name="P:Spring.Aop.Target.PoolingConfig.MaxSize"> + <member name="T:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor"> <summary> - The maximum number of object instances in a pool. + Interceptor to wrap an <see cref="T:Spring.Aop.IAfterReturningAdvice"/> + instance. </summary> + <remarks> + <p> + A more efficient alternative solution in cases where there is no + interception advice and therefore no need to create an + <see cref="T:AopAlliance.Intercept.IMethodInvocation"/> object may be + offered in future. + </p> + <p> + Used internally by the AOP framework: application developers should not need + to use this class directly. + </p> + </remarks> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="T:AopAlliance.Aop.IAdvice"> + <member name="T:AopAlliance.Intercept.IMethodInterceptor"> <summary> - Tag interface for advice. + Intercepts calls on an interface on its way to the target. </summary> <remarks> <p> - Implementations can be any type of advice, such as interceptors. + Such interceptions are nested "on top" of the target. </p> </remarks> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.#ctor"> + <member name="T:AopAlliance.Intercept.IInterceptor"> <summary> - Creates a new instance of the - <see cref="T:Spring.Aop.Target.AbstractPoolingTargetSource"/> - class. + Represents a generic interceptor. </summary> <remarks> <p> - This is an <see langword="abstract"/> class, and as such exposes no - public constructors. + A generic interceptor can intercept runtime events that occur within a + base program. Those events are materialized by (reified in) joinpoints. + Runtime joinpoints can be invocations, field access, exceptions, etc. </p> + <p> + This interface is not used directly. Use the various derived interfaces + to intercept specific events. + </p> </remarks> + <seealso cref="T:AopAlliance.Intercept.IJoinpoint"/> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.GetTarget"> + <member name="T:AopAlliance.Aop.IAdvice"> <summary> - Returns the target object (acquired from the pool). + Tag interface for advice. </summary> - <returns>The target object (acquired from the pool).</returns> - <exception cref="T:System.Exception"> - If unable to obtain the target object. - </exception> + <remarks> + <p> + Implementations can be any type of advice, such as interceptors. + </p> + </remarks> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.GetPoolingConfigMixin"> + <member name="M:AopAlliance.Intercept.IMethodInterceptor.Invoke(AopAlliance.Intercept.IMethodInvocation)"> <summary> - Gets the <see cref="T:Spring.Aop.Target.PoolingConfig"/> mixin. + Implement this method to perform extra treatments before and after + the call to the supplied <paramref name="invocation"/>. </summary> + <remarks> + <p> + Polite implementations would certainly like to invoke + <see cref="M:AopAlliance.Intercept.IJoinpoint.Proceed"/>. + </p> + </remarks> + <param name="invocation"> + The method invocation that is being intercepted. + </param> <returns> - An <see cref="T:Spring.Aop.IIntroductionAdvisor"/> exposing statistics - about the pool maintained by this object. + The result of the call to the + <see cref="M:AopAlliance.Intercept.IJoinpoint.Proceed"/> method of + the supplied <paramref name="invocation"/>; this return value may + well have been intercepted by the interceptor. </returns> + <exception cref="T:System.Exception"> + If any of the interceptors in the chain or the target object itself + throws an exception. + </exception> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.CreatePool(Spring.Objects.Factory.IObjectFactory)"> + <member name="M:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor.#ctor(Spring.Aop.IAfterReturningAdvice)"> <summary> - Create the pool. + Creates a new instance of the + <see cref="T:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor"/> + class. </summary> - <param name="factory"> - The owning <see cref="T:Spring.Objects.Factory.IObjectFactory"/>, in - case one needs collaborators from it (normally one's own properties - are sufficient). + <param name="advice"> + The advice to be applied after a target method successfully + returns. </param> - <exception cref="T:System.Exception"> - In the case of errors encountered during the creation of the pool. + <exception cref="T:System.ArgumentNullException"> + If the supplied <paramref name="advice"/> is <see langword="null"/>. </exception> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.ReleaseTarget(System.Object)"> + <member name="M:Spring.Aop.Framework.Adapter.AfterReturningAdviceInterceptor.Invoke(AopAlliance.Intercept.IMethodInvocation)"> <summary> - Releases the target object (returns it to the pool). + Executes interceptor after the target method successfully returns. </summary> - <param name="target"> - The target object to release (return to the pool). + <param name="invocation"> + The method invocation that is being intercepted. </param> + <returns> + The result of the call to the + <see cref="M:AopAlliance.Intercept.IJoinpoint.Proceed"/> method of + the supplied <paramref name="invocation"/>; this return value may + well have been intercepted by the interceptor. + </returns> <exception cref="T:System.Exception"> - In the case that the <paramref name="target"/> could not be released. + If any of the interceptors in the chain or the target object itself + throws an exception. </exception> </member> - <member name="M:Spring.Aop.Target.AbstractPoolingTargetSource.Dispose"> + <member name="T:Spring.Aop.Framework.Adapter.BeforeAdviceAdapter"> <summary> - Performs application-defined tasks associated with freeing, releasing, or - resetting unmanaged resources. + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> implementation + to enable <see cref="T:Spring.Aop.IMethodBeforeAdvice"/> to be used in the + Spring.NET AOP framework. </summary> - <remarks> - <p> - Disposes of the pool. - </p> - </remarks> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="P:Spring.Aop.Target.AbstractPoolingTargetSource.MaxSize"> + <member name="M:Spring.Aop.Framework.Adapter.BeforeAdviceAdapter.SupportsAdvice(AopAlliance.Aop.IAdvice)"> <summary> - The maximum number of object instances in this pool. + Returns <see langword="true"/> if the supplied + <paramref name="advice"/> is an instance of the + <see cref="T:Spring.Aop.IMethodBeforeAdvice"/> interface. </summary> + <param name="advice">The advice to check.</param> + <returns> + <see langword="true"/> if the supplied <paramref name="advice"/> is + an instance of the <see cref="T:Spring.Aop.IMethodBeforeAdvice"/> interface; + <see langword="false"/> if not or if the supplied + <paramref name="advice"/> is <cref lang="null"/>. + </returns> </member> - <member name="P:Spring.Aop.Target.AbstractPoolingTargetSource.Active"> + <member name="M:Spring.Aop.Framework.Adapter.BeforeAdviceAdapter.GetInterceptor(Spring.Aop.IAdvisor)"> <summary> - The number of active object instances in this pool. + Wraps the supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> within a + <see cref="T:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/> + instance. </summary> + <param name="advisor"> + The advisor exposing the <see cref="T:AopAlliance.Aop.IAdvice"/> that + is to be wrapped. + </param> + <returns> + The supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> wrapped within a + <see cref="T:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/> + instance. + </returns> </member> - <member name="P:Spring.Aop.Target.AbstractPoolingTargetSource.Free"> + <member name="T:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry"> <summary> - The number of free object instances in this pool. + Default implementation of the + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry"/> + interface. </summary> - </member> - <member name="P:Spring.Aop.Target.AbstractPoolingTargetSource.ObjectFactory"> - <summary> - The target factory that will be used to perform the lookup - of the object referred to by the - <see cref="P:Spring.Aop.Target.AbstractPrototypeTargetSource.TargetObjectName"/> - property. - </summary> - <value> - The owning <see cref="T:Spring.Objects.Factory.IObjectFactory"/> - (will never be <see langword="null"/>). - </value> - <exception cref="T:Spring.Objects.ObjectsException"> - In case of initialization errors. - </exception> - <seealso cref="P:Spring.Aop.Target.AbstractPrototypeTargetSource.ObjectFactory"/> - </member> - <member name="T:Spring.Aop.Support.DynamicMethodMatcher"> - <summary> - Convenient abstract superclass for dynamic method matchers that do - care about arguments at runtime. - </summary> <author>Rod Johnson</author> <author>Aleksandar Seovic (.NET)</author> </member> - <member name="T:Spring.Aop.IMethodMatcher"> + <member name="T:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry"> <summary> - That part of an <see cref="T:Spring.Aop.IPointcut"/> that checks whether a - target method is eligible for advice. + A registry of + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> instances. </summary> <remarks> <p> - An <see cref="T:Spring.Aop.IMethodMatcher"/> may be evaluated - <b>statically</b> or at runtime (<b>dynamically</b>). Static - matching involves only the method signature and (possibly) any - <see cref="T:System.Attribute"/>s that have been applied to a method. - Dynamic matching additionally takes into account the actual argument - values passed to a method invocation. + Implementations <b>must</b> also automatically register adapters for + <see cref="T:AopAlliance.Intercept.IInterceptor"/> types. </p> - <p> - If the value of the <see cref="P:Spring.Aop.IMethodMatcher.IsRuntime"/> - property of an implementation instance returns <see langword="false"/>, - evaluation can be performed statically, and the result will be the same - for all invocations of this method, whatever their arguments. This - means that if the value of the - <see cref="P:Spring.Aop.IMethodMatcher.IsRuntime"/> is - <see langword="false"/>, the three argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type,System.Object[])"/> - method will never be invoked for the lifetime of the - <see cref="T:Spring.Aop.IMethodMatcher"/>. - </p> - <p> - If an implementation returns <see langword="true"/> in its two argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type)"/> - method, and the value of it's - <see cref="P:Spring.Aop.IMethodMatcher.IsRuntime"/> property is - <see langword="true"/>, the three argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type,System.Object[])"/> - method will be invoked <i>immediately before each and every potential - execution of the related advice</i>, to decide whether the advice - should run. All previous advice, such as earlier interceptors in an - interceptor chain, will have run, so any state changes they have - produced in parameters or thread local storage, will be available at - the time of evaluation. - </p> + <note> + This is an SPI interface, that should not need to be implemented by any + Spring.NET user. + </note> </remarks> <author>Rod Johnson</author> <author>Aleksandar Seovic (.NET)</author> - <seealso cref="T:Spring.Aop.TrueMethodMatcher"/> </member> - <member name="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type)"> + <member name="M:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry.Wrap(System.Object)"> <summary> - Does the supplied <paramref name="method"/> satisfy this matcher? + Returns an <see cref="T:Spring.Aop.IAdvisor"/> wrapping the supplied + <paramref name="advice"/>. </summary> - <remarks> - <p> - This is a static check. If this method invocation returns - <see langword="false"/>,or if the - <see cref="P:Spring.Aop.IMethodMatcher.IsRuntime"/> property is - <see langword="false"/>, then no runtime check will be made. - </p> - </remarks> - <param name="method">The candidate method.</param> - <param name="targetType"> - The target <see cref="T:System.Type"/> (may be <see langword="null"/>, - in which case the candidate <see cref="T:System.Type"/> must be taken - to be the <paramref name="method"/>'s declaring class). + <param name="advice"> + The object that should be an advice, such as + <see cref="T:Spring.Aop.IBeforeAdvice"/> or + <see cref="T:Spring.Aop.IThrowsAdvice"/>. </param> - <returns> - <see langword="true"/> if this this method matches statically. + <returns> + An <see cref="T:Spring.Aop.IAdvisor"/> wrapping the supplied + <paramref name="advice"/>. Never returns <cref lang="null"/>. If + the <paramref name="advice"/> parameter is an + <see cref="T:Spring.Aop.IAdvisor"/>, it will simply be returned. </returns> + <exception cref="T:Spring.Aop.Framework.Adapter.UnknownAdviceTypeException"> + If no registered + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> can wrap + the supplied <paramref name="advice"/>. + </exception> </member> - <member name="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type,System.Object[])"> + <member name="M:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry.GetInterceptor(Spring.Aop.IAdvisor)"> <summary> - Is there a runtime (dynamic) match for the supplied - <paramref name="method"/>? + Returns an <see cref="T:AopAlliance.Intercept.IInterceptor"/> to + allow the use of the supplied <paramref name="advisor"/> in an + interception-based framework. </summary> <remarks> <p> - In order for this method to have even been invoked, the supplied - <paramref name="method"/> must have matched - statically. This method is invoked only if the two argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type)"/> - method returns <see langword="true"/> for the supplied - <paramref name="method"/> and <paramref name="targetType"/>, and - if the <see cref="P:Spring.Aop.IMethodMatcher.IsRuntime"/> property - is <see langword="true"/>. + Don't worry about the pointcut associated with the + <see cref="T:Spring.Aop.IAdvisor"/>; if it's an + <see cref="T:Spring.Aop.IPointcutAdvisor"/>, just return an + interceptor. </p> - <p> - Invoked immediately <b>before</b> any potential running of the - advice, and <b>after</b> any advice earlier in the advice chain has - run. - </p> </remarks> - <param name="method">The candidate method.</param> - <param name="targetType"> - The target <see cref="T:System.Type"/>. + <param name="advisor"> + The advisor to find an interceptor for. </param> - <param name="args">The arguments to the method</param> <returns> - <see langword="true"/> if there is a runtime match.</returns> + An interceptor to expose this advisor's behaviour. + </returns> + <exception cref="T:Spring.Aop.Framework.Adapter.UnknownAdviceTypeException"> + If the advisor type is not understood by any registered + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/>. + </exception> </member> - <member name="P:Spring.Aop.IMethodMatcher.IsRuntime"> + <member name="M:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry.RegisterAdvisorAdapter(Spring.Aop.Framework.Adapter.IAdvisorAdapter)"> <summary> - Is this <see cref="T:Spring.Aop.IMethodMatcher"/> dynamic? + Register the given <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/>. </summary> <remarks> <p> - If <see langword="true"/>, the three argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type,System.Object[])"/> - method will be invoked if the two argument - <see cref="M:Spring.Aop.IMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type)"/> - method returns <see langword="true"/>. + Note that it is not necessary to register adapters for + <see cref="T:AopAlliance.Intercept.IInterceptor"/> instances: these + must be automatically recognized by an + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry"/> + implementation. </p> - <p> - Note that this property can be checked when an AOP proxy is created, - and implementations need not check the value of this property again - before each method invocation. - </p> </remarks> - <value> - <see langword="true"/> if this - <see cref="T:Spring.Aop.IMethodMatcher"/> is dynamic. - </value> + <param name="adapter"> + An <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> that + understands the particular advisor and advice types. + </param> </member> - <member name="M:Spring.Aop.Support.DynamicMethodMatcher.#ctor"> + <member name="M:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry.#ctor"> <summary> Creates a new instance of the - <see cref="T:Spring.Aop.Support.DynamicMethodMatcher"/> - class. + <see cref="T:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry"/> class. </summary> <remarks> <p> - This is an <see langword="abstract"/> class, and as such exposes no - public constructors. + This constructor will also register the well-known + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> types. </p> </remarks> + <seealso cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> </member> - <member name="M:Spring.Aop.Support.DynamicMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type)"> + <member name="M:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry.Wrap(System.Object)"> <summary> - Does the supplied <paramref name="method"/> satisfy this matcher? + Returns an <see cref="T:Spring.Aop.IAdvisor"/> wrapping the supplied + <paramref name="advice"/>. </summary> - <remarks> - <p> - Derived classes can override this method to add preconditions for - dynamic matching. - </p> - <p> - This implementation always returns <see langword="true"/>. - </p> - </remarks> - <param name="method">The candidate method.</param> - <param name="targetType"> - The target <see cref="T:System.Type"/> (may be <see langword="null"/>, - in which case the candidate <see cref="T:System.Type"/> must be taken - to be the <paramref name="method"/>'s declaring class). + <param name="advice"> + The object that should be an advice, such as + <see cref="T:Spring.Aop.IBeforeAdvice"/> or + <see cref="T:Spring.Aop.IThrowsAdvice"/>. </param> + <returns> + An <see cref="T:Spring.Aop.IAdvisor"/> wrapping the supplied + <paramref name="advice"/>. Never returns <cref lang="null"/>. If + the <paramref name="advice"/> parameter is an + <see cref="T:Spring.Aop.IAdvisor"/>, it will simply be returned. + </returns> + <exception cref="T:Spring.Aop.Framework.Adapter.UnknownAdviceTypeException"> + If no registered + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> can wrap + the supplied <paramref name="advice"/>. + </exception> + </member> + <member name="M:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry.GetInterceptor(Spring.Aop.IAdvisor)"> + <summary> + Returns an <see cref="T:AopAlliance.Intercept.IInterceptor"/> to + allow the use of the supplied <paramref name="advisor"/> in an + interception-based framework. + </summary> + <param name="advisor">The advisor to find an interceptor for.</param> <returns> - <see langword="true"/> if this this method matches statically. + An interceptor to expose this advisor's behaviour. </returns> + <exception cref="T:Spring.Aop.Framework.Adapter.UnknownAdviceTypeException"> + If the advisor type is not understood by any registered + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/>. + </exception> </member> - <member name="M:Spring.Aop.Support.DynamicMethodMatcher.Matches(System.Reflection.MethodInfo,System.Type,System.Object[])"> + <member name="M:Spring.Aop.Framework.Adapter.DefaultAdvisorAdapterRegistry.RegisterAdvisorAdapter(Spring.Aop.Framework.Adapter.IAdvisorAdapter)"> <summary> - Is there a runtime (dynamic) match for the supplied - <paramref name="method"/>? + Register the given <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/>. </summary> - <remarks> - <p> - Must be overriden by derived classes to provide criteria for dynamic matching. - </p> - </remarks> - <param name="method">The candidate method.</param> - <param name="targetType"> - The target <see cref="T:System.Type"/>. + <param name="adapter"> + An <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> that + understands the particular advisor and advice types. </param> - <param name="args">The arguments to the method</param> - <returns> - <see langword="true"/> if there is a runtime match.</returns> </member> - <member name="P:Spring.Aop.Support.DynamicMethodMatcher.IsRuntime"> + <member name="T:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry"> <summary> - Is this <see cref="T:Spring.Aop.IMethodMatcher"/> dynamic? + Provides Singleton-style access to the default + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry"/> instance. </summary> - <value> - Always returns <see langword="true"/>, to specify that this is a - dynamic matcher. - </value> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="T:Spring.Aop.Support.ComposablePointcut"> + <member name="M:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry.#ctor"> <summary> - Convenient class for building up pointcuts. + Creates a new instance of the + <see cref="T:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry"/> class. </summary> <remarks> <p> - All methods return a <see cref="T:Spring.Aop.Support.ComposablePointcut"/> - instance, which facilitates the following concise usage pattern... + This contructor is marked as <see langword="private"/> to enforce the + Singleton pattern </p> - <code language="C#"> - IPointcut pointcut = new ComposablePointcut() - .Union(typeFilter) - .Intersection(methodMatcher) - .Intersection(pointcut); - </code> - <p> - There is no <c>Union()</c> method on this class. Use the - <see cref="M:Spring.Aop.Support.Pointcuts.Union(Spring.Aop.IPointcut,Spring.Aop.IPointcut)"/> method for such functionality. - </p> - </remarks> - <author>Rod Johnson</author> - <author>Aleksandar Seovic (.NET)</author> + </remarks> </member> - <member name="T:Spring.Aop.IPointcut"> + <member name="P:Spring.Aop.Framework.Adapter.GlobalAdvisorAdapterRegistry.Instance"> <summary> - Spring.NET's core pointcut abstraction. + The default <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapterRegistry"/> instance. </summary> + </member> + <member name="T:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"> + <summary> + <see cref="T:AopAlliance.Intercept.IInterceptor"/> implementation that + wraps <see cref="T:Spring.Aop.IMethodBeforeAdvice"/> instances. + </summary> <remarks> <p> - A pointcut is composed of <see cref="T:Spring.Aop.ITypeFilter"/>s and - <see cref="T:Spring.Aop.IMethodMatcher"/>s. Both these basic terms and an - <see cref="T:Spring.Aop.IPointcut"/> itself can be combined to build up - sophisticated combinations. + In the future Spring.NET may also offer a more efficient alternative + solution in cases where there is no interception advice and therefore + no need to create an <see cref="T:AopAlliance.Intercept.IMethodInvocation"/> + object. </p> + <p> + Used internally by the Spring.NET AOP framework: application developers + should not need to use this class directly. + </p> </remarks> <author>Rod Johnson</author> <author>Aleksandar Seovic (.NET)</author> </member> - <member name="P:Spring.Aop.IPointcut.TypeFilter"> + <member name="M:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor.#ctor(Spring.Aop.IMethodBeforeAdvice)"> <summary> - The <see cref="T:Spring.Aop.ITypeFilter"/> for this pointcut. + Creates a new instance of the + <see cref="T:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor"/> + class. </summary> - <value> - The current <see cref="T:Spring.Aop.ITypeFilter"/>. - </value> + <param name="advice"> + The <see cref="T:Spring.Aop.IMethodBeforeAdvice"/> that is to be wrapped. + </param> + <exception cref="T:System.ArgumentNullException"> + If the supplied <paramref name="advice"/> is <see langword="null"/>. + </exception> </member> - <member name="P:Spring.Aop.IPointcut.MethodMatcher"> + <member name="M:Spring.Aop.Framework.Adapter.MethodBeforeAdviceInterceptor.Invoke(AopAlliance.Intercept.IMethodInvocation)"> <summary> - The <see cref="T:Spring.Aop.IMethodMatcher"/> for this pointcut. + Executes interceptor before the target method successfully returns. </summary> - <value> - The current <see cref="T:Spring.Aop.IMethodMatcher"/>. - </value> + <param name="invocation"> + The method invocation that is being intercepted. + </param> + <returns> + The result of the call to the + <see cref="M:AopAlliance.Intercept.IJoinpoint.Proceed"/> method of + the supplied <paramref name="invocation"/>. + </returns> + <exception cref="T:System.Exception"> + If any of the interceptors in the chain or the target object itself + throws an exception. + </exception> </member> - <member name="M:Spring.Aop.Support.ComposablePointcut.#ctor"> + <member name="T:Spring.Aop.Framework.Adapter.ThrowsAdviceAdapter"> <summary> - Creates a new instance of the - <see cref="T:Spring.Aop.Support.ComposablePointcut"/> class - that matches all the methods on all <see cref="T:System.Type"/>s. + <see cref="T:Spring.Aop.Framework.Adapter.IAdvisorAdapter"/> implementation + to enable <see cref="T:Spring.Aop.IThrowsAdvice"/> to be used in the + Spring.NET AOP framework. </summary> + <author>Rod Johnson</author> + <author>Aleksandar Seovic (.NET)</author> </member> - <member name="M:Spring.Aop.Support.ComposablePointcut.#ctor(Spring.Aop.ITypeFilter,Spring.Aop.IMethodMatcher)"> + <member name="M:Spring.Aop.Framework.Adapter.ThrowsAdviceAdapter.SupportsAdvice(AopAlliance.Aop.IAdvice)"> <summary> - Creates a new instance of the - <see cref="T:Spring.Aop.Support.ComposablePointcut"/> class - that uses the supplied <paramref name="typeFilter"/> and - <paramref name="methodMatcher"/>. + Returns <see langword="true"/> if the supplied + <paramref name="advice"/> is an instance of the + <see cref="T:Spring.Aop.IThrowsAdvice"/> interface. </summary> - <param name="typeFilter"> - The type filter to use. - </param> - <param name="methodMatcher"> - The method matcher to use. - </param> + <param name="advice">The advice to check.</param> + <returns> + <see langword="true"/> if the supplied <paramref name="advice"/> is + an instance of the <see cref="T:Spring.Aop.IThrowsAdvice"/> interface; + <see langword="false"/> if not or if the supplied + <paramref name="advice"/> is <cref lang="null"/>. + </returns> </member> - <member name="M:Spring.Aop.Support.ComposablePointcut.Union(Spring.Aop.ITypeFilter)"> + <member name="M:Spring.Aop.Framework.Adapter.ThrowsAdviceAdapter.GetInterceptor(Spring.Aop.IAdvisor)"> <summary> - Changes the current type filter to be the union of the existing filter and the - supplied <paramref name="filter"/>. + Wraps the supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> within a + <see cref="T:Spring.Aop.Framework.Adapter.ThrowsAdviceInterceptor"/> + instance. </summary> - <param name="filter">The filter to union with.</param> + <param name="advisor"> + The advisor exposing the <see cref="T:AopAlliance.Aop.IAdvice"/> that + is to be wrapped. + </param> <returns> - The union of the existing filter and the supplied <paramref name="filter"/>. + The supplied <paramref name="advisor"/>'s + <see cref="P:Spring.Aop.IAdvisor.Advice"/> wrapped within a + <see cref="T:Spring.Aop.Framework.Adapter.ThrowsAdviceInterceptor"/> + instance. </returns> </member> - <member name="M:Spring.Aop.Support.ComposablePointcut.Intersection(Spring.Aop.ITypeFilter)"> + <member name="T:Spring.Aop.Framework.Adapter.ThrowsAdviceInterceptor"> + <summary>Interceptor to wrap an after throwing advice.</summary> + <remarks> + <p> + Implementations of the <see cref="T:Spring.Aop.IThrowsAdvice"/> interface + <b>must</b> define methods of the form... + <code lang="C#"> + AfterThrowing([MethodInfo method, Object[] args, Object target], Exception subclass); + </code> + The method name is fixed (i.e. your methods <b>must</b> be named + <c>AfterThrowing</c>. The first three arguments (<i>as a whole</i>) are + optional, and only useful if futher information about the joinpoint is + required. The return type <i>can</i> be anything, but is almost always + <see langword="void"/> by convention. + </p> + <p> + Please note that the object encapsulating the throws advice does not + need to implement the <see cref="T:S... [truncated message content] |
From: <fab...@us...> - 2009-05-02 21:53:50
|
Revision: 4224 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4224&view=rev Author: fabiomaulo Date: 2009-05-02 21:53:39 +0000 (Sat, 02 May 2009) Log Message: ----------- NUnit2.5.0RC1 Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/nunit.framework.dll trunk/nhibernate/lib/net/3.5/nunit.framework.dll trunk/nhibernate/src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs trunk/nhibernate/src/NHibernate.Test/Bytecode/Lightweight/BytecodeProviderFixture.cs trunk/nhibernate/src/NHibernate.Test/Cascade/RefreshFixture.cs trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationFixture.cs trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs trunk/nhibernate/src/NHibernate.Test/ConnectionStringTest/NamedConnectionStringFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs trunk/nhibernate/src/NHibernate.Test/Deletetransient/DeleteTransientEntityTest.cs trunk/nhibernate/src/NHibernate.Test/DriverTest/NullReferenceFixture.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Multi/MultiRepresentationFixture.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Accessors/XmlAccessorFixture.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs trunk/nhibernate/src/NHibernate.Test/Events/Collections/AbstractCollectionEventFixture.cs trunk/nhibernate/src/NHibernate.Test/ExpressionTest/SimpleExpressionFixture.cs trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs trunk/nhibernate/src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs trunk/nhibernate/src/NHibernate.Test/FilterTest/FilterConfig.cs trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs trunk/nhibernate/src/NHibernate.Test/IdGen/Enhanced/SequenceStyleConfigUnitFixture.cs trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs trunk/nhibernate/src/NHibernate.Test/IdTest/IdentifierGeneratorFactoryFixture.cs trunk/nhibernate/src/NHibernate.Test/Legacy/CriteriaTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs trunk/nhibernate/src/NHibernate.Test/MappingExceptions/MissingDefCtorFixture.cs trunk/nhibernate/src/NHibernate.Test/MappingTest/ForeignKeyFixture.cs trunk/nhibernate/src/NHibernate.Test/NHAssert.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/EmptyMappingsFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FallbackFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/LazyLoadBugTest.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1289/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1326/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1349/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1488/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1499/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1508/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1533/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1552/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1593/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1612/NativeSqlCollectionLoaderFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1621/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1635/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1675/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1693/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1694/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1710/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1713/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1741/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH280/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH350/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH496/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH593/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH606/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH712/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/OptimisticConcurrencyFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ProxyValidator/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj trunk/nhibernate/src/NHibernate.Test/Naturalid/Immutable/ImmutableNaturalIdFixture.cs trunk/nhibernate/src/NHibernate.Test/Naturalid/Mutable/MutableNaturalIdFixture.cs trunk/nhibernate/src/NHibernate.Test/Operations/AbstractOperationTestCase.cs trunk/nhibernate/src/NHibernate.Test/Operations/MergeFixture.cs trunk/nhibernate/src/NHibernate.Test/Pagination/PaginationFixture.cs trunk/nhibernate/src/NHibernate.Test/PropertyTest/BackFieldAccessorFixture.cs trunk/nhibernate/src/NHibernate.Test/PropertyTest/BasicSetterExceptionFixture.cs trunk/nhibernate/src/NHibernate.Test/PropertyTest/FieldSetterExceptionFixture.cs trunk/nhibernate/src/NHibernate.Test/PropertyTest/ReadonlyAccessorFixture.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/DetachedQueryFixture.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/MultipleQueriesFixture.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/QueryParametersFixture.cs trunk/nhibernate/src/NHibernate.Test/ReflectionOptimizerTest/LcgFixture.cs trunk/nhibernate/src/NHibernate.Test/SecondLevelCacheTest/QueryCacheFixture.cs trunk/nhibernate/src/NHibernate.Test/Stateless/StatelessWithRelationsFixture.cs trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaExportTests/WithColumnTagFixture.cs trunk/nhibernate/src/NHibernate.Test/Tools/hbm2ddl/SchemaValidator/SchemaValidateFixture.cs trunk/nhibernate/src/NHibernate.Test/TransactionTest/TransactionFixture.cs trunk/nhibernate/src/NHibernate.Test/TransformTests/AliasToBeanResultTransformerFixture.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/CurrencyTypeFixture.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/PersistentEnumTypeFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/AssemblyQualifiedTypeNameFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/IdentityMapFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/LinkedHashMapFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/ReflectHelperFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/SequencedHashMapFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/SingletonEnumerableFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/SoftLimitMRUCacheFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/StringHelperFixture.cs trunk/nhibernate/src/NHibernate.Test/UtilityTest/TypeNameParserFixture.cs trunk/nhibernate/src/NHibernate.Test/VersionTest/Db/MsSQL/GeneratedBinaryVersionFixture.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/Assertions/ Modified: trunk/nhibernate/lib/net/2.0/nunit.framework.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/nunit.framework.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.BulkManipulation { Modified: trunk/nhibernate/src/NHibernate.Test/Bytecode/Lightweight/BytecodeProviderFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Bytecode/Lightweight/BytecodeProviderFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Bytecode/Lightweight/BytecodeProviderFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using NHibernate.Bytecode; using NHibernate.Bytecode.Lightweight; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Bytecode.Lightweight { Modified: trunk/nhibernate/src/NHibernate.Test/Cascade/RefreshFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Cascade/RefreshFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Cascade/RefreshFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -2,7 +2,6 @@ using System.Collections; using System.Data; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Cascade { Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -161,7 +161,6 @@ } [Test] - [ExpectedException(typeof(HibernateConfigException))] public void CacheConfigurationForUnmappedClass() { string cfgString = @@ -173,11 +172,10 @@ </hibernate-configuration>"; Configuration cfg = new Configuration(); - cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null)); + Assert.Throws<HibernateConfigException>(()=>cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null))); } [Test] - [ExpectedException(typeof(HibernateConfigException))] public void CacheConfigurationForUnmappedCollection() { string cfgString = @@ -190,17 +188,16 @@ </hibernate-configuration>"; Configuration cfg = new Configuration(); - cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null)); + Assert.Throws<HibernateConfigException>(()=>cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null))); } [Test] - [ExpectedException(typeof(HibernateConfigException))] public void NoSessionFactoriesInConfiguration() { string cfgString = @"<?xml version='1.0' encoding='utf-8' ?><someElement />"; Configuration cfg = new Configuration(); - cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null)); + Assert.Throws<HibernateConfigException>(()=>cfg.Configure(new XmlTextReader(cfgString, XmlNodeType.Document, null))); } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -11,7 +11,7 @@ [TestFixture] public class ConfigurationSchemaFixture { - [Test, ExpectedException(typeof(HibernateConfigException))] + [Test] public void InvalidConfig() { string xml = @@ -21,7 +21,7 @@ </hibernate-configuration>"; XmlTextReader xtr = new XmlTextReader(xml, XmlNodeType.Document, null); - HibernateConfiguration hc = new HibernateConfiguration(xtr); + Assert.Throws<HibernateConfigException>(()=>new HibernateConfiguration(xtr)); } [Test] @@ -52,7 +52,7 @@ Assert.AreEqual(hc.UseReflectionOptimizer, newhc.UseReflectionOptimizer); } - [Test, ExpectedException(typeof(HibernateConfigException))] + [Test] public void EmptyFactoryNotAllowed() { // session-factory omission not allowed out of App.config @@ -63,7 +63,7 @@ </hibernate-configuration>"; XmlTextReader xtr = new XmlTextReader(xml, XmlNodeType.Document, null); - HibernateConfiguration hc = new HibernateConfiguration(xtr); + Assert.Throws<HibernateConfigException>(()=> new HibernateConfiguration(xtr)); } [Test] @@ -148,7 +148,7 @@ (new MappingConfiguration("AAssembly", null)))); } - [Test, ExpectedException(typeof(HibernateConfigException))] + [Test] public void NotAllowedMappings() { string xml = @@ -160,7 +160,7 @@ </hibernate-configuration>"; XmlTextReader xtr = new XmlTextReader(xml, XmlNodeType.Document, null); - HibernateConfiguration hc = new HibernateConfiguration(xtr); + Assert.Throws<HibernateConfigException>(()=>new HibernateConfiguration(xtr)); } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/CfgTest/ConfigurationSerializationTests.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -5,7 +5,6 @@ using NHibernate.DomainModel; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.CfgTest { Modified: trunk/nhibernate/src/NHibernate.Test/ConnectionStringTest/NamedConnectionStringFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ConnectionStringTest/NamedConnectionStringFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/ConnectionStringTest/NamedConnectionStringFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -11,13 +11,12 @@ public class NamedConnectionStringFixture { [Test] - [ExpectedException(typeof(HibernateException), "Could not find named connection string MyConStr")] public void InvalidNamedConnectedStringThrows() { Dictionary<string, string> settings = new Dictionary<string, string>(); settings.Add(Environment.ConnectionStringName, "MyConStr"); ConnectionProvider cp = new MockConnectionProvider(); - cp.Configure(settings); + Assert.Throws<HibernateException>(()=>cp.Configure(settings), "Could not find named connection string MyConStr"); } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/CriteriaQueryTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -7,7 +7,6 @@ using NHibernate.Type; using NHibernate.Util; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Criteria { @@ -1434,14 +1433,14 @@ session.Close(); } - [Test, ExpectedException(typeof(QueryException))] + [Test] public void TypeMismatch() { using (ISession session = OpenSession()) { - session.CreateCriteria(typeof(Enrolment)) + Assert.Throws<QueryException>(() => session.CreateCriteria(typeof(Enrolment)) .Add(Expression.Eq("Student", 10)) // Type mismatch! - .List(); + .List()); } } Modified: trunk/nhibernate/src/NHibernate.Test/Deletetransient/DeleteTransientEntityTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Deletetransient/DeleteTransientEntityTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Deletetransient/DeleteTransientEntityTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,5 @@ using System.Collections; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Deletetransient { Modified: trunk/nhibernate/src/NHibernate.Test/DriverTest/NullReferenceFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/DriverTest/NullReferenceFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/DriverTest/NullReferenceFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -24,28 +24,21 @@ /// but all properties were null. /// </remarks> /// TODO: I think this fixture is redundant now due to the QueryTest fixtures, just mark it so that it catches the new exception type for now - [Test, ExpectedException(typeof(QueryException))] + [Test] public void NoParameterNameNullReference() { ISession s = null; try { s = OpenSession(); - Console.WriteLine("about to run query"); IQuery q = s.CreateQuery("from Simple s where s.Name = :missing"); Assert.IsNotNull(q); q.List(); } - catch (ADOException ae) + catch (QueryException ae) { - Assert.IsTrue(ae.InnerException is QueryException); - Assert.IsTrue(ae.InnerException.Message.StartsWith("No value assigned to parameter")); + Assert.IsTrue(ae.Message.StartsWith("Not all named parameters have been set")); } - catch (Exception e) - { - Console.WriteLine(e.ToString()); - throw; - } finally { s.Close(); Modified: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Multi/MultiRepresentationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Multi/MultiRepresentationFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Multi/MultiRepresentationFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Xml; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.EntityModeTest.Multi { Modified: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Accessors/XmlAccessorFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Accessors/XmlAccessorFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Accessors/XmlAccessorFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Mapping; using NHibernate.Properties; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.EntityModeTest.Xml.Accessors { Modified: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -5,7 +5,6 @@ using NHibernate.Criterion; using NHibernate.Transform; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using Environment=NHibernate.Cfg.Environment; namespace NHibernate.Test.EntityModeTest.Xml.Basic Modified: trunk/nhibernate/src/NHibernate.Test/Events/Collections/AbstractCollectionEventFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Events/Collections/AbstractCollectionEventFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Events/Collections/AbstractCollectionEventFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -4,7 +4,6 @@ using NHibernate.Event; using NHibernate.Test.Events.Collections.Association.Bidirectional.ManyToMany; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Events.Collections { Modified: trunk/nhibernate/src/NHibernate.Test/ExpressionTest/SimpleExpressionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExpressionTest/SimpleExpressionFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/ExpressionTest/SimpleExpressionFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -71,7 +71,6 @@ } [Test] - [ExpectedException(typeof(QueryException))] public void MisspelledPropertyWithNormalizedEntityPersister() { using (ISession session = factory.OpenSession()) @@ -79,7 +78,7 @@ CreateObjects(typeof(Multi), session); ICriterion expression = Expression.Eq("MisspelledProperty", DateTime.Now); - expression.ToSqlString(criteria, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter>()); + Assert.Throws<QueryException>(() =>expression.ToSqlString(criteria, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter>())); } } } Modified: trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Extendshbm/ExtendsFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,5 @@ using NHibernate.Cfg; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Extendshbm { Modified: trunk/nhibernate/src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,5 @@ using System.Collections; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Extralazy { Modified: trunk/nhibernate/src/NHibernate.Test/FilterTest/FilterConfig.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/FilterTest/FilterConfig.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/FilterTest/FilterConfig.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -55,7 +55,6 @@ [Test] - [ExpectedException(typeof(HibernateException))] public void TestFilterThrowsWithNoParameterSet() { Configuration cfg = new Configuration(); @@ -65,7 +64,7 @@ ISession session = factory.OpenSession(); IFilter filter = session.EnableFilter("LiveFilter"); - filter.Validate(); + Assert.Throws<HibernateException>(() => filter.Validate()); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.HQL.Ast { Modified: trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Dialect; using NHibernate.Dialect.Function; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.Hql { @@ -186,7 +185,7 @@ } } - [Test, ExpectedException(typeof(QueryException))] + [Test] public void AggregateSumNH1100() { using (ISession s = OpenSession()) @@ -199,7 +198,7 @@ } using (ISession s = OpenSession()) { - s.CreateQuery("select distinct new SummaryItem(a.Description, sum(BodyWeight)) from Animal a").List<SummaryItem>(); + Assert.Throws<QueryException>(() => s.CreateQuery("select distinct new SummaryItem(a.Description, sum(BodyWeight)) from Animal a").List<SummaryItem>()); } } Modified: trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/HQL/SqlCommentsFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System.Collections; using NHibernate.Cfg; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.HQL { Modified: trunk/nhibernate/src/NHibernate.Test/IdGen/Enhanced/SequenceStyleConfigUnitFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/IdGen/Enhanced/SequenceStyleConfigUnitFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/IdGen/Enhanced/SequenceStyleConfigUnitFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System.Collections.Generic; using NHibernate.Id.Enhanced; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.IdGen.Enhanced { Modified: trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,5 @@ using System.Collections; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.IdGen.NativeGuid { Modified: trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Engine; using NHibernate.Id; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.IdGen.NativeGuid { Modified: trunk/nhibernate/src/NHibernate.Test/IdTest/IdentifierGeneratorFactoryFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/IdTest/IdentifierGeneratorFactoryFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/IdTest/IdentifierGeneratorFactoryFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -12,10 +12,10 @@ /// caught with a bad class name passed in. /// </summary> [Test] - [ExpectedException(typeof(IdentifierGenerationException), "Could not interpret id generator strategy: Guid")] public void NonCreatableStrategy() { - IdentifierGeneratorFactory.Create("Guid", NHibernateUtil.Guid, null, new MsSql2000Dialect()); + Assert.Throws<IdentifierGenerationException>(() => IdentifierGeneratorFactory.Create("Guid", NHibernateUtil.Guid, null, new MsSql2000Dialect()), + "Could not interpret id generator strategy: Guid"); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/CriteriaTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/CriteriaTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/CriteriaTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -117,14 +117,13 @@ } [Test] - [ExpectedException(typeof(QueryException))] public void CriteriaTypeMismatch() { using (ISession s = OpenSession()) { - s.CreateCriteria(typeof(Master)) + Assert.Throws<QueryException>(() =>s.CreateCriteria(typeof(Master)) .Add(Expression.Like("Details", "SomeString")) - .List(); + .List()); } } @@ -144,14 +143,13 @@ } [Test] - [ExpectedException(typeof(QueryException))] public void CriteriaCompositeProperty() { using (ISession s = OpenSession()) { - s.CreateCriteria(typeof(Master)) + Assert.Throws<QueryException>(() =>s.CreateCriteria(typeof(Master)) .Add(Expression.Eq("Details.I", 10)) - .List(); + .List()); } } Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1985,24 +1985,22 @@ } [Test] - [ExpectedException(typeof(QueryException))] public void VerifyParameterNamedMissing() { using (ISession s = OpenSession()) { IQuery q = s.CreateQuery("select bar from Bar as bar where bar.X > :myX"); - q.List(); + Assert.Throws<QueryException>(() =>q.List()); } } [Test] - [ExpectedException(typeof(QueryException))] public void VerifyParameterPositionalMissing() { using (ISession s = OpenSession()) { IQuery q = s.CreateQuery("select bar from Bar as bar where bar.X > ?"); - q.List(); + Assert.Throws<QueryException>(() =>q.List()); } } @@ -2028,7 +2026,6 @@ } [Test] - [ExpectedException(typeof(QueryException))] public void VerifyParameterPositionalMissing2() { using (ISession s = OpenSession()) @@ -2036,7 +2033,7 @@ IQuery q = s.CreateQuery("select bar from Bar as bar where bar.String = ? or bar.String = ? or bar.String = ?"); q.SetParameter(0, "bull"); q.SetParameter(2, "shit"); - q.List(); + Assert.Throws<QueryException>(() =>q.List()); } } Modified: trunk/nhibernate/src/NHibernate.Test/MappingExceptions/MissingDefCtorFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingExceptions/MissingDefCtorFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/MappingExceptions/MissingDefCtorFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -11,14 +11,14 @@ [TestFixture] public class MissingDefCtorFixture { - [Test, ExpectedException(typeof(InstantiationException))] + [Test] public void ClassMissingDefaultCtor() { // add a resource that doesn't exist string resource = "NHibernate.Test.MappingExceptions.MissingDefCtor.hbm.xml"; Configuration cfg = new Configuration(); - cfg.AddResource(resource, this.GetType().Assembly); - cfg.BuildSessionFactory(); + cfg.AddResource(resource, this.GetType().Assembly); + Assert.Throws<InstantiationException>(() =>cfg.BuildSessionFactory()); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/MappingTest/ForeignKeyFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingTest/ForeignKeyFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/MappingTest/ForeignKeyFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -7,7 +7,6 @@ public class ForeignKeyFixture { [Test] - [ExpectedException(typeof(FKUnmatchingColumnsException))] public void UnmatchingColumns() { Table primaryTable = new Table("pktable"); @@ -38,7 +37,7 @@ fk.Table = fkTable; fk.ReferencedTable = primaryTable; - fk.AlignColumns(); + Assert.Throws<FKUnmatchingColumnsException>(() => fk.AlignColumns()); } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHAssert.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHAssert.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHAssert.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,8 @@ using System; -using NHibernate.Test.Assertions; +using System.Reflection; +using System.Text; using NUnit.Framework; +using System.Collections.Generic; namespace NHibernate.Test { @@ -15,7 +17,7 @@ public static void HaveSerializableAttribute(System.Type clazz, string message, params object[] args) { - Assert.DoAssert(new HaveSerializableAttributeAsserter(clazz, message, args)); + Assert.That(clazz, Has.Attribute<SerializableAttribute>(), message, args); } public static void InheritedAreMarkedSerializable(System.Type clazz) @@ -25,7 +27,20 @@ public static void InheritedAreMarkedSerializable(System.Type clazz, string message, params object[] args) { - Assert.DoAssert(new InheritedAreMarkedSerializable(clazz, message, args)); + var sb = new StringBuilder(); + int failedCount = 0; + Assembly nhbA = Assembly.GetAssembly(clazz); + IList<System.Type> types = ClassList(nhbA, clazz); + foreach (System.Type tp in types) + { + object[] atts = tp.GetCustomAttributes(typeof(SerializableAttribute), false); + if (atts.Length == 0) + { + sb.AppendLine(string.Format(" class {0} is not marked as Serializable", tp.FullName)); + failedCount++; + } + } + Assert.That(failedCount, Is.EqualTo(0)); } public static void IsSerializable(object obj) @@ -35,9 +50,23 @@ public static void IsSerializable(object obj, string message, params object[] args) { - Assert.DoAssert(new IsSerializable(obj, message, args)); + Assert.That(obj, Is.BinarySerializable, message, args); } #endregion + private static IList<System.Type> ClassList(Assembly assembly, System.Type type) + { + IList<System.Type> result = new List<System.Type>(); + if (assembly != null) + { + System.Type[] types = assembly.GetTypes(); + foreach (System.Type tp in types) + { + if (tp != type && type.IsAssignableFrom(tp) && !tp.IsInterface) + result.Add(tp); + } + } + return result; + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Docs/Associations/BiM21/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -46,7 +46,6 @@ } [Test] - [ExpectedException(typeof(PropertyValueException))] public void TestErrorUsage() { using (ISession session = OpenSession()) @@ -59,7 +58,7 @@ fred.Address = flinstoneWay; wilma.Address = flinstoneWay; - session.Save(fred); + Assert.Throws<PropertyValueException>(() => session.Save(fred)); } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/EmptyMappingsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/EmptyMappingsFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/EmptyMappingsFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -30,13 +30,13 @@ } } - [Test, ExpectedException(typeof(ObjectDisposedException))] + [Test] public void ReconnectAfterClose() { using (ISession s = OpenSession()) { s.Close(); - s.Reconnect(); + Assert.Throws<ObjectDisposedException>(() => s.Reconnect()); } } @@ -56,11 +56,11 @@ } } - [Test, ExpectedException(typeof(ArgumentNullException))] + [Test] public void NullInterceptor() { IInterceptor nullInterceptor = null; - sessions.OpenSession(nullInterceptor).Close(); + Assert.Throws<ArgumentNullException>(() => sessions.OpenSession(nullInterceptor).Close()); } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FallbackFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FallbackFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/FallbackFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -5,7 +5,6 @@ using NHibernate.Driver; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using Environment=NHibernate.Cfg.Environment; Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/LazyLoadBugTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/LazyLoadBugTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/LazyLoadBugTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -14,7 +14,6 @@ } [Test] - [ExpectedException(typeof(LazyInitializationException))] public void TestLazyLoad() { int parentId = 0; @@ -45,7 +44,7 @@ // Because it maintains logic to maintain the collection during the property set it should // tell NHibernate to skip the setter and access the field. If it doesn't, then throw // a LazyInitializationException. - int count = parent2.Children.Count; + Assert.Throws<LazyInitializationException>(() => { int count = parent2.Children.Count; }); } } finally Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1289/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1289/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1289/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using System.Text; using Iesi.Collections.Generic; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1289 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1326/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1326/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1326/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,7 @@ using System; using NHibernate.Cfg; using NHibernate.Event; +using NHibernate.Id; using NHibernate.Transaction; using NUnit.Framework; @@ -16,14 +17,12 @@ [Test] - [ExpectedException(typeof(InvalidOperationException), - "Disconnect cannot be called while a transaction is in progress.")] public void ShouldThrowIfCallingDisconnectInsideTransaction() { using (ISession s = OpenSession()) using (ITransaction tx = s.BeginTransaction()) { - s.Disconnect(); + Assert.Throws<InvalidOperationException>(() => s.Disconnect(), "Disconnect cannot be called while a transaction is in progress."); tx.Commit(); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1349/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1349/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1349/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1349 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1413/PagingTest.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System; using NHibernate.Criterion; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1413 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1443/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -2,7 +2,6 @@ using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1443 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1464/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System; using NHibernate.Proxy; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; using System.Collections.Generic; namespace NHibernate.Test.NHSpecificTest.NH1464 Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1488/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1488/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1488/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,6 +1,5 @@ using System.Collections; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1488 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1490/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System.Collections.Generic; using NHibernate.Dialect; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1490 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1499/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1499/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1499/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -43,7 +43,6 @@ } } [Test] - [ExpectedException(typeof(QueryException))] public void CheckIfDetachedCriteriaCanBeUsedOnPropertyRestriction() { using (ISession session = OpenSession()) @@ -56,7 +55,7 @@ Property.ForName("Title").Eq("Spec"), Property.ForName("Person").Eq(detached) )); - IList<Document> results = criteria.List<Document>(); + Assert.Throws<QueryException>(() => criteria.List<Document>()); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1508/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1508/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1508/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -66,32 +66,26 @@ } [Test] - [ExpectedException(typeof(NotSupportedException))] public void ThrowsExceptionWhenSqlQueryIsGiven() { using (ISession session = OpenSession()) using (ITransaction tx = session.BeginTransaction()) { ISQLQuery sqlQuery = session.CreateSQLQuery("select * from Document"); - IMultiQuery q = session - .CreateMultiQuery() - .Add(sqlQuery); - q.List(); + Assert.Throws<NotSupportedException>(() => session.CreateMultiQuery().Add(sqlQuery)); } } [Test] - [ExpectedException(typeof(NotSupportedException))] public void ThrowsExceptionWhenNamedSqlQueryIsGiven() { using (ISession session = OpenSession()) using (ITransaction tx = session.BeginTransaction()) { - IMultiQuery q = session + Assert.Throws<NotSupportedException>(() =>session .CreateMultiQuery() - .AddNamedQuery("SampleSqlQuery"); - q.List(); + .AddNamedQuery("SampleSqlQuery")); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1515/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System.Collections.Generic; using NHibernate.Proxy; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1515 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1521/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Dialect; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1521 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1533/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1533/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1533/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1533 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1552/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1552/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1552/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -4,7 +4,6 @@ using System.Text; using NHibernate.Dialect; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1552 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1593/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1593/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1593/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1593 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1608/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using NHibernate.Util; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1608 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1612/NativeSqlCollectionLoaderFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1612/NativeSqlCollectionLoaderFixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1612/NativeSqlCollectionLoaderFixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -2,7 +2,6 @@ using System.Collections.Generic; using NHibernate.Dialect; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1612 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1621/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1621/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1621/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1621 { @@ -32,7 +31,7 @@ var nums = session.CreateQuery("from Nums b where b.Sum > 4").List<Nums>(); - Assert.That(nums, Has.Count(1)); + Assert.That(nums.Count, Is.EqualTo(1)); Assert.That(nums[0].Sum, Is.EqualTo(7)); session.Delete("from Nums"); Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1632 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1635/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1635/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1635/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,7 +1,6 @@ using System.Text; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1635 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1640 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1675/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1675/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1675/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1675 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1693/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1693/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1693/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1693 { @@ -43,7 +42,7 @@ var list = session.CreateQuery(q1) .SetParameter("cat", 10) .List<Invoice>(); - Assert.That(list, Has.Count(2)); + Assert.That(list.Count, Is.EqualTo(2)); Assert.That(list[0].Num == 2 && list[0].Mode == "a"); Assert.That(list[1].Num == 4 && list[1].Mode == "a"); @@ -64,7 +63,7 @@ var list = session.CreateQuery(q1) .SetParameter("cat", 10) .List<Invoice>(); - Assert.That(list, Has.Count(2)); + Assert.That(list.Count, Is.EqualTo(2)); Assert.That(list[0].Num == 2 && list[0].Mode == "a"); Assert.That(list[1].Num == 4 && list[1].Mode == "a"); Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1694/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1694/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1694/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -2,7 +2,6 @@ using NHibernate.Criterion; using NHibernate.Dialect; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1694 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1710/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1710/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1710/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Engine; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1710 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1713/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1713/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1713/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -2,7 +2,6 @@ using NHibernate.Dialect; using NHibernate.Util; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1713 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1741/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1741/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1741/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -3,7 +3,6 @@ using NHibernate.Impl; using NUnit.Framework; using NHibernate.Util; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH1741 { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH280/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH280/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH280/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -55,12 +55,12 @@ } } - [Test, ExpectedException(typeof(NHibernate.QueryException))] + [Test] public void TokenUnknow() { using (ISession s = OpenSession()) { - IList l = s.CreateQuery("select 123, notRecognized, f.Description from Foo f").List(); + Assert.Throws<QueryException>(() =>s.CreateQuery("select 123, notRecognized, f.Description from Foo f").List()); } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH350/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH350/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH350/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -13,7 +13,7 @@ // We pass an Int32 id to Load and expect an exception, since the class // uses Int64 ids. - [Test, ExpectedException(typeof(TypeMismatchException))] + [Test] public void Loading() { object parentId; @@ -31,9 +31,7 @@ { using (ISession session = OpenSession()) { - SecurityDomain aDomain = (SecurityDomain) session.Load(typeof(SecurityDomain), 1); - Assert.AreEqual("Name", aDomain.Name); - Assert.IsTrue(aDomain.ChildDomains.Count > 0); + Assert.Throws<TypeMismatchException>(() => session.Load(typeof(SecurityDomain), 1)); } } finally Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH496/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH496/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH496/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -36,8 +36,7 @@ using (ISession s = OpenSession()) using (ITransaction t = s.BeginTransaction()) { - obj = (WronglyMappedClass) s.Get(typeof(WronglyMappedClass), obj.Id); - Assert.AreEqual(10, obj.SomeInt); + Assert.Throws<PropertyAccessException>(() => s.Get(typeof(WronglyMappedClass), obj.Id)); t.Commit(); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH593/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH593/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH593/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -6,16 +6,16 @@ [TestFixture] public class Fixture : BugTestCase { - [Test, ExpectedException(typeof(QueryException))] + [Test] public void Bug() { using (ISession session = OpenSession()) { User user = new User("test"); user.UserId = 10; - session.CreateCriteria(typeof(Blog)) + Assert.Throws<QueryException>(() => session.CreateCriteria(typeof(Blog)) .Add(Expression.In("Users", new User[] {user})) - .List(); + .List()); } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH606/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH606/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH606/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -26,13 +26,13 @@ [TestFixture] public class Fixture { - [Test, ExpectedException(typeof(MappingException))] + [Test] public void InvalidGenericMapping() { - ISessionFactory sf = new Configuration() - .AddResource(typeof (Fixture).Namespace + ".Mapping.hbm.xml", typeof (Fixture).Assembly) - .BuildSessionFactory(); - sf.Close(); + Assert.Throws<MappingException>( + () => + new Configuration().AddResource(typeof (Fixture).Namespace + ".Mapping.hbm.xml", typeof (Fixture).Assembly). + BuildSessionFactory()); } } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Fixture.cs 2009-05-02 05:10:00 UTC (rev 4223) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH662/Fixture.cs 2009-05-02 21:53:39 UTC (rev 4224) @@ -1,5 +1,4 @@ using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace NHibernate.Test.NHSpecificTest.NH662 { Modified: trunk/nhiber... [truncated message content] |
From: <fab...@us...> - 2009-05-08 16:40:53
|
Revision: 4270 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4270&view=rev Author: fabiomaulo Date: 2009-05-08 16:40:47 +0000 (Fri, 08 May 2009) Log Message: ----------- Fixed the query syntax for the new parser Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate.Test/Legacy/MasterDetailTest.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-05-08 16:07:27 UTC (rev 4269) +++ trunk/nhibernate/releasenotes.txt 2009-05-08 16:40:47 UTC (rev 4270) @@ -9,6 +9,7 @@ * In SchemaExport.Execute the parameter "format" was removed; (NH-1701) enabled configuration property format_sql (default true) * Antlr3.Runtime.dll is required * the syntax foo.bar.baz.elements or foo.bar.baz.indices is not longer supported. Use the alternative syntax of elements(foo.bar.baz) or indices(foo.bar.baz) instead + Note: in some case, where a sub-select is needed, the collection is enough example: FROM m IN CLASS Master WHERE NOT EXISTS( FROM m.Details d WHERE NOT d.I=5 ) ##### Possible Breaking Changes for external frameworks ##### * ISession interface has additional methods Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/MasterDetailTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/MasterDetailTest.cs 2009-05-08 16:07:27 UTC (rev 4269) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/MasterDetailTest.cs 2009-05-08 16:40:47 UTC (rev 4270) @@ -366,11 +366,11 @@ ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); - string path = IsClassicParser ? "m.Details.elements" : "elements(m.Details)"; + string path = IsClassicParser ? "m.Details.elements" : "m.Details"; if (Dialect.SupportsSubSelects) { - s.CreateQuery("FROM m IN CLASS Master WHERE NOT EXISTS ( FROM d in " + path + " WHERE NOT d.I=5 )").Enumerable(); + s.CreateQuery("FROM m IN CLASS Master WHERE NOT EXISTS ( FROM " + path + " d WHERE NOT d.I=5 )").Enumerable(); s.CreateQuery("FROM m IN CLASS Master WHERE NOT 5 IN ( SELECT d.I FROM d IN " + path + " )").Enumerable(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-11 06:39:59
|
Revision: 4276 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4276&view=rev Author: fabiomaulo Date: 2009-05-11 06:39:49 +0000 (Mon, 11 May 2009) Log Message: ----------- Fixed NH-1179 Possible breaking change: now filters are working, as expected, even for many-to-one associations Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs trunk/nhibernate/src/NHibernate/Loader/JoinWalker.cs trunk/nhibernate/src/NHibernate/SqlCommand/ANSIJoinFragment.cs trunk/nhibernate/src/NHibernate/SqlCommand/QueryJoinFragment.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1179/Fixture.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/releasenotes.txt 2009-05-11 06:39:49 UTC (rev 4276) @@ -24,6 +24,7 @@ ##### Breaking Changes ##### * see NH-1633 if you are using SQL native queries * CriteriaUtil is gone. NHibernate.Transform.Transformers now returns predefined IResultTransformer. + * Now filters are working even with many-to-one association for Criteria and HQL (NH-1293, NH-1179) Build 2.1.0.Alpha2 (rev4167) ======================== Modified: trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/src/NHibernate/Engine/JoinSequence.cs 2009-05-11 06:39:49 UTC (rev 4276) @@ -166,31 +166,33 @@ string on = join.AssociationType.GetOnCondition(join.Alias, factory, enabledFilters); string condition; if (last != null && - IsManyToManyRoot(last) && - ((IQueryableCollection) last).ElementType == join.AssociationType) + IsManyToManyRoot(last) && + ((IQueryableCollection)last).ElementType == join.AssociationType) { // the current join represents the join between a many-to-many association table // and its "target" table. Here we need to apply any additional filters // defined specifically on the many-to-many - string manyToManyFilter = ((IQueryableCollection) last) + string manyToManyFilter = ((IQueryableCollection)last) .GetManyToManyFilterFragment(join.Alias, enabledFilters); condition = "".Equals(manyToManyFilter) - ? on - : "".Equals(on) - ? manyToManyFilter - : on + " and " + manyToManyFilter; + ? on + : "".Equals(on) + ? manyToManyFilter + : on + " and " + manyToManyFilter; } else { - condition = on; + // NH Different behavior : NH1179 and NH1293 + // Apply filters in Many-To-One association + if (string.IsNullOrEmpty(on) && enabledFilters.Count > 0) + { + condition = join.Joinable.FilterFragment(join.Alias, enabledFilters); + } + else + { + condition = on; + } } - //Start NH1179 ************ - //if (string.IsNullOrEmpty(condition)) - //{ - // string filterCondition = join.Joinable.FilterFragment(join.Alias, enabledFilters); - // joinFragment.HasFilterCondition = joinFragment.AddCondition(filterCondition); - //} - //End NH1179 ************ if (withClauseFragment != null) { Modified: trunk/nhibernate/src/NHibernate/Loader/JoinWalker.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/JoinWalker.cs 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/src/NHibernate/Loader/JoinWalker.cs 2009-05-11 06:39:49 UTC (rev 4276) @@ -564,10 +564,20 @@ foreach (OuterJoinableAssociation oj in associations) { if (last != null && last.IsManyToManyWith(oj)) - oj.AddManyToManyJoin(outerjoin, (IQueryableCollection)last.Joinable); + { + oj.AddManyToManyJoin(outerjoin, (IQueryableCollection) last.Joinable); + } else + { oj.AddJoins(outerjoin); - + // NH Different behavior : NH1179 and NH1293 + // Apply filters in Many-To-One association + if (enabledFilters.Count > 0) + { + var manyToOneFilterFragment = oj.Joinable.FilterFragment(oj.RHSAlias, enabledFilters); + outerjoin.AddCondition(manyToOneFilterFragment); + } + } last = oj; } Modified: trunk/nhibernate/src/NHibernate/SqlCommand/ANSIJoinFragment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/ANSIJoinFragment.cs 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/src/NHibernate/SqlCommand/ANSIJoinFragment.cs 2009-05-11 06:39:49 UTC (rev 4276) @@ -9,7 +9,7 @@ public class ANSIJoinFragment : JoinFragment { private SqlStringBuilder buffer = new SqlStringBuilder(); - private SqlStringBuilder conditions = new SqlStringBuilder(); + private readonly SqlStringBuilder conditions = new SqlStringBuilder(); public override void AddJoin(string tableName, string alias, string[] fkColumns, string[] pkColumns, JoinType joinType) { @@ -86,12 +86,12 @@ public override bool AddCondition(string condition) { - throw new NotSupportedException(); + return AddCondition(conditions, condition); } public override bool AddCondition(SqlString condition) { - throw new NotSupportedException(); + return AddCondition(conditions, condition); } public override void AddFromFragmentString(SqlString fromFragmentString) Modified: trunk/nhibernate/src/NHibernate/SqlCommand/QueryJoinFragment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/QueryJoinFragment.cs 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/src/NHibernate/SqlCommand/QueryJoinFragment.cs 2009-05-11 06:39:49 UTC (rev 4276) @@ -85,9 +85,10 @@ public override bool AddCondition(string condition) { //TODO: this seems hackish + var trimCondition = condition.Trim(); if ( - afterFrom.ToSqlString().ToString().IndexOf(condition.Trim()) < 0 && - afterWhere.ToSqlString().ToString().IndexOf(condition.Trim()) < 0) + afterFrom.ToSqlString().ToString().IndexOf(trimCondition) < 0 && + afterWhere.ToSqlString().ToString().IndexOf(trimCondition) < 0) { if (!condition.StartsWith(" and ")) { @@ -104,9 +105,10 @@ public override bool AddCondition(SqlString condition) { //TODO: this seems hackish + var trimCondition = condition.Trim().ToString(); if ( - afterFrom.ToString().IndexOf(condition.Trim().ToString()) < 0 && - afterWhere.ToString().IndexOf(condition.Trim().ToString()) < 0) + afterFrom.ToString().IndexOf(trimCondition) < 0 && + afterWhere.ToString().IndexOf(trimCondition) < 0) { if (!condition.StartsWithCaseInsensitive(" and ")) { Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1179/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1179/Fixture.cs 2009-05-10 14:55:50 UTC (rev 4275) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1179/Fixture.cs 2009-05-11 06:39:49 UTC (rev 4276) @@ -11,11 +11,9 @@ get { return "NH1179"; } } - [Test, Ignore("Not supported.")] + [Test] public void ApplyFilterExplicitJoin() { - // Note: if we fix this we must fix it for Criteria too (NH-1293) - RelatedClass rc1 = new RelatedClass(1); RelatedClass rc2 = new RelatedClass(2); RelatedClass rc11 = new RelatedClass(1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-16 00:59:52
|
Revision: 4324 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4324&view=rev Author: fabiomaulo Date: 2009-05-16 00:59:51 +0000 (Sat, 16 May 2009) Log Message: ----------- - Actualization last NUnit + last Castle.DynProxy - some minor in related prj. Modified Paths: -------------- trunk/nhibernate/lib/net/2.0/Castle.Core.dll trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.dll trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml trunk/nhibernate/lib/net/2.0/nunit.core.dll trunk/nhibernate/lib/net/2.0/nunit.framework.dll trunk/nhibernate/lib/net/3.5/Castle.Core.dll trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.dll trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml trunk/nhibernate/lib/net/3.5/nunit.core.dll trunk/nhibernate/lib/net/3.5/nunit.framework.dll trunk/nhibernate/src/NHibernate.Everything.sln trunk/nhibernate/src/NHibernate.Example.Web/Web.Config trunk/nhibernate/src/NHibernate.Examples/App.config trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj trunk/nhibernate/src/NHibernate.Test.Performance/App.config trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj Modified: trunk/nhibernate/lib/net/2.0/Castle.Core.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml =================================================================== --- trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/lib/net/2.0/Castle.DynamicProxy2.xml 2009-05-16 00:59:51 UTC (rev 4324) @@ -294,32 +294,33 @@ </member> <member name="T:Castle.DynamicProxy.IProxyGenerationHook"> <summary> - Used during the target type inspection process. - Implementors have a chance to interfere in the - proxy generation process + Used during the target type inspection process. Implementors have a chance to customize the + proxy generation process. </summary> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.ShouldInterceptMethod(System.Type,System.Reflection.MethodInfo)"> <summary> - Invoked by the generation process to know if - the specified member should be proxied + Invoked by the generation process to determine if the specified method should be proxied. </summary> - <param name="type"></param> - <param name="memberInfo"></param> - <returns></returns> + <param name="type">The type which declares the given method.</param> + <param name="methodInfo">The method to inspect.</param> + <returns>True if the given method should be proxied; false otherwise.</returns> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.NonVirtualMemberNotification(System.Type,System.Reflection.MemberInfo)"> <summary> - Invoked by the generation process to notify that a - member wasn't marked as virtual. + Invoked by the generation process to notify that a member was not marked as virtual. </summary> - <param name="type"></param> - <param name="memberInfo"></param> + <param name="type">The type which declares the non-virtual member.</param> + <param name="memberInfo">The non-virtual member.</param> + <remarks> + Non-virtual members cannot be proxied. This method gives an opportunity to inspect + any non-virtual member of a type that has been requested to be proxied, and if + appropriate - throw an exception to notify the caller. + </remarks> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.MethodsInspected"> <summary> - Invoked by the generation process to notify - that the whole process is completed. + Invoked by the generation process to notify that the whole process has completed. </summary> </member> <member name="T:Castle.DynamicProxy.CacheMappingsAttribute"> @@ -440,6 +441,33 @@ </summary> <param name="scope">The module scope for generated proxy types.</param> </member> + <member name="T:Castle.DynamicProxy.IInterceptorSelector"> + <summary> + Provides an extension point that allows proxies to choose specific interceptors on + a per method basis. + </summary> + </member> + <member name="M:Castle.DynamicProxy.IInterceptorSelector.SelectInterceptors(System.Type,System.Reflection.MethodInfo,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Selects the interceptors that should intercept calls to the given <paramref name="method"/>. + </summary> + <param name="type">The type declaring the method to intercept.</param> + <param name="method">The method that will be intercepted.</param> + <param name="interceptors">All interceptors registered with the proxy.</param> + <returns>An array of interceptors to invoke upon calling the <paramref name="method"/>.</returns> + <remarks> + This method is called only once per proxy instance, upon the first call to the + <paramref name="method"/>. Either an empty array or null are valid return values to indicate + that no interceptor should intercept calls to the method. Although it is not advised, it is + legal to return other <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations than these provided in + <paramref name="interceptors"/>. A better way to do this, is by passing all the required + interceptors to the appropriate method of <see cref="T:Castle.DynamicProxy.ProxyGenerator"/>. You can use this + method to influence the order in which interceptors will be called, by reordering the array. + Returning an array containing null references (Nothing in Visual Basic) is not legal, + and will result in a runtime exception. + </remarks> + <seealso cref="T:Castle.DynamicProxy.ProxyGenerationOptions"/> + </member> <member name="M:Castle.DynamicProxy.InternalsHelper.IsInternalToDynamicProxy(System.Reflection.Assembly)"> <summary> Determines whether this assembly has internals visible to dynamic proxy. Modified: trunk/nhibernate/lib/net/2.0/nunit.core.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/2.0/nunit.framework.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/Castle.Core.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml =================================================================== --- trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/lib/net/3.5/Castle.DynamicProxy2.xml 2009-05-16 00:59:51 UTC (rev 4324) @@ -294,32 +294,33 @@ </member> <member name="T:Castle.DynamicProxy.IProxyGenerationHook"> <summary> - Used during the target type inspection process. - Implementors have a chance to interfere in the - proxy generation process + Used during the target type inspection process. Implementors have a chance to customize the + proxy generation process. </summary> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.ShouldInterceptMethod(System.Type,System.Reflection.MethodInfo)"> <summary> - Invoked by the generation process to know if - the specified member should be proxied + Invoked by the generation process to determine if the specified method should be proxied. </summary> - <param name="type"></param> - <param name="memberInfo"></param> - <returns></returns> + <param name="type">The type which declares the given method.</param> + <param name="methodInfo">The method to inspect.</param> + <returns>True if the given method should be proxied; false otherwise.</returns> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.NonVirtualMemberNotification(System.Type,System.Reflection.MemberInfo)"> <summary> - Invoked by the generation process to notify that a - member wasn't marked as virtual. + Invoked by the generation process to notify that a member was not marked as virtual. </summary> - <param name="type"></param> - <param name="memberInfo"></param> + <param name="type">The type which declares the non-virtual member.</param> + <param name="memberInfo">The non-virtual member.</param> + <remarks> + Non-virtual members cannot be proxied. This method gives an opportunity to inspect + any non-virtual member of a type that has been requested to be proxied, and if + appropriate - throw an exception to notify the caller. + </remarks> </member> <member name="M:Castle.DynamicProxy.IProxyGenerationHook.MethodsInspected"> <summary> - Invoked by the generation process to notify - that the whole process is completed. + Invoked by the generation process to notify that the whole process has completed. </summary> </member> <member name="T:Castle.DynamicProxy.CacheMappingsAttribute"> @@ -440,6 +441,33 @@ </summary> <param name="scope">The module scope for generated proxy types.</param> </member> + <member name="T:Castle.DynamicProxy.IInterceptorSelector"> + <summary> + Provides an extension point that allows proxies to choose specific interceptors on + a per method basis. + </summary> + </member> + <member name="M:Castle.DynamicProxy.IInterceptorSelector.SelectInterceptors(System.Type,System.Reflection.MethodInfo,Castle.Core.Interceptor.IInterceptor[])"> + <summary> + Selects the interceptors that should intercept calls to the given <paramref name="method"/>. + </summary> + <param name="type">The type declaring the method to intercept.</param> + <param name="method">The method that will be intercepted.</param> + <param name="interceptors">All interceptors registered with the proxy.</param> + <returns>An array of interceptors to invoke upon calling the <paramref name="method"/>.</returns> + <remarks> + This method is called only once per proxy instance, upon the first call to the + <paramref name="method"/>. Either an empty array or null are valid return values to indicate + that no interceptor should intercept calls to the method. Although it is not advised, it is + legal to return other <see cref="T:Castle.Core.Interceptor.IInterceptor"/> implementations than these provided in + <paramref name="interceptors"/>. A better way to do this, is by passing all the required + interceptors to the appropriate method of <see cref="T:Castle.DynamicProxy.ProxyGenerator"/>. You can use this + method to influence the order in which interceptors will be called, by reordering the array. + Returning an array containing null references (Nothing in Visual Basic) is not legal, + and will result in a runtime exception. + </remarks> + <seealso cref="T:Castle.DynamicProxy.ProxyGenerationOptions"/> + </member> <member name="M:Castle.DynamicProxy.InternalsHelper.IsInternalToDynamicProxy(System.Reflection.Assembly)"> <summary> Determines whether this assembly has internals visible to dynamic proxy. Modified: trunk/nhibernate/lib/net/3.5/nunit.core.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/nunit.framework.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2009-05-16 00:59:51 UTC (rev 4324) @@ -78,7 +78,7 @@ Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "NHibernate.Example.Web", "NHibernate.Example.Web\", "{C5D6EE68-1760-4F97-AD31-42343593D8C1}" ProjectSection(WebsiteProperties) = preProject TargetFramework = "2.0" - ProjectReferences = "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}|NHibernate.dll;" + ProjectReferences = "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}|NHibernate.dll;{8289D6AD-9714-42D3-A94D-D4D9814D1281}|NHibernate.ByteCode.LinFu.dll;" Debug.AspNetCompiler.VirtualPath = "/NHibernate.Example.Web" Debug.AspNetCompiler.PhysicalPath = "NHibernate.Example.Web\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\NHibernate.Example.Web\" Modified: trunk/nhibernate/src/NHibernate.Example.Web/Web.Config =================================================================== --- trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Example.Web/Web.Config 2009-05-16 00:59:51 UTC (rev 4324) @@ -59,7 +59,8 @@ <property name="connection.connection_string"> Server=(local);initial catalog=nhibernate;Integrated Security=true </property> - <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="current_session_context_class">managed_web</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> Modified: trunk/nhibernate/src/NHibernate.Examples/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/App.config 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Examples/App.config 2009-05-16 00:59:51 UTC (rev 4324) @@ -16,7 +16,10 @@ Server=(local);initial catalog=nhibernate;Integrated Security=SSPI </property> <property name="show_sql">true</property> - <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> + <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-16 00:59:51 UTC (rev 4324) @@ -167,6 +167,10 @@ <EmbeddedResource Include="QuickStart\User.hbm.xml" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\NHibernate.ByteCode.LinFu\NHibernate.ByteCode.LinFu.csproj"> + <Project>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</Project> + <Name>NHibernate.ByteCode.LinFu</Name> + </ProjectReference> <ProjectReference Include="..\NHibernate\NHibernate.csproj"> <Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project> <Name>NHibernate</Name> Modified: trunk/nhibernate/src/NHibernate.Test.Performance/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Test.Performance/App.config 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Test.Performance/App.config 2009-05-16 00:59:51 UTC (rev 4324) @@ -33,11 +33,12 @@ <property name="connection.connection_string"> Server=(local);initial catalog=nhibernate;Integrated Security=SSPI </property> - <property name="show_sql">false</property> - <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> + <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <property name="use_outer_join">true</property> <property name="command_timeout">444</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> + + <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj 2009-05-15 22:59:12 UTC (rev 4323) +++ trunk/nhibernate/src/NHibernate.Test.Performance/NHibernate.Test.Performance.csproj 2009-05-16 00:59:51 UTC (rev 4324) @@ -66,6 +66,10 @@ <None Include="NHibernate.Test.Performance.nunit" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\NHibernate.ByteCode.LinFu\NHibernate.ByteCode.LinFu.csproj"> + <Project>{8289D6AD-9714-42D3-A94D-D4D9814D1281}</Project> + <Name>NHibernate.ByteCode.LinFu</Name> + </ProjectReference> <ProjectReference Include="..\NHibernate.DomainModel\NHibernate.DomainModel.csproj"> <Project>{5C649B55-1B3F-4C38-9998-1B043E94A244}</Project> <Name>NHibernate.DomainModel</Name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-16 16:07:18
|
Revision: 4330 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4330&view=rev Author: fabiomaulo Date: 2009-05-16 16:07:09 +0000 (Sat, 16 May 2009) Log Message: ----------- Removed the two stone wheels of our Ferrari. Modified Paths: -------------- trunk/nhibernate/default.build trunk/nhibernate/src/NHibernate.Everything.sln Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Examples/ trunk/nhibernate/src/NHibernate.Test.Performance/ Modified: trunk/nhibernate/default.build =================================================================== --- trunk/nhibernate/default.build 2009-05-16 11:31:17 UTC (rev 4329) +++ trunk/nhibernate/default.build 2009-05-16 16:07:09 UTC (rev 4330) @@ -12,9 +12,6 @@ <!-- Pass -D:skip.tests=true to NAnt to skip running tests when building --> <property name="skip.tests" value="false" overwrite="false" /> - <!-- Disable performance tests by default. They take too much time. --> - <property name="run.performance.tests" value="false" overwrite="false" /> - <!-- Supported versions of .NET Framework, separated by spaces. Used by *-all-frameworks targets. @@ -34,8 +31,6 @@ <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.DomainModel/NHibernate.DomainModel.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> - <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" /> - <include name="NHibernate.Examples/NHibernate.Examples.build" /> <include name="NHibernate.Tool.HbmXsd/NHibernate.Tool.HbmXsd.build" /> </fileset> @@ -45,8 +40,6 @@ <include name="NHibernate.ByteCode.Castle.Tests/ByteCode.Test.build" /> <include name="NHibernate.ByteCode.Spring.Tests/ByteCode.Test.build" /> <include name="NHibernate.Test/NHibernate.Test.build" /> - <include name="NHibernate.Test.Performance/NHibernate.Test.Performance.build" - if="${run.performance.tests}" /> </fileset> <target name="init" depends="common.init" Modified: trunk/nhibernate/src/NHibernate.Everything.sln =================================================================== --- trunk/nhibernate/src/NHibernate.Everything.sln 2009-05-16 11:31:17 UTC (rev 4329) +++ trunk/nhibernate/src/NHibernate.Everything.sln 2009-05-16 16:07:09 UTC (rev 4330) @@ -67,10 +67,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Test", "NHibernate.Test\NHibernate.Test.csproj", "{7AEE5B37-C552-4E59-9B6F-88755BCB5070}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Test.Performance", "NHibernate.Test.Performance\NHibernate.Test.Performance.csproj", "{13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Examples", "NHibernate.Examples\NHibernate.Examples.csproj", "{E3482030-5828-4112-9906-D4C5153DCE3F}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections", "Iesi.Collections\Iesi.Collections.csproj", "{4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iesi.Collections.Test", "Iesi.Collections.Test\Iesi.Collections.Test.csproj", "{58CE4584-31B9-4E74-A7FB-5D40BFAD0876}" @@ -153,26 +149,6 @@ {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.Build.0 = Release|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Debug|.NET.ActiveCfg = Debug|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Release|.NET.ActiveCfg = Release|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Release|Any CPU.Build.0 = Release|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Debug|.NET.ActiveCfg = Debug|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Release|.NET.ActiveCfg = Release|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Release|Any CPU.Build.0 = Release|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E3482030-5828-4112-9906-D4C5153DCE3F}.Release|Mixed Platforms.Build.0 = Release|Any CPU {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|.NET.ActiveCfg = Debug|Any CPU {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -289,8 +265,6 @@ {5909BFE7-93CF-4E5F-BE22-6293368AF01D} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} {5C649B55-1B3F-4C38-9998-1B043E94A244} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} {7AEE5B37-C552-4E59-9B6F-88755BCB5070} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} - {13CE8E1E-E87B-4DE1-B091-0C3AA05FFA3E} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} - {E3482030-5828-4112-9906-D4C5153DCE3F} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD} {446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4} {4C251E3E-6EA1-4A51-BBCB-F9C42AE55344} = {C91E7018-3C67-4830-963A-C388C75E1BD5} {58CE4584-31B9-4E74-A7FB-5D40BFAD0876} = {C91E7018-3C67-4830-963A-C388C75E1BD5} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-18 21:56:57
|
Revision: 4342 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4342&view=rev Author: fabiomaulo Date: 2009-05-18 21:56:51 +0000 (Mon, 18 May 2009) Log Message: ----------- Removed obsolete ORACLE dialects. Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/GeneratedTest/PartiallyGeneratedComponentTest.cs trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithCachingTest.cs trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithoutCachingTest.cs trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/SQLFunctionsTest.cs trunk/nhibernate/src/NHibernate.Test/Legacy/SQLLoaderTest.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/BinaryTypeFixture.cs trunk/nhibernate/src/NHibernate.Test/TypesTest/DoubleTypeFixture.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs trunk/nhibernate/src/NHibernate/Dialect/OracleDialect.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/releasenotes.txt 2009-05-18 21:56:51 UTC (rev 4342) @@ -11,11 +11,12 @@ * the syntax foo.bar.baz.elements or foo.bar.baz.indices is not longer supported. Use the alternative syntax of elements(foo.bar.baz) or indices(foo.bar.baz) instead Note: in some case, where a sub-select is needed, the collection is enough example: FROM m IN CLASS Master WHERE NOT EXISTS( FROM m.Details d WHERE NOT d.I=5 ) - ##### Possible Breaking Changes for external frameworks ##### + ##### Possible Breaking Changes ##### * ISession interface has additional methods * IStatelessSession interface has additional methods * DefaultProxyFactoryFactory removed * IProxyFactoryFactory now provide the IProxyValidator implementation + * Now filters are working even with many-to-one association for Criteria and HQL (NH-1293, NH-1179) ##### Initialization time ##### * The ProxyValidator check for "internal virtual" (to be intercepted by proxy need "protected internal virtual") @@ -24,8 +25,8 @@ ##### Breaking Changes ##### * see NH-1633 if you are using SQL native queries * CriteriaUtil is gone. NHibernate.Transform.Transformers now returns predefined IResultTransformer. - * Now filters are working even with many-to-one association for Criteria and HQL (NH-1293, NH-1179) * ISessionFactory.Settings is gone (moved to ISessionFactoryImplementor.Settings) + * Obsolete ORACLE dialects was removed (new implementations are available) Build 2.1.0.Alpha2 (rev4167) ======================== Deleted: trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -1,270 +0,0 @@ -using System; -using System.Collections; -using System.Data; -using NHibernate.Dialect.Function; -using NHibernate.Dialect.Schema; -using NHibernate.Engine; -using NHibernate.SqlCommand; -using Environment=NHibernate.Cfg.Environment; -using System.Data.Common; - -namespace NHibernate.Dialect -{ - /// <summary> - /// It's a immature version, it just work. - /// An SQL dialect for Oracle 9 - /// </summary> - /// <remarks> - /// The Oracle9Dialect defaults the following configuration properties: - /// <list type="table"> - /// <listheader> - /// <term>Property</term> - /// <description>Default Value</description> - /// </listheader> - /// <item> - /// <term>use_outer_join</term> - /// <description><see langword="true" /></description> - /// </item> - /// <item> - /// <term>connection.driver_class</term> - /// <description><see cref="NHibernate.Driver.OracleClientDriver" /></description> - /// </item> - /// </list> - /// </remarks> - [Obsolete("This dialect will be removed in the next NHibernate version; Use Oracle9iDialect")] - public class Oracle9Dialect : Dialect - { - /// <summary></summary> - public Oracle9Dialect() - { - DefaultProperties[Environment.PrepareSql] = "false"; - DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.OracleClientDriver"; - - RegisterColumnType(DbType.AnsiStringFixedLength, "CHAR(255)"); - RegisterColumnType(DbType.AnsiStringFixedLength, 2000, "CHAR($l)"); - RegisterColumnType(DbType.AnsiString, "VARCHAR2(255)"); - RegisterColumnType(DbType.AnsiString, 2000, "VARCHAR2($l)"); - RegisterColumnType(DbType.AnsiString, 2147483647, "CLOB"); // should use the IType.ClobType - RegisterColumnType(DbType.Binary, "RAW(2000)"); - RegisterColumnType(DbType.Binary, 2000, "RAW($l)"); - RegisterColumnType(DbType.Binary, 2147483647, "BLOB"); - RegisterColumnType(DbType.Boolean, "NUMBER(1,0)"); - RegisterColumnType(DbType.Byte, "NUMBER(3,0)"); - RegisterColumnType(DbType.Currency, "NUMBER(19,1)"); - RegisterColumnType(DbType.Date, "DATE"); - RegisterColumnType(DbType.DateTime, "TIMESTAMP(4)"); - RegisterColumnType(DbType.Decimal, "NUMBER(19,5)"); - RegisterColumnType(DbType.Decimal, 19, "NUMBER(19, $l)"); - // having problems with both ODP and OracleClient from MS not being able - // to read values out of a field that is DOUBLE PRECISION - RegisterColumnType(DbType.Double, "DOUBLE PRECISION"); //"FLOAT(53)" ); - //RegisterColumnType(DbType.Guid, "CHAR(38)"); - RegisterColumnType(DbType.Int16, "NUMBER(5,0)"); - RegisterColumnType(DbType.Int32, "NUMBER(10,0)"); - RegisterColumnType(DbType.Int64, "NUMBER(20,0)"); - RegisterColumnType(DbType.UInt16, "NUMBER(5,0)"); - RegisterColumnType(DbType.UInt32, "NUMBER(10,0)"); - RegisterColumnType(DbType.UInt64, "NUMBER(20,0)"); - RegisterColumnType(DbType.Single, "FLOAT(24)"); - RegisterColumnType(DbType.StringFixedLength, "NCHAR(255)"); - RegisterColumnType(DbType.StringFixedLength, 2000, "NCHAR($l)"); - RegisterColumnType(DbType.String, "NVARCHAR2(255)"); - RegisterColumnType(DbType.String, 2000, "NVARCHAR2($l)"); - RegisterColumnType(DbType.String, 1073741823, "NCLOB"); - RegisterColumnType(DbType.Time, "DATE"); - - RegisterFunction("abs", new StandardSQLFunction("abs")); - RegisterFunction("sign", new StandardSQLFunction("sign", NHibernateUtil.Int32)); - - RegisterFunction("acos", new StandardSQLFunction("acos", NHibernateUtil.Double)); - RegisterFunction("asin", new StandardSQLFunction("asin", NHibernateUtil.Double)); - RegisterFunction("atan", new StandardSQLFunction("atan", NHibernateUtil.Double)); - RegisterFunction("cos", new StandardSQLFunction("cos", NHibernateUtil.Double)); - RegisterFunction("cosh", new StandardSQLFunction("cosh", NHibernateUtil.Double)); - RegisterFunction("exp", new StandardSQLFunction("exp", NHibernateUtil.Double)); - RegisterFunction("ln", new StandardSQLFunction("ln", NHibernateUtil.Double)); - RegisterFunction("sin", new StandardSQLFunction("sin", NHibernateUtil.Double)); - RegisterFunction("sinh", new StandardSQLFunction("sinh", NHibernateUtil.Double)); - RegisterFunction("stddev", new StandardSQLFunction("stddev", NHibernateUtil.Double)); - RegisterFunction("sqrt", new StandardSQLFunction("sqrt", NHibernateUtil.Double)); - RegisterFunction("tan", new StandardSQLFunction("tan", NHibernateUtil.Double)); - RegisterFunction("tanh", new StandardSQLFunction("tanh", NHibernateUtil.Double)); - RegisterFunction("variance", new StandardSQLFunction("variance", NHibernateUtil.Double)); - - RegisterFunction("round", new StandardSQLFunction("round")); - RegisterFunction("trunc", new StandardSQLFunction("trunc")); - RegisterFunction("ceil", new StandardSQLFunction("ceil")); - RegisterFunction("floor", new StandardSQLFunction("floor")); - - RegisterFunction("chr", new StandardSQLFunction("chr", NHibernateUtil.Character)); - RegisterFunction("initcap", new StandardSQLFunction("initcap")); - RegisterFunction("lower", new StandardSQLFunction("lower")); - RegisterFunction("ltrim", new StandardSQLFunction("ltrim")); - RegisterFunction("rtrim", new StandardSQLFunction("rtrim")); - RegisterFunction("soundex", new StandardSQLFunction("soundex")); - RegisterFunction("upper", new StandardSQLFunction("upper")); - RegisterFunction("ascii", new StandardSQLFunction("ascii", NHibernateUtil.Int32)); - RegisterFunction("length", new StandardSQLFunction("length", NHibernateUtil.Int64)); - RegisterFunction("left", new SQLFunctionTemplate(NHibernateUtil.String, "substr(?1, 1, ?2)")); - RegisterFunction("right", new SQLFunctionTemplate(NHibernateUtil.String, "substr(?1, -?2)")); - - RegisterFunction("to_char", new StandardSQLFunction("to_char", NHibernateUtil.String)); - RegisterFunction("to_date", new StandardSQLFunction("to_date", NHibernateUtil.Timestamp)); - - RegisterFunction("lastday", new StandardSQLFunction("lastday", NHibernateUtil.Date)); - RegisterFunction("sysdate", new NoArgSQLFunction("sysdate", NHibernateUtil.Date, false)); - RegisterFunction("uid", new NoArgSQLFunction("uid", NHibernateUtil.Int32, false)); - RegisterFunction("user", new NoArgSQLFunction("user", NHibernateUtil.String, false)); - RegisterFunction("current_timestamp", new CurrentTimeStamp()); - - RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar2(2000))")); - - // Multi-param string dialect functions... - RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(", "||", ")")); - RegisterFunction("instr", new StandardSQLFunction("instr", NHibernateUtil.String)); - RegisterFunction("instrb", new StandardSQLFunction("instrb", NHibernateUtil.String)); - RegisterFunction("lpad", new StandardSQLFunction("lpad", NHibernateUtil.String)); - RegisterFunction("replace", new StandardSQLFunction("replace", NHibernateUtil.String)); - RegisterFunction("rpad", new StandardSQLFunction("rpad", NHibernateUtil.String)); - RegisterFunction("substr", new StandardSQLFunction("substr", NHibernateUtil.String)); - RegisterFunction("substring", new StandardSQLFunction("substr", NHibernateUtil.String)); - RegisterFunction("substrb", new StandardSQLFunction("substrb", NHibernateUtil.String)); - RegisterFunction("translate", new StandardSQLFunction("translate", NHibernateUtil.String)); - - // Multi-param numeric dialect functions... - RegisterFunction("atan2", new StandardSQLFunction("atan2", NHibernateUtil.Single)); - RegisterFunction("log", new StandardSQLFunction("log", NHibernateUtil.Int32)); - RegisterFunction("mod", new StandardSQLFunction("mod", NHibernateUtil.Int32)); - RegisterFunction("nvl", new StandardSQLFunction("nvl")); - RegisterFunction("power", new StandardSQLFunction("power", NHibernateUtil.Single)); - - // Multi-param date dialect functions... - RegisterFunction("add_months", new StandardSQLFunction("add_months", NHibernateUtil.Date)); - RegisterFunction("months_between", new StandardSQLFunction("months_between", NHibernateUtil.Single)); - RegisterFunction("next_day", new StandardSQLFunction("next_day", NHibernateUtil.Date)); - } - - /// <summary></summary> - public override string AddColumnString - { - get { return "add"; } - } - - /// <summary></summary> - public override string GetSequenceNextValString(string sequenceName) - { - return "select " + sequenceName + ".nextval from dual"; - } - - /// <summary></summary> - public override string GetCreateSequenceString(string sequenceName) - { - return - "create sequence " + sequenceName + - " INCREMENT BY 1 START WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE CACHE 20 NOORDER"; - } - - /// <summary></summary> - public override string GetDropSequenceString(string sequenceName) - { - return "drop sequence " + sequenceName; - } - - /// <summary></summary> - public override string CascadeConstraintsString - { - get { return " cascade constraints"; } - } - - public override string ForUpdateNowaitString - { - get { return " for update nowait"; } - } - - /// <summary></summary> - public override bool SupportsSequences - { - get { return true; } - } - - /// <summary></summary> - public override bool SupportsLimit - { - get { return true; } - } - - public override bool SupportsVariableLimit - { - get { return false; } - } - - - public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) - { - SqlStringBuilder pagingBuilder = new SqlStringBuilder(); - var hasOffset = offset > 0; - - pagingBuilder.Add("SELECT * FROM ("); - pagingBuilder.Add(querySqlString); - if (hasOffset) - { - pagingBuilder.Add(") WHERE rownum BETWEEN "); - pagingBuilder.Add(offset.ToString()); - pagingBuilder.Add(" AND "); - pagingBuilder.Add((limit + offset).ToString()); - } - else - { - pagingBuilder.Add(") WHERE rownum <= "); - pagingBuilder.Add(limit.ToString()); - } - - return pagingBuilder.ToSqlString(); - } - - /// <summary></summary> - public override bool BindLimitParametersInReverseOrder - { - get { return true; } - } - - /// <summary></summary> - public override bool UseMaxForLimit - { - get { return true; } - } - - public override bool ForUpdateOfColumns - { - get { return true; } - } - - public override string GetForUpdateString(string aliases) - { - return ForUpdateString + " of " + aliases; - } - - public override string GetForUpdateNowaitString(string aliases) - { - return ForUpdateString + " of " + aliases + " nowait"; - } - - public override IDataBaseSchema GetDataBaseSchema(DbConnection connection) - { - return new OracleDataBaseSchema(connection); - } - - [Serializable] - private class CurrentTimeStamp : NoArgSQLFunction - { - public CurrentTimeStamp() - : base("current_timestamp", NHibernateUtil.DateTime, true) - { } - - public override SqlString Render(IList args, ISessionFactoryImplementor factory) - { - return new SqlString(Name); - } - } - } -} Deleted: trunk/nhibernate/src/NHibernate/Dialect/OracleDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/OracleDialect.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate/Dialect/OracleDialect.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -1,30 +0,0 @@ -using System; -using System.Data; -using NHibernate.SqlCommand; - -namespace NHibernate.Dialect -{ - /// <summary> - /// An SQL dialect for Oracle, compatible with Oracle 8. - /// </summary> - [Obsolete("This dialect will be removed in the next NHibernate version; Use Oracle8iDialect")] - public class OracleDialect : Oracle9Dialect - { - public OracleDialect() - { - RegisterColumnType(DbType.DateTime, "DATE"); - } - - /// <summary></summary> - public override JoinFragment CreateOuterJoinFragment() - { - return new OracleJoinFragment(); - } - - /// <summary></summary> - public override CaseFragment CreateCaseFragment() - { - return new DecodeCaseFragment(this); - } - } -} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -25,7 +25,7 @@ /// </item> /// </list> /// </remarks> - public class OracleLiteDialect : Oracle9Dialect + public class OracleLiteDialect : Oracle9iDialect { /// <summary></summary> public OracleLiteDialect() Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-18 21:56:51 UTC (rev 4342) @@ -111,8 +111,6 @@ <Compile Include="Dialect\MsSql2000Dialect.cs" /> <Compile Include="Dialect\MsSql7Dialect.cs" /> <Compile Include="Dialect\MySQLDialect.cs" /> - <Compile Include="Dialect\Oracle9Dialect.cs" /> - <Compile Include="Dialect\OracleDialect.cs" /> <Compile Include="Dialect\PostgreSQLDialect.cs" /> <Compile Include="Dialect\SQLiteDialect.cs" /> <Compile Include="Dialect\SybaseDialect.cs" /> Modified: trunk/nhibernate/src/NHibernate.Test/GeneratedTest/PartiallyGeneratedComponentTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GeneratedTest/PartiallyGeneratedComponentTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/GeneratedTest/PartiallyGeneratedComponentTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -21,8 +21,7 @@ protected override bool AppliesTo(Dialect.Dialect dialect) { - return dialect is MsSql2000Dialect || dialect is FirebirdDialect || dialect is Oracle9Dialect - || dialect is Oracle8iDialect; + return dialect is MsSql2000Dialect || dialect is FirebirdDialect || dialect is Oracle8iDialect; } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithCachingTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithCachingTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithCachingTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -17,7 +17,7 @@ protected override bool AppliesTo(Dialect.Dialect dialect) { - return dialect is MsSql2000Dialect || dialect is Oracle9Dialect || dialect is Oracle8iDialect; + return dialect is MsSql2000Dialect || dialect is Oracle8iDialect; } } } Modified: trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithoutCachingTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithoutCachingTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/GeneratedTest/TriggerGeneratedValuesWithoutCachingTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -17,7 +17,7 @@ protected override bool AppliesTo(Dialect.Dialect dialect) { - return dialect is MsSql2000Dialect || dialect is Oracle9Dialect || dialect is Oracle8iDialect; + return dialect is MsSql2000Dialect || dialect is Oracle8iDialect; } protected override string CacheConcurrencyStrategy Modified: trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/HQL/HQLFunctions.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -20,11 +20,11 @@ notSupportedStandardFunction.Add("locate", new[] { typeof(MsSql2000Dialect), typeof(MsSql2005Dialect), typeof(MsSql2008Dialect) ,typeof(FirebirdDialect), typeof(PostgreSQLDialect) }); notSupportedStandardFunction.Add("bit_length", - new[] { typeof(MsSql2000Dialect), typeof(MsSql2005Dialect), typeof(MsSql2008Dialect), typeof(Oracle9Dialect), typeof(OracleDialect), typeof(Oracle8iDialect), typeof(Oracle9iDialect), typeof(Oracle10gDialect) }); + new[] { typeof(MsSql2000Dialect), typeof(MsSql2005Dialect), typeof(MsSql2008Dialect), typeof(Oracle8iDialect), typeof(Oracle9iDialect), typeof(Oracle10gDialect) }); notSupportedStandardFunction.Add("extract", new[] { typeof(MsSql2000Dialect), typeof(MsSql2005Dialect), typeof(MsSql2008Dialect) }); notSupportedStandardFunction.Add("nullif", - new[] { typeof(OracleDialect), typeof(Oracle8iDialect)}); + new[] { typeof(Oracle8iDialect)}); } private bool IsOracleDialect() Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -2518,7 +2518,7 @@ // TODO: figure out why this is throwing an ORA-1722 error // probably the conversion ProxyArray.id (to_number ensuring a not null value) - if (!(Dialect is Oracle9Dialect) && !(Dialect is Oracle8iDialect)) + if (!(Dialect is Oracle8iDialect)) { s.CreateQuery( "select count(*) from Bar as bar join bar.Component.Glarch.ProxyArray as g where cast(g.id as Int32) in indices(bar.Baz.FooArray)"). Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/SQLFunctionsTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/SQLFunctionsTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/SQLFunctionsTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -59,7 +59,7 @@ Assert.AreEqual(1, s.CreateQuery("select count(*) from s in class Simple").List().Count); - if (Dialect is Oracle9Dialect) + if (Dialect is Oracle8iDialect) { // Check Oracle Dialect mix of dialect functions - no args (no parenthesis and single arg functions IList rset = s.CreateQuery("select s.Name, sysdate, trunc(s.Pay), round(s.Pay) from s in class Simple").List(); @@ -129,8 +129,8 @@ [Test] public void Broken() { - if (Dialect is Oracle9Dialect) - return; + if (Dialect is Oracle8iDialect) + Assert.Ignore("Does not apply to " + typeof(Oracle8iDialect).FullName); ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/SQLLoaderTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/SQLLoaderTest.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/SQLLoaderTest.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -34,7 +34,7 @@ [Test] public void TS() { - if (Dialect is Oracle9Dialect) + if (Dialect is Oracle8iDialect) { return; } @@ -57,7 +57,7 @@ [Test] public void TSNamed() { - if (Dialect is Oracle9Dialect) + if (Dialect is Oracle8iDialect) { return; } Modified: trunk/nhibernate/src/NHibernate.Test/TypesTest/BinaryTypeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypesTest/BinaryTypeFixture.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/TypesTest/BinaryTypeFixture.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -77,7 +77,7 @@ [Test] public void InsertZeroLength() { - if (Dialect is Oracle9Dialect || Dialect is Oracle8iDialect) + if (Dialect is Oracle8iDialect) { Assert.Ignore("Certain drivers (ie - Oralce) don't handle writing and reading byte[0]"); } Modified: trunk/nhibernate/src/NHibernate.Test/TypesTest/DoubleTypeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TypesTest/DoubleTypeFixture.cs 2009-05-18 21:32:58 UTC (rev 4341) +++ trunk/nhibernate/src/NHibernate.Test/TypesTest/DoubleTypeFixture.cs 2009-05-18 21:56:51 UTC (rev 4342) @@ -21,7 +21,7 @@ protected override void OnSetUp() { base.OnSetUp(); - if (Dialect is Oracle9Dialect || Dialect is Oracle8iDialect) + if (Dialect is Oracle8iDialect) { _values[0] = 1.5e20; _values[1] = 1.2e-20; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-24 05:24:08
|
Revision: 4372 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4372&view=rev Author: fabiomaulo Date: 2009-05-24 05:24:03 +0000 (Sun, 24 May 2009) Log Message: ----------- Improved ISQLExceptionConverter for future extensions Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/ADOException.cs trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs trunk/nhibernate/src/NHibernate/Exceptions/ADOConnectionException.cs trunk/nhibernate/src/NHibernate/Exceptions/ADOExceptionHelper.cs trunk/nhibernate/src/NHibernate/Exceptions/ConstraintViolationException.cs trunk/nhibernate/src/NHibernate/Exceptions/DataException.cs trunk/nhibernate/src/NHibernate/Exceptions/GenericADOException.cs trunk/nhibernate/src/NHibernate/Exceptions/ISQLExceptionConverter.cs trunk/nhibernate/src/NHibernate/Exceptions/LockAcquisitionException.cs trunk/nhibernate/src/NHibernate/Exceptions/SQLExceptionConverterFactory.cs trunk/nhibernate/src/NHibernate/Exceptions/SQLGrammarException.cs trunk/nhibernate/src/NHibernate/Exceptions/SQLStateConverter.cs trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/MSSQLExceptionConverterExample.cs trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/OracleClientExceptionConverterExample.cs trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/PostgresExceptionConverterExample.cs trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/SQLExceptionConversionTest.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/releasenotes.txt 2009-05-24 05:24:03 UTC (rev 4372) @@ -29,6 +29,8 @@ * CriteriaUtil is gone. NHibernate.Transform.Transformers now returns predefined IResultTransformer. * ISessionFactory.Settings is gone (moved to ISessionFactoryImplementor.Settings) * 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 Build 2.1.0.Alpha2 (rev4167) ======================== Modified: trunk/nhibernate/src/NHibernate/ADOException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ADOException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/ADOException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,7 +1,6 @@ using System; using System.Runtime.Serialization; using System.Security.Permissions; -using NHibernate.SqlCommand; namespace NHibernate { @@ -16,7 +15,7 @@ [Serializable] public class ADOException : HibernateException { - private readonly SqlString sql; + private readonly string sql; /// <summary> /// Initializes a new instance of the <see cref="ADOException"/> class. @@ -31,7 +30,7 @@ { } - public ADOException(string message, Exception innerException, SqlString sql) + public ADOException(string message, Exception innerException, string sql) : base(message + "[SQL: " + sql + "]", innerException) { this.sql = sql; @@ -49,7 +48,7 @@ /// </param> protected ADOException(SerializationInfo info, StreamingContext context) : base(info, context) { - this.sql = (SqlString) info.GetValue("sql", typeof(SqlString)); + this.sql = (string) info.GetValue("sql", typeof(string)); } [SecurityPermission(SecurityAction.LinkDemand, @@ -60,7 +59,7 @@ info.AddValue("sql", sql); } - public SqlString SqlString + public string SqlString { get { return sql; } } Modified: trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -501,7 +501,7 @@ get { return commandsToClose.Count > 0 || readersToClose.Count > 0; } } - protected ADOException Convert(Exception sqlException, string message) + protected Exception Convert(Exception sqlException, string message) { return ADOExceptionHelper.Convert(Factory.SQLExceptionConverter, sqlException, message); } Modified: trunk/nhibernate/src/NHibernate/Exceptions/ADOConnectionException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/ADOConnectionException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/ADOConnectionException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,6 +1,5 @@ using System; using System.Runtime.Serialization; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -12,7 +11,7 @@ public class ADOConnectionException : ADOException { public ADOConnectionException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public ADOConnectionException(string message, Exception innerException, SqlString sql) : base(message, innerException, sql) {} + public ADOConnectionException(string message, Exception innerException, string sql) : base(message, innerException, sql) {} public ADOConnectionException(string message, Exception innerException) : base(message, innerException) {} } } Modified: trunk/nhibernate/src/NHibernate/Exceptions/ADOExceptionHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/ADOExceptionHelper.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/ADOExceptionHelper.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -21,12 +21,13 @@ /// <param name="message">An optional error message.</param> /// <param name="sql">The SQL executed.</param> /// <returns> The converted <see cref="ADOException"/>.</returns> - public static ADOException Convert(ISQLExceptionConverter converter, Exception sqlException, string message, + public static Exception Convert(ISQLExceptionConverter converter, Exception sqlException, string message, SqlString sql) { sql = TryGetActualSqlQuery(sqlException, sql); ADOExceptionReporter.LogExceptions(sqlException, ExtendMessage(message, sql, null, null)); - return converter.Convert(sqlException, message, sql); + return + converter.Convert(new AdoExceptionContextInfo {SqlException = sqlException, Message = message, Sql = sql.ToString()}); } /// <summary> @@ -37,7 +38,7 @@ /// <param name="sqlException">The exception to convert.</param> /// <param name="message">An optional error message.</param> /// <returns> The converted <see cref="ADOException"/>.</returns> - public static ADOException Convert(ISQLExceptionConverter converter, Exception sqlException, string message) + public static Exception Convert(ISQLExceptionConverter converter, Exception sqlException, string message) { var sql = new SqlString(SQLNotAvailable); sql = TryGetActualSqlQuery(sqlException, sql); @@ -50,7 +51,7 @@ sql = TryGetActualSqlQuery(sqle, sql); string extendMessage = ExtendMessage(message, sql, parameterValues, namedParameters); ADOExceptionReporter.LogExceptions(sqle, extendMessage); - return new ADOException(extendMessage, sqle, sql); + return new ADOException(extendMessage, sqle, sql.ToString()); } /// <summary> For the given <see cref="Exception"/>, locates the <see cref="System.Data.Common.DbException"/>. </summary> Modified: trunk/nhibernate/src/NHibernate/Exceptions/ConstraintViolationException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/ConstraintViolationException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/ConstraintViolationException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,6 +1,5 @@ using System; using System.Runtime.Serialization; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -15,7 +14,7 @@ public ConstraintViolationException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public ConstraintViolationException(string message, Exception innerException, SqlString sql, string constraintName) + public ConstraintViolationException(string message, Exception innerException, string sql, string constraintName) : base(message, innerException, sql) { this.constraintName = constraintName; Modified: trunk/nhibernate/src/NHibernate/Exceptions/DataException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/DataException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/DataException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,6 +1,5 @@ using System; using System.Runtime.Serialization; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -13,7 +12,7 @@ public class DataException : ADOException { public DataException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public DataException(string message, Exception innerException, SqlString sql) : base(message, innerException, sql) {} + public DataException(string message, Exception innerException, string sql) : base(message, innerException, sql) {} public DataException(string message, Exception innerException) : base(message, innerException) {} } } Modified: trunk/nhibernate/src/NHibernate/Exceptions/GenericADOException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/GenericADOException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/GenericADOException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -8,7 +8,7 @@ public class GenericADOException : ADOException { public GenericADOException(SerializationInfo info, StreamingContext context) : base(info, context) { } - public GenericADOException(string message, Exception innerException, SqlString sql) : base(message, innerException, sql) { } + public GenericADOException(string message, Exception innerException, string sql) : base(message, innerException, sql) { } public GenericADOException(string message, Exception innerException) : base(message, innerException) { } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Exceptions/ISQLExceptionConverter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/ISQLExceptionConverter.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/ISQLExceptionConverter.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,8 +1,32 @@ using System; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { + /// <summary> + /// Collect data of an <see cref="ADOException"/> to be converted. + /// </summary> + public class AdoExceptionContextInfo + { + // This class was introduced, in NH, to allow less intrusive possible extensions + // of information given to the ISQLExceptionConverter + // (extensions of a class instead succesive changes of a method) + + /// <summary> + /// The <see cref="System.Data.Common.DbException"/> to be converted. + /// </summary> + public Exception SqlException { get; set; } + + /// <summary> + /// An optional error message. + /// </summary> + public string Message { get; set; } + + /// <summary> + /// The SQL that generate the exception + /// </summary> + public string Sql { get; set; } + } + /// <summary> /// Defines a contract for implementations that know how to convert a <see cref="System.Data.Common.DbException"/> /// into NHibernate's <see cref="ADOException"/> hierarchy. @@ -20,12 +44,10 @@ public interface ISQLExceptionConverter { /// <summary> - /// Convert the given <see cref="System.Data.Common.DbException"/> into NHibernate's ADOException hierarchy. + /// Convert the given <see cref="System.Data.Common.DbException"/> into custom Exception. /// </summary> - /// <param name="sqlException">The <see cref="System.Data.Common.DbException"/> to be converted. </param> - /// <param name="message"> An optional error message. </param> - /// <param name="sql">The SQL that generate the exception</param> - /// <returns> The resulting ADOException. </returns> - ADOException Convert(Exception sqlException, string message, SqlString sql); + /// <param name="adoExceptionContextInfo">Available information during exception throw.</param> + /// <returns> The resulting Exception to throw. </returns> + Exception Convert(AdoExceptionContextInfo adoExceptionContextInfo); } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Exceptions/LockAcquisitionException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/LockAcquisitionException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/LockAcquisitionException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,6 +1,5 @@ using System; using System.Runtime.Serialization; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -12,7 +11,7 @@ public class LockAcquisitionException : ADOException { public LockAcquisitionException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public LockAcquisitionException(string message, Exception innerException, SqlString sql) : base(message, innerException, sql) {} + public LockAcquisitionException(string message, Exception innerException, string sql) : base(message, innerException, sql) {} public LockAcquisitionException(string message, Exception innerException) : base(message, innerException) {} } } Modified: trunk/nhibernate/src/NHibernate/Exceptions/SQLExceptionConverterFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/SQLExceptionConverterFactory.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/SQLExceptionConverterFactory.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Reflection; using log4net; -using NHibernate.SqlCommand; using NHibernate.Util; namespace NHibernate.Exceptions @@ -16,9 +15,9 @@ { #region ISQLExceptionConverter Members - public ADOException Convert(Exception sqlException, string message, SqlString sql) + public Exception Convert(AdoExceptionContextInfo exceptionContextInfo) { - throw new GenericADOException(message, sqlException, sql); + throw new GenericADOException(exceptionContextInfo.Message, exceptionContextInfo.SqlException, exceptionContextInfo.Sql); } #endregion Modified: trunk/nhibernate/src/NHibernate/Exceptions/SQLGrammarException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/SQLGrammarException.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/SQLGrammarException.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,6 +1,5 @@ using System; using System.Runtime.Serialization; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -12,7 +11,7 @@ public class SQLGrammarException : ADOException { public SQLGrammarException(SerializationInfo info, StreamingContext context) : base(info, context) {} - public SQLGrammarException(string message, Exception innerException, SqlString sql) : base(message, innerException, sql) {} + public SQLGrammarException(string message, Exception innerException, string sql) : base(message, innerException, sql) {} public SQLGrammarException(string message, Exception innerException) : base(message, innerException) {} } } Modified: trunk/nhibernate/src/NHibernate/Exceptions/SQLStateConverter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Exceptions/SQLStateConverter.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Exceptions/SQLStateConverter.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,5 +1,4 @@ using System; -using NHibernate.SqlCommand; namespace NHibernate.Exceptions { @@ -19,7 +18,7 @@ #region ISQLExceptionConverter Members - public ADOException Convert(Exception sqlException, string message, SqlString sql) + public Exception Convert(AdoExceptionContextInfo exceptionInfo) { /* * So far I know we don't have something similar to "X/Open-compliant SQLState" in .NET @@ -27,7 +26,7 @@ * and its own IViolatedConstraintNameExtracter if needed. * The System.Data.Common.DbException, of .NET2.0, don't give us something applicable to all dialects. */ - return HandledNonSpecificException(sqlException, message, sql); + return HandledNonSpecificException(exceptionInfo.SqlException, exceptionInfo.Message, exceptionInfo.Sql); } #endregion @@ -37,7 +36,7 @@ /// <param name="message">An optional message </param> /// <param name="sql">Optionally, the sql being performed when the exception occurred. </param> /// <returns> The converted exception; should <b>never</b> be null. </returns> - public static ADOException HandledNonSpecificException(Exception sqlException, string message, SqlString sql) + public static ADOException HandledNonSpecificException(Exception sqlException, string message, string sql) { return new GenericADOException(message, sqlException, sql); } Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -2,7 +2,6 @@ using System.Collections; using System.Collections.Generic; using System.Data; -using System.Transactions; using NHibernate.AdoNet; using NHibernate.Collection; using NHibernate.Engine; @@ -285,7 +284,7 @@ } } - protected ADOException Convert(Exception sqlException, string message) + protected Exception Convert(Exception sqlException, string message) { using (new SessionIdLoggingContext(SessionId)) { Modified: trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/MSSQLExceptionConverterExample.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/MSSQLExceptionConverterExample.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/MSSQLExceptionConverterExample.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,7 +1,6 @@ using System; using System.Data.SqlClient; using NHibernate.Exceptions; -using NHibernate.SqlCommand; namespace NHibernate.Test.ExceptionsTest { @@ -11,17 +10,17 @@ { #region ISQLExceptionConverter Members - public ADOException Convert(Exception sqlException, string message, SqlString sql) + public Exception Convert(AdoExceptionContextInfo exInfo) { - SqlException sqle = ADOExceptionHelper.ExtractDbException(sqlException) as SqlException; + SqlException sqle = ADOExceptionHelper.ExtractDbException(exInfo.SqlException) as SqlException; if(sqle != null) { if (sqle.Number == 547) - return new ConstraintViolationException(message, sqle.InnerException, sql, null); + return new ConstraintViolationException(exInfo.Message, sqle.InnerException, exInfo.Sql, null); if (sqle.Number == 208) - return new SQLGrammarException(message, sqle.InnerException, sql); + return new SQLGrammarException(exInfo.Message, sqle.InnerException, exInfo.Sql); } - return SQLStateConverter.HandledNonSpecificException(sqlException, message, sql); + return SQLStateConverter.HandledNonSpecificException(exInfo.SqlException, exInfo.Message, exInfo.Sql); } #endregion Modified: trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/OracleClientExceptionConverterExample.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/OracleClientExceptionConverterExample.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/OracleClientExceptionConverterExample.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,7 +1,6 @@ using System; using System.Data.OracleClient; using NHibernate.Exceptions; -using NHibernate.SqlCommand; namespace NHibernate.Test.ExceptionsTest { @@ -9,21 +8,21 @@ { #region ISQLExceptionConverter Members - public ADOException Convert(Exception sqlException, string message, SqlString sql) + public Exception Convert(AdoExceptionContextInfo exInfo) { - var sqle = ADOExceptionHelper.ExtractDbException(sqlException) as OracleException; + var sqle = ADOExceptionHelper.ExtractDbException(exInfo.SqlException) as OracleException; if (sqle != null) { if (sqle.Code == 1036) { - return new ConstraintViolationException(message, sqle.InnerException, sql, null); + return new ConstraintViolationException(exInfo.Message, sqle.InnerException, exInfo.Sql, null); } if (sqle.Code == 942) { - return new SQLGrammarException(message, sqle.InnerException, sql); + return new SQLGrammarException(exInfo.Message, sqle.InnerException, exInfo.Sql); } } - return SQLStateConverter.HandledNonSpecificException(sqlException, message, sql); + return SQLStateConverter.HandledNonSpecificException(exInfo.SqlException, exInfo.Message, exInfo.Sql); } #endregion Modified: trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/PostgresExceptionConverterExample.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/PostgresExceptionConverterExample.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/PostgresExceptionConverterExample.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -1,30 +1,28 @@ using System; using System.Data.Common; -using NHibernate; using NHibernate.Exceptions; -using NHibernate.SqlCommand; public class PostgresExceptionConverterExample : ISQLExceptionConverter { #region ISQLExceptionConverter Members - public ADOException Convert(Exception sqlException, string message, SqlString sql) + public Exception Convert(AdoExceptionContextInfo exInfo) { - var sqle = ADOExceptionHelper.ExtractDbException(sqlException) as DbException; + var sqle = ADOExceptionHelper.ExtractDbException(exInfo.SqlException) as DbException; if (sqle != null) { string code = (string) sqle.GetType().GetProperty("Code").GetValue(sqle, null); if (code == "23503") { - return new ConstraintViolationException(message, sqle.InnerException, sql, null); + return new ConstraintViolationException(exInfo.Message, sqle.InnerException, exInfo.Sql, null); } if (code == "42P01") { - return new SQLGrammarException(message, sqle.InnerException, sql); + return new SQLGrammarException(exInfo.Message, sqle.InnerException, exInfo.Sql); } } - return SQLStateConverter.HandledNonSpecificException(sqlException, message, sql); + return SQLStateConverter.HandledNonSpecificException(exInfo.SqlException, exInfo.Message, exInfo.Sql); } #endregion Modified: trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/SQLExceptionConversionTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/SQLExceptionConversionTest.cs 2009-05-23 23:18:48 UTC (rev 4371) +++ trunk/nhibernate/src/NHibernate.Test/ExceptionsTest/SQLExceptionConversionTest.cs 2009-05-24 05:24:03 UTC (rev 4372) @@ -79,7 +79,7 @@ catch (Exception sqle) { ADOExceptionReporter.LogExceptions(sqle, "Just output!!!!"); - ADOException adoException = converter.Convert(sqle, null, null); + Exception adoException = converter.Convert(new AdoExceptionContextInfo{SqlException = sqle}); Assert.AreEqual(typeof(ConstraintViolationException), adoException.GetType(), "Bad conversion [" + sqle.Message + "]"); ConstraintViolationException ex = (ConstraintViolationException)adoException; @@ -126,7 +126,9 @@ } catch (Exception sqle) { - Assert.AreEqual(typeof(SQLGrammarException), converter.Convert(sqle, null, null).GetType(), "Bad conversion [" + sqle.Message + "]"); + Assert.AreEqual(typeof (SQLGrammarException), + converter.Convert(new AdoExceptionContextInfo {SqlException = sqle}).GetType(), + "Bad conversion [" + sqle.Message + "]"); } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |