You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fab...@us...> - 2009-05-18 21:23:58
|
Revision: 4338 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4338&view=rev Author: fabiomaulo Date: 2009-05-18 21:23:51 +0000 (Mon, 18 May 2009) Log Message: ----------- Starting fix of NH-1786 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Bytecode/ActivatorObjectsFactory.cs trunk/nhibernate/src/NHibernate/Bytecode/IObjectsFactory.cs trunk/nhibernate/src/NHibernate.Test/Bytecode/ActivatorObjectFactoryFixture.cs Added: trunk/nhibernate/src/NHibernate/Bytecode/ActivatorObjectsFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/ActivatorObjectsFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Bytecode/ActivatorObjectsFactory.cs 2009-05-18 21:23:51 UTC (rev 4338) @@ -0,0 +1,22 @@ +using System; + +namespace NHibernate.Bytecode +{ + public class ActivatorObjectsFactory: IObjectsFactory + { + public object CreateInstance(System.Type type) + { + throw new NotImplementedException(); + } + + public object CreateInstance(System.Type type, bool nonPublic) + { + throw new NotImplementedException(); + } + + public object CreateInstance(System.Type type, params object[] ctorArgs) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Bytecode/IObjectsFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Bytecode/IObjectsFactory.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Bytecode/IObjectsFactory.cs 2009-05-18 21:23:51 UTC (rev 4338) @@ -0,0 +1,29 @@ +namespace NHibernate.Bytecode +{ + public interface IObjectsFactory + { + /// <summary> + /// Creates an instance of the specified type. + /// </summary> + /// <param name="type">The type of object to create.</param> + /// <returns>A reference to the created object.</returns> + object CreateInstance(System.Type type); + + /// <summary> + /// Creates an instance of the specified type. + /// </summary> + /// <param name="type">The type of object to create.</param> + /// <param name="nonPublic">true if a public or nonpublic default constructor can match; false if only a public default constructor can match.</param> + /// <returns>A reference to the created object.</returns> + object CreateInstance(System.Type type, bool nonPublic); + + /// <summary> + /// Creates an instance of the specified type using the constructor + /// that best matches the specified parameters. + /// </summary> + /// <param name="type">The type of object to create.</param> + /// <param name="ctorArgs">An array of constructor arguments.</param> + /// <returns>A reference to the created object.</returns> + object CreateInstance(System.Type type, params object[] ctorArgs); + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-18 19:37:55 UTC (rev 4337) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-18 21:23:51 UTC (rev 4338) @@ -451,7 +451,9 @@ <Compile Include="AdoNet\Util\FormatStyle.cs" /> <Compile Include="AdoNet\Util\IFormatter.cs" /> <Compile Include="AdoNet\Util\SqlStatementLogger.cs" /> + <Compile Include="Bytecode\ActivatorObjectsFactory.cs" /> <Compile Include="Bytecode\HibernateByteCodeException.cs" /> + <Compile Include="Bytecode\IObjectsFactory.cs" /> <Compile Include="Bytecode\ProxyFactoryFactoryNotConfiguredException.cs" /> <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> <Compile Include="Cache\FakeCache.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/Bytecode/ActivatorObjectFactoryFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Bytecode/ActivatorObjectFactoryFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Bytecode/ActivatorObjectFactoryFixture.cs 2009-05-18 21:23:51 UTC (rev 4338) @@ -0,0 +1,72 @@ +using System; +using NHibernate.Bytecode; +using NUnit.Framework; + +namespace NHibernate.Test.Bytecode +{ + [TestFixture, Ignore("Not implemented yet.")] + public class ActivatorObjectFactoryFixture + { + public class WithOutPublicParameterLessCtor + { + public string Something { get; set; } + protected WithOutPublicParameterLessCtor() { } + + public WithOutPublicParameterLessCtor(string something) + { + Something = something; + } + } + + public class PublicParameterLessCtor + { + } + + public struct ValueType + { + public string Something { get; set; } + } + + [Test] + public void CreateInstanceDefCtor() + { + var of = new ActivatorObjectsFactory(); + Assert.Throws<ArgumentNullException>(() => of.CreateInstance(null)); + Assert.Throws<ArgumentNullException>(() => of.CreateInstance(typeof(WithOutPublicParameterLessCtor))); + var instance = of.CreateInstance(typeof(PublicParameterLessCtor)); + Assert.That(instance, Is.Not.Null); + Assert.That(instance, Is.InstanceOf<PublicParameterLessCtor>()); + } + + [Test] + public void CreateInstanceWithNoPublicCtor() + { + var of = new ActivatorObjectsFactory(); + Assert.Throws<ArgumentNullException>(() => of.CreateInstance(null, false)); + var instance = of.CreateInstance(typeof(WithOutPublicParameterLessCtor), true); + Assert.That(instance, Is.Not.Null); + Assert.That(instance, Is.InstanceOf<WithOutPublicParameterLessCtor>()); + } + + [Test] + public void CreateInstanceOfValueType() + { + var of = new ActivatorObjectsFactory(); + var instance = of.CreateInstance(typeof(ValueType), true); + Assert.That(instance, Is.Not.Null); + Assert.That(instance, Is.InstanceOf<ValueType>()); + } + + [Test] + public void CreateInstanceWithArguments() + { + var of = new ActivatorObjectsFactory(); + Assert.Throws<ArgumentNullException>(() => of.CreateInstance(null, new[] {1})); + var value = "a value"; + var instance = of.CreateInstance(typeof(WithOutPublicParameterLessCtor), new[]{value}); + Assert.That(instance, Is.Not.Null); + Assert.That(instance, Is.InstanceOf<WithOutPublicParameterLessCtor>()); + Assert.That(((WithOutPublicParameterLessCtor)instance).Something, Is.EqualTo(value)); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-18 19:37:55 UTC (rev 4337) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-18 21:23:51 UTC (rev 4338) @@ -88,6 +88,7 @@ <Compile Include="BulkManipulation\BaseFixture.cs" /> <Compile Include="BulkManipulation\HQLBulkOperations.cs" /> <Compile Include="BulkManipulation\SimpleClass.cs" /> + <Compile Include="Bytecode\ActivatorObjectFactoryFixture.cs" /> <Compile Include="Bytecode\Lightweight\BytecodeProviderFixture.cs" /> <Compile Include="Bytecode\WrongProxyFactoryFactory.cs" /> <Compile Include="CacheTest\CacheFixture.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-18 19:38:02
|
Revision: 4337 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4337&view=rev Author: fabiomaulo Date: 2009-05-18 19:37:55 +0000 (Mon, 18 May 2009) Log Message: ----------- Fix NH-1783 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Type/DateType.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/DomainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/SampleTest.cs Modified: trunk/nhibernate/src/NHibernate/Type/DateType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/DateType.cs 2009-05-18 05:31:15 UTC (rev 4336) +++ trunk/nhibernate/src/NHibernate/Type/DateType.cs 2009-05-18 19:37:55 UTC (rev 4337) @@ -49,15 +49,16 @@ public override void Set(IDbCommand st, object value, int index) { - IDataParameter parm = st.Parameters[index] as IDataParameter; - if ((DateTime)value < BaseDateValue) + var parm = st.Parameters[index] as IDataParameter; + var dateTime = (DateTime)value; + if (dateTime < BaseDateValue) { parm.Value = DBNull.Value; } else { parm.DbType = DbType.Date; - parm.Value = value; + parm.Value = dateTime.Date; } } Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/DomainClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/DomainClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/DomainClass.cs 2009-05-18 19:37:55 UTC (rev 4337) @@ -0,0 +1,11 @@ +using System; + +namespace NHibernate.Test.NHSpecificTest.NH1783 +{ + public class DomainClass + { + public int Id { get; set; } + + public DateTime BirthDate { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/Mappings.hbm.xml 2009-05-18 19:37:55 UTC (rev 4337) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1783" + default-lazy="false"> + <class name="DomainClass"> + <id name="Id"> + <generator class="assigned" /> + </id> + <property name="BirthDate" type="Date" /> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/SampleTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/SampleTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1783/SampleTest.cs 2009-05-18 19:37:55 UTC (rev 4337) @@ -0,0 +1,38 @@ +using System; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1783 +{ + [TestFixture] + public class SampleTest : BugTestCase + { + [Test] + public void DatePropertyShouldBeStoredWithoutTimePart() + { + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + var entity = new DomainClass {Id = 1, BirthDate = new DateTime(1950, 2, 13, 3, 12, 10)}; + session.Save(entity); + tx.Commit(); + } + + using (ISession session = OpenSession()) + { + // upload the result using DateTime type to verify it does not have the time-part. + var l = session.CreateSQLQuery("SELECT BirthDate AS bd FROM DomainClass") + .AddScalar("bd",NHibernateUtil.DateTime).List(); + var actual = (DateTime) l[0]; + var expected = new DateTime(1950, 2, 13); + Assert.That(actual, Is.EqualTo(expected)); + } + + using (ISession session = OpenSession()) + using (ITransaction tx = session.BeginTransaction()) + { + session.CreateQuery("delete from DomainClass").ExecuteUpdate(); + tx.Commit(); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-18 05:31:15 UTC (rev 4336) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-18 19:37:55 UTC (rev 4337) @@ -424,6 +424,8 @@ <Compile Include="NHSpecificTest\NH1775\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1776\Category.cs" /> <Compile Include="NHSpecificTest\NH1776\FilterQueryTwiceFixture.cs" /> + <Compile Include="NHSpecificTest\NH1783\DomainClass.cs" /> + <Compile Include="NHSpecificTest\NH1783\SampleTest.cs" /> <Compile Include="NHSpecificTest\NH645\HQLFunctionFixture.cs" /> <Compile Include="HQL\HQLFunctions.cs" /> <Compile Include="HQL\Human.cs" /> @@ -1816,6 +1818,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1783\Mappings.hbm.xml" /> <EmbeddedResource Include="LazyOneToOne\Person.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1747\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1159\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-18 05:31:21
|
Revision: 4336 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4336&view=rev Author: fabiomaulo Date: 2009-05-18 05:31:15 +0000 (Mon, 18 May 2009) Log Message: ----------- Test from H3.1 (not supported in .NET so far) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employee.cs trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employment.cs trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.cs trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employee.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employee.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employee.cs 2009-05-18 05:31:15 UTC (rev 4336) @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace NHibernate.Test.LazyOneToOne +{ + public class Employee + { + protected Employee() + { + Employments = new List<Employment>(); + } + + public Employee(Person person) + : this() + { + Person = person; + PersonName = person.Name; + Person.Employee = this; + } + + public virtual string PersonName { get; protected set; } + + public virtual Person Person { get; protected set; } + + public virtual ICollection<Employment> Employments { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employment.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employment.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Employment.cs 2009-05-18 05:31:15 UTC (rev 4336) @@ -0,0 +1,50 @@ +using System; + +namespace NHibernate.Test.LazyOneToOne +{ + public class Employment + { + protected Employment() { } + public Employment(Employee e, String org) + { + PersonName = e.PersonName; + OrganizationName = org; + StartDate = DateTime.Today.AddDays(-1); + e.Employments.Add(this); + } + + public virtual string PersonName { get; protected set; } + + public virtual string OrganizationName { get; protected set; } + + public virtual DateTime? StartDate { get; set; } + + public virtual DateTime? EndDate { get; set; } + + public override bool Equals(object obj) + { + return Equals(obj as Employment); + } + + public virtual bool Equals(Employment other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + if (ReferenceEquals(this, other)) + { + return true; + } + return Equals(other.PersonName, PersonName) && Equals(other.OrganizationName, OrganizationName); + } + + public override int GetHashCode() + { + unchecked + { + return ((PersonName != null ? PersonName.GetHashCode() : 0) * 397) ^ (OrganizationName != null ? OrganizationName.GetHashCode() : 0); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/LazyOneToOneTest.cs 2009-05-18 05:31:15 UTC (rev 4336) @@ -0,0 +1,85 @@ +using System; +using System.Collections; +using NHibernate.Intercept; +using NUnit.Framework; +using Environment = NHibernate.Cfg.Environment; + +namespace NHibernate.Test.LazyOneToOne +{ + [TestFixture, Ignore("Not supported.")] + public class LazyOneToOneTest : TestCase + { + protected override IList Mappings + { + get { return new[] {"LazyOneToOne.Person.hbm.xml"}; } + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override bool AppliesTo(Dialect.Dialect dialect) + { + // this test work only with Field interception (NH-1618) + return FieldInterceptionHelper.IsInstrumented( new Person() ); + } + protected override void Configure(Cfg.Configuration configuration) + { + cfg.SetProperty(Environment.MaxFetchDepth, "2"); + cfg.SetProperty(Environment.UseSecondLevelCache, "false"); + } + + protected override string CacheConcurrencyStrategy + { + get { return null; } + } + + [Test] + public void Lazy() + { + ISession s = OpenSession(); + ITransaction t = s.BeginTransaction(); + var p = new Person {Name = "Gavin"}; + var p2 = new Person {Name = "Emmanuel"}; + var e = new Employee(p); + new Employment(e, "JBoss"); + var old = new Employment(e, "IFA") {EndDate = DateTime.Today}; + s.Persist(p); + s.Persist(p2); + t.Commit(); + s.Close(); + + s = OpenSession(); + t = s.BeginTransaction(); + p = s.CreateQuery("from Person where name='Gavin'").UniqueResult<Person>(); + //Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee")); + + Assert.That(p.Employee.Person, Is.SameAs(p)); + Assert.That(NHibernateUtil.IsInitialized(p.Employee.Employments)); + Assert.That(p.Employee.Employments.Count, Is.EqualTo(1)); + + p2 = s.CreateQuery("from Person where name='Emmanuel'").UniqueResult<Person>(); + Assert.That(p2.Employee, Is.Null); + t.Commit(); + s.Close(); + + s = OpenSession(); + t = s.BeginTransaction(); + p = s.Get<Person>("Gavin"); + //Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Employee")); + + Assert.That(p.Employee.Person, Is.SameAs(p)); + Assert.That(NHibernateUtil.IsInitialized(p.Employee.Employments)); + Assert.That(p.Employee.Employments.Count, Is.EqualTo(1)); + + p2 = s.Get<Person>("Emmanuel"); + Assert.That(p2.Employee, Is.Null); + s.Delete(p2); + s.Delete(old); + s.Delete(p); + t.Commit(); + s.Close(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.cs 2009-05-18 05:31:15 UTC (rev 4336) @@ -0,0 +1,8 @@ +namespace NHibernate.Test.LazyOneToOne +{ + public class Person + { + public virtual string Name { get; set; } + public virtual Employee Employee { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/LazyOneToOne/Person.hbm.xml 2009-05-18 05:31:15 UTC (rev 4336) @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.LazyOneToOne"> + + <class name="Person"> + <id name="Name"/> + <one-to-one name="Employee" lazy="no-proxy" cascade="persist,delete"/> + </class> + + <class name="Employee"> + <id name="PersonName"/> + <one-to-one name="Person" lazy="no-proxy"/> + <bag name="Employments" inverse="true" fetch="join" lazy="false" + where="EndDate is null" + cascade="persist,delete"> + <key column="PersonName"/> + <one-to-many class="Employment"/> + </bag> + </class> + + <class name="Employment"> + <composite-id> + <key-property name="PersonName"/> + <key-property name="OrganizationName"/> + </composite-id> + <property name="StartDate" update="false"/> + <property name="EndDate"/> + </class> + +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 21:30:26 UTC (rev 4335) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-18 05:31:15 UTC (rev 4336) @@ -327,6 +327,10 @@ <Compile Include="HQL\Ast\WithClauseFixture.cs" /> <Compile Include="HQL\Ast\Zoo.cs" /> <Compile Include="HQL\BaseFunctionFixture.cs" /> + <Compile Include="LazyOneToOne\Employee.cs" /> + <Compile Include="LazyOneToOne\Employment.cs" /> + <Compile Include="LazyOneToOne\LazyOneToOneTest.cs" /> + <Compile Include="LazyOneToOne\Person.cs" /> <Compile Include="MappingTest\NonReflectiveBinderFixture.cs" /> <Compile Include="MappingTest\Wicked.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\AbstractIntEnumsBagFixture.cs" /> @@ -1812,6 +1816,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="LazyOneToOne\Person.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1747\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1159\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1093\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2009-05-17 21:30:33
|
Revision: 4335 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4335&view=rev Author: tehlike Date: 2009-05-17 21:30:26 +0000 (Sun, 17 May 2009) Log Message: ----------- Adding tests for NH-1747 by Anne Epstein Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Classes.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Mappings.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Classes.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Classes.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Classes.cs 2009-05-17 21:30:26 UTC (rev 4335) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1747 +{ + public class Payment + { + private Int32 id; + public virtual Int32 Id { get { return id; } set { id = value; } } + + private Decimal amount; + public virtual Decimal Amount { get { return amount; } set { amount = value; } } + private PaymentBatch paymentBatch; + public virtual PaymentBatch PaymentBatch { get { return paymentBatch; } set { paymentBatch = value; } } + } + + public class PaymentBatch + { + private Int32 id; + public virtual Int32 Id { get { return id; } set { id = value; } } + + private IList<Payment> payments = new List<Payment>(); + public virtual IList<Payment> Payments { get { return payments; } } + + public virtual void AddPayment(Payment p) + { + payments.Add(p); + p.PaymentBatch = this; + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Fixture.cs 2009-05-17 21:30:26 UTC (rev 4335) @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1747 +{ + [TestFixture,Ignore] + public class JoinTraversalTest : BugTestCase + { + + protected override void OnSetUp() + { + base.OnSetUp(); + using (ISession session = OpenSession()) + { + var payment = new Payment { Amount = 5m, Id = 1 }; + var paymentBatch = new PaymentBatch { Id = 3 }; + paymentBatch.AddPayment(payment); + session.Save(paymentBatch); + session.Save(payment); + session.Flush(); + } + } + + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession session = OpenSession()) + { + var hql = "from System.Object"; + session.Delete(hql); + session.Flush(); + } + } + + [Test] + public void TraversingBagToJoinChildElementShouldWork() + { + using (ISession session = OpenSession()) + { + var paymentBatch = session.Get<PaymentBatch>(3); + Assert.AreEqual(1, paymentBatch.Payments.Count); + + } + } + } + +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1747/Mappings.hbm.xml 2009-05-17 21:30:26 UTC (rev 4335) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1747" default-access="field.camelcase"> + <class name="Payment" table="PAYMENT"> + <id name="Id" type="Int32" column="PAYMENT_ID"> + <generator class="assigned"/> + </id> + <property name="Amount" column="AMOUNT"/> + <join table="CREDIT_PAYMENT"> + <key column="PAYMENTID" /> + <many-to-one name="PaymentBatch" column="PaymentBatchFK_ID"/> + </join> + </class> + + <class name="PaymentBatch" table="PAYMENTBATCH"> + <id name="Id" type="Int32" column="PAYMENTBATCH_ID"> + <generator class="assigned"/> + </id> + + <bag name="Payments" inverse="true"> + <key column="PaymentBatchFK_ID" /> + <one-to-many class="Payment"/> + </bag> + </class> +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 20:36:05 UTC (rev 4334) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 21:30:26 UTC (rev 4335) @@ -407,6 +407,8 @@ <Compile Include="NHSpecificTest\NH1741\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1742\DomainClass.cs" /> <Compile Include="NHSpecificTest\NH1742\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1747\Classes.cs" /> + <Compile Include="NHSpecificTest\NH1747\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1760\DomainClass.cs" /> <Compile Include="NHSpecificTest\NH1760\SampleTest.cs" /> <Compile Include="NHSpecificTest\NH1763\DomainClass.cs" /> @@ -1810,6 +1812,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1747\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1159\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1093\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1714\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2009-05-17 20:36:10
|
Revision: 4334 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4334&view=rev Author: tehlike Date: 2009-05-17 20:36:05 +0000 (Sun, 17 May 2009) Log Message: ----------- Adding tests for NH-1159 proving it is not an issue. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Contact.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/ContactTitle.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/HibernateInterceptor.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Mappings.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Contact.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Contact.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Contact.cs 2009-05-17 20:36:05 UTC (rev 4334) @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1159 +{ + [Serializable] + public partial class Contact + { + + private bool isChanged; + private Int64 id; + private string forename; + private string surname; + private string preferredname; + + public Contact() + { + this.id = 0; + this.forename = String.Empty; + this.surname = String.Empty; + this.preferredname = String.Empty; + } + + public Contact( + string forename, + string surname) + : this() + { + this.forename = forename; + this.surname = surname; + this.preferredname = String.Empty; + } + + + #region Public Properties + + public virtual Int64 Id + { + get { return id; } + set + { + isChanged |= (id != value); + id = value; + } + + } + + public virtual string Forename + { + get { return forename; } + + set + { + if (value == null) + throw new ArgumentOutOfRangeException("Null value not allowed for Forename", value, "null"); + + if (value.Length > 50) + throw new ArgumentOutOfRangeException("Invalid value for Forename", value, value.ToString()); + + isChanged |= (forename != value); forename = value; + } + } + + public virtual string Surname + { + get { return surname; } + + set + { + if (value == null) + throw new ArgumentOutOfRangeException("Null value not allowed for Surname", value, "null"); + + if (value.Length > 50) + throw new ArgumentOutOfRangeException("Invalid value for Surname", value, value.ToString()); + + isChanged |= (surname != value); surname = value; + } + } + + public virtual string PreferredName + { + get { return preferredname; } + + set + { + if (value != null && value.Length > 50) + throw new ArgumentOutOfRangeException("Invalid value for PreferredName", value, value.ToString()); + + isChanged |= (preferredname != value); preferredname = value; + } + } + + /// <summary> + /// Returns whether or not the object has changed it's values. + /// </summary> + public virtual bool IsChanged + { + get { return isChanged; } + } + + #endregion + + #region Equals And HashCode Overrides + /// <summary> + /// local implementation of Equals based on unique value members + /// </summary> + public override bool Equals(object obj) + { + if (this == obj) return true; + if ((obj == null) || (obj.GetType() != this.GetType())) return false; + Contact castObj = (Contact)obj; + return (castObj != null) && + (this.id == castObj.Id); + } + + /// <summary> + /// local implementation of GetHashCode based on unique value members + /// </summary> + public override int GetHashCode() + { + + int hash = 57; + hash = 27 * hash * id.GetHashCode(); + return hash; + } + #endregion + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/ContactTitle.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/ContactTitle.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/ContactTitle.cs 2009-05-17 20:36:05 UTC (rev 4334) @@ -0,0 +1,135 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1159 +{ + /// <summary> + /// Generated by MyGeneration using the NHibernate Object Mapping template + /// </summary> + [Serializable] + public partial class ContactTitle + { + + #region Private Members + private bool isChanged; + + private Int64 id; + private IList contactList; + private string descr; + #endregion + + #region Default ( Empty ) Class Constuctor + /// <summary> + /// default constructor + /// </summary> + public ContactTitle() + { + id = 0; + contactList = new ArrayList(); + descr = String.Empty; + } + #endregion // End of Default ( Empty ) Class Constuctor + + #region Required Fields Only Constructor + /// <summary> + /// required (not null) fields only constructor + /// </summary> + public ContactTitle( + string descr) + : this() + { + this.descr = descr; + } + #endregion // End Required Fields Only Constructor + + #region Public Properties + + /// <summary> + /// + /// </summary> + public virtual Int64 Id + { + get { return id; } + set + { + isChanged |= (id != value); + id = value; + } + + } + + public virtual IList ContactList + { + get + { + return contactList; + } + set + { + contactList = value; + } + } + + /// <summary> + /// + /// </summary> + public virtual string Descr + { + get { return descr; } + + set + { + if (value == null) + throw new ArgumentOutOfRangeException("Null value not allowed for Descr", value, "null"); + + if (value.Length > 50) + throw new ArgumentOutOfRangeException("Invalid value for Descr", value, value.ToString()); + + isChanged |= (descr != value); descr = value; + } + } + + /// <summary> + /// Returns whether or not the object has changed it's values. + /// </summary> + public virtual bool IsChanged + { + get { return isChanged; } + } + + #endregion + + #region Equals And HashCode Overrides + /// <summary> + /// local implementation of Equals based on unique value members + /// </summary> + public override bool Equals(object obj) + { + if (this == obj) return true; + if ((obj == null) || (obj.GetType() != this.GetType())) return false; + ContactTitle castObj = (ContactTitle)obj; + return (castObj != null) && + (this.id == castObj.Id); + } + + /// <summary> + /// local implementation of GetHashCode based on unique value members + /// </summary> + public override int GetHashCode() + { + + int hash = 57; + hash = 27 * hash * id.GetHashCode(); + return hash; + } + #endregion + + public override string ToString() + { + return id.ToString() + " " + descr; + } + } + +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs 2009-05-17 20:36:05 UTC (rev 4334) @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1159 +{ + [TestFixture] + public class Fixture:BugTestCase + { + + protected override void OnSetUp() + { + using (ISession session = OpenSession()) + using (ITransaction tran = session.BeginTransaction()) + { + Contact c=new Contact{Id=1,Forename ="David",Surname="Bates",PreferredName="Davey"}; + session.Save(c); + tran.Commit(); + } + HibernateInterceptor.CallCount = 0; + + } + + protected override void OnTearDown() + { + using (ISession session = OpenSession()) + using (ITransaction tran = session.BeginTransaction()) + { + session.Delete("from Contact"); + tran.Commit(); + } + } + + [Test] + public void DoesNotFlushWithCriteriaWithCommit() + { + using (ISession session = OpenSession(new HibernateInterceptor())) + using (ITransaction tran = session.BeginTransaction()) + { + session.FlushMode = FlushMode.Commit; + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0)); + Contact contact = session.Get<Contact>((Int64)1); + contact.PreferredName = "Updated preferred name"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + contact.Forename = "Updated forename"; + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + ICriteria query = session.CreateCriteria(typeof(ContactTitle)); + query.Add(Expression.Eq("Id", (Int64)1)); + query.UniqueResult<ContactTitle>(); + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + contact.Surname = "Updated surname"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2)); + + session.SaveOrUpdateCopy(contact); + } + } + [Test] + public void DoesNotFlushWithCriteriaWithNever() + { + using (ISession session = OpenSession(new HibernateInterceptor())) + using (ITransaction tran = session.BeginTransaction()) + { + session.FlushMode = FlushMode.Never; + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0)); + Contact contact = session.Get<Contact>((Int64)1); + contact.PreferredName = "Updated preferred name"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + contact.Forename = "Updated forename"; + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + ICriteria query = session.CreateCriteria(typeof(ContactTitle)); + query.Add(Expression.Eq("Id", (Int64)1)); + query.UniqueResult<ContactTitle>(); + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + contact.Surname = "Updated surname"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2)); + + session.SaveOrUpdateCopy(contact); + } + } + [Test] + public void DoesNotFlushWithCriteriaWithAuto() + { + using (ISession session = OpenSession(new HibernateInterceptor())) + using (ITransaction tran = session.BeginTransaction()) + { + session.FlushMode = FlushMode.Auto; + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0)); + + Contact contact = session.Get<Contact>((Int64)1); + contact.PreferredName = "Updated preferred name"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + contact.Forename = "Updated forename"; + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1)); + + ICriteria query = session.CreateCriteria(typeof(ContactTitle)); + query.Add(Expression.Eq("Id", (Int64)1)); + query.UniqueResult<ContactTitle>(); + + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2)); + + contact.Surname = "Updated surname"; + session.Flush(); + Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(3)); + + session.SaveOrUpdateCopy(contact); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/HibernateInterceptor.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/HibernateInterceptor.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/HibernateInterceptor.cs 2009-05-17 20:36:05 UTC (rev 4334) @@ -0,0 +1,16 @@ +using System; +using NHibernate.Type; + +namespace NHibernate.Test.NHSpecificTest.NH1159 +{ + public class HibernateInterceptor : EmptyInterceptor + { + public static int CallCount = 0; + public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types) + { + CallCount++; + return false; + } + } + +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1159/Mappings.hbm.xml 2009-05-17 20:36:05 UTC (rev 4334) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1159"> + <class name="Contact" table="Contact"> + <id name="Id" column="id" type="Int64" unsaved-value="0"> + <generator class="assigned"/> + </id> + <property column="forename" type="String" name="Forename" not-null="true" length="50" /> + <property column="surname" type="String" name="Surname" not-null="true" length="50" /> + <property column="preferredName" type="String" name="PreferredName" length="50" /> + </class> +</hibernate-mapping> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 16:35:57 UTC (rev 4333) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 20:36:05 UTC (rev 4334) @@ -336,6 +336,10 @@ <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> <Compile Include="NHSpecificTest\NH1093\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1093\SimpleCached.cs" /> + <Compile Include="NHSpecificTest\NH1159\Contact.cs" /> + <Compile Include="NHSpecificTest\NH1159\ContactTitle.cs" /> + <Compile Include="NHSpecificTest\NH1159\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1159\HibernateInterceptor.cs" /> <Compile Include="NHSpecificTest\NH1264\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1264\Name.cs" /> <Compile Include="NHSpecificTest\NH1264\Passenger.cs" /> @@ -1806,6 +1810,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1159\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1093\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1714\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1763\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-17 16:36:02
|
Revision: 4333 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4333&view=rev Author: fabiomaulo Date: 2009-05-17 16:35:57 +0000 (Sun, 17 May 2009) Log Message: ----------- Fix NH-1093 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cache/NoCacheProvider.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Util/PropertiesHelper.cs trunk/nhibernate/src/NHibernate.Test/LogSpy.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Cache/FakeCache.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/SimpleCached.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Cache/NoCachingEnabledException.cs Added: trunk/nhibernate/src/NHibernate/Cache/FakeCache.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cache/FakeCache.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Cache/FakeCache.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -0,0 +1,50 @@ +namespace NHibernate.Cache +{ + /// <summary> + /// Used by <see cref="NoCacheProvider"/> + /// </summary> + public class FakeCache : ICache + { + public FakeCache(string regionName) + { + RegionName = regionName; + } + + public object Get(object key) + { + return null; + } + + public void Put(object key, object value) + { + } + + public void Remove(object key) + { + } + + public void Clear() + { + } + + public void Destroy() + { + } + + public void Lock(object key) + { + } + + public void Unlock(object key) + { + } + + public long NextTimestamp() + { + return Timestamper.Next(); + } + + public int Timeout { get; private set; } + public string RegionName { get; private set; } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Cache/NoCacheProvider.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cache/NoCacheProvider.cs 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate/Cache/NoCacheProvider.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using log4net; namespace NHibernate.Cache { @@ -8,6 +9,10 @@ /// </summary> public class NoCacheProvider : ICacheProvider { + private static readonly ILog log = LogManager.GetLogger(typeof(NoCacheProvider)); + + public const string WarnMessage = "Second-level cache is enabled in a class, but no cache provider was selected. Fake cache used."; + /// <summary> /// Configure the cache /// </summary> @@ -16,7 +21,9 @@ /// <exception cref="CacheException" /> public ICache BuildCache(string regionName, IDictionary<string, string> properties) { - throw new NoCachingEnabledException(); + // NH different behavior because NH-1093 + log.Warn(WarnMessage); + return new FakeCache(regionName); } /// <summary> Deleted: trunk/nhibernate/src/NHibernate/Cache/NoCachingEnabledException.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cache/NoCachingEnabledException.cs 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate/Cache/NoCachingEnabledException.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -1,17 +0,0 @@ -using System; -using Environment = NHibernate.Cfg.Environment; - -namespace NHibernate.Cache -{ - [Serializable] - public class NoCachingEnabledException : CacheException - { - private const string ExceptionMessage = "Second-level cache is enabled, but no cache provider was selected. " + - "Please use " + Environment.CacheProvider + " to specify a cache provider such as SysCacheProvider"; - - public NoCachingEnabledException() - : base(ExceptionMessage) - { - } - } -} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-05-17 16:35:57 UTC (rev 4333) @@ -454,6 +454,7 @@ <Compile Include="Bytecode\HibernateByteCodeException.cs" /> <Compile Include="Bytecode\ProxyFactoryFactoryNotConfiguredException.cs" /> <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> + <Compile Include="Cache\FakeCache.cs" /> <Compile Include="Cfg\MappingSchema\AbstractDecoratable.cs" /> <Compile Include="Cfg\MappingSchema\HbmTimestamp.cs" /> <Compile Include="Cfg\MappingSchema\HbmVersion.cs" /> @@ -641,7 +642,6 @@ <Compile Include="Cache\FilterKey.cs" /> <Compile Include="Cache\IOptimisticCacheSource.cs" /> <Compile Include="Cache\NoCacheProvider.cs" /> - <Compile Include="Cache\NoCachingEnabledException.cs" /> <Compile Include="Cfg\ClassExtractor.cs" /> <Compile Include="Cfg\ConfigurationSchema\CfgXmlHelper.cs" /> <Compile Include="Cfg\ConfigurationSchema\ClassCacheConfiguration.cs" /> Modified: trunk/nhibernate/src/NHibernate/Util/PropertiesHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Util/PropertiesHelper.cs 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate/Util/PropertiesHelper.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -41,6 +41,10 @@ { string value; properties.TryGetValue(property, out value); + if(value == string.Empty) + { + value = null; + } return value ?? defaultValue; } Modified: trunk/nhibernate/src/NHibernate.Test/LogSpy.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate.Test/LogSpy.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -14,7 +14,7 @@ private readonly Logger logger; private readonly Level prevLogLevel; - public LogSpy(ILog log, bool disable) + public LogSpy(ILog log, Level level) { logger = log.Logger as Logger; if (logger == null) @@ -24,13 +24,18 @@ // Change the log level to DEBUG and temporarily save the previous log level prevLogLevel = logger.Level; - logger.Level = disable ? Level.Off : Level.Debug; + logger.Level = level; // Add a new MemoryAppender to the logger. appender = new MemoryAppender(); logger.AddAppender(appender); } + public LogSpy(ILog log, bool disable) + : this(log, disable ? Level.Off : Level.Debug) + { + } + public LogSpy(ILog log) : this(log, false) { } public LogSpy(System.Type loggerType) : this(LogManager.GetLogger(loggerType), false) { } public LogSpy(System.Type loggerType, bool disable) : this(LogManager.GetLogger(loggerType), disable) { } Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Fixture.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -0,0 +1,93 @@ +using log4net; +using NHibernate.Cfg; +using NUnit.Framework; +using log4net.Core; + +namespace NHibernate.Test.NHSpecificTest.NH1093 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void Configure(Configuration configuration) + { + configuration.SetProperty(Environment.CacheProvider, string.Empty); + configuration.SetProperty(Environment.UseQueryCache, "true"); + configuration.SetProperty(Environment.UseSecondLevelCache, "true"); + } + + protected override string CacheConcurrencyStrategy + { + get { return null; } + } + + private void Cleanup() + { + using (ISession s = sessions.OpenSession()) + { + using (s.BeginTransaction()) + { + s.CreateQuery("delete from SimpleCached").ExecuteUpdate(); + s.Transaction.Commit(); + } + } + } + + private void FillDb() + { + using (ISession s = sessions.OpenSession()) + { + using (ITransaction tx = s.BeginTransaction()) + { + s.Save(new SimpleCached {Description = "Simple 1"}); + s.Save(new SimpleCached {Description = "Simple 2"}); + tx.Commit(); + } + } + } + + [Test] + [Description("Without configured cache, shouldn't throw exception")] + public void NoException() + { + FillDb(); + NormalList(); + CriteriaQueryCache(); + HqlQueryCache(); + Cleanup(); + } + + private void HqlQueryCache() + { + using (ISession s = OpenSession()) + { + s.CreateQuery("from SimpleCached").SetCacheable(true).List<SimpleCached>(); + } + } + + private void CriteriaQueryCache() + { + using (ISession s = OpenSession()) + { + s.CreateCriteria<SimpleCached>().SetCacheable(true).List<SimpleCached>(); + } + } + + private void NormalList() + { + using (ISession s = OpenSession()) + { + s.CreateCriteria<SimpleCached>().List<SimpleCached>(); + } + } + + protected override void BuildSessionFactory() + { + // Without configured cache, should log warn. + using (var ls = new LogSpy(LogManager.GetLogger("NHibernate"), Level.Warn)) + { + base.BuildSessionFactory(); + Assert.That(ls.GetWholeLog(), Text.Contains("Fake cache used")); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/Mappings.hbm.xml 2009-05-17 16:35:57 UTC (rev 4333) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1093"> + + <class name="SimpleCached"> + <cache region="something" usage="nonstrict-read-write"/> + <id name="Id"> + <generator class="native"/> + </id> + <property name="Description"/> + </class> + +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/SimpleCached.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/SimpleCached.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1093/SimpleCached.cs 2009-05-17 16:35:57 UTC (rev 4333) @@ -0,0 +1,8 @@ +namespace NHibernate.Test.NHSpecificTest.NH1093 +{ + public class SimpleCached + { + public virtual int Id { get; set; } + public virtual string Description { get; set; } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 05:37:33 UTC (rev 4332) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-17 16:35:57 UTC (rev 4333) @@ -334,6 +334,8 @@ <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagPartialNameFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> + <Compile Include="NHSpecificTest\NH1093\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1093\SimpleCached.cs" /> <Compile Include="NHSpecificTest\NH1264\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1264\Name.cs" /> <Compile Include="NHSpecificTest\NH1264\Passenger.cs" /> @@ -1804,6 +1806,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1093\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1714\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1763\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsNoName.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-17 05:37:38
|
Revision: 4332 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4332&view=rev Author: fabiomaulo Date: 2009-05-17 05:37:33 +0000 (Sun, 17 May 2009) Log Message: ----------- Fixed wrong mapping in NH-1391 test Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture2.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture.cs 2009-05-16 16:12:10 UTC (rev 4331) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture.cs 2009-05-17 05:37:33 UTC (rev 4332) @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Text; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.NH1391 { - [TestFixture,Ignore] + [TestFixture] public class Fixture:BugTestCase { protected override void OnSetUp() Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture2.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture2.cs 2009-05-16 16:12:10 UTC (rev 4331) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Fixture2.cs 2009-05-17 05:37:33 UTC (rev 4332) @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; +using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.NH1391 { - [TestFixture,Ignore] + [TestFixture] public class Fixture2:BugTestCase { protected override void OnSetUp() Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Mappings.hbm.xml 2009-05-16 16:12:10 UTC (rev 4331) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1391/Mappings.hbm.xml 2009-05-17 05:37:33 UTC (rev 4332) @@ -7,7 +7,7 @@ <id name="Id" type="int"> <generator class="native"/> </id> - <discriminator column="AnimalType" type="int"/> + <discriminator column="AnimalType" type="int" force="true"/> <property name="Name" type="string"/> <many-to-one name="Owner" class="Person" column="OwnerId"/> <subclass name="Cat" discriminator-value="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 16:12:12
|
Revision: 4331 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4331&view=rev Author: fabiomaulo Date: 2009-05-16 16:12:10 +0000 (Sat, 16 May 2009) Log Message: ----------- Removed unused folder (ignored by actual committers). Removed Paths: ------------- trunk/Documentation/ 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: <aye...@us...> - 2009-05-16 11:31:23
|
Revision: 4329 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4329&view=rev Author: ayenderahien Date: 2009-05-16 11:31:17 +0000 (Sat, 16 May 2009) Log Message: ----------- minor logging changes - making it easer for humans to read them Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-16 08:09:29 UTC (rev 4328) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-16 11:31:17 UTC (rev 4329) @@ -226,7 +226,7 @@ if (log.IsDebugEnabled) { - log.Debug(string.Format("[session-id={0}]opened session at timestamp:{1}", sessionId, timestamp)); + log.Debug(string.Format("[session-id={0}] opened session at timestamp:{1}", sessionId, timestamp)); } CheckAndUpdateSessionStatus(); @@ -1654,7 +1654,7 @@ { using (new SessionIdLoggingContext(sessionId)) { - log.Debug(string.Format("[session-id={0}]running ISession.Dispose()",sessionId)); + log.Debug(string.Format("[session-id={0}] running ISession.Dispose()",sessionId)); if (TakingPartInDtcTransaction) { shouldCloseSessionOnDtcTransactionCompleted = true; @@ -1683,7 +1683,7 @@ return; } - log.Debug(string.Format("[session-id={0}]executing real Dispose({1})", sessionId, isDisposing)); + log.Debug(string.Format("[session-id={0}] executing real Dispose({1})", sessionId, isDisposing)); // free managed resources that are being managed by the session if we // know this call came through Dispose() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-05-16 08:09:36
|
Revision: 4328 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4328&view=rev Author: ayenderahien Date: 2009-05-16 08:09:29 +0000 (Sat, 16 May 2009) Log Message: ----------- NH-1714 - changing GetSession to create a new child session if asking for a session with the same entity mode Allows to continue using the same audit scenarios Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/DomainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/LogClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/SimpleReproductionFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/UseCaseDemonstrationFixture.cs Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-16 07:30:51 UTC (rev 4327) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-05-16 08:09:29 UTC (rev 4328) @@ -2332,10 +2332,15 @@ { using (new SessionIdLoggingContext(sessionId)) { - if (this.entityMode.Equals(entityMode)) - { - return this; - } + // This is explicitly removed to allow support + // for child sessions that want to flush during + // the parent session lifecycle. See NH-1714, + // and the suggested audit examples. + // + //if (this.entityMode.Equals(entityMode)) + //{ + // return this; + //} if (rootSession != null) { Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/DomainClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/DomainClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/DomainClass.cs 2009-05-16 08:09:29 UTC (rev 4328) @@ -0,0 +1,22 @@ + + +namespace NHibernate.Test.NHSpecificTest.NH1714 +{ + public class DomainClass + { + private byte[] byteData; + private int id; + + public int Id + { + get { return id; } + set { id = value; } + } + + public byte[] ByteData + { + get { return byteData; } + set { byteData = value; } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/LogClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/LogClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/LogClass.cs 2009-05-16 08:09:29 UTC (rev 4328) @@ -0,0 +1,20 @@ +namespace NHibernate.Test.NHSpecificTest.NH1714 +{ + public class LogClass + { + private byte[] byteData; + private int id; + + public int Id + { + get { return id; } + set { id = value; } + } + + public byte[] ByteData + { + get { return byteData; } + set { byteData = value; } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/Mappings.hbm.xml 2009-05-16 08:09:29 UTC (rev 4328) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1714" default-access="field.camelcase" + default-lazy="false"> + <class name="DomainClass"> + <id name="Id"> + <generator class="native" /> + </id> + <property name="ByteData" /> + </class> + <class name="LogClass"> + <id name="Id"> + <generator class="native" /> + </id> + </class> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/SimpleReproductionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/SimpleReproductionFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/SimpleReproductionFixture.cs 2009-05-16 08:09:29 UTC (rev 4328) @@ -0,0 +1,43 @@ +using System; +using NHibernate.Dialect; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1714 +{ + [TestFixture] + public class SimpleReproductionFixture : BugTestCase + { + protected override bool AppliesTo(NHibernate.Dialect.Dialect dialect) + { + return dialect as MsSql2005Dialect != null; + } + + [Test] + public void DbCommandsFromEventListenerShouldBeEnlistedInRunningTransaction() + { + using (ISession session = OpenSession()) + { + using (var tx = session.BeginTransaction()) + { + var entity = new DomainClass(); + session.Save(entity); + + using (var otherSession = session.GetSession(EntityMode.Poco)) + { + otherSession.Save(new DomainClass()); + otherSession.Flush(); + } + + tx.Commit(); + } + } + + using(var session = OpenSession()) + using (var tx = session.BeginTransaction()) + { + session.Delete("from DomainClass"); + tx.Commit(); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/UseCaseDemonstrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/UseCaseDemonstrationFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1714/UseCaseDemonstrationFixture.cs 2009-05-16 08:09:29 UTC (rev 4328) @@ -0,0 +1,73 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using NHibernate.Dialect; +using NHibernate.Event; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1714 +{ + [TestFixture] + public class UseCaseDemonstrationFixture : BugTestCase + { + protected override void OnSetUp() + { + base.OnSetUp(); + var listener = new IPreInsertEventListener[this.cfg.EventListeners.PreInsertEventListeners.Length + 1]; + this.cfg.EventListeners.PreInsertEventListeners.CopyTo(listener, 0); + listener[listener.Length - 1] = new MyCustomEventListener(); + + this.cfg.EventListeners.PreInsertEventListeners = listener; + } + + protected override bool AppliesTo(NHibernate.Dialect.Dialect dialect) + { + return dialect as MsSql2005Dialect != null; + } + + [Test] + public void DbCommandsFromEventListenerShouldBeEnlistedInRunningTransaction() + { + using (ISession session = this.OpenSession()) + { + using (var tx = session.BeginTransaction()) + { + var entity = new DomainClass(); + session.Save(entity); + + tx.Commit(); + } + } + + using (ISession session = this.OpenSession()) + { + using (var tx = session.BeginTransaction()) + { + session.Delete("from DomainClass"); + session.Delete("from LogClass"); + tx.Commit(); + } + } + } + } + + public class MyCustomEventListener : IPreInsertEventListener + { + public bool OnPreInsert(PreInsertEvent e) + { + if(e.Entity is DomainClass == false) + return false; + + // this will join into the parent's transaction + using (var session = e.Session.GetSession(EntityMode.Poco)) + { + //should insert log record here + session.Save(new LogClass()); + session.Flush(); + } + + return false; + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-16 07:30:51 UTC (rev 4327) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-16 08:09:29 UTC (rev 4328) @@ -387,6 +387,10 @@ <Compile Include="NHSpecificTest\NH1713\Fixture.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="NHSpecificTest\NH1714\DomainClass.cs" /> + <Compile Include="NHSpecificTest\NH1714\LogClass.cs" /> + <Compile Include="NHSpecificTest\NH1714\SimpleReproductionFixture.cs" /> + <Compile Include="NHSpecificTest\NH1714\UseCaseDemonstrationFixture.cs" /> <Compile Include="NHSpecificTest\NH1715\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1715\ClassA.cs" /> <Compile Include="NHSpecificTest\NH1716\ClassA.cs" /> @@ -1800,6 +1804,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1714\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1763\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsNoName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsPartialName.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-05-16 07:30:57
|
Revision: 4327 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4327&view=rev Author: ayenderahien Date: 2009-05-16 07:30:51 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixing NH-1169 - Will only throw an error if SqlCommandSet is actually used (will make using NHibernate with Sql Server on Mono easier) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/SqlClientCommandSet.cs Modified: trunk/nhibernate/src/NHibernate/Impl/SqlClientCommandSet.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SqlClientCommandSet.cs 2009-05-16 06:17:39 UTC (rev 4326) +++ trunk/nhibernate/src/NHibernate/Impl/SqlClientCommandSet.cs 2009-05-16 07:30:51 UTC (rev 4327) @@ -1,5 +1,6 @@ using System; +using System.Data; using System.Data.SqlClient; using System.Diagnostics; using System.Reflection; @@ -12,13 +13,19 @@ static SqlClientCommandSet() { - Assembly sysData = Assembly.Load("System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + Assembly sysData = typeof(IDbConnection).Assembly; sqlCmdSetType = sysData.GetType("System.Data.SqlClient.SqlCommandSet"); - Debug.Assert(sqlCmdSetType != null, "Could not find SqlCommandSet!"); } protected override object CreateInternalCommandSet() { + if (sqlCmdSetType == null) + { + throw new HibernateException("Could not find SqlCommandSet"+Environment.NewLine + + "If you are running on Mono, batching support isn't implemented on Mono" + Environment.NewLine + + "If you are running on Microsoft .NET, this probably means that internal details"+Environment.NewLine+ + "of the BCL that we rely on to allow this have changed, this is a bug. Please inform the developers"); + } return Activator.CreateInstance(sqlCmdSetType, true); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-05-16 06:17:49
|
Revision: 4326 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4326&view=rev Author: ayenderahien Date: 2009-05-16 06:17:39 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixing NH-1763 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/ConditionalProjection.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/DomainClass.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/EmptyStringUserType.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/SampleTest.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/ConditionalProjection.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/ConditionalProjection.cs 2009-05-16 06:00:06 UTC (rev 4325) +++ trunk/nhibernate/src/NHibernate/Criterion/ConditionalProjection.cs 2009-05-16 06:17:39 UTC (rev 4326) @@ -74,7 +74,7 @@ { for (int i = 0; i < trueTypes.Length; i++) { - if(trueTypes[i] != falseTypes[i]) + if(trueTypes[i].Equals(falseTypes[i]) == false) { areEqual = false; break; Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/DomainClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/DomainClass.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/DomainClass.cs 2009-05-16 06:17:39 UTC (rev 4326) @@ -0,0 +1,11 @@ +using System; + +namespace NHibernate.Test.NHSpecificTest.NH1763 +{ + public class Customer + { + public Int32 Id { get; set; } + public String Name { get; set; } + public string Name2 { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/EmptyStringUserType.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/EmptyStringUserType.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/EmptyStringUserType.cs 2009-05-16 06:17:39 UTC (rev 4326) @@ -0,0 +1,110 @@ +using System; +using NHibernate.Engine; +using NHibernate.UserTypes; + +namespace NHibernate.Test.NHSpecificTest.NH1763 +{ + /// <summary> + /// Summary description for EmptyStringUserType + /// </summary> + [Serializable] + public class EmptyStringUserType : ICompositeUserType + { + public EmptyStringUserType() + { + } + + public System.Type ReturnedClass + { + get + { + return typeof(string); + } + } + public bool IsMutable + { + get { return true; } + } + public String[] PropertyNames + { + get + { + return new String[] { "string" }; + } + } + + public NHibernate.Type.IType[] PropertyTypes + { + get + { + return new NHibernate.Type.IType[] { NHibernateUtil.String }; + } + } + public object Assemble(object cached, NHibernate.Engine.ISessionImplementor session, object owner) + { + return DeepCopy(cached); + } + + public object Disassemble(Object value, NHibernate.Engine.ISessionImplementor session) + { + return DeepCopy(value); + } + public Object DeepCopy(Object a) + { + if (a == null) return null; + return a; + } + + public new bool Equals(object x, object y) + { + return (x == y) || (x != null && y != null && (x.Equals(y))); + } + + public object NullSafeGet(System.Data.IDataReader rs, String[] names, NHibernate.Engine.ISessionImplementor session, Object owner) + { + return NHibernateUtil.String.NullSafeGet(rs, names[0], session, owner); + } + + public void NullSafeSet(System.Data.IDbCommand st, Object value, int index, NHibernate.Engine.ISessionImplementor session) + { + string str = null; + if (value != null) str = value.ToString().Trim(); + if (str == String.Empty) + { + str = null; + NHibernateUtil.String.NullSafeSet(st, str, index, session); + } + else + NHibernateUtil.String.NullSafeSet(st, value, index, session); + + } + + public Object GetPropertyValue(Object component, int property) + { + return null; + } + + public void SetPropertyValue(Object object1, int i, Object object2) + { + + } + + + #region ICompositeUserType Members + + + public int GetHashCode(object x) + { + return x == null ? typeof(string).GetHashCode() : x.GetHashCode(); + + } + + public object Replace(object original, object target, ISessionImplementor session, object owner) + { + return DeepCopy(original); + } + + + #endregion + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/Mappings.hbm.xml 2009-05-16 06:17:39 UTC (rev 4326) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1763" + default-lazy="false"> + + <class name="Customer"> + <id name="Id"> + <generator class="native" /> + </id> + <property name="Name" type="NHibernate.Test.NHSpecificTest.NH1763.EmptyStringUserType, NHibernate.Test"> + <column name="Name"/> + </property> + <property name="Name2" type="NHibernate.Test.NHSpecificTest.NH1763.EmptyStringUserType, NHibernate.Test"> + <column name="Name2"/> + </property> + </class> + +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/SampleTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/SampleTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1763/SampleTest.cs 2009-05-16 06:17:39 UTC (rev 4326) @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1763 +{ + [TestFixture] + public class SampleTest : BugTestCase + { + [Test] + public void CanUseConditionalOnCompositeType() + { + using (ISession session = OpenSession()) + { + session.CreateCriteria<Customer>() + .SetProjection(Projections.Conditional(Restrictions.IdEq(1), + Projections.Property("Name"), + Projections.Property("Name2"))) + .List(); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-16 06:00:06 UTC (rev 4325) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-16 06:17:39 UTC (rev 4326) @@ -399,6 +399,9 @@ <Compile Include="NHSpecificTest\NH1742\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1760\DomainClass.cs" /> <Compile Include="NHSpecificTest\NH1760\SampleTest.cs" /> + <Compile Include="NHSpecificTest\NH1763\DomainClass.cs" /> + <Compile Include="NHSpecificTest\NH1763\EmptyStringUserType.cs" /> + <Compile Include="NHSpecificTest\NH1763\SampleTest.cs" /> <Compile Include="NHSpecificTest\NH1773\Domain.cs" /> <Compile Include="NHSpecificTest\NH1773\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1775\Domain.cs" /> @@ -1797,6 +1800,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1763\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsNoName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsPartialName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1343\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-16 06:00:08
|
Revision: 4325 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4325&view=rev Author: fabiomaulo Date: 2009-05-16 06:00:06 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixed some problems in the Example an Performance prjs... btw both are obsolete. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml Property Changed: ---------------- trunk/nhibernate/src/NHibernate.Examples/ Property changes on: trunk/nhibernate/src/NHibernate.Examples ___________________________________________________________________ Modified: svn:ignore - bin obj .#* *.user *.xsx [Bb]in [Dd]ebug [Rr]elease *.aps *.eto + bin obj .#* *.user *.xsx [Bb]in [Dd]ebug [Rr]elease *.aps *.eto hibernate.cfg.xml Modified: trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/Blogger/BloggerFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -39,7 +39,7 @@ // reload the blog to verify the db has the correct values ISession s = _sessions.OpenSession(); - blog = (Blog) s.Find("from Blog as b where b.Name=:name", "GregBlog", NHibernateUtil.String)[0]; + blog = s.CreateQuery("from Blog as b where b.Name=:name").SetString("name","GregBlog").List<Blog>()[0]; Assert.IsNotNull(blog); Assert.AreEqual(2, blog.Items.Count); @@ -98,7 +98,7 @@ public void Configure() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddClass(typeof(Blog)); cfg.AddClass(typeof(BlogItem)); _sessions = cfg.BuildSessionFactory(); @@ -106,7 +106,7 @@ public void ExportTables() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddClass(typeof(Blog)); cfg.AddClass(typeof(BlogItem)); new SchemaExport(cfg).Create(true, true); Modified: trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/Cascades/CascadeFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -19,7 +19,7 @@ [SetUp] public void SetUp() { - cfg = new Configuration(); + cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddAssembly("NHibernate.Examples"); new SchemaExport(cfg).Create(true, true); Modified: trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029/MemberFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -19,7 +19,7 @@ [Test] public void ValidateQuickStart() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddResource("NHibernate.Examples.ForumQuestions.T1078029.Member.hbm.xml", Assembly.Load("NHibernate.Examples")); ISessionFactory factory = cfg.BuildSessionFactory(); Modified: trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/ForumQuestions/TestCase.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -27,7 +27,7 @@ public void ExportSchema(string[] files, bool exportSchema) { - cfg = new Configuration(); + cfg = TestConfigurationHelper.GetDefaultConfiguration(); for (int i = 0; i < files.Length; i++) { Modified: trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/NHibernate.Examples.csproj 2009-05-16 06:00:06 UTC (rev 4325) @@ -154,7 +154,7 @@ <Compile Include="QuickStart\UserFixture.cs"> <SubType>Code</SubType> </Compile> - <Content Include="hibernate.cfg.xml" /> + <Compile Include="TestConfigurationHelper.cs" /> <EmbeddedResource Include="Blogger\Blog.hbm.xml" /> <EmbeddedResource Include="Blogger\BlogItem.hbm.xml" /> <EmbeddedResource Include="Cascades\Alias.hbm.xml" /> @@ -181,9 +181,10 @@ </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> - <PreBuildEvent>copy /y "$(ProjectDir)App.config" "$(TargetPath).config" -copy /y "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml"</PreBuildEvent> - <PostBuildEvent> - </PostBuildEvent> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent>copy "$(ProjectDir)App.config" "$(TargetPath).config" +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 Modified: trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/QuickStart/UserFixture.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -16,7 +16,7 @@ [Test] public void ValidateQuickStart() { - Configuration cfg = new Configuration(); + Configuration cfg = TestConfigurationHelper.GetDefaultConfiguration(); cfg.AddAssembly("NHibernate.Examples"); ISessionFactory factory = cfg.BuildSessionFactory(); Copied: trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs (from rev 4323, trunk/nhibernate/src/NHibernate.Test/TestConfigurationHelper.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Examples/TestConfigurationHelper.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -0,0 +1,40 @@ +using System; +using System.IO; +using NHibernate.Cfg; + +namespace NHibernate.Examples +{ + 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 Deleted: trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Examples/hibernate.cfg.xml 2009-05-16 06:00:06 UTC (rev 4325) @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > - <session-factory name="NHibernate.Test"> - <!-- properties --> - <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> - <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> - <property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;Integrated Security=SSPI</property> - <property name="show_sql">false</property> - <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> - <property name="use_outer_join">true</property> - <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> - <!-- mapping files --> - <mapping assembly="NHibernate.Examples" /> - </session-factory> - -</hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs 2009-05-16 00:59:51 UTC (rev 4324) +++ trunk/nhibernate/src/NHibernate.Test.Performance/PerformanceTest.cs 2009-05-16 06:00:06 UTC (rev 4325) @@ -62,7 +62,7 @@ driver = (DriverBase) Activator.CreateInstance(System.Type.GetType(driverClass)); - string prepare = (string) cfg.Properties[Environment.PrepareSql] as string; + string prepare = cfg.GetProperty(Environment.PrepareSql); if (prepare == "true") { prepareSql = true; 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-15 22:59:19
|
Revision: 4323 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4323&view=rev Author: fabiomaulo Date: 2009-05-15 22:59:12 +0000 (Fri, 15 May 2009) Log Message: ----------- Fix NH-1780 and related Modified Paths: -------------- trunk/nhibernate/doc/reference/modules/component_mapping.xml trunk/nhibernate/doc/reference/modules/example_parentchild.xml Modified: trunk/nhibernate/doc/reference/modules/component_mapping.xml =================================================================== --- trunk/nhibernate/doc/reference/modules/component_mapping.xml 2009-05-15 22:37:17 UTC (rev 4322) +++ trunk/nhibernate/doc/reference/modules/component_mapping.xml 2009-05-15 22:59:12 UTC (rev 4323) @@ -270,14 +270,14 @@ </para> <para> - You may instead implement <literal>IInterceptor.IsUnsaved()</literal> if + You may instead implement <literal>IInterceptor.IsTransient()</literal> if you wish to use <literal>SaveOrUpdate()</literal> or cascading save / update. As an alternative, you may also set the <literal>unsaved-value</literal> attribute on a <literal><version></literal> (or <literal><timestamp></literal>) element to specify a value that indicates a new transient instance. In this case, the version of the entity is used instead of the (assigned) identifier and you don't have - to implement <literal>IInterceptor.IsUnsaved()</literal> yourself. + to implement <literal>IInterceptor.IsTransient()</literal> yourself. </para> <para> Modified: trunk/nhibernate/doc/reference/modules/example_parentchild.xml =================================================================== --- trunk/nhibernate/doc/reference/modules/example_parentchild.xml 2009-05-15 22:37:17 UTC (rev 4322) +++ trunk/nhibernate/doc/reference/modules/example_parentchild.xml 2009-05-15 22:59:12 UTC (rev 4323) @@ -310,7 +310,7 @@ <para> There is one further possibility. There is a new <literal>IInterceptor</literal> method named - <literal>IsUnsaved()</literal> which lets the application implement its own strategy for distinguishing + <literal>IsTransient()</literal> which lets the application implement its own strategy for distinguishing newly instantiated objects. For example, you could define a base class for your persistent classes. </para> @@ -338,11 +338,12 @@ <para> (The <literal>saved</literal> property is non-persistent.) - Now implement <literal>IsUnsaved()</literal>, along with <literal>OnLoad()</literal> + Now implement <literal>IsTransient()</literal>, along with <literal>OnLoad()</literal> and <literal>OnSave()</literal> as follows. </para> - <programlisting><![CDATA[public object IsUnsaved(object entity) + <programlisting> + <![CDATA[public object IsTransient(object entity) { if (entity is Persistent) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 22:37:23
|
Revision: 4322 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4322&view=rev Author: fabiomaulo Date: 2009-05-15 22:37:17 +0000 (Fri, 15 May 2009) Log Message: ----------- Final improvement of type name recognition on <element> Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/CollectionBinder.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagNoNameFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsNoName.hbm.xml Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/CollectionBinder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/CollectionBinder.cs 2009-05-15 21:47:20 UTC (rev 4321) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/CollectionBinder.cs 2009-05-15 22:37:17 UTC (rev 4322) @@ -596,8 +596,22 @@ } else if ("element".Equals(name)) { - SimpleValue elt = new SimpleValue(model.CollectionTable); + var elt = new SimpleValue(model.CollectionTable); model.Element = elt; + if(model.IsGeneric) + { + switch (model.GenericArguments.Length) + { + case 1: + // a collection with a generic type parameter + elt.TypeName = model.GenericArguments[0].AssemblyQualifiedName; + break; + case 2: + // a map (IDictionary) with 2 parameters + elt.TypeName = model.GenericArguments[1].AssemblyQualifiedName; + break; + } + } BindSimpleValue(subnode, elt, true, Mapping.Collection.DefaultElementColumnName); } else if ("many-to-many".Equals(name)) Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagNoNameFixture.cs (from rev 4321, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagPartialNameFixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagNoNameFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagNoNameFixture.cs 2009-05-15 22:37:17 UTC (rev 4322) @@ -0,0 +1,14 @@ +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.ElementsEnums +{ + [TestFixture] + public class IntEnumsBagNoNameFixture : AbstractIntEnumsBagFixture + { + protected override IList Mappings + { + get { return new[] { "NHSpecificTest.ElementsEnums.SimpleWithEnumsNoName.hbm.xml" }; } + } + } +} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsNoName.hbm.xml (from rev 4321, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsPartialName.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsNoName.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsNoName.hbm.xml 2009-05-15 22:37:17 UTC (rev 4322) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.ElementsEnums"> + + <class name="SimpleWithEnums"> + <id type="int"> + <generator class="native"/> + </id> + + <property name="Something"/> + <bag name="Things"> + <key column="bid"/> + <element column="enumvalue"/> + </bag> + </class> +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 21:47:20 UTC (rev 4321) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 22:37:17 UTC (rev 4322) @@ -330,6 +330,7 @@ <Compile Include="MappingTest\NonReflectiveBinderFixture.cs" /> <Compile Include="MappingTest\Wicked.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\AbstractIntEnumsBagFixture.cs" /> + <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagNoNameFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagPartialNameFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> @@ -1796,6 +1797,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsNoName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsPartialName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1343\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1264\Passenger.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 21:47:25
|
Revision: 4321 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4321&view=rev Author: fabiomaulo Date: 2009-05-15 21:47:20 +0000 (Fri, 15 May 2009) Log Message: ----------- Improv class <type> recognition on <element> Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagPartialNameFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsPartialName.hbm.xml Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs 2009-05-15 20:55:13 UTC (rev 4320) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs 2009-05-15 21:47:20 UTC (rev 4321) @@ -7,6 +7,7 @@ using log4net; using NHibernate.Mapping; +using NHibernate.Type; using NHibernate.Util; using NHibernate.Cfg.MappingSchema; @@ -69,6 +70,24 @@ return TypeNameParser.Parse(className, mappings.DefaultNamespace, mappings.DefaultAssembly).Type; } + protected static bool NeedQualifiedClassName(string className) + { + if(string.IsNullOrEmpty(className)) + { + return false; + } + if(className.IndexOf('.') > 0) + { + return false; + } + if(TypeFactory.Basic(className) != null) + { + return false; + } + + return true; + } + /// <summary> /// Attempts to find a type by its full name. Throws a <see cref="MappingException" /> /// using the provided <paramref name="errorMessage" /> in case of failure. Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-05-15 20:55:13 UTC (rev 4320) +++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2009-05-15 21:47:20 UTC (rev 4321) @@ -833,7 +833,13 @@ simpleValue.TypeParameters = parameters; if (typeName != null) + { + if(NeedQualifiedClassName(typeName)) + { + typeName = FullQualifiedClassName(typeName, mappings); + } simpleValue.TypeName = typeName; + } } private void BindColumnsOrFormula(XmlNode node, SimpleValue simpleValue, string path, bool isNullable) Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagPartialNameFixture.cs (from rev 4320, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagPartialNameFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagPartialNameFixture.cs 2009-05-15 21:47:20 UTC (rev 4321) @@ -0,0 +1,14 @@ +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.ElementsEnums +{ + [TestFixture] + public class IntEnumsBagPartialNameFixture : AbstractIntEnumsBagFixture + { + protected override IList Mappings + { + get { return new[] { "NHSpecificTest.ElementsEnums.SimpleWithEnumsPartialName.hbm.xml" }; } + } + } +} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsPartialName.hbm.xml (from rev 4318, trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnums.hbm.xml) =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsPartialName.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/SimpleWithEnumsPartialName.hbm.xml 2009-05-15 21:47:20 UTC (rev 4321) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.ElementsEnums"> + + <class name="SimpleWithEnums"> + <id type="int"> + <generator class="native"/> + </id> + + <property name="Something"/> + <bag name="Things"> + <key column="bid"/> + <element type="Something" column="enumvalue"/> + </bag> + </class> +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:55:13 UTC (rev 4320) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 21:47:20 UTC (rev 4321) @@ -330,6 +330,7 @@ <Compile Include="MappingTest\NonReflectiveBinderFixture.cs" /> <Compile Include="MappingTest\Wicked.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\AbstractIntEnumsBagFixture.cs" /> + <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagPartialNameFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> <Compile Include="NHSpecificTest\NH1264\Fixture.cs" /> @@ -1795,6 +1796,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnumsPartialName.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1343\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1264\Passenger.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1264\Reservation.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 20:55:19
|
Revision: 4320 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4320&view=rev Author: fabiomaulo Date: 2009-05-15 20:55:13 +0000 (Fri, 15 May 2009) Log Message: ----------- Preparing test to work with different mappings Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs 2009-05-15 20:55:13 UTC (rev 4320) @@ -0,0 +1,41 @@ +using NUnit.Framework; +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.ElementsEnums +{ + public abstract class AbstractIntEnumsBagFixture : TestCase + { + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + [Test] + [Description("Should load the list of enums (NH-1772)")] + public void LoadEnums() + { + object savedId; + using (ISession s = OpenSession()) + using (s.BeginTransaction()) + { + savedId = s.Save(new SimpleWithEnums { Things = new List<Something> { Something.B, Something.C, Something.D, Something.E } }); + s.Transaction.Commit(); + } + + using (ISession s = OpenSession()) + using (s.BeginTransaction()) + { + var swe = s.Get<SimpleWithEnums>(savedId); + Assert.That(swe.Things, Is.EqualTo(new[] { Something.B, Something.C, Something.D, Something.E })); + s.Transaction.Commit(); + } + + using (ISession s = OpenSession()) + using (s.BeginTransaction()) + { + s.Delete("from SimpleWithEnums"); + s.Transaction.Commit(); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs 2009-05-15 20:39:11 UTC (rev 4319) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs 2009-05-15 20:55:13 UTC (rev 4320) @@ -1,48 +1,14 @@ using System.Collections; -using System.Collections.Generic; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest.ElementsEnums { [TestFixture] - public class IntEnumsBagFixture : TestCase + public class IntEnumsBagFixture : AbstractIntEnumsBagFixture { protected override IList Mappings { get { return new[] { "NHSpecificTest.ElementsEnums.SimpleWithEnums.hbm.xml" }; } } - - protected override string MappingsAssembly - { - get { return "NHibernate.Test"; } - } - - [Test] - [Description("Should load the list of enums (NH-1772)")] - public void LoadEnums() - { - object savedId; - using (ISession s = OpenSession()) - using (s.BeginTransaction()) - { - savedId = s.Save(new SimpleWithEnums { Things = new List<Something> { Something.B, Something.C, Something.D, Something.E } }); - s.Transaction.Commit(); - } - - using (ISession s = OpenSession()) - using (s.BeginTransaction()) - { - var swe = s.Get<SimpleWithEnums>(savedId); - Assert.That(swe.Things, Is.EqualTo(new[] {Something.B, Something.C, Something.D, Something.E})); - s.Transaction.Commit(); - } - - using (ISession s = OpenSession()) - using (s.BeginTransaction()) - { - s.Delete("from SimpleWithEnums"); - s.Transaction.Commit(); - } - } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:39:11 UTC (rev 4319) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:55:13 UTC (rev 4320) @@ -329,6 +329,7 @@ <Compile Include="HQL\BaseFunctionFixture.cs" /> <Compile Include="MappingTest\NonReflectiveBinderFixture.cs" /> <Compile Include="MappingTest\Wicked.cs" /> + <Compile Include="NHSpecificTest\ElementsEnums\AbstractIntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> <Compile Include="NHSpecificTest\NH1264\Fixture.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 20:39:19
|
Revision: 4319 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4319&view=rev Author: fabiomaulo Date: 2009-05-15 20:39:11 +0000 (Fri, 15 May 2009) Log Message: ----------- Fixed NH-1343 (by the new parser) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/OrderLine.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Product.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/ProductFixture.cs Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Mappings.hbm.xml 2009-05-15 20:39:11 UTC (rev 4319) @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1343"> + + <class name="OrderLine"> + <id name ="Id"> + <generator class="native" /> + </id> + + <many-to-one name="Product" class="Product" column="ProductID" /> + + <property name="Description"/> + </class> + + <class name="Product"> + <id name ="Id"> + <generator class="native" /> + </id> + <property name="Description"/> + </class> + + <query name="GetLinesForProduct"> + from OrderLine ol + where Product = :product + </query> + + <query name="GetLinesForProductWithAlias"> + from OrderLine ol + where ol.Product = :product + </query> +</hibernate-mapping> \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/OrderLine.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/OrderLine.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/OrderLine.cs 2009-05-15 20:39:11 UTC (rev 4319) @@ -0,0 +1,19 @@ +namespace NHibernate.Test.NHSpecificTest.NH1343 +{ + public class OrderLine + { + protected OrderLine() {} + + public OrderLine(string description, Product product) + { + Description = description; + Product = product; + } + + public virtual int Id { get; private set; } + + public virtual string Description { get; set; } + + public virtual Product Product { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Product.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Product.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/Product.cs 2009-05-15 20:39:11 UTC (rev 4319) @@ -0,0 +1,16 @@ +namespace NHibernate.Test.NHSpecificTest.NH1343 +{ + public class Product + { + protected Product() {} + + public Product(string description) + { + Description = description; + } + + public virtual int Id { get; set; } + + public virtual string Description { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/ProductFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/ProductFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1343/ProductFixture.cs 2009-05-15 20:39:11 UTC (rev 4319) @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1343 +{ + [TestFixture] + public class ProductFixture : BugTestCase + { + protected override void OnTearDown() + { + using (ISession session = OpenSession()) + { + session.Delete("from OrderLine"); + session.Delete("from Product"); + session.Flush(); + } + } + + [Test] + public void ProductQueryPassesParsingButFails() + { + Product product1 = new Product("product1"); + OrderLine orderLine = new OrderLine("1", product1); + + using (ISession session = OpenSession()) + { + session.Save(product1); + session.Save(orderLine); + session.Flush(); + + IQuery query = session.GetNamedQuery("GetLinesForProduct"); + query.SetParameter("product", product1); + IList<OrderLine> list = query.List<OrderLine>(); + Assert.AreEqual(1, list.Count); + } + } + + [Test] + public void ProductQueryPassesAndExecutesRightIfPuttingAlias() + { + Product product1 = new Product("product1"); + OrderLine orderLine = new OrderLine("1", product1); + + using (ISession session = OpenSession()) + { + session.Save(product1); + session.Save(orderLine); + session.Flush(); + + IQuery query = session.GetNamedQuery("GetLinesForProductWithAlias"); + query.SetParameter("product", product1); + IList<OrderLine> list = query.List<OrderLine>(); + Assert.AreEqual(1, list.Count); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:28:58 UTC (rev 4318) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:39:11 UTC (rev 4319) @@ -335,6 +335,9 @@ <Compile Include="NHSpecificTest\NH1264\Name.cs" /> <Compile Include="NHSpecificTest\NH1264\Passenger.cs" /> <Compile Include="NHSpecificTest\NH1264\Reservation.cs" /> + <Compile Include="NHSpecificTest\NH1343\OrderLine.cs" /> + <Compile Include="NHSpecificTest\NH1343\Product.cs" /> + <Compile Include="NHSpecificTest\NH1343\ProductFixture.cs" /> <Compile Include="NHSpecificTest\NH1388\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1574\Principal.cs" /> <Compile Include="NHSpecificTest\NH1574\SpecializedPrincipal.cs" /> @@ -1791,6 +1794,7 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1343\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1264\Passenger.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1264\Reservation.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1775\Member.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 20:29:07
|
Revision: 4318 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4318&view=rev Author: fabiomaulo Date: 2009-05-15 20:28:58 +0000 (Fri, 15 May 2009) Log Message: ----------- Minor (wrong assertion) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs 2009-05-15 18:47:52 UTC (rev 4317) +++ trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs 2009-05-15 20:28:58 UTC (rev 4318) @@ -120,7 +120,7 @@ sessions.Statistics.Clear(); FillDb(); string logs = sl.GetWholeLog(); - Assert.That(logs, Text.DoesNotContain("batcher").IgnoreCase); + Assert.That(logs, Text.DoesNotContain("Batch command").IgnoreCase); Assert.That(logs, Text.Contains("INSERT").IgnoreCase); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-05-15 18:47:57
|
Revision: 4317 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4317&view=rev Author: fabiomaulo Date: 2009-05-15 18:47:52 +0000 (Fri, 15 May 2009) Log Message: ----------- NH-1264 fixed in some moment in the past Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Name.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.hbm.xml Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Fixture.cs 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,79 @@ +using System.Collections; +using System.Collections.Generic; +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1264 +{ + [TestFixture] + public class Fixture : TestCase + { + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override IList Mappings + { + get { return new[] {"NHSpecificTest.NH1264.Passenger.hbm.xml", "NHSpecificTest.NH1264.Reservation.hbm.xml",}; } + } + + protected override void OnTearDown() + { + base.OnTearDown(); + using (ISession s = OpenSession()) + { + s.Delete("from Reservation r"); + s.Delete("from Passenger p"); + s.Flush(); + } + } + + [Test] + public void EagerFetchAnomaly() + { + ISession s = OpenSession(); + ITransaction t = s.BeginTransaction(); + + var mickey = new Passenger(); + mickey.Name = new Name(); + mickey.Name.First = "Mickey"; + mickey.Name.Last = "Mouse"; + mickey.FrequentFlyerNumber = "1234"; + s.Save(mickey); + + var reservation = new Reservation(); + reservation.ConfirmationNumber = "11111111111111"; + reservation.Passengers.Add(mickey); + mickey.Reservation = reservation; + s.Save(reservation); + + t.Commit(); + s.Close(); + + s = OpenSession(); + + DetachedCriteria dc = DetachedCriteria.For<Reservation>().SetFetchMode("Passengers", FetchMode.Eager); + + dc.CreateCriteria("Passengers").Add(Property.ForName("FrequentFlyerNumber").Eq("1234")); + + IList<Reservation> results = dc.GetExecutableCriteria(s).List<Reservation>(); + + s.Close(); + + Assert.AreEqual(1, results.Count); + foreach (var r in results) + { + Assert.AreEqual(1, r.Passengers.Count); + } + + s = OpenSession(); + t = s.BeginTransaction(); + + s.Delete(reservation); + + t.Commit(); + s.Close(); + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Name.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Name.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Name.cs 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1264 +{ + public class Name + { + private string first; + private string last; + private string display; + + public string First + { + get { return first; } + set { first = value; } + } + + public string Last + { + get { return last; } + set { last = value; } + } + + public string Display + { + get { return display ?? first + " " + last; } + set { display = value; } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.cs 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1264 +{ + public class Passenger + { + private int id; + + public int Id + { + get { return id; } + set { id = value; } + } + + private Name name; + + public Name Name + { + get { return name; } + set { name = value; } + } + + private string frequentFlyerNumber; + + public string FrequentFlyerNumber + { + get { return frequentFlyerNumber; } + set { frequentFlyerNumber = value; } + } + + private Reservation reservation; + + public Reservation Reservation + { + get { return reservation; } + set { reservation = value; } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Passenger.hbm.xml 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1264" + default-lazy="false"> + + <class name="Passenger"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="FrequentFlyerNumber" /> + <many-to-one name="Reservation" column="reservation_id" class="Reservation"/> + <component name="Name" class="Name"> + <property name="First" /> + <property name="Last" /> + </component> + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.cs 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1264 +{ + public class Reservation + { + private IList<Passenger> passengers; + + private int id; + + public int Id + { + get { return id; } + set { id = value; } + } + + private string confirmationNumber; + + public string ConfirmationNumber + { + get { return confirmationNumber; } + set { confirmationNumber = value; } + } + + public IList<Passenger> Passengers + { + get + { + if (passengers == null) + { + passengers = new List<Passenger>(); + } + return passengers; + } + + private set + { + passengers = value; + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1264/Reservation.hbm.xml 2009-05-15 18:47:52 UTC (rev 4317) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1264" + default-lazy="false"> + + <class name="Reservation"> + <id name="Id"> + <generator class="native"/> + </id> + <property name="ConfirmationNumber" /> + + <bag name="Passengers"> + <key column="Reservation_id"/> + <one-to-many class="Passenger"/> + </bag> + </class> + +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 16:38:45 UTC (rev 4316) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 18:47:52 UTC (rev 4317) @@ -331,6 +331,10 @@ <Compile Include="MappingTest\Wicked.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" /> <Compile Include="NHSpecificTest\ElementsEnums\Something.cs" /> + <Compile Include="NHSpecificTest\NH1264\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1264\Name.cs" /> + <Compile Include="NHSpecificTest\NH1264\Passenger.cs" /> + <Compile Include="NHSpecificTest\NH1264\Reservation.cs" /> <Compile Include="NHSpecificTest\NH1388\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1574\Principal.cs" /> <Compile Include="NHSpecificTest\NH1574\SpecializedPrincipal.cs" /> @@ -1787,6 +1791,8 @@ <EmbeddedResource Include="BulkManipulation\SimpleClass.hbm.xml" /> <EmbeddedResource Include="Ado\VerySimple.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1264\Passenger.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\NH1264\Reservation.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1775\Member.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1388\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\ElementsEnums\SimpleWithEnums.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-05-15 16:38:55
|
Revision: 4316 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4316&view=rev Author: ayenderahien Date: 2009-05-15 16:38:45 +0000 (Fri, 15 May 2009) Log Message: ----------- Will push batched command to SQL log as a single unit, or to the batcher log if the sql log is disabled Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs trunk/nhibernate/src/NHibernate/AdoNet/Util/SqlStatementLogger.cs trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs Modified: trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-15 08:02:51 UTC (rev 4315) +++ trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-15 16:38:45 UTC (rev 4316) @@ -65,8 +65,13 @@ log.Debug("Executing batch"); CheckReaders(); Prepare(currentBatch.BatchCommand); - if (log.IsDebugEnabled) + if (Factory.Settings.SqlStatementLogger.IsDebugEnabled) { + Factory.Settings.SqlStatementLogger.LogBatchCommand(currentBatchCommandsLog.ToString()); + currentBatchCommandsLog = new StringBuilder(); + } + else if (log.IsDebugEnabled) + { log.Debug(currentBatchCommandsLog.ToString()); currentBatchCommandsLog = new StringBuilder(); } Modified: trunk/nhibernate/src/NHibernate/AdoNet/Util/SqlStatementLogger.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/Util/SqlStatementLogger.cs 2009-05-15 08:02:51 UTC (rev 4315) +++ trunk/nhibernate/src/NHibernate/AdoNet/Util/SqlStatementLogger.cs 2009-05-15 16:38:45 UTC (rev 4316) @@ -139,5 +139,14 @@ { return FormatSql ? style : FormatStyle.None; } + + public void LogBatchCommand(string batchCommand) + { + log.Debug(batchCommand); + if(LogToStdout) + { + Console.Out.WriteLine("NHibernate: " + batchCommand); + } + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs 2009-05-15 08:02:51 UTC (rev 4315) +++ trunk/nhibernate/src/NHibernate.Test/Ado/BatcherFixture.cs 2009-05-15 16:38:45 UTC (rev 4316) @@ -160,6 +160,24 @@ } [Test] + public void SqlLogShouldGetBatchCommandNotification() + { + using (new LogSpy(typeof(AbstractBatcher))) + { + using (var sl = new SqlLogSpy()) + { + sessions.Statistics.Clear(); + FillDb(); + string logs = sl.GetWholeLog(); + Assert.That(logs, Text.Contains("Batch command:").IgnoreCase); + } + } + + Assert.That(sessions.Statistics.PrepareStatementCount, Is.EqualTo(1)); + Cleanup(); + } + + [Test] [Description(@"Activating the AbstractBatcher's log the log stream: -should contain well formatted SQL log info")] public void AbstractBatcherLogFormattedSql() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2009-05-15 08:03:02
|
Revision: 4315 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4315&view=rev Author: steverstrong Date: 2009-05-15 08:02:51 +0000 (Fri, 15 May 2009) Log Message: ----------- Fix and test for NH-1775 Modified Paths: -------------- 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/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/SqlGenerator.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTTreeAdaptor.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/HqlSqlWalkerTreeAdapter.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTErrorNode.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1775/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1775/Domain.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1775/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1775/Member.hbm.xml Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2009-05-15 07:46:31 UTC (rev 4314) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2009-05-15 08:02:51 UTC (rev 4315) @@ -1,4587 +1,4719 @@ -// $ANTLR 3.1.2 C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g 2009-05-05 16:12:32 - -// 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 LT = 104; - public const int EXPONENT = 123; - public const int STAR = 111; - public const int FLOAT_SUFFIX = 124; - public const int LITERAL_by = 54; - public const int CASE = 55; - public const int NEW = 37; - public const int FILTER_ENTITY = 74; - public const int PARAM = 116; - public const int COUNT = 12; - public const int NOT = 38; - public const int EOF = -1; - public const int UNARY_PLUS = 89; - public const int QUOTED_String = 117; - public const int ESCqs = 121; - public const int WEIRD_IDENT = 91; - public const int OPEN_BRACKET = 113; - public const int FULL = 23; - public const int ORDER_ELEMENT = 83; - public const int IS_NULL = 78; - public const int ESCAPE = 18; - public const int INSERT = 29; - public const int BOTH = 62; - public const int VERSIONED = 52; - public const int EQ = 99; - public const int SELECT = 45; - public const int INTO = 30; - public const int NE = 102; - public const int GE = 107; - public const int CONCAT = 108; - public const int ID_LETTER = 120; - public const int NULL = 39; - public const int ELSE = 57; - public const int SELECT_FROM = 87; - public const int TRAILING = 68; - public const int ON = 60; - public const int NUM_LONG = 96; - public const int NUM_DOUBLE = 94; - public const int UNARY_MINUS = 88; - public const int DELETE = 13; - public const int INDICES = 27; - public const int OF = 67; - public const int METHOD_CALL = 79; - public const int LEADING = 64; - public const int EMPTY = 63; - public const int T__126 = 126; - public const int GROUP = 24; - public const int T__127 = 127; - public const int WS = 122; - public const int FETCH = 21; - public const int VECTOR_EXPR = 90; - public const int NOT_IN = 81; - public const int NUM_INT = 93; - public const int OR = 40; - public const int ALIAS = 70; - public const int JAVA_CONSTANT = 97; - public const int CONSTANT = 92; - public const int GT = 105; - public const int QUERY = 84; - public const int INDEX_OP = 76; - public const int NUM_FLOAT = 95; - public const int FROM = 22; - public const int END = 56; - public const int FALSE = 20; - public const int DISTINCT = 16; - public const int CONSTRUCTOR = 71; - public const int CLOSE_BRACKET = 114; - public const int WHERE = 53; - public const int CLASS = 11; - public const int MEMBER = 65; - public const int INNER = 28; - public const int PROPERTIES = 43; - public const int ORDER = 41; - public const int MAX = 35; - public const int UPDATE = 51; - public const int SQL_NE = 103; - public const int AND = 6; - public const int SUM = 48; - public const int ASCENDING = 8; - public const int EXPR_LIST = 73; - public const int AS = 7; - public const int IN = 26; - public const int THEN = 58; - public const int OBJECT = 66; - public const int COMMA = 98; - public const int IS = 31; - public const int LEFT = 33; - public const int AVG = 9; - public const int SOME = 47; - public const int ALL = 4; - public const int IDENT = 118; - public const int CASE2 = 72; - public const int PLUS = 109; - public const int EXISTS = 19; - public const int DOT = 15; - public const int WITH = 61; - public const int LIKE = 34; - public const int OUTER = 42; - public const int ID_START_LETTER = 119; - public const int ROW_STAR = 86; - public const int NOT_LIKE = 82; - public const int RANGE = 85; - public const int NOT_BETWEEN = 80; - public const int HEX_DIGIT = 125; - public const int SET = 46; - public const int RIGHT = 44; - public const int HAVING = 25; - public const int MIN = 36; - public const int IS_NOT_NULL = 77; - public const int MINUS = 110; - public const int ELEMENTS = 17; - public const int TRUE = 49; - public const int JOIN = 32; - public const int IN_LIST = 75; - public const int UNION = 50; - public const int OPEN = 100; - public const int COLON = 115; - public const int ANY = 5; - public const int CLOSE = 101; - public const int WHEN = 59; - public const int DIV = 112; - public const int DESCENDING = 14; - public const int AGGREGATE = 69; - public const int BETWEEN = 10; - public const int LE = 106; - - // 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 "C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g";} - } - - // $ANTLR start "ALL" - public void mALL() // throws RecognitionException [2] - { - try - { - int _type = ALL; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:9:5: ( 'all' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:10:5: ( 'any' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:11:5: ( 'and' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:12:4: ( 'as' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:13:11: ( 'asc' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:14:5: ( 'avg' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:15:9: ( 'between' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:16:7: ( 'class' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:17:7: ( 'count' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:18:8: ( 'delete' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:19:12: ( 'desc' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:20:10: ( 'distinct' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:21:10: ( 'elements' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:22:8: ( 'escape' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:23:8: ( 'exists' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:24:7: ( 'false' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:25:7: ( 'fetch' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:26:6: ( 'from' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:27:6: ( 'full' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:28:7: ( 'group' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:29:8: ( 'having' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:30:4: ( 'in' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:31:9: ( 'indices' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:32:7: ( 'inner' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:33:8: ( 'insert' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:34:6: ( 'into' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:35:4: ( 'is' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:36:6: ( 'join' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:37:6: ( 'left' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:38:6: ( 'like' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:39:5: ( 'max' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:40:5: ( 'min' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:41:5: ( 'new' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:42:5: ( 'not' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:43:6: ( 'null' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:44:4: ( 'or' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:45:7: ( 'order' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:46:7: ( 'outer' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:47:12: ( 'properties' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:48:7: ( 'right' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:49:8: ( 'select' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:50:5: ( 'set' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:51:6: ( 'some' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:52:5: ( 'sum' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:53:6: ( 'true' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:54:7: ( 'union' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:55:8: ( 'update' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:56:11: ( 'versioned' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:57:7: ( 'where' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:58:12: ( 'by' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:59:6: ( 'case' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:60:5: ( 'end' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:61:6: ( 'else' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:62:6: ( 'then' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:63:6: ( 'when' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:64:4: ( 'on' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:65:6: ( 'with' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\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] - { - try - { - int _type = BOTH; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:66:6: ( 'both' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:66:8: 'both' - { - Match("both"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BOTH" - - // $ANTLR start "EMPTY" - public void mEMPTY() // throws RecognitionException [2] - { - try - { - int _type = EMPTY; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:67:7: ( 'empty' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:67:9: 'empty' - { - Match("empty"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "EMPTY" - - // $ANTLR start "LEADING" - public void mLEADING() // throws RecognitionException [2] - { - try - { - int _type = LEADING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:68:9: ( 'leading' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:68:11: 'leading' - { - Match("leading"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "LEADING" - - // $ANTLR start "MEMBER" - public void mMEMBER() // throws RecognitionException [2] - { - try - { - int _type = MEMBER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:69:8: ( 'member' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:69:10: 'member' - { - Match("member"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "MEMBER" - - // $ANTLR start "OBJECT" - public void mOBJECT() // throws RecognitionException [2] - { - try - { - int _type = OBJECT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:70:8: ( 'object' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:70:10: 'object' - { - Match("object"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "OBJECT" - - // $ANTLR start "OF" - public void mOF() // throws RecognitionException [2] - { - try - { - int _type = OF; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:71:4: ( 'of' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:71:6: 'of' - { - Match("of"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "OF" - - // $ANTLR start "TRAILING" - public void mTRAILING() // throws RecognitionException [2] - { - try - { - int _type = TRAILING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:72:10: ( 'trailing' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:72:12: 'trailing' - { - Match("trailing"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "TRAILING" - - // $ANTLR start "T__126" - public void mT__126() // throws RecognitionException [2] - { - try - { - int _type = T__126; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:73:8: ( 'ascending' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:73:10: 'ascending' - { - Match("ascending"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "T__126" - - // $ANTLR start "T__127" - public void mT__127() // throws RecognitionException [2] - { - try - { - int _type = T__127; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:74:8: ( 'descending' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:74:10: 'descending' - { - Match("descending"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "T__127" - - // $ANTLR start "EQ" - public void mEQ() // throws RecognitionException [2] - { - try - { - int _type = EQ; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:741:3: ( '=' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:741:5: '=' - { - Match('='); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "EQ" - - // $ANTLR start "LT" - public void mLT() // throws RecognitionException [2] - { - try - { - int _type = LT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:742:3: ( '<' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:742:5: '<' - { - Match('<'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "LT" - - // $ANTLR start "GT" - public void mGT() // throws RecognitionException [2] - { - try - { - int _type = GT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:743:3: ( '>' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:743:5: '>' - { - Match('>'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "GT" - - // $ANTLR start "SQL_NE" - public void mSQL_NE() // throws RecognitionException [2] - { - try - { - int _type = SQL_NE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:744:7: ( '<>' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:744:9: '<>' - { - Match("<>"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "SQL_NE" - - // $ANTLR start "NE" - public void mNE() // throws RecognitionException [2] - { - try - { - int _type = NE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:745:3: ( '!=' | '^=' ) - int alt1 = 2; - int LA1_0 = input.LA(1); - - if ( (LA1_0 == '!') ) - { - alt1 = 1; - } - else if ( (LA1_0 == '^') ) - { - alt1 = 2; - } - else - { - if ( state.backtracking > 0 ) {state.failed = true; return ;} - NoViableAltException nvae_d1s0 = - new NoViableAltException("", 1, 0, input); - - throw nvae_d1s0; - } - switch (alt1) - { - case 1 : - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:745:5: '!=' - { - Match("!="); if (state.failed) return ; - - - } - break; - case 2 : - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:745:12: '^=' - { - Match("^="); if (state.failed) return ; - - - } - break; - - } - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "NE" - - // $ANTLR start "LE" - public void mLE() // throws RecognitionException [2] - { - try - { - int _type = LE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:746:3: ( '<=' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:746:5: '<=' - { - Match("<="); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "LE" - - // $ANTLR start "GE" - public void mGE() // throws RecognitionException [2] - { - try - { - int _type = GE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:747:3: ( '>=' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:747:5: '>=' - { - Match(">="); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "GE" - - // $ANTLR start "COMMA" - public void mCOMMA() // throws RecognitionException [2] - { - try - { - int _type = COMMA; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:749:6: ( ',' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:749:8: ',' - { - Match(','); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "COMMA" - - // $ANTLR start "OPEN" - public void mOPEN() // throws RecognitionException [2] - { - try - { - int _type = OPEN; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:751:5: ( '(' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:751:7: '(' - { - Match('('); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "OPEN" - - // $ANTLR start "CLOSE" - public void mCLOSE() // throws RecognitionException [2] - { - try - { - int _type = CLOSE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:752:6: ( ')' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:752:8: ')' - { - Match(')'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "CLOSE" - - // $ANTLR start "OPEN_BRACKET" - public void mOPEN_BRACKET() // throws RecognitionException [2] - { - try - { - int _type = OPEN_BRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:753:13: ( '[' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:753:15: '[' - { - Match('['); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "OPEN_BRACKET" - - // $ANTLR start "CLOSE_BRACKET" - public void mCLOSE_BRACKET() // throws RecognitionException [2] - { - try - { - int _type = CLOSE_BRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:754:14: ( ']' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:754:16: ']' - { - Match(']'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "CLOSE_BRACKET" - - // $ANTLR start "CONCAT" - public void mCONCAT() // throws RecognitionException [2] - { - try - { - int _type = CONCAT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:756:7: ( '||' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:756:9: '||' - { - Match("||"); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "CONCAT" - - // $ANTLR start "PLUS" - public void mPLUS() // throws RecognitionException [2] - { - try - { - int _type = PLUS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:757:5: ( '+' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:757:7: '+' - { - Match('+'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "PLUS" - - // $ANTLR start "MINUS" - public void mMINUS() // throws RecognitionException [2] - { - try - { - int _type = MINUS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:758:6: ( '-' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:758:8: '-' - { - Match('-'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "MINUS" - - // $ANTLR start "STAR" - public void mSTAR() // throws RecognitionException [2] - { - try - { - int _type = STAR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:759:5: ( '*' ) - // C:\\CSharp\\NH\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:759:7: '*' - { - Match('*'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - ... [truncated message content] |
From: <aye...@us...> - 2009-05-15 07:46:41
|
Revision: 4314 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4314&view=rev Author: ayenderahien Date: 2009-05-15 07:46:31 +0000 (Fri, 15 May 2009) Log Message: ----------- Fixing NRE when use dynamically change logging configuration Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs Modified: trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-15 07:44:35 UTC (rev 4313) +++ trunk/nhibernate/src/NHibernate/AdoNet/SqlClientBatchingBatcher.cs 2009-05-15 07:46:31 UTC (rev 4314) @@ -19,10 +19,11 @@ { batchSize = Factory.Settings.AdoBatchSize; currentBatch = new SqlClientSqlCommandSet(); - if (log.IsDebugEnabled) - { - currentBatchCommandsLog = new StringBuilder(); - } + //we always create this, because we need to deal with a scenario in which + //the user change the logging configuration at runtime. Trying to put this + //behind an if(log.IsDebugEnabled) will cause a null reference exception + //at that point. + currentBatchCommandsLog = new StringBuilder(); } public override int BatchSize This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |