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: <ric...@us...> - 2010-05-27 10:11:50
|
Revision: 4983 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4983&view=rev Author: ricbrown Date: 2010-05-27 10:11:44 +0000 (Thu, 27 May 2010) Log Message: ----------- Fix NH-2205 (NHibernate.Loader.Loader.DoQuery can hide exceptions) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs Modified: trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs =================================================================== --- trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2010-05-27 09:19:36 UTC (rev 4982) +++ trunk/nhibernate/src/NHibernate/AdoNet/AbstractBatcher.cs 2010-05-27 10:11:44 UTC (rev 4983) @@ -371,7 +371,17 @@ ResultSetWrapper rsw = reader as ResultSetWrapper; var actualReader = rsw == null ? reader : rsw.Target; readersToClose.Remove(actualReader); - reader.Dispose(); + + try + { + reader.Dispose(); + } + catch (Exception e) + { + // NH2205 - prevent exceptions when closing the reader from hiding any original exception + log.Warn("exception closing reader", e); + } + LogCloseReader(); if (!log.IsDebugEnabled) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-05-27 09:19:43
|
Revision: 4982 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4982&view=rev Author: ricbrown Date: 2010-05-27 09:19:36 +0000 (Thu, 27 May 2010) Log Message: ----------- Fix NH-2199 (Map with element doesn't support nullable types) Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs trunk/nhibernate/src/NHibernate.DomainModel/Baz.cs trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.cs trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.hbm.xml trunk/nhibernate/src/NHibernate.Test/CollectionTest/Parent.cs Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/releasenotes.txt 2010-05-27 09:19:36 UTC (rev 4982) @@ -1,3 +1,10 @@ +Build 3.0.0.Alpha1 +============================= +** Known BREAKING CHANGES from NH2.1.1.GA to NH3.0.0.Alpha1 + ##### Run time ##### + * (NH-2199) - null values in maps/dictionaries are no longer silenty ignored/deleted + + Build 2.1.1.GA (rev4814) ============================= Modified: trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/src/NHibernate/Collection/Generic/PersistentGenericMap.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -54,7 +54,7 @@ IDictionary<TKey, TValue> sn = (IDictionary<TKey, TValue>)GetSnapshot(); foreach (KeyValuePair<TKey, TValue> e in sn) { - if (e.Value != null && !gmap.ContainsKey(e.Key)) + if (!gmap.ContainsKey(e.Key)) { object key = e.Key; deletes.Add(indexIsFormula ? e.Value : key); @@ -67,7 +67,7 @@ { IDictionary sn = (IDictionary)GetSnapshot(); KeyValuePair<TKey, TValue> e = (KeyValuePair<TKey, TValue>)entry; - return e.Value != null && sn[e.Key] == null; + return !sn.Contains(e.Key); } public override bool NeedsUpdating(object entry, int i, IType elemType) @@ -75,7 +75,9 @@ IDictionary sn = (IDictionary)GetSnapshot(); KeyValuePair<TKey, TValue> e = (KeyValuePair<TKey, TValue>)entry; object snValue = sn[e.Key]; - return e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session); + bool isNew = !sn.Contains(e.Key); + return e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session) + || (!isNew && ((e.Value == null) != (snValue == null))); } public override object GetIndex(object entry, int i, ICollectionPersister persister) @@ -96,9 +98,14 @@ public override bool EntryExists(object entry, int i) { - return ((KeyValuePair<TKey, TValue>)entry).Value != null; + return gmap.ContainsKey(((KeyValuePair<TKey, TValue>)entry).Key); } + protected override void AddDuringInitialize(object index, object element) + { + gmap[(TKey)index] = (TValue)element; + } + #region IDictionary<TKey,TValue> Members bool IDictionary<TKey, TValue>.ContainsKey(TKey key) Modified: trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/src/NHibernate/Collection/PersistentMap.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -109,13 +109,15 @@ object element = role.ReadElement(rs, owner, descriptor.SuffixedElementAliases, Session); object index = role.ReadIndex(rs, descriptor.SuffixedIndexAliases, Session); - if (element != null) - { - map[index] = element; - } + AddDuringInitialize(index, element); return element; } + protected virtual void AddDuringInitialize(object index, object element) + { + map[index] = element; + } + public override IEnumerable Entries(ICollectionPersister persister) { return map; @@ -158,7 +160,7 @@ foreach (DictionaryEntry e in sn) { object key = e.Key; - if (e.Value != null && map[key] == null) + if (!map.Contains(key)) { deletes.Add(indexIsFormula ? e.Value : key); } @@ -170,7 +172,7 @@ { IDictionary sn = (IDictionary) GetSnapshot(); DictionaryEntry e = (DictionaryEntry) entry; - return e.Value != null && sn[e.Key] == null; + return !sn.Contains(e.Key); } public override bool NeedsUpdating(object entry, int i, IType elemType) @@ -178,7 +180,9 @@ IDictionary sn = (IDictionary) GetSnapshot(); DictionaryEntry e = (DictionaryEntry) entry; object snValue = sn[e.Key]; - return e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session); + bool isNew = !sn.Contains(e.Key); + return e.Value != null && snValue != null && elemType.IsDirty(snValue, e.Value, Session) + || (!isNew && ((e.Value == null) != (snValue == null))); } public override object GetIndex(object entry, int i, ICollectionPersister persister) @@ -216,7 +220,7 @@ public override bool EntryExists(object entry, int i) { - return ((DictionaryEntry) entry).Value != null; + return map.Contains(((DictionaryEntry) entry).Key); } #region IDictionary Members Modified: trunk/nhibernate/src/NHibernate.DomainModel/Baz.cs =================================================================== --- trunk/nhibernate/src/NHibernate.DomainModel/Baz.cs 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/src/NHibernate.DomainModel/Baz.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -391,7 +391,7 @@ StringDateMap = new SortedList(); StringDateMap.Add("now", DateTime.Now); - StringDateMap.Add("never", null); + StringDateMap.Add("never", null); // value is persisted since NH-2199 // according to SQL Server the big bag happened in 1753 ;) StringDateMap.Add("big bang", new DateTime(1753, 01, 01)); //StringDateMap.Add( "millenium", new DateTime( 2000, 01, 01 ) ); Added: trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -0,0 +1,227 @@ +using System; +using System.Collections; +using NUnit.Framework; + +namespace NHibernate.Test.CollectionTest +{ + [TestFixture] + public class NullableValueTypeElementMapFixture : TestCase + { + protected override IList Mappings + { + get { return new[] {"CollectionTest.NullableValueTypeElementMapFixture.hbm.xml"}; } + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override void OnTearDown() + { + using (var s = sessions.OpenSession()) + { + s.Delete("from Parent"); + s.Flush(); + } + } + + [Test] + public void ShouldOverwriteElementValueWithNull() + { + Guid parentId; + var date = new DateTime(2010, 09, 08); + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = new Parent(); + parent.TypedDates[0] = date; + + s.Save(parent); + parentId = parent.Id; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(1), + "Should have one child on first reload"); + + Assert.That(parent.TypedDates[0], Is.Not.Null, + "Should have value in map for 0 on first reload"); + + Assert.That(parent.TypedDates[0].Value, Is.EqualTo(date), + "Should have same date as saved in map for 0 on first reload"); + + parent.TypedDates[0] = null; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(1), + "Should have one child on reload after nulling"); + + Assert.That(parent.TypedDates[0], Is.Null, + "Should have null value for child on reload after nulling"); + } + } + + [Test] + public void ShouldOverwriteNullElementWithValue() + { + Guid parentId; + var date = new DateTime(2010, 09, 08); + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = new Parent(); + parent.TypedDates[0] = null; + + s.Save(parent); + parentId = parent.Id; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(1), + "Should have 1 child after first reload"); + + Assert.That(parent.TypedDates[0], Is.Null, + "Should have null value after first reload"); + + parent.TypedDates[0] = date; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(1), + "Should have 1 child on reload after setting value"); + + Assert.That(parent.TypedDates[0], Is.Not.Null, + "Should have child with value on reload after setting value"); + + Assert.That(parent.TypedDates[0].Value, Is.EqualTo(date)); + } + } + + [Test] + public void ShouldAddAndRemoveNullElements() + { + Guid parentId; + var date = new DateTime(2010, 09, 08); + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = new Parent(); + parent.TypedDates[0] = null; + parent.TypedDates[1] = date; + + s.Save(parent); + parentId = parent.Id; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(2)); + Assert.That(parent.TypedDates[0], Is.Null); + Assert.That(parent.TypedDates[1], Is.EqualTo(date)); + + parent.TypedDates.Remove(0); + parent.TypedDates[2] = null; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.TypedDates.Count, Is.EqualTo(2)); + Assert.That(parent.TypedDates[1], Is.EqualTo(date)); + Assert.That(parent.TypedDates[2], Is.Null); + } + } + + [Test] + public void AddRemoveUntypedElements() + { + Guid parentId; + var date = new DateTime(2010, 09, 08); + + int toBeRemoved = 0; + int toBeUpdatedToNull = 1; + int toRemainNull = 2; + int toBeUpdatedFromNull = 3; + int toBeAddedNull = 4; + int toBeAddedNotNull = 5; + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = new Parent(); + parent.UntypedDates[toBeRemoved] = null; + parent.UntypedDates[toBeUpdatedToNull] = date; + parent.UntypedDates[toRemainNull] = null; + parent.UntypedDates[toBeUpdatedFromNull] = null; + + s.Save(parent); + parentId = parent.Id; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.UntypedDates.Count, Is.EqualTo(4)); + Assert.That(parent.UntypedDates[toBeRemoved], Is.Null); + Assert.That(parent.UntypedDates[toBeUpdatedToNull], Is.EqualTo(date)); + Assert.That(parent.UntypedDates[toRemainNull], Is.Null); + Assert.That(parent.UntypedDates[toBeUpdatedFromNull], Is.Null); + + parent.UntypedDates.Remove(toBeRemoved); + parent.UntypedDates[toBeUpdatedToNull] = null; + parent.UntypedDates[toBeUpdatedFromNull] = date; + parent.UntypedDates[toBeAddedNull] = null; + parent.UntypedDates[toBeAddedNotNull] = date; + tx.Commit(); + } + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + var parent = s.Load<Parent>(parentId); + + Assert.That(parent.UntypedDates.Count, Is.EqualTo(5)); + Assert.That(parent.UntypedDates[toBeUpdatedToNull], Is.Null); + Assert.That(parent.UntypedDates[toRemainNull], Is.Null); + Assert.That(parent.UntypedDates[toBeUpdatedFromNull], Is.EqualTo(date)); + Assert.That(parent.UntypedDates[toBeAddedNull], Is.Null); + Assert.That(parent.UntypedDates[toBeAddedNotNull], Is.EqualTo(date)); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/CollectionTest/NullableValueTypeElementMapFixture.hbm.xml 2010-05-27 09:19:36 UTC (rev 4982) @@ -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.CollectionTest"> + <class name="Parent"> + <id name="Id"> + <generator class="guid.comb" /> + </id> + <map name="TypedDates"> + <key column="ParentId" /> + <index column="Idx" type="int" /> + <element column="Value" /> + </map> + <map name="UntypedDates"> + <key column="ParentId" /> + <index column="Idx" type="int" /> + <element column="Value" type="System.Nullable`1[[System.DateTime, mscorlib]]" /> + </map> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/CollectionTest/Parent.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/CollectionTest/Parent.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/CollectionTest/Parent.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace NHibernate.Test.CollectionTest +{ + public class Parent + { + public virtual Guid Id { get; set; } + public virtual IDictionary<int, DateTime?> TypedDates { get; set; } + public virtual IDictionary UntypedDates { get; set; } + + public Parent() + { + TypedDates = new Dictionary<int, DateTime?>(); + UntypedDates = new Hashtable(); + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/src/NHibernate.Test/Legacy/FooBarTest.cs 2010-05-27 09:19:36 UTC (rev 4982) @@ -825,7 +825,7 @@ list = s.CreateQuery("select index(date) from Baz baz join baz.StringDateMap date").List(); Console.WriteLine(list); - Assert.AreEqual(2, list.Count); + Assert.AreEqual(3, list.Count); s.CreateQuery( "from foo in class Foo where foo.Integer not between 1 and 5 and foo.String not in ('cde', 'abc') and foo.String is not null and foo.Integer<=3") Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-24 20:02:27 UTC (rev 4981) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-27 09:19:36 UTC (rev 4982) @@ -126,6 +126,8 @@ <Compile Include="Classic\Video.cs" /> <Compile Include="CollectionTest\A.cs" /> <Compile Include="CollectionTest\IdBagFixture.cs" /> + <Compile Include="CollectionTest\NullableValueTypeElementMapFixture.cs" /> + <Compile Include="CollectionTest\Parent.cs" /> <Compile Include="CompositeCollection\BaseClassA.cs" /> <Compile Include="CompositeCollection\BaseClassB.cs" /> <Compile Include="CompositeCollection\ChildClassA.cs" /> @@ -2135,6 +2137,7 @@ <EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" /> <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" /> + <EmbeddedResource Include="CollectionTest\NullableValueTypeElementMapFixture.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> <EmbeddedResource Include="NHSpecificTest\NH2201\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2192\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-05-24 20:02:33
|
Revision: 4981 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4981&view=rev Author: ricbrown Date: 2010-05-24 20:02:27 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix NH-2201 (NDataReader doesn't reset the currentrow index when a move to NextResult is executed) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs Modified: trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2010-05-10 11:24:31 UTC (rev 4980) +++ trunk/nhibernate/src/NHibernate/Driver/NDataReader.cs 2010-05-24 20:02:27 UTC (rev 4981) @@ -117,6 +117,7 @@ public bool NextResult() { currentResultIndex++; + currentRowIndex = -1; if (currentResultIndex >= results.Length) { Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Fixture.cs 2010-05-24 20:02:27 UTC (rev 4981) @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH2201 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnTearDown() + { + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + s.Delete("from Parent"); + tx.Commit(); + } + + base.OnTearDown(); + } + + [Test] + public void CanUseMutliCriteriaAndFetchSelect() + { + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + s.Save(new Parent()); + s.Save(new SubClass() { Name = "test" }); + + tx.Commit(); + } + + using (ISession s = OpenSession()) + { + Console.WriteLine("*** start"); + var results = + s.CreateMultiCriteria() + .Add<Parent>(s.CreateCriteria<Parent>()) + .Add<Parent>(s.CreateCriteria<Parent>()) + .List(); + + var result1 = (IList<Parent>)results[0]; + var result2 = (IList<Parent>)results[1]; + + Assert.That(result1.Count, Is.EqualTo(2)); + Assert.That(result2.Count, Is.EqualTo(2)); + Console.WriteLine("*** end"); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Mappings.hbm.xml 2010-05-24 20:02:27 UTC (rev 4981) @@ -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.NH2201"> + + <class name="Parent" lazy="false"> + <id name="Id"> + <generator class="guid.comb" /> + </id> + <discriminator /> + <subclass name="SubClass"> + <join table="ParentDetail" fetch="select"> + <key column="ParentId" /> + <property name="Name" /> + </join> + </subclass> + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2201/Model.cs 2010-05-24 20:02:27 UTC (rev 4981) @@ -0,0 +1,14 @@ +using System; + +namespace NHibernate.Test.NHSpecificTest.NH2201 +{ + public class Parent + { + public virtual Guid Id { get; set; } + } + + public class SubClass : Parent + { + public virtual string Name { get; set; } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-10 11:24:31 UTC (rev 4980) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-24 20:02:27 UTC (rev 4981) @@ -712,6 +712,8 @@ <Compile Include="NHSpecificTest\NH2113\Model.cs" /> <Compile Include="NHSpecificTest\NH2192\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2192\Model.cs" /> + <Compile Include="NHSpecificTest\NH2201\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2201\Model.cs" /> <Compile Include="NHSpecificTest\NH473\Child.cs" /> <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> @@ -2134,6 +2136,7 @@ <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH2201\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2192\Mappings.hbm.xml" /> <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-05-10 11:24:38
|
Revision: 4980 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4980&view=rev Author: ricbrown Date: 2010-05-10 11:24:31 +0000 (Mon, 10 May 2010) Log Message: ----------- Added IResultTransformer method to IQueryOver. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverOrderBuilder.cs trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverProjectionBuilder.cs trunk/nhibernate/src/NHibernate/Criterion/ProjectionsExtensions.cs trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs trunk/nhibernate/src/NHibernate/IQueryOver.cs trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ProjectionsFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverOrderBuilder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverOrderBuilder.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverOrderBuilder.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -15,7 +15,7 @@ public QueryOverOrderBuilder(QueryOver<TRoot,TSubType> root, Expression<Func<TSubType, object>> path) : base(root, path) {} - public QueryOverOrderBuilder(QueryOver<TRoot,TSubType> root, Expression<Func<object>> path) : base(root, path) + public QueryOverOrderBuilder(QueryOver<TRoot,TSubType> root, Expression<Func<object>> path, bool isAlias) : base(root, path, isAlias) {} } @@ -26,7 +26,7 @@ public IQueryOverOrderBuilder(IQueryOver<TRoot,TSubType> root, Expression<Func<TSubType, object>> path) : base(root, path) {} - public IQueryOverOrderBuilder(IQueryOver<TRoot,TSubType> root, Expression<Func<object>> path) : base(root, path) + public IQueryOverOrderBuilder(IQueryOver<TRoot,TSubType> root, Expression<Func<object>> path, bool isAlias) : base(root, path, isAlias) {} } @@ -36,24 +36,27 @@ protected TReturn root; protected LambdaExpression path; + protected bool isAlias; protected QueryOverOrderBuilderBase(TReturn root, Expression<Func<TSubType, object>> path) { this.root = root; this.path = path; + this.isAlias = false; } - protected QueryOverOrderBuilderBase(TReturn root, Expression<Func<object>> path) + protected QueryOverOrderBuilderBase(TReturn root, Expression<Func<object>> path, bool isAlias) { this.root = root; this.path = path; + this.isAlias = isAlias; } public TReturn Asc { get { - this.root.UnderlyingCriteria.AddOrder(ExpressionProcessor.ProcessOrder(path, Order.Asc)); + this.root.UnderlyingCriteria.AddOrder(ExpressionProcessor.ProcessOrder(path, Order.Asc, isAlias)); return this.root; } } @@ -62,7 +65,7 @@ { get { - this.root.UnderlyingCriteria.AddOrder(ExpressionProcessor.ProcessOrder(path, Order.Desc)); + this.root.UnderlyingCriteria.AddOrder(ExpressionProcessor.ProcessOrder(path, Order.Desc, isAlias)); return this.root; } } Modified: trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverProjectionBuilder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverProjectionBuilder.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/Criterion/Lambda/QueryOverProjectionBuilder.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -46,7 +46,7 @@ /// </summary> public QueryOverProjectionBuilder<T> WithAlias(Expression<Func<object>> alias) { - string aliasContainer = ExpressionProcessor.FindMemberExpression(alias.Body); + string aliasContainer = ExpressionProcessor.FindPropertyExpression(alias.Body); lastProjection = Projections.Alias(lastProjection, aliasContainer); return this; } Modified: trunk/nhibernate/src/NHibernate/Criterion/ProjectionsExtensions.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/ProjectionsExtensions.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/Criterion/ProjectionsExtensions.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -16,7 +16,7 @@ public static IProjection WithAlias(this IProjection projection, Expression<Func<object>> alias) { - string aliasContainer = ExpressionProcessor.FindMemberExpression(alias.Body); + string aliasContainer = ExpressionProcessor.FindPropertyExpression(alias.Body); return Projections.Alias(projection, aliasContainer); } } Modified: trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -7,6 +7,7 @@ using NHibernate.Engine; using NHibernate.Impl; using NHibernate.SqlCommand; +using NHibernate.Transform; namespace NHibernate.Criterion { @@ -330,9 +331,14 @@ public QueryOverOrderBuilder<TRoot,TSubType> OrderBy(Expression<Func<object>> path) { - return new QueryOverOrderBuilder<TRoot,TSubType>(this, path); + return new QueryOverOrderBuilder<TRoot,TSubType>(this, path, false); } + public QueryOverOrderBuilder<TRoot,TSubType> OrderByAlias(Expression<Func<object>> path) + { + return new QueryOverOrderBuilder<TRoot,TSubType>(this, path, true); + } + public QueryOverOrderBuilder<TRoot,TSubType> ThenBy(Expression<Func<TSubType, object>> path) { return new QueryOverOrderBuilder<TRoot,TSubType>(this, path); @@ -340,15 +346,26 @@ public QueryOverOrderBuilder<TRoot,TSubType> ThenBy(Expression<Func<object>> path) { - return new QueryOverOrderBuilder<TRoot,TSubType>(this, path); + return new QueryOverOrderBuilder<TRoot,TSubType>(this, path, false); } + public QueryOverOrderBuilder<TRoot,TSubType> ThenByAlias(Expression<Func<object>> path) + { + return new QueryOverOrderBuilder<TRoot,TSubType>(this, path, true); + } + public QueryOver<TRoot,TSubType> ClearOrders() { criteria.ClearOrders(); return this; } + public QueryOver<TRoot,TSubType> TransformUsing(IResultTransformer resultTransformer) + { + criteria.SetResultTransformer(resultTransformer); + return this; + } + public QueryOver<TRoot,TSubType> Skip(int firstResult) { criteria.SetFirstResult(firstResult); @@ -671,17 +688,26 @@ { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path); } IQueryOverOrderBuilder<TRoot,TSubType> IQueryOver<TRoot,TSubType>.OrderBy(Expression<Func<object>> path) - { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path); } + { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path, false); } + IQueryOverOrderBuilder<TRoot,TSubType> IQueryOver<TRoot,TSubType>.OrderByAlias(Expression<Func<object>> path) + { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path, true); } + IQueryOverOrderBuilder<TRoot,TSubType> IQueryOver<TRoot,TSubType>.ThenBy(Expression<Func<TSubType, object>> path) { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path); } IQueryOverOrderBuilder<TRoot,TSubType> IQueryOver<TRoot,TSubType>.ThenBy(Expression<Func<object>> path) - { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path); } + { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path, false); } + IQueryOverOrderBuilder<TRoot,TSubType> IQueryOver<TRoot,TSubType>.ThenByAlias(Expression<Func<object>> path) + { return new IQueryOverOrderBuilder<TRoot,TSubType>(this, path, true); } + IQueryOver<TRoot,TSubType> IQueryOver<TRoot, TSubType>.ClearOrders() { return ClearOrders(); } + IQueryOver<TRoot,TSubType> IQueryOver<TRoot,TSubType>.TransformUsing(IResultTransformer resultTransformer) + { return TransformUsing(resultTransformer); } + IQueryOver<TRoot,TSubType> IQueryOver<TRoot,TSubType>.Skip(int firstResult) { return Skip(firstResult); } Modified: trunk/nhibernate/src/NHibernate/IQueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -6,6 +6,7 @@ using NHibernate.Criterion; using NHibernate.Criterion.Lambda; using NHibernate.SqlCommand; +using NHibernate.Transform; namespace NHibernate { @@ -262,6 +263,13 @@ IQueryOverOrderBuilder<TRoot,TSubType> OrderBy(Expression<Func<object>> path); /// <summary> + /// Add order for an aliased projection expressed as a lambda expression + /// </summary> + /// <param name="path">Lambda expression</param> + /// <returns>criteria instance</returns> + IQueryOverOrderBuilder<TRoot,TSubType> OrderByAlias(Expression<Func<object>> path); + + /// <summary> /// Add order expressed as a lambda expression /// </summary> /// <param name="path">Lambda expression</param> @@ -276,11 +284,23 @@ IQueryOverOrderBuilder<TRoot,TSubType> ThenBy(Expression<Func<object>> path); /// <summary> + /// Add order for an aliased projection expressed as a lambda expression + /// </summary> + /// <param name="path">Lambda expression</param> + /// <returns>criteria instance</returns> + IQueryOverOrderBuilder<TRoot,TSubType> ThenByAlias(Expression<Func<object>> path); + + /// <summary> /// Clear all orders from the query. /// </summary> IQueryOver<TRoot, TSubType> ClearOrders(); /// <summary> + /// Transform the results using the supplied IResultTransformer + /// </summary> + IQueryOver<TRoot,TSubType> TransformUsing(IResultTransformer resultTransformer); + + /// <summary> /// Set the first result to be retrieved /// </summary> /// <param name="firstResult"></param> Modified: trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -174,6 +174,17 @@ } /// <summary> + /// Retrieves the name of the property from a member expression (without leading member access) + /// </summary> + public static string FindPropertyExpression(Expression expression) + { + string memberExpression = FindMemberExpression(expression); + int periodPosition = memberExpression.LastIndexOf('.') + 1; + string property = (periodPosition <= 0) ? memberExpression : memberExpression.Substring(periodPosition); + return property; + } + + /// <summary> /// Retrieves a detached criteria from an appropriate lambda expression /// </summary> /// <param name="expression">Expresson for detached criteria using .As<>() extension"/></param> @@ -458,11 +469,13 @@ /// </summary> /// <param name="expression">The lambda expression to convert</param> /// <param name="orderDelegate">The appropriate order delegate (order direction)</param> + /// <param name="isAlias">Indicates if the path is an aliased projection</param> /// <returns>NHibernate Order</returns> public static Order ProcessOrder( LambdaExpression expression, - Func<string, Order> orderDelegate) + Func<string, Order> orderDelegate, + bool isAlias) { - string property = FindMemberExpression(expression.Body); + string property = isAlias ? FindPropertyExpression(expression.Body) : FindMemberExpression(expression.Body); Order order = orderDelegate(property); return order; } Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -146,6 +146,38 @@ } [Test] + public void Project_TransformToDto() + { + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Save(new Person() { Name = "test person 1", Age = 20 }); + s.Save(new Person() { Name = "test person 1", Age = 30 }); + s.Save(new Person() { Name = "test person 2", Age = 40 }); + t.Commit(); + } + + using (ISession s = OpenSession()) + { + PersonSummary summary = null; + var actual = + s.QueryOver<Person>() + .Select(list => list + .SelectGroup(p => p.Name).WithAlias(() => summary.Name) + .Select(Projections.RowCount()).WithAlias(() => summary.Count)) + .OrderByAlias(() => summary.Name).Asc + .TransformUsing(Transformers.AliasToBean<PersonSummary>()) + .List<PersonSummary>(); + + Assert.That(actual.Count, Is.EqualTo(2)); + Assert.That(actual[0].Name, Is.EqualTo("test person 1")); + Assert.That(actual[0].Count, Is.EqualTo(2)); + Assert.That(actual[1].Name, Is.EqualTo("test person 2")); + Assert.That(actual[1].Count, Is.EqualTo(1)); + } + } + + [Test] public void UniqueResult() { using (ISession s = OpenSession()) @@ -244,7 +276,7 @@ .Select(list => list .Select(p => p.Name) .SelectSubQuery(childCountQuery).WithAlias(() => childCountAlias)) - .OrderBy(() => childCountAlias).Desc + .OrderByAlias(() => childCountAlias).Desc .List<object[]>() .Select(props => new { Name = (string)props[0], Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/LambdaFixtureBase.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -157,6 +157,13 @@ return; } + if (expected is ConstructorInfo) + { + Assert.AreEqual(expected.ToString(), actual.ToString()); + _fieldPath.Pop(); + return; + } + while (expectedType != null) { foreach (FieldInfo fieldInfo in expectedType.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/Model.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -75,5 +75,11 @@ } + public class PersonSummary + { + public string Name { get; set; } + public int Count { get; set; } + } + } Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ProjectionsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ProjectionsFixture.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ProjectionsFixture.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -41,7 +41,7 @@ .SetProjection(Projections.ProjectionList() .Add(Projections.Alias(Projections.Avg("Age"), "personAgeProjectionAlias")) .Add(Projections.Avg("Age"), "personAgeProjectionAlias") - .Add(Projections.Avg("personAlias.Age")) + .Add(Projections.Avg("personAlias.Age"), "Age") .Add(Projections.Count("Age")) .Add(Projections.Count("personAlias.Age")) .Add(Projections.CountDistinct("Age")) @@ -65,7 +65,7 @@ .Select(Projections.ProjectionList() .Add(Projections.Avg<Person>(p => p.Age).WithAlias(() => personAgeProjectionAlias)) .Add(Projections.Avg<Person>(p => p.Age), () => personAgeProjectionAlias) - .Add(Projections.Avg(() => personAlias.Age)) + .Add(Projections.Avg(() => personAlias.Age).WithAlias(() => personAlias.Age)) .Add(Projections.Count<Person>(p => p.Age)) .Add(Projections.Count(() => personAlias.Age)) .Add(Projections.CountDistinct<Person>(p => p.Age)) @@ -93,7 +93,7 @@ .SetProjection(Projections.ProjectionList() .Add(Projections.Alias(Projections.Avg("Age"), "personAgeProjectionAlias")) .Add(Projections.Avg("Age")) - .Add(Projections.Avg("personAlias.Age")) + .Add(Projections.Avg("personAlias.Age"), "Age") .Add(Projections.Count("Age")) .Add(Projections.Count("personAlias.Age")) .Add(Projections.CountDistinct("Age")) @@ -117,7 +117,7 @@ .Select(list => list .SelectAvg(p => p.Age).WithAlias(() => personAgeProjectionAlias) .Select(Projections.Avg("Age")) // allows private properties - .SelectAvg(() => personAlias.Age) + .SelectAvg(() => personAlias.Age).WithAlias(() => personAlias.Age) .SelectCount(p => p.Age) .SelectCount(() => personAlias.Age) .SelectCountDistinct(p => p.Age) Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs 2010-05-07 22:44:13 UTC (rev 4979) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs 2010-05-10 11:24:31 UTC (rev 4980) @@ -354,15 +354,20 @@ .AddOrder(Order.Asc("Name")) .AddOrder(Order.Desc("Age")) .AddOrder(Order.Desc("personAlias.Name")) - .AddOrder(Order.Asc("personAlias.Age")); + .AddOrder(Order.Asc("personAlias.Age")) + .AddOrder(Order.Asc("summary")) + .AddOrder(Order.Desc("Count")); Person personAlias = null; + PersonSummary summary = null; IQueryOver<Person> actual = CreateTestQueryOver<Person>(() => personAlias) .OrderBy(p => p.Name).Asc .ThenBy(p => p.Age).Desc .ThenBy(() => personAlias.Name).Desc - .ThenBy(() => personAlias.Age).Asc; + .ThenBy(() => personAlias.Age).Asc + .OrderByAlias(() => summary).Asc + .ThenByAlias(() => summary.Count).Desc; AssertCriteriaAreEqual(expected, actual); } @@ -454,6 +459,20 @@ } [Test] + public void ResultTransformer() + { + ICriteria expected = + CreateTestCriteria(typeof(Person)) + .SetResultTransformer(Transformers.AliasToBean<Person>()); + + IQueryOver<Person> actual = + CreateTestQueryOver<Person>() + .TransformUsing(Transformers.AliasToBean<Person>()); + + AssertCriteriaAreEqual(expected, actual); + } + + [Test] public void LockAlias() { ICriteria expected = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-05-07 22:44:20
|
Revision: 4979 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4979&view=rev Author: ricbrown Date: 2010-05-07 22:44:13 +0000 (Fri, 07 May 2010) Log Message: ----------- Fix NH-2192 (Thread safety issue with QueryParameters.PrepareParameterTypes) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs trunk/nhibernate/src/NHibernate/SqlCommand/SqlString.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Model.cs Modified: trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2010-05-01 22:22:06 UTC (rev 4978) +++ trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2010-05-07 22:44:13 UTC (rev 4979) @@ -304,7 +304,7 @@ if (session.EnabledFilters.Count == 0 || sql.ToString().IndexOf(ParserHelper.HqlVariablePrefix) < 0) { - processedSQL = sql; + processedSQL = sql.Copy(); return; } @@ -393,7 +393,7 @@ processedSQL = result.ToSqlString(); } - private IList<Parameter> ResetParameterLocations(SqlString sqlString) + private IList<Parameter> FindParametersIn(SqlString sqlString) { IList<Parameter> sqlParameters = new List<Parameter>(); @@ -401,9 +401,7 @@ { if (sqlParameter is Parameter) { - Parameter parameter = (Parameter)sqlParameter; - parameter.ParameterPosition = null; - sqlParameters.Add(parameter); + sqlParameters.Add((Parameter)sqlParameter); } } @@ -441,7 +439,7 @@ int parameterIndex = 0; int totalSpan = 0; - IList<Parameter> sqlParameters = ResetParameterLocations(sqlString); + IList<Parameter> sqlParameters = FindParametersIn(sqlString); for (int index = 0; index < PositionalParameterTypes.Length; index++) { Modified: trunk/nhibernate/src/NHibernate/SqlCommand/SqlString.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/SqlString.cs 2010-05-01 22:22:06 UTC (rev 4978) +++ trunk/nhibernate/src/NHibernate/SqlCommand/SqlString.cs 2010-05-07 22:44:13 UTC (rev 4979) @@ -572,6 +572,22 @@ } /// <summary> + /// Make a copy of the SqlString, with new parameter references (Placeholders) + /// </summary> + public SqlString Copy() + { + SqlString clone = Clone(); + + for (int i=0; i<clone.sqlParts.Length; i++) + { + if (clone.sqlParts[i] is Parameter) + clone.sqlParts[i] = SqlCommand.Parameter.Placeholder; + } + + return clone; + } + + /// <summary> /// Returns substring of this SqlString starting with the specified /// <paramref name="text" />. If the text is not found, returns an /// empty, not-null SqlString. Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Fixture.cs 2010-05-07 22:44:13 UTC (rev 4979) @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH2192 +{ + [TestFixture] + public class Fixture : BugTestCase + { + protected override void OnSetUp() + { + base.OnSetUp(); + + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + s.Save(new ContentItem() { Name = "Test" }); + s.Save(new ContentItem() { Name = "Test" }); + s.Save(new ContentItem() { Name = "Test2" }); + tx.Commit(); + } + } + + protected override void OnTearDown() + { + using (var s = OpenSession()) + using (var tx = s.BeginTransaction()) + { + s.Delete("from ContentItem"); + tx.Commit(); + } + + base.OnTearDown(); + } + + private const int _threadCount = 150; + + [Test] + public void HqlIsThreadsafe_UsingThreads() + { + object sync = new object(); + List<int> results = new List<int>(); + List<Exception> exceptions = new List<Exception>(); + + var threads = new List<Thread>(); + + for (int i=0; i<_threadCount; i++) + { + var thread = new Thread(new ThreadStart(() => + { + try + { + int result = FetchRowResults(); + lock (sync) + { + results.Add(result); + } + } + catch (Exception e) + { + lock (sync) + { + exceptions.Add(e); + } + } + })); + + threads.Add(thread); + } + + threads.ForEach(t => t.Start()); + threads.ForEach(t => t.Join()); + + if (exceptions.Count > 0) + throw exceptions[0]; + + results.ForEach(r => Assert.That(r, Is.EqualTo(2))); + } + + [Test] + public void HqlIsThreadsafe_UsingPool() + { + List<Exception> exceptions = new List<Exception>(); + Func<int> result = FetchRowResults; + List<IAsyncResult> results = new List<IAsyncResult>(); + + for (int i=0; i<_threadCount; i++) + results.Add(result.BeginInvoke(null, null)); + + results.ForEach(r => + { + try + { + Assert.That(result.EndInvoke(r), Is.EqualTo(2)); + } + catch (Exception e) + { + exceptions.Add(e); + } + }); + + if (exceptions.Count > 0) + throw exceptions[0]; + } + + private int FetchRowResults() + { + using (var s = Sfi.OpenSession()) + { + var count = + s.CreateQuery("select ci from ContentItem ci where ci.Name = :v1") + .SetParameter("v1", "Test") + .List<ContentItem>() + .Count; + + return count; + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Mappings.hbm.xml 2010-05-07 22:44:13 UTC (rev 4979) @@ -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.NH2192"> + + <class name="ContentItem"> + <id name="Id"> + <generator class="hilo" /> + </id> + <property name="Name" type="String" /> + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Model.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH2192/Model.cs 2010-05-07 22:44:13 UTC (rev 4979) @@ -0,0 +1,8 @@ +namespace NHibernate.Test.NHSpecificTest.NH2192 +{ + public class ContentItem + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-01 22:22:06 UTC (rev 4978) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-07 22:44:13 UTC (rev 4979) @@ -710,6 +710,8 @@ <Compile Include="NHSpecificTest\NH2077\Model.cs" /> <Compile Include="NHSpecificTest\NH2113\Fixture.cs" /> <Compile Include="NHSpecificTest\NH2113\Model.cs" /> + <Compile Include="NHSpecificTest\NH2192\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH2192\Model.cs" /> <Compile Include="NHSpecificTest\NH473\Child.cs" /> <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> @@ -2132,6 +2134,7 @@ <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH2192\Mappings.hbm.xml" /> <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-05-01 22:22:13
|
Revision: 4978 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4978&view=rev Author: steverstrong Date: 2010-05-01 22:22:06 +0000 (Sat, 01 May 2010) Log Message: ----------- Updated to latest version of ANTLR (ANTLRWorks 3.2 for code generation, 3.1.3 C# runtime) Modified Paths: -------------- trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll trunk/nhibernate/lib/net/3.5/antlr.runtime.dll 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/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Tree/ASTNode.cs Modified: trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/antlr.runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-05-01 18:38:21 UTC (rev 4977) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-05-01 22:22:06 UTC (rev 4978) @@ -1,4729 +1,4729 @@ -// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-08-19 15:39:23 - -// The variable 'variable' is assigned but its value is never used. -#pragma warning disable 168, 219 -// Unreachable code detected. -#pragma warning disable 162 -namespace NHibernate.Hql.Ast.ANTLR -{ - -using System; -using Antlr.Runtime; -using IList = System.Collections.IList; -using ArrayList = System.Collections.ArrayList; -using Stack = Antlr.Runtime.Collections.StackList; - -using IDictionary = System.Collections.IDictionary; -using Hashtable = System.Collections.Hashtable; - -public partial class HqlLexer : Lexer { - public const int EXPR_LIST = 73; - public const int EXISTS = 19; - public const int COMMA = 99; - public const int FETCH = 21; - public const int MINUS = 115; - public const int AS = 7; - public const int END = 56; - public const int INTO = 30; - public const int FALSE = 20; - public const int ELEMENTS = 17; - public const int THEN = 58; - public const int ALIAS = 70; - public const int BOR = 111; - public const int ON = 60; - public const int DOT = 15; - public const int ORDER = 41; - public const int AND = 6; - public const int CONSTANT = 92; - public const int UNARY_MINUS = 88; - public const int METHOD_CALL = 79; - public const int RIGHT = 44; - public const int CONCAT = 109; - public const int PROPERTIES = 43; - public const int SELECT = 45; - public const int LE = 107; - public const int BETWEEN = 10; - public const int NUM_INT = 93; - public const int BOTH = 62; - public const int PLUS = 114; - public const int VERSIONED = 52; - public const int MEMBER = 65; - public const int NUM_DECIMAL = 95; - public const int UNION = 50; - public const int DISTINCT = 16; - public const int RANGE = 85; - public const int FILTER_ENTITY = 74; - public const int IDENT = 123; - public const int WHEN = 59; - public const int DESCENDING = 14; - public const int WS = 127; - public const int EQ = 100; - public const int NEW = 37; - public const int LT = 105; - public const int ESCqs = 126; - public const int OF = 67; - public const int UPDATE = 51; - public const int SELECT_FROM = 87; - public const int LITERAL_by = 54; - public const int FLOAT_SUFFIX = 129; - public const int ANY = 5; - public const int UNARY_PLUS = 89; - public const int NUM_FLOAT = 96; - public const int GE = 108; - public const int CASE = 55; - public const int OPEN_BRACKET = 118; - public const int ELSE = 57; - public const int OPEN = 101; - public const int COUNT = 12; - public const int NULL = 39; - public const int T__132 = 132; - public const int COLON = 120; - public const int DIV = 117; - public const int HAVING = 25; - public const int ALL = 4; - public const int SET = 46; - public const int T__131 = 131; - public const int INSERT = 29; - public const int TRUE = 49; - public const int CASE2 = 72; - public const int IS_NOT_NULL = 77; - public const int WHERE = 53; - public const int AGGREGATE = 69; - public const int VECTOR_EXPR = 90; - public const int BNOT = 110; - public const int LEADING = 64; - public const int CLOSE_BRACKET = 119; - public const int NUM_DOUBLE = 94; - public const int INNER = 28; - public const int QUERY = 84; - public const int ORDER_ELEMENT = 83; - public const int OR = 40; - public const int FULL = 23; - public const int INDICES = 27; - public const int IS_NULL = 78; - public const int GROUP = 24; - public const int ESCAPE = 18; - public const int PARAM = 121; - public const int INDEX_OP = 76; - public const int ID_LETTER = 125; - public const int HEX_DIGIT = 130; - public const int LEFT = 33; - public const int TRAILING = 68; - public const int JOIN = 32; - public const int NOT_BETWEEN = 80; - public const int SUM = 48; - public const int BAND = 113; - public const int ROW_STAR = 86; - public const int OUTER = 42; - public const int NOT_IN = 81; - public const int FROM = 22; - public const int DELETE = 13; - public const int OBJECT = 66; - public const int MAX = 35; - public const int NOT_LIKE = 82; - public const int EMPTY = 63; - public const int QUOTED_String = 122; - public const int ASCENDING = 8; - public const int NUM_LONG = 97; - public const int IS = 31; - public const int SQL_NE = 104; - public const int IN_LIST = 75; - public const int WEIRD_IDENT = 91; - public const int NE = 103; - public const int GT = 106; - public const int MIN = 36; - public const int LIKE = 34; - public const int WITH = 61; - public const int IN = 26; - public const int CONSTRUCTOR = 71; - public const int SOME = 47; - public const int CLASS = 11; - public const int EXPONENT = 128; - public const int ID_START_LETTER = 124; - public const int EOF = -1; - public const int CLOSE = 102; - public const int AVG = 9; - public const int BXOR = 112; - public const int STAR = 116; - public const int NOT = 38; - public const int JAVA_CONSTANT = 98; - - // delegates - // delegators - - public HqlLexer() - { - InitializeCyclicDFAs(); - } - public HqlLexer(ICharStream input) - : this(input, null) { - } - public HqlLexer(ICharStream input, RecognizerSharedState state) - : base(input, state) { - InitializeCyclicDFAs(); - - } - - override public string GrammarFileName - { - get { return "/Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:9:5: ( 'all' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:10:5: ( 'any' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:11:5: ( 'and' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:12:4: ( 'as' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:13:11: ( 'asc' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:14:5: ( 'avg' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:15:9: ( 'between' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:16:7: ( 'class' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:17:7: ( 'count' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:18:8: ( 'delete' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:19:12: ( 'desc' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:20:10: ( 'distinct' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:21:10: ( 'elements' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:22:8: ( 'escape' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:23:8: ( 'exists' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:24:7: ( 'false' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:25:7: ( 'fetch' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:26:6: ( 'from' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:27:6: ( 'full' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:28:7: ( 'group' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:29:8: ( 'having' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:30:4: ( 'in' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:31:9: ( 'indices' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:32:7: ( 'inner' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:33:8: ( 'insert' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:34:6: ( 'into' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:35:4: ( 'is' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:36:6: ( 'join' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:37:6: ( 'left' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:38:6: ( 'like' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:39:5: ( 'max' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:40:5: ( 'min' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:41:5: ( 'new' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:42:5: ( 'not' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:43:6: ( 'null' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:44:4: ( 'or' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:45:7: ( 'order' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:46:7: ( 'outer' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:47:12: ( 'properties' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:48:7: ( 'right' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:49:8: ( 'select' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:50:5: ( 'set' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:51:6: ( 'some' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:52:5: ( 'sum' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:53:6: ( 'true' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:54:7: ( 'union' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:55:8: ( 'update' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:56:11: ( 'versioned' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:57:7: ( 'where' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:58:12: ( 'by' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:59:6: ( 'case' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:60:5: ( 'end' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:61:6: ( 'else' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:62:6: ( 'then' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:63:6: ( 'when' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:64:4: ( 'on' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:65:6: ( 'with' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:66:6: ( 'both' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:67:7: ( 'empty' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:68:9: ( 'leading' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:69:8: ( 'member' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:70:8: ( 'object' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:71:4: ( 'of' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:72:10: ( 'trailing' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__131" - public void mT__131() // throws RecognitionException [2] - { - try - { - int _type = T__131; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:73:8: ( 'ascending' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__131" - - // $ANTLR start "T__132" - public void mT__132() // throws RecognitionException [2] - { - try - { - int _type = T__132; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:74:8: ( 'descending' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__132" - - // $ANTLR start "EQ" - public void mEQ() // throws RecognitionException [2] - { - try - { - int _type = EQ; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:672:3: ( '=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:672: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:673:3: ( '<' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:673: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:674:3: ( '>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:674: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:675:7: ( '<>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:675: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676: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 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676:5: '!=' - { - Match("!="); if (state.failed) return ; - - - } - break; - case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:677:3: ( '<=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:677: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:678:3: ( '>=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:678:5: '>=' - { - Match(">="); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "GE" - - // $ANTLR start "BOR" - public void mBOR() // throws RecognitionException [2] - { - try - { - int _type = BOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:680:5: ( '|' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:680:8: '|' - { - Match('|'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BOR" - - // $ANTLR start "BXOR" - public void mBXOR() // throws RecognitionException [2] - { - try - { - int _type = BXOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:681:6: ( '^' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:681:8: '^' - { - Match('^'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BXOR" - - // $ANTLR start "BAND" - public void mBAND() // throws RecognitionException [2] - { - try - { - int _type = BAND; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:682:6: ( '&' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:682:8: '&' - { - Match('&'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BAND" - - // $ANTLR start "BNOT" - public void mBNOT() // throws RecognitionException [2] - { - try - { - int _type = BNOT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:683:6: ( '!' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:683:8: '!' - { - Match('!'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BNOT" - - // $ANTLR start "COMMA" - public void mCOMMA() // throws RecognitionException [2] - { - try - { - int _type = COMMA; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:685:6: ( ',' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:685:8: ',' - { - Match(','); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "COMMA" - - // $ANTLR start "OPEN" ... [truncated message content] |
From: <ste...@us...> - 2010-05-01 18:38:27
|
Revision: 4977 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4977&view=rev Author: steverstrong Date: 2010-05-01 18:38:21 +0000 (Sat, 01 May 2010) Log Message: ----------- Fix for JIRA NH-2169 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs Modified: trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs 2010-04-29 21:49:12 UTC (rev 4976) +++ trunk/nhibernate/src/NHibernate/Linq/Functions/StringGenerator.cs 2010-05-01 18:38:21 UTC (rev 4977) @@ -122,11 +122,11 @@ if (((method.Name == "ToUpper") || (method.Name == "ToUpperInvariant"))) { - methodName = "lower"; + methodName = "upper"; } else { - methodName = "upper"; + methodName = "lower"; } return treeBuilder.MethodCall(methodName, visitor.Visit(targetObject).AsExpression()); Added: trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/CasingTest.cs 2010-05-01 18:38:21 UTC (rev 4977) @@ -0,0 +1,49 @@ +using System.Linq; +using NUnit.Framework; + +namespace NHibernate.Test.Linq +{ + [TestFixture] + public class CasingTest : LinqTestCase + { + [Test] + public void ToUpper() + { + var name = (from e in db.Employees + where e.EmployeeId == 1 + select e.FirstName.ToUpper()) + .Single(); + Assert.AreEqual("NANCY", name); + } + + [Test] + public void ToUpperInvariant() + { + var name = (from e in db.Employees + where e.EmployeeId == 1 + select e.FirstName.ToUpper()) + .Single(); + Assert.AreEqual("NANCY", name); + } + + [Test] + public void ToLower() + { + var name = (from e in db.Employees + where e.EmployeeId == 1 + select e.FirstName.ToLower()) + .Single(); + Assert.AreEqual("nancy", name); + } + + [Test] + public void ToLowerInvariant() + { + var name = (from e in db.Employees + where e.EmployeeId == 1 + select e.FirstName.ToLowerInvariant()) + .Single(); + Assert.AreEqual("nancy", name); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-29 21:49:12 UTC (rev 4976) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-05-01 18:38:21 UTC (rev 4977) @@ -381,6 +381,7 @@ <Compile Include="Linq\AggregateTests.cs" /> <Compile Include="Linq\BinaryBooleanExpressionTests.cs" /> <Compile Include="Linq\BinaryExpressionOrdererTests.cs" /> + <Compile Include="Linq\CasingTest.cs" /> <Compile Include="Linq\CollectionAssert.cs" /> <Compile Include="Linq\DateTimeTests.cs" /> <Compile Include="Linq\DynamicQueryTests.cs" /> @@ -2131,9 +2132,9 @@ <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> - <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> - <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" /> - <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" /> + <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1981\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2074\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2077\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-04-29 21:49:20
|
Revision: 4976 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4976&view=rev Author: steverstrong Date: 2010-04-29 21:49:12 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Reverted the ANTLR update Modified Paths: -------------- trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll trunk/nhibernate/lib/net/3.5/antlr.runtime.dll 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/Tree/ASTNode.cs Modified: trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/antlr.runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-04-29 21:01:11 UTC (rev 4975) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-04-29 21:49:12 UTC (rev 4976) @@ -1,4729 +1,4729 @@ -// $ANTLR 3.2 Sep 23, 2009 12:02:23 C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g 2010-04-29 22:45:03 - -// The variable 'variable' is assigned but its value is never used. -#pragma warning disable 168, 219 -// Unreachable code detected. -#pragma warning disable 162 - - -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; -namespace NHibernate.Hql.Ast.ANTLR -{ -public partial class HqlLexer : Lexer { - public const int LT = 105; - public const int EXPONENT = 128; - public const int STAR = 116; - public const int FLOAT_SUFFIX = 129; - 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 = 121; - 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 = 122; - public const int ESCqs = 126; - public const int WEIRD_IDENT = 91; - public const int OPEN_BRACKET = 118; - 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 NUM_DECIMAL = 95; - public const int VERSIONED = 52; - public const int EQ = 100; - public const int SELECT = 45; - public const int INTO = 30; - public const int NE = 103; - public const int GE = 108; - public const int CONCAT = 109; - public const int ID_LETTER = 125; - 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 = 97; - 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 GROUP = 24; - public const int WS = 127; - 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 = 98; - public const int CONSTANT = 92; - public const int GT = 106; - public const int QUERY = 84; - public const int BNOT = 110; - public const int INDEX_OP = 76; - public const int NUM_FLOAT = 96; - public const int FROM = 22; - public const int END = 56; - public const int FALSE = 20; - public const int DISTINCT = 16; - public const int T__131 = 131; - public const int CONSTRUCTOR = 71; - public const int T__132 = 132; - public const int CLOSE_BRACKET = 119; - 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 = 104; - 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 = 99; - public const int IS = 31; - public const int AVG = 9; - public const int LEFT = 33; - public const int SOME = 47; - public const int ALL = 4; - public const int BOR = 111; - public const int IDENT = 123; - public const int CASE2 = 72; - public const int BXOR = 112; - public const int PLUS = 114; - 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 = 124; - 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 = 130; - 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 = 115; - public const int ELEMENTS = 17; - public const int BAND = 113; - 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 = 101; - public const int COLON = 120; - public const int ANY = 5; - public const int CLOSE = 102; - public const int WHEN = 59; - public const int DIV = 117; - public const int DESCENDING = 14; - public const int AGGREGATE = 69; - public const int BETWEEN = 10; - public const int LE = 107; - - // 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:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:9:5: ( 'all' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:10:5: ( 'any' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:11:5: ( 'and' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:12:4: ( 'as' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:13:11: ( 'asc' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:14:5: ( 'avg' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:15:9: ( 'between' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:16:7: ( 'class' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:17:7: ( 'count' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:18:8: ( 'delete' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:19:12: ( 'desc' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:20:10: ( 'distinct' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:21:10: ( 'elements' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:22:8: ( 'escape' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:23:8: ( 'exists' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:24:7: ( 'false' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:25:7: ( 'fetch' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:26:6: ( 'from' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:27:6: ( 'full' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:28:7: ( 'group' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:29:8: ( 'having' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:30:4: ( 'in' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:31:9: ( 'indices' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:32:7: ( 'inner' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:33:8: ( 'insert' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:34:6: ( 'into' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:35:4: ( 'is' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:36:6: ( 'join' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:37:6: ( 'left' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:38:6: ( 'like' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:39:5: ( 'max' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:40:5: ( 'min' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:41:5: ( 'new' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:42:5: ( 'not' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:43:6: ( 'null' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:44:4: ( 'or' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:45:7: ( 'order' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:46:7: ( 'outer' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:47:12: ( 'properties' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:48:7: ( 'right' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:49:8: ( 'select' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:50:5: ( 'set' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:51:6: ( 'some' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:52:5: ( 'sum' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:53:6: ( 'true' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:54:7: ( 'union' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:55:8: ( 'update' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:56:11: ( 'versioned' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:57:7: ( 'where' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:58:12: ( 'by' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:59:6: ( 'case' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:60:5: ( 'end' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:61:6: ( 'else' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:62:6: ( 'then' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:63:6: ( 'when' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:64:4: ( 'on' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:65:6: ( 'with' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:66:6: ( 'both' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:67:7: ( 'empty' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:68:9: ( 'leading' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:69:8: ( 'member' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:70:8: ( 'object' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:71:4: ( 'of' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:72:10: ( 'trailing' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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__131" - public void mT__131() // throws RecognitionException [2] - { - try - { - int _type = T__131; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:73:8: ( 'ascending' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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__131" - - // $ANTLR start "T__132" - public void mT__132() // throws RecognitionException [2] - { - try - { - int _type = T__132; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:74:8: ( 'descending' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\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__132" - - // $ANTLR start "EQ" - public void mEQ() // throws RecognitionException [2] - { - try - { - int _type = EQ; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:672:3: ( '=' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:672: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:673:3: ( '<' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:673: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:674:3: ( '>' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:674: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:675:7: ( '<>' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:675: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:676: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:676:5: '!=' - { - Match("!="); if (state.failed) return ; - - - } - break; - case 2 : - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:676: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:677:3: ( '<=' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:677: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:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:678:3: ( '>=' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:678:5: '>=' - { - Match(">="); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "GE" - - // $ANTLR start "BOR" - public void mBOR() // throws RecognitionException [2] - { - try - { - int _type = BOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:680:5: ( '|' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:680:8: '|' - { - Match('|'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BOR" - - // $ANTLR start "BXOR" - public void mBXOR() // throws RecognitionException [2] - { - try - { - int _type = BXOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:681:6: ( '^' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:681:8: '^' - { - Match('^'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BXOR" - - // $ANTLR start "BAND" - public void mBAND() // throws RecognitionException [2] - { - try - { - int _type = BAND; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:682:6: ( '&' ) - // C:\\Users\\Steve\\Documents\\NHibernate\\nhibernate\\src\\NHibernate\\Hql\\Ast\\ANTLR\\Hql.g:682:8: '&' - { - Match('&'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BAND" - - // $ANTLR start "BNOT" - public void mBNOT() // throws RecognitionException [2] - { - try - { - int _type = BNOT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\St... [truncated message content] |
From: <ste...@us...> - 2010-04-29 21:01:18
|
Revision: 4975 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4975&view=rev Author: steverstrong Date: 2010-04-29 21:01:11 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Updated to latest version of ANTLR (ANTLRWorks 3.2 for code generation, 3.1.3 C# runtime) Modified Paths: -------------- trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll trunk/nhibernate/lib/net/3.5/antlr.runtime.dll 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/Tree/ASTNode.cs Modified: trunk/nhibernate/lib/net/3.5/Antlr3.Runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/lib/net/3.5/antlr.runtime.dll =================================================================== (Binary files differ) Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-04-27 16:54:44 UTC (rev 4974) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2010-04-29 21:01:11 UTC (rev 4975) @@ -1,4729 +1,4729 @@ -// $ANTLR 3.1.2 /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g 2009-08-19 15:39:23 - -// The variable 'variable' is assigned but its value is never used. -#pragma warning disable 168, 219 -// Unreachable code detected. -#pragma warning disable 162 -namespace NHibernate.Hql.Ast.ANTLR -{ - -using System; -using Antlr.Runtime; -using IList = System.Collections.IList; -using ArrayList = System.Collections.ArrayList; -using Stack = Antlr.Runtime.Collections.StackList; - -using IDictionary = System.Collections.IDictionary; -using Hashtable = System.Collections.Hashtable; - -public partial class HqlLexer : Lexer { - public const int EXPR_LIST = 73; - public const int EXISTS = 19; - public const int COMMA = 99; - public const int FETCH = 21; - public const int MINUS = 115; - public const int AS = 7; - public const int END = 56; - public const int INTO = 30; - public const int FALSE = 20; - public const int ELEMENTS = 17; - public const int THEN = 58; - public const int ALIAS = 70; - public const int BOR = 111; - public const int ON = 60; - public const int DOT = 15; - public const int ORDER = 41; - public const int AND = 6; - public const int CONSTANT = 92; - public const int UNARY_MINUS = 88; - public const int METHOD_CALL = 79; - public const int RIGHT = 44; - public const int CONCAT = 109; - public const int PROPERTIES = 43; - public const int SELECT = 45; - public const int LE = 107; - public const int BETWEEN = 10; - public const int NUM_INT = 93; - public const int BOTH = 62; - public const int PLUS = 114; - public const int VERSIONED = 52; - public const int MEMBER = 65; - public const int NUM_DECIMAL = 95; - public const int UNION = 50; - public const int DISTINCT = 16; - public const int RANGE = 85; - public const int FILTER_ENTITY = 74; - public const int IDENT = 123; - public const int WHEN = 59; - public const int DESCENDING = 14; - public const int WS = 127; - public const int EQ = 100; - public const int NEW = 37; - public const int LT = 105; - public const int ESCqs = 126; - public const int OF = 67; - public const int UPDATE = 51; - public const int SELECT_FROM = 87; - public const int LITERAL_by = 54; - public const int FLOAT_SUFFIX = 129; - public const int ANY = 5; - public const int UNARY_PLUS = 89; - public const int NUM_FLOAT = 96; - public const int GE = 108; - public const int CASE = 55; - public const int OPEN_BRACKET = 118; - public const int ELSE = 57; - public const int OPEN = 101; - public const int COUNT = 12; - public const int NULL = 39; - public const int T__132 = 132; - public const int COLON = 120; - public const int DIV = 117; - public const int HAVING = 25; - public const int ALL = 4; - public const int SET = 46; - public const int T__131 = 131; - public const int INSERT = 29; - public const int TRUE = 49; - public const int CASE2 = 72; - public const int IS_NOT_NULL = 77; - public const int WHERE = 53; - public const int AGGREGATE = 69; - public const int VECTOR_EXPR = 90; - public const int BNOT = 110; - public const int LEADING = 64; - public const int CLOSE_BRACKET = 119; - public const int NUM_DOUBLE = 94; - public const int INNER = 28; - public const int QUERY = 84; - public const int ORDER_ELEMENT = 83; - public const int OR = 40; - public const int FULL = 23; - public const int INDICES = 27; - public const int IS_NULL = 78; - public const int GROUP = 24; - public const int ESCAPE = 18; - public const int PARAM = 121; - public const int INDEX_OP = 76; - public const int ID_LETTER = 125; - public const int HEX_DIGIT = 130; - public const int LEFT = 33; - public const int TRAILING = 68; - public const int JOIN = 32; - public const int NOT_BETWEEN = 80; - public const int SUM = 48; - public const int BAND = 113; - public const int ROW_STAR = 86; - public const int OUTER = 42; - public const int NOT_IN = 81; - public const int FROM = 22; - public const int DELETE = 13; - public const int OBJECT = 66; - public const int MAX = 35; - public const int NOT_LIKE = 82; - public const int EMPTY = 63; - public const int QUOTED_String = 122; - public const int ASCENDING = 8; - public const int NUM_LONG = 97; - public const int IS = 31; - public const int SQL_NE = 104; - public const int IN_LIST = 75; - public const int WEIRD_IDENT = 91; - public const int NE = 103; - public const int GT = 106; - public const int MIN = 36; - public const int LIKE = 34; - public const int WITH = 61; - public const int IN = 26; - public const int CONSTRUCTOR = 71; - public const int SOME = 47; - public const int CLASS = 11; - public const int EXPONENT = 128; - public const int ID_START_LETTER = 124; - public const int EOF = -1; - public const int CLOSE = 102; - public const int AVG = 9; - public const int BXOR = 112; - public const int STAR = 116; - public const int NOT = 38; - public const int JAVA_CONSTANT = 98; - - // delegates - // delegators - - public HqlLexer() - { - InitializeCyclicDFAs(); - } - public HqlLexer(ICharStream input) - : this(input, null) { - } - public HqlLexer(ICharStream input, RecognizerSharedState state) - : base(input, state) { - InitializeCyclicDFAs(); - - } - - override public string GrammarFileName - { - get { return "/Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:9:5: ( 'all' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:10:5: ( 'any' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:11:5: ( 'and' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:12:4: ( 'as' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:13:11: ( 'asc' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:14:5: ( 'avg' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:15:9: ( 'between' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:16:7: ( 'class' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:17:7: ( 'count' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:18:8: ( 'delete' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:19:12: ( 'desc' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:20:10: ( 'distinct' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:21:10: ( 'elements' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:22:8: ( 'escape' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:23:8: ( 'exists' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:24:7: ( 'false' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:25:7: ( 'fetch' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:26:6: ( 'from' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:27:6: ( 'full' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:28:7: ( 'group' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:29:8: ( 'having' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:30:4: ( 'in' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:31:9: ( 'indices' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:32:7: ( 'inner' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:33:8: ( 'insert' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:34:6: ( 'into' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:35:4: ( 'is' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:36:6: ( 'join' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:37:6: ( 'left' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:38:6: ( 'like' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:39:5: ( 'max' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:40:5: ( 'min' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:41:5: ( 'new' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:42:5: ( 'not' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:43:6: ( 'null' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:44:4: ( 'or' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:45:7: ( 'order' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:46:7: ( 'outer' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:47:12: ( 'properties' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:48:7: ( 'right' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:49:8: ( 'select' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:50:5: ( 'set' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:51:6: ( 'some' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:52:5: ( 'sum' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:53:6: ( 'true' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:54:7: ( 'union' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:55:8: ( 'update' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:56:11: ( 'versioned' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:57:7: ( 'where' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:58:12: ( 'by' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:59:6: ( 'case' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:60:5: ( 'end' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:61:6: ( 'else' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:62:6: ( 'then' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:63:6: ( 'when' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:64:4: ( 'on' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:65:6: ( 'with' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:66:6: ( 'both' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:67:7: ( 'empty' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:68:9: ( 'leading' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:69:8: ( 'member' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:70:8: ( 'object' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:71:4: ( 'of' ) - // /Users/Steve/Projects/NHibernate/Trunk/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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:72:10: ( 'trailing' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__131" - public void mT__131() // throws RecognitionException [2] - { - try - { - int _type = T__131; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:73:8: ( 'ascending' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__131" - - // $ANTLR start "T__132" - public void mT__132() // throws RecognitionException [2] - { - try - { - int _type = T__132; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:74:8: ( 'descending' ) - // /Users/Steve/Projects/NHibernate/Trunk/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__132" - - // $ANTLR start "EQ" - public void mEQ() // throws RecognitionException [2] - { - try - { - int _type = EQ; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:672:3: ( '=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:672: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:673:3: ( '<' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:673: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:674:3: ( '>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:674: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:675:7: ( '<>' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:675: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676: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 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676:5: '!=' - { - Match("!="); if (state.failed) return ; - - - } - break; - case 2 : - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:676: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:677:3: ( '<=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:677: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; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:678:3: ( '>=' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:678:5: '>=' - { - Match(">="); if (state.failed) return ; - - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "GE" - - // $ANTLR start "BOR" - public void mBOR() // throws RecognitionException [2] - { - try - { - int _type = BOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:680:5: ( '|' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:680:8: '|' - { - Match('|'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BOR" - - // $ANTLR start "BXOR" - public void mBXOR() // throws RecognitionException [2] - { - try - { - int _type = BXOR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:681:6: ( '^' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:681:8: '^' - { - Match('^'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BXOR" - - // $ANTLR start "BAND" - public void mBAND() // throws RecognitionException [2] - { - try - { - int _type = BAND; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:682:6: ( '&' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:682:8: '&' - { - Match('&'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BAND" - - // $ANTLR start "BNOT" - public void mBNOT() // throws RecognitionException [2] - { - try - { - int _type = BNOT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:683:6: ( '!' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:683:8: '!' - { - Match('!'); if (state.failed) return ; - - } - - state.type = _type; - state.channel = _channel; - } - finally - { - } - } - // $ANTLR end "BNOT" - - // $ANTLR start "COMMA" - public void mCOMMA() // throws RecognitionException [2] - { - try - { - int _type = COMMA; - int _channel = DEFAULT_TOKEN_CHANNEL; - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:685:6: ( ',' ) - // /Users/Steve/Projects/NHibernate/Trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:685: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] - ... [truncated message content] |
From: <ric...@us...> - 2010-04-27 16:54:50
|
Revision: 4974 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4974&view=rev Author: ricbrown Date: 2010-04-27 16:54:44 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Added RowCountInt64 to IQueryOver. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs trunk/nhibernate/src/NHibernate/IQueryOver.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-04-27 16:28:10 UTC (rev 4973) +++ trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-04-27 16:54:44 UTC (rev 4974) @@ -124,6 +124,20 @@ } /// <summary> + /// Clones the QueryOver, clears the orders and paging, and projects the RowCount (Int64) + /// </summary> + /// <returns></returns> + public QueryOver<TRoot,TRoot> ToRowCountInt64Query() + { + return + Clone() + .ClearOrders() + .Skip(0) + .Take(RowSelection.NoValue) + .Select(Projections.RowCountInt64()); + } + + /// <summary> /// Creates an exact clone of the QueryOver /// </summary> public QueryOver<TRoot,TRoot> Clone() @@ -152,9 +166,15 @@ IQueryOver<TRoot,TRoot> IQueryOver<TRoot>.ToRowCountQuery() { return ToRowCountQuery(); } + IQueryOver<TRoot,TRoot> IQueryOver<TRoot>.ToRowCountInt64Query() + { return ToRowCountInt64Query(); } + int IQueryOver<TRoot>.RowCount() { return ToRowCountQuery().SingleOrDefault<int>(); } + long IQueryOver<TRoot>.RowCountInt64() + { return ToRowCountInt64Query().SingleOrDefault<long>(); } + TRoot IQueryOver<TRoot>.SingleOrDefault() { return SingleOrDefault(); } Modified: trunk/nhibernate/src/NHibernate/IQueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-04-27 16:28:10 UTC (rev 4973) +++ trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-04-27 16:54:44 UTC (rev 4974) @@ -56,11 +56,22 @@ IQueryOver<TRoot,TRoot> ToRowCountQuery(); /// <summary> - /// Short for ToRowCountQuery().SingleOrDefault() + /// Clones the QueryOver, removes orders and paging, and projects the row-count (Int64) + /// for the query /// </summary> + IQueryOver<TRoot,TRoot> ToRowCountInt64Query(); + + /// <summary> + /// Short for ToRowCountQuery().SingleOrDefault<int>() + /// </summary> int RowCount(); /// <summary> + /// Short for ToRowCountInt64Query().SingleOrDefault<long>() + /// </summary> + long RowCountInt64(); + + /// <summary> /// Convenience method to return a single instance that matches /// the query, or null if the query returns no results. /// </summary> Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-04-27 16:28:10 UTC (rev 4973) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-04-27 16:54:44 UTC (rev 4974) @@ -278,10 +278,13 @@ IList<Person> results = query.List(); int rowCount = query.RowCount(); + object bigRowCount = query.RowCountInt64(); Assert.That(results.Count, Is.EqualTo(1)); Assert.That(results[0].Name, Is.EqualTo("Name 3")); Assert.That(rowCount, Is.EqualTo(4)); + Assert.That(bigRowCount, Is.TypeOf<long>()); + Assert.That(bigRowCount, Is.EqualTo(4)); } } Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs 2010-04-27 16:28:10 UTC (rev 4973) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/QueryOverFixture.cs 2010-04-27 16:54:44 UTC (rev 4974) @@ -552,6 +552,31 @@ AssertCriteriaAreEqual(expected.UnderlyingCriteria, actual); } + [Test] + public void TransformQueryOverToRowCount64() + { + IQueryOver<Person> expected = + CreateTestQueryOver<Person>() + .Where(p => p.Name == "test") + .JoinQueryOver(p => p.Children) + .Where((Child c) => c.Age == 5) + .Select(Projections.RowCountInt64()); + + IQueryOver<Person> actual = + CreateTestQueryOver<Person>() + .Where(p => p.Name == "test") + .JoinQueryOver(p => p.Children) + .Where((Child c) => c.Age == 5) + .OrderBy(c => c.Age).Asc + .Skip(20) + .Take(10); + + expected = expected.Clone(); + actual = actual.ToRowCountInt64Query(); + + AssertCriteriaAreEqual(expected.UnderlyingCriteria, actual); + } + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-04-27 16:28:16
|
Revision: 4973 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4973&view=rev Author: ricbrown Date: 2010-04-27 16:28:10 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Implement NH-2186 (Allow MultiCriteria to directly add IQueryOver; improvement suggested by Jason Dentler) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs trunk/nhibernate/src/NHibernate/IMultiCriteria.cs trunk/nhibernate/src/NHibernate/IQueryOver.cs trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs Modified: trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-04-22 22:25:21 UTC (rev 4972) +++ trunk/nhibernate/src/NHibernate/Criterion/QueryOver.cs 2010-04-27 16:28:10 UTC (rev 4973) @@ -35,6 +35,11 @@ get { return criteria; } } + public ICriteria RootCriteria + { + get { return impl; } + } + public DetachedCriteria DetachedCriteria { get { return new DetachedCriteria(impl, impl); } @@ -138,9 +143,6 @@ } - ICriteria IQueryOver<TRoot>.UnderlyingCriteria - { get { return UnderlyingCriteria; } } - IList<TRoot> IQueryOver<TRoot>.List() { return List(); } Modified: trunk/nhibernate/src/NHibernate/IMultiCriteria.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IMultiCriteria.cs 2010-04-22 22:25:21 UTC (rev 4972) +++ trunk/nhibernate/src/NHibernate/IMultiCriteria.cs 2010-04-27 16:28:10 UTC (rev 4973) @@ -83,6 +83,44 @@ IMultiCriteria Add(string key, DetachedCriteria detachedCriteria); /// <summary> + /// Adds the specified IQueryOver to the query. The result will be contained in a <see cref="System.Collections.Generic.List{resultGenericListType}"/> + /// </summary> + /// <param name="resultGenericListType">Return results in a <see cref="System.Collections.Generic.List{resultGenericListType}"/></param> + /// <param name="queryOver">The IQueryOver.</param> + /// <returns></returns> + IMultiCriteria Add(System.Type resultGenericListType, IQueryOver queryOver); + + /// <summary> + /// Adds the specified IQueryOver to the query. The result will be contained in a <see cref="System.Collections.Generic.List{T}"/> + /// </summary> + /// <param name="queryOver">The IQueryOver.</param> + /// <returns></returns> + IMultiCriteria Add<T>(IQueryOver<T> queryOver); + + /// <summary> + /// Adds the specified IQueryOver to the query. The result will be contained in a <see cref="System.Collections.Generic.List{U}"/> + /// </summary> + /// <param name="queryOver">The IQueryOver.</param> + /// <returns></returns> + IMultiCriteria Add<U>(IQueryOver queryOver); + + /// <summary> + /// Adds the specified IQueryOver to the query, and associates it with the given key. The result will be contained in a <see cref="System.Collections.Generic.List{T}"/> + /// </summary> + /// <param name="key">The key</param> + /// <param name="queryOver">The IQueryOver</param> + /// <returns></returns> + IMultiCriteria Add<T>(string key, IQueryOver<T> queryOver); + + /// <summary> + /// Adds the specified IQueryOver to the query, and associates it with the given key. The result will be contained in a <see cref="System.Collections.Generic.List{U}"/> + /// </summary> + /// <param name="key">The key</param> + /// <param name="queryOver">The IQueryOver</param> + /// <returns></returns> + IMultiCriteria Add<U>(string key, IQueryOver queryOver); + + /// <summary> /// Sets whatevert this criteria is cacheable. /// </summary> /// <param name="cachable">if set to <c>true</c> [cachable].</param> Modified: trunk/nhibernate/src/NHibernate/IQueryOver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-04-22 22:25:21 UTC (rev 4972) +++ trunk/nhibernate/src/NHibernate/IQueryOver.cs 2010-04-27 16:28:10 UTC (rev 4973) @@ -10,6 +10,19 @@ namespace NHibernate { + public interface IQueryOver + { + /// <summary> + /// Access the underlying ICriteria + /// </summary> + ICriteria UnderlyingCriteria { get; } + + /// <summary> + /// Access the root underlying ICriteria + /// </summary> + ICriteria RootCriteria { get; } + } + /// <summary> /// QueryOver<TRoot> is an API for retrieving entities by composing /// <see cref="Criterion.Expression" /> objects expressed using Lambda expression syntax. @@ -22,14 +35,9 @@ /// .List(); /// </code> /// </remarks> - public interface IQueryOver<TRoot> + public interface IQueryOver<TRoot> : IQueryOver { /// <summary> - /// Access the underlying ICriteria - /// </summary> - ICriteria UnderlyingCriteria { get; } - - /// <summary> /// Get the results of the root type and fill the <see cref="IList<T>"/> /// </summary> /// <returns>The list filled with the results.</returns> Modified: trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2010-04-22 22:25:21 UTC (rev 4972) +++ trunk/nhibernate/src/NHibernate/Impl/MultiCriteriaImpl.cs 2010-04-27 16:28:10 UTC (rev 4973) @@ -424,6 +424,31 @@ return this; } + public IMultiCriteria Add(System.Type resultGenericListType, IQueryOver queryOver) + { + return Add(resultGenericListType, queryOver.RootCriteria); + } + + public IMultiCriteria Add<T>(IQueryOver<T> queryOver) + { + return Add<T>(queryOver.RootCriteria); + } + + public IMultiCriteria Add<U>(IQueryOver queryOver) + { + return Add<U>(queryOver.RootCriteria); + } + + public IMultiCriteria Add<T>(string key, IQueryOver<T> queryOver) + { + return Add<T>(key, queryOver.RootCriteria); + } + + public IMultiCriteria Add<U>(string key, IQueryOver queryOver) + { + return Add<U>(key, queryOver.RootCriteria); + } + public IMultiCriteria SetCacheable(bool cachable) { isCacheable = cachable; Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-04-22 22:25:21 UTC (rev 4972) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/IntegrationFixture.cs 2010-04-27 16:28:10 UTC (rev 4973) @@ -265,24 +265,8 @@ [Test] public void RowCount() { - using (ISession s = OpenSession()) - using (ITransaction t = s.BeginTransaction()) - { - s.Save(new Person() { Name = "Name 1", Age = 1 } - .AddChild(new Child() { Nickname = "Name 1.1", Age = 1})); + SetupPagingData(); - s.Save(new Person() { Name = "Name 2", Age = 2 } - .AddChild(new Child() { Nickname = "Name 2.1", Age = 3})); - - s.Save(new Person() { Name = "Name 3", Age = 3 } - .AddChild(new Child() { Nickname = "Name 3.1", Age = 2})); - - s.Save(new Person() { Name = "Name 4", Age = 4 } - .AddChild(new Child() { Nickname = "Name 4.1", Age = 4})); - - t.Commit(); - } - using (ISession s = OpenSession()) { IQueryOver<Person> query = @@ -301,6 +285,79 @@ } } + [Test] + public void MultiCriteria() + { + SetupPagingData(); + + using (ISession s = OpenSession()) + { + IQueryOver<Person> query = + s.QueryOver<Person>() + .JoinQueryOver(p => p.Children) + .OrderBy(c => c.Age).Desc + .Skip(2) + .Take(1); + + var multiCriteria = + s.CreateMultiCriteria() + .Add("page", query) + .Add<int>("count", query.ToRowCountQuery()); + + var pageResults = (IList<Person>) multiCriteria.GetResult("page"); + var countResults = (IList<int>) multiCriteria.GetResult("count"); + + Assert.That(pageResults.Count, Is.EqualTo(1)); + Assert.That(pageResults[0].Name, Is.EqualTo("Name 3")); + Assert.That(countResults.Count, Is.EqualTo(1)); + Assert.That(countResults[0], Is.EqualTo(4)); + } + + using (ISession s = OpenSession()) + { + QueryOver<Person> query = + QueryOver.Of<Person>() + .JoinQueryOver(p => p.Children) + .OrderBy(c => c.Age).Desc + .Skip(2) + .Take(1); + + var multiCriteria = + s.CreateMultiCriteria() + .Add("page", query) + .Add<int>("count", query.ToRowCountQuery()); + + var pageResults = (IList<Person>) multiCriteria.GetResult("page"); + var countResults = (IList<int>) multiCriteria.GetResult("count"); + + Assert.That(pageResults.Count, Is.EqualTo(1)); + Assert.That(pageResults[0].Name, Is.EqualTo("Name 3")); + Assert.That(countResults.Count, Is.EqualTo(1)); + Assert.That(countResults[0], Is.EqualTo(4)); + } + } + + private void SetupPagingData() + { + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Save(new Person() { Name = "Name 1", Age = 1 } + .AddChild(new Child() { Nickname = "Name 1.1", Age = 1})); + + s.Save(new Person() { Name = "Name 2", Age = 2 } + .AddChild(new Child() { Nickname = "Name 2.1", Age = 3})); + + s.Save(new Person() { Name = "Name 3", Age = 3 } + .AddChild(new Child() { Nickname = "Name 3.1", Age = 2})); + + s.Save(new Person() { Name = "Name 4", Age = 4 } + .AddChild(new Child() { Nickname = "Name 4.1", Age = 4})); + + t.Commit(); + } + } + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2010-04-22 22:25:27
|
Revision: 4972 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4972&view=rev Author: ayenderahien Date: 2010-04-22 22:25:21 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Applying patch for NH-2131 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Transaction/AdoNetTransactionFactory.cs trunk/nhibernate/src/NHibernate/Transaction/AdoNetWithDistrubtedTransactionFactory.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Model.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/PerfTest.cs trunk/nhibernate/src/NHibernate.TestDatabaseSetup/Properties/ Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2010-04-13 18:10:31 UTC (rev 4971) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2010-04-22 22:25:21 UTC (rev 4972) @@ -186,12 +186,9 @@ protected internal virtual void CheckAndUpdateSessionStatus() { - using (new SessionIdLoggingContext(SessionId)) - { - ErrorIfClosed(); - EnlistInAmbientTransactionIfNeeded(); - } - } + ErrorIfClosed(); + EnlistInAmbientTransactionIfNeeded(); + } protected internal virtual void ErrorIfClosed() { @@ -335,10 +332,7 @@ protected void EnlistInAmbientTransactionIfNeeded() { - using (new SessionIdLoggingContext(SessionId)) - { - factory.TransactionFactory.EnlistInDistributedTransactionIfNeeded(this); - } + factory.TransactionFactory.EnlistInDistributedTransactionIfNeeded(this); } } } Modified: trunk/nhibernate/src/NHibernate/Transaction/AdoNetTransactionFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Transaction/AdoNetTransactionFactory.cs 2010-04-13 18:10:31 UTC (rev 4971) +++ trunk/nhibernate/src/NHibernate/Transaction/AdoNetTransactionFactory.cs 2010-04-22 22:25:21 UTC (rev 4972) @@ -7,6 +7,7 @@ using NHibernate.Engine; using NHibernate.Engine.Transaction; using NHibernate.Exceptions; +using NHibernate.Impl; namespace NHibernate.Transaction { @@ -64,30 +65,34 @@ } catch (Exception t) { - try - { - if (trans != null && connection.State != ConnectionState.Closed) - { - trans.Rollback(); - } - } - catch (Exception ignore) - { - isolaterLog.Debug("unable to release connection on exception [" + ignore + "]"); - } + using (new SessionIdLoggingContext(session.SessionId)) + { + try + { + if (trans != null && connection.State != ConnectionState.Closed) + { + trans.Rollback(); + } + } + catch (Exception ignore) + { + isolaterLog.Debug("unable to release connection on exception [" + ignore + "]"); + } - if (t is HibernateException) - { - throw; - } - else if (t is DbException) - { - throw ADOExceptionHelper.Convert(session.Factory.SQLExceptionConverter, t, "error performing isolated work"); - } - else - { - throw new HibernateException("error performing isolated work", t); - } + if (t is HibernateException) + { + throw; + } + else if (t is DbException) + { + throw ADOExceptionHelper.Convert(session.Factory.SQLExceptionConverter, t, + "error performing isolated work"); + } + else + { + throw new HibernateException("error performing isolated work", t); + } + } } finally { Modified: trunk/nhibernate/src/NHibernate/Transaction/AdoNetWithDistrubtedTransactionFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Transaction/AdoNetWithDistrubtedTransactionFactory.cs 2010-04-13 18:10:31 UTC (rev 4971) +++ trunk/nhibernate/src/NHibernate/Transaction/AdoNetWithDistrubtedTransactionFactory.cs 2010-04-22 22:25:21 UTC (rev 4972) @@ -26,34 +26,42 @@ public void EnlistInDistributedTransactionIfNeeded(ISessionImplementor session) { - if (session.TransactionContext != null) - return; - if (System.Transactions.Transaction.Current == null) - return; - var transactionContext = new DistributedTransactionContext(session, System.Transactions.Transaction.Current); - session.TransactionContext = transactionContext; - logger.DebugFormat("enlisted into DTC transaction: {0}", transactionContext.AmbientTransation.IsolationLevel); - session.AfterTransactionBegin(null); - transactionContext.AmbientTransation.TransactionCompleted += delegate(object sender, TransactionEventArgs e) - { - bool wasSuccessful = false; - try - { - wasSuccessful = e.Transaction.TransactionInformation.Status - == TransactionStatus.Committed; - } - catch (ObjectDisposedException ode) - { - logger.Warn("Completed transaction was disposed, assuming transaction rollback", ode); - } - session.AfterTransactionCompletion(wasSuccessful, null); - if (transactionContext.ShouldCloseSessionOnDistributedTransactionCompleted) - { - session.CloseSessionFromDistributedTransaction(); - } - session.TransactionContext = null; - }; - transactionContext.AmbientTransation.EnlistVolatile(transactionContext, EnlistmentOptions.EnlistDuringPrepareRequired); + if (session.TransactionContext != null) + return; + if (System.Transactions.Transaction.Current == null) + return; + var transactionContext = new DistributedTransactionContext(session, + System.Transactions.Transaction.Current); + session.TransactionContext = transactionContext; + logger.DebugFormat("enlisted into DTC transaction: {0}", + transactionContext.AmbientTransation.IsolationLevel); + session.AfterTransactionBegin(null); + transactionContext.AmbientTransation.TransactionCompleted += + delegate(object sender, TransactionEventArgs e) + { + using (new SessionIdLoggingContext(session.SessionId)) + { + bool wasSuccessful = false; + try + { + wasSuccessful = e.Transaction.TransactionInformation.Status + == TransactionStatus.Committed; + } + catch (ObjectDisposedException ode) + { + logger.Warn("Completed transaction was disposed, assuming transaction rollback", ode); + } + session.AfterTransactionCompletion(wasSuccessful, null); + if (transactionContext.ShouldCloseSessionOnDistributedTransactionCompleted) + { + session.CloseSessionFromDistributedTransaction(); + } + session.TransactionContext = null; + } + }; + transactionContext.AmbientTransation.EnlistVolatile(transactionContext, + EnlistmentOptions.EnlistDuringPrepareRequired); + } public bool IsInDistributedActiveTransaction(ISessionImplementor session) Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Mappings.hbm.xml 2010-04-22 22:25:21 UTC (rev 4972) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + namespace="NHibernate.Test.NHSpecificTest.SessionIdLoggingContextTest" + assembly="NHibernate.Test"> + + <class name="ClassA"> + <id name="Id"> + <generator class="guid.comb"/> + </id> + <property name="Name"/> + <bag name="Children" cascade="all-delete-orphan"> + <key column="Parent" /> + <one-to-many class="ClassA"/> + </bag> + + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Model.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/Model.cs 2010-04-22 22:25:21 UTC (rev 4972) @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.SessionIdLoggingContextTest +{ + public class ClassA + { + public virtual Guid Id { get; set; } + public virtual IList<ClassA> Children { get; set; } + public virtual string Name { get; set; } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/PerfTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/PerfTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/SessionIdLoggingContextTest/PerfTest.cs 2010-04-22 22:25:21 UTC (rev 4972) @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using NHibernate.Criterion; +using NHibernate.Transform; +using NUnit.Framework; +using NHibernate.Transaction; + +namespace NHibernate.Test.NHSpecificTest.SessionIdLoggingContextTest +{ + [TestFixture] + public class PerfTest : BugTestCase + { + const int noOfParents = 1000; + const int noOfChildrenForEachParent = 20; + + [Test] + public void Benchmark() + { + using(var s= OpenSession()) + { + var ticksAtStart = DateTime.Now.Ticks; + var res = s.CreateCriteria<ClassA>() + .SetFetchMode("Children", FetchMode.Join) + .SetResultTransformer(Transformers.DistinctRootEntity) + .Add(Restrictions.Eq("Name", "Parent")) + .List<ClassA>(); + Console.WriteLine(TimeSpan.FromTicks(DateTime.Now.Ticks-ticksAtStart)); + Assert.AreEqual(noOfParents, res.Count); + Assert.AreEqual(noOfChildrenForEachParent, res[0].Children.Count); + } + } + + protected override void Configure(Cfg.Configuration configuration) + { + //get rid of the overhead supporting distr trans + configuration.SetProperty(Cfg.Environment.TransactionStrategy, typeof(AdoNetTransactionFactory).FullName); + } + + protected override void OnSetUp() + { + using (var s = OpenSession()) + { + using (var tx = s.BeginTransaction()) + { + for (var i = 0; i < noOfParents; i++) + { + var parent = createEntity("Parent"); + for (var j = 0; j < noOfChildrenForEachParent; j++) + { + var child = createEntity("Child"); + parent.Children.Add(child); + } + s.Save(parent); + } + tx.Commit(); + } + } + } + + protected override void OnTearDown() + { + using(var s = OpenSession()) + { + using(var tx = s.BeginTransaction()) + { + s.CreateQuery("delete from ClassA").ExecuteUpdate(); + tx.Commit(); + } + } + } + + private static ClassA createEntity(string name) + { + var obj = new ClassA + { + Children = new List<ClassA>(), + Name = name + }; + return obj; + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-13 18:10:31 UTC (rev 4971) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-22 22:25:21 UTC (rev 4972) @@ -1291,6 +1291,8 @@ <Compile Include="NHSpecificTest\ProxyValidator\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1362\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1362\Model.cs" /> + <Compile Include="NHSpecificTest\SessionIdLoggingContextTest\Model.cs" /> + <Compile Include="NHSpecificTest\SessionIdLoggingContextTest\PerfTest.cs" /> <Compile Include="NHSpecificTest\SetFixture.cs" /> <Compile Include="NHSpecificTest\SimpleComponentFixture.cs" /> <Compile Include="NHSpecificTest\UnsavedValueFixture.cs" /> @@ -2129,8 +2131,9 @@ <EmbeddedResource Include="CfgTest\Loquacious\EntityToCache.hbm.xml" /> <EmbeddedResource Include="DriverTest\SqlServerCeEntity.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> - <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> - <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" /> + <EmbeddedResource Include="ListIndex\SimpleOneToMany.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\SessionIdLoggingContextTest\Mappings.hbm.xml" /> + <EmbeddedResource Include="NHSpecificTest\NH2113\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1981\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2074\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH2077\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-04-13 18:10:39
|
Revision: 4971 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4971&view=rev Author: ricbrown Date: 2010-04-13 18:10:31 +0000 (Tue, 13 Apr 2010) Log Message: ----------- Fix NH-2173 (SetMaxResults fails when Dialect has BindLimitParametersFirst == true) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs trunk/nhibernate/src/NHibernate/Loader/Loader.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Pagination/CustomDialectFixture.cs trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDialect.cs trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDriver.cs Modified: trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2010-04-07 10:48:41 UTC (rev 4970) +++ trunk/nhibernate/src/NHibernate/Engine/QueryParameters.cs 2010-04-13 18:10:31 UTC (rev 4971) @@ -526,7 +526,7 @@ public int BindParameters(IDbCommand command, int start, ISessionImplementor session) { - int location = 0; + int location = start; var values = new List<object>(); var types = new List<IType>(); var sources = new List<string>(); @@ -565,13 +565,14 @@ } int span = 0; - for (int i = 0; i < values.Count; i++) + for (int i = start; i < values.Count; i++) { IType type = types[i]; object value = values[i]; + string source = sources[i]; if (log.IsDebugEnabled) { - log.Debug(string.Format("BindParameters({0}:{1}) {2} -> [{3}]", "Named", type, value, i)); + log.Debug(string.Format("BindParameters({0}:{1}) {2} -> [{3}]", source, type, value, i)); } type.NullSafeSet(command, value, start + span, session); span += type.GetColumnSpan(session.Factory); Modified: trunk/nhibernate/src/NHibernate/Loader/Loader.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2010-04-07 10:48:41 UTC (rev 4970) +++ trunk/nhibernate/src/NHibernate/Loader/Loader.cs 2010-04-13 18:10:31 UTC (rev 4971) @@ -1104,9 +1104,10 @@ bool useLimit = UseLimit(selection, dialect); bool hasFirstRow = GetFirstRow(selection) > 0; bool useOffset = hasFirstRow && useLimit && dialect.SupportsLimitOffset; + int startIndex = GetFirstLimitParameterCount(dialect, useLimit, hasFirstRow, useOffset); // TODO NH bool callable = queryParameters.Callable; - SqlType[] parameterTypes = queryParameters.PrepareParameterTypes(sqlString, Factory, GetNamedParameterLocs, 0, useLimit, useOffset); + SqlType[] parameterTypes = queryParameters.PrepareParameterTypes(sqlString, Factory, GetNamedParameterLocs, startIndex, useLimit, useOffset); if (useLimit) { @@ -1204,6 +1205,13 @@ } } + private int GetFirstLimitParameterCount(Dialect.Dialect dialect, bool useLimit, bool hasFirstRow, bool useOffset) + { + if (!useLimit) return 0; + if (!dialect.BindLimitParametersFirst) return 0; + return (hasFirstRow && useOffset) ? 2 : 1; + } + /// <summary> /// Bind parameters needed by the dialect-specific LIMIT clause /// </summary> @@ -1264,7 +1272,7 @@ // NH Different behavior: // The responsibility of parameter binding was entirely moved to QueryParameters // to deal with positionslParameter+NamedParameter+ParameterOfFilters - return queryParameters.BindParameters(statement, 0, session); + return queryParameters.BindParameters(statement, startIndex, session); } public virtual int[] GetNamedParameterLocs(string name) @@ -1693,8 +1701,9 @@ bool useLimit = UseLimit(selection, dialect); bool hasFirstRow = GetFirstRow(selection) > 0; bool useOffset = hasFirstRow && useLimit && dialect.SupportsLimitOffset; + int limitParameterCount = GetFirstLimitParameterCount(dialect, useLimit, hasFirstRow, useOffset); - SqlType[] sqlTypes = parameters.PrepareParameterTypes(sqlString, Factory, GetNamedParameterLocs, startParameterIndex, useLimit, useOffset); + SqlType[] sqlTypes = parameters.PrepareParameterTypes(sqlString, Factory, GetNamedParameterLocs, startParameterIndex + limitParameterCount, useLimit, useOffset); if (useLimit) { Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-07 10:48:41 UTC (rev 4970) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-04-13 18:10:31 UTC (rev 4971) @@ -1320,6 +1320,9 @@ <Compile Include="Operations\PersonalDetails.cs" /> <Compile Include="Operations\TimestampedEntity.cs" /> <Compile Include="Operations\VersionedEntity.cs" /> + <Compile Include="Pagination\CustomDialectFixture.cs" /> + <Compile Include="Pagination\CustomMsSqlDialect.cs" /> + <Compile Include="Pagination\CustomMsSqlDriver.cs" /> <Compile Include="Pagination\DataPoint.cs" /> <Compile Include="Pagination\PaginationFixture.cs" /> <Compile Include="ProjectionFixtures\Key.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/Pagination/CustomDialectFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Pagination/CustomDialectFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Pagination/CustomDialectFixture.cs 2010-04-13 18:10:31 UTC (rev 4971) @@ -0,0 +1,119 @@ +using System.Collections; +using System.Collections.Generic; +using NHibernate.Cfg; +using NHibernate.Criterion; +using NUnit.Framework; +using Environment = NHibernate.Cfg.Environment; + +namespace NHibernate.Test.Pagination +{ + [TestFixture] + public class CustomDialectFixture : TestCase + { + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + protected override IList Mappings + { + get { return new[] {"Pagination.DataPoint.hbm.xml"}; } + } + + protected override void Configure(Configuration configuration) + { + if (!(Dialect is Dialect.MsSql2005Dialect)) + Assert.Ignore("Test is for SQL dialect only"); + + cfg.SetProperty(Environment.Dialect, typeof(CustomMsSqlDialect).AssemblyQualifiedName); + cfg.SetProperty(Environment.ConnectionDriver, typeof(CustomMsSqlDriver).AssemblyQualifiedName); + } + + private CustomMsSqlDialect CustomDialect + { + get { return (CustomMsSqlDialect)Sfi.Dialect; } + } + + private CustomMsSqlDriver CustomDriver + { + get { return (CustomMsSqlDriver)Sfi.ConnectionProvider.Driver; } + } + + protected override void OnSetUp() + { + base.OnSetUp(); + + CustomDriver.CustomMsSqlDialect = CustomDialect; + + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Save(new DataPoint() { X = 5 }); + s.Save(new DataPoint() { X = 6 }); + s.Save(new DataPoint() { X = 7 }); + s.Save(new DataPoint() { X = 8 }); + s.Save(new DataPoint() { X = 9 }); + t.Commit(); + } + } + + protected override void OnTearDown() + { + + using (ISession s = OpenSession()) + using (ITransaction t = s.BeginTransaction()) + { + s.Delete("from DataPoint"); + t.Commit(); + } + base.OnTearDown(); + } + + [Test] + public void LimitFirst() + { + using (ISession s = OpenSession()) + { + CustomDialect.ForcedSupportsVariableLimit = true; + CustomDialect.ForcedBindLimitParameterFirst = true; + + var points = + s.CreateCriteria<DataPoint>() + .Add(Restrictions.Gt("X", 5.1d)) + .AddOrder(Order.Asc("X")) + .SetFirstResult(1) + .SetMaxResults(2) + .List<DataPoint>(); + + Assert.That(points.Count, Is.EqualTo(2)); + Assert.That(points[0].X, Is.EqualTo(7d)); + Assert.That(points[1].X, Is.EqualTo(8d)); + } + } + + [Test] + public void LimitFirstMultiCriteria() + { + using (ISession s = OpenSession()) + { + CustomDialect.ForcedSupportsVariableLimit = true; + CustomDialect.ForcedBindLimitParameterFirst = true; + + var criteria = + s.CreateMultiCriteria() + .Add<DataPoint>( + s.CreateCriteria<DataPoint>() + .Add(Restrictions.Gt("X", 5.1d)) + .AddOrder(Order.Asc("X")) + .SetFirstResult(1) + .SetMaxResults(2)); + + var points = (IList<DataPoint>)criteria.List()[0]; + + Assert.That(points.Count, Is.EqualTo(2)); + Assert.That(points[0].X, Is.EqualTo(7d)); + Assert.That(points[1].X, Is.EqualTo(8d)); + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDialect.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDialect.cs 2010-04-13 18:10:31 UTC (rev 4971) @@ -0,0 +1,17 @@ +using NHibernate.Dialect; + +namespace NHibernate.Test.Pagination +{ + /// <summary> + /// Class to simulate dialects with different binding of limit parameters + /// using an MSSql database + /// </summary> + public class CustomMsSqlDialect : MsSql2005Dialect + { + public bool ForcedBindLimitParameterFirst; + public bool ForcedSupportsVariableLimit; + + public override bool BindLimitParametersFirst { get { return ForcedBindLimitParameterFirst; } } + public override bool SupportsVariableLimit { get { return ForcedSupportsVariableLimit; } } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDriver.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDriver.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Pagination/CustomMsSqlDriver.cs 2010-04-13 18:10:31 UTC (rev 4971) @@ -0,0 +1,35 @@ +using System.Data; +using System.Text.RegularExpressions; +using NHibernate.Driver; +using NUnit.Framework; + +namespace NHibernate.Test.Pagination +{ + /// <summary> + /// Class to work with CustomMsSqlDialect to allow + /// verification of simulated limit parameters + /// </summary> + public class CustomMsSqlDriver : SqlClientDriver + { + public CustomMsSqlDialect CustomMsSqlDialect; + + protected override void OnBeforePrepare(IDbCommand command) + { + bool hasLimit = new Regex(@"select\s+top").IsMatch(command.CommandText.ToLower()); + + if (hasLimit && CustomMsSqlDialect.ForcedSupportsVariableLimit && CustomMsSqlDialect.ForcedBindLimitParameterFirst) + { + int offset = (int)((IDataParameter)command.Parameters[0]).Value; + int limit = (int)((IDataParameter)command.Parameters[1]).Value; + + Assert.That(command.CommandText.ToLower().Contains("top " + limit), + "Expected string containing 'top " + limit + "', but got " + command.CommandText); + + Assert.That(command.CommandText.ToLower().Contains("hibernate_sort_row > " + offset), + "Expected string containing 'hibernate_sort_row > " + offset + "', but got " + command.CommandText); + } + + base.OnBeforePrepare(command); + } + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-04-07 10:48:48
|
Revision: 4970 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4970&view=rev Author: steverstrong Date: 2010-04-07 10:48:41 +0000 (Wed, 07 Apr 2010) Log Message: ----------- Added support for OfType() and "is" in Linq queries Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/Linq/PagingTests.cs trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs Added Paths: ----------- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessOfType.cs Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeBuilder.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -405,5 +405,10 @@ { return new HqlLeftFetchJoin(_factory, expression, @alias); } + + public HqlClass Class() + { + return new HqlClass(_factory); + } } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -697,6 +697,14 @@ } } + public class HqlClass : HqlExpression + { + public HqlClass(IASTFactory factory) + : base(HqlSqlWalker.CLASS, "class", factory) + { + } + } + public class HqlLeft : HqlTreeNode { public HqlLeft(IASTFactory factory) Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -102,8 +102,8 @@ // return VisitListInitExpression((ListInitExpression)expression); case ExpressionType.Parameter: return VisitParameterExpression((ParameterExpression)expression); - //case ExpressionType.TypeIs: - // return VisitTypeBinaryExpression((TypeBinaryExpression)expression); + case ExpressionType.TypeIs: + return VisitTypeBinaryExpression((TypeBinaryExpression)expression); default: if (expression is SubQueryExpression) @@ -136,6 +136,15 @@ } } + private HqlTreeNode VisitTypeBinaryExpression(TypeBinaryExpression expression) + { + return _hqlTreeBuilder.Equality( + _hqlTreeBuilder.Dot( + Visit(expression.Expression).AsExpression(), + _hqlTreeBuilder.Class()), + _hqlTreeBuilder.Ident(expression.TypeOperand.FullName)); + } + protected HqlTreeNode VisitNhStar(NhStarExpression expression) { return _hqlTreeBuilder.Star(); Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -79,6 +79,7 @@ ResultOperatorMap.Add<FetchOneRequest, ProcessFetchOne>(); ResultOperatorMap.Add<FetchManyRequest, ProcessFetchMany>(); ResultOperatorMap.Add<CacheableResultOperator, ProcessCacheable>(); + ResultOperatorMap.Add<OfTypeResultOperator, ProcessOfType>(); } private QueryModelVisitor(VisitorParameters visitorParameters, bool root, QueryModel queryModel) Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessOfType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessOfType.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessOfType.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NHibernate.Hql.Ast; +using Remotion.Data.Linq.Clauses.ResultOperators; +using Remotion.Data.Linq.Clauses.StreamedData; + +namespace NHibernate.Linq.Visitors.ResultOperatorProcessors +{ + public class ProcessOfType : IResultOperatorProcessor<OfTypeResultOperator> + { + public void Process(OfTypeResultOperator resultOperator, QueryModelVisitor queryModelVisitor, IntermediateHqlTree tree) + { + var source = + queryModelVisitor.CurrentEvaluationType.As<StreamedSequenceInfo>().ItemExpression; + + var type = BuildDot(resultOperator.SearchedItemType.FullName.Split('.'), tree.TreeBuilder); + + tree.AddWhereClause(tree.TreeBuilder.Equality( + tree.TreeBuilder.Dot( + HqlGeneratorExpressionTreeVisitor.Visit(source, queryModelVisitor.VisitorParameters).AsExpression(), + tree.TreeBuilder.Class()), + tree.TreeBuilder.Ident(resultOperator.SearchedItemType.FullName))); + } + + private static HqlExpression BuildDot(IEnumerable<string> split, HqlTreeBuilder builder) + { + if (split.Count() == 1) + { + return builder.Ident(split.First()); + } + + return builder.Dot(builder.Ident(split.First()), BuildDot(split.Skip(1), builder)); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-04-07 10:48:41 UTC (rev 4970) @@ -682,6 +682,7 @@ <Compile Include="Linq\ReWriters\RemoveUnnecessaryBodyOperators.cs" /> <Compile Include="Linq\Clauses\LeftJoinClause.cs" /> <Compile Include="Linq\IntermediateHqlTree.cs" /> + <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessOfType.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessCacheable.cs" /> <Compile Include="Linq\Visitors\QuerySourceLocator.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessFetch.cs" /> Modified: trunk/nhibernate/src/NHibernate.Test/Linq/PagingTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/PagingTests.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate.Test/Linq/PagingTests.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -26,7 +26,7 @@ } [Test] - [Ignore("NHibernate does not currently support subqueries in from clause")] + [Ignore("Multiple Takes (or Skips) not handled correctly")] public void CustomersChainedTake() { var q = (from c in db.Customers @@ -41,7 +41,7 @@ } [Test] - [Ignore("NHibernate does not currently support subqueries in from clause")] + [Ignore("Multiple Takes (or Skips) not handled correctly")] public void CustomersChainedSkip() { var q = (from c in db.Customers select c.CustomerId).Skip(10).Skip(5); @@ -53,7 +53,7 @@ [Test] - [Ignore("NHibernate does not currently support subqueries in from clause")] + [Ignore("Count with Skip or Take is incorrect (Skip / Take done on the query not the HQL, so get applied at the wrong point")] public void CountAfterTakeShouldReportTheCorrectNumber() { var users = db.Customers.Skip(3).Take(10); Modified: trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-04-05 07:15:43 UTC (rev 4969) +++ trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-04-07 10:48:41 UTC (rev 4970) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; +using NHibernate.Linq; using NHibernate.Test.Linq.Entities; using NUnit.Framework; @@ -384,5 +385,24 @@ Assert.AreEqual(2, query.Count); } - } + + [Test] + public void SearchOnObjectTypeWithExtensionMethod() + { + var query = (from o in session.Query<Animal>() + select o).OfType<Dog>().ToList(); + + Assert.AreEqual(2, query.Count); + } + + [Test] + public void SearchOnObjectTypeWithIsKeyword() + { + var query = (from o in session.Query<Animal>() + where o is Dog + select o).ToList(); + + Assert.AreEqual(2, query.Count); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-04-05 07:15:49
|
Revision: 4969 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4969&view=rev Author: ricbrown Date: 2010-04-05 07:15:43 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Implement NH-2152 (QueryOver equality to null) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ExpressionProcessorFixture.cs trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/RestrictionsFixture.cs Modified: trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs 2010-04-05 07:14:54 UTC (rev 4968) +++ trunk/nhibernate/src/NHibernate/Impl/ExpressionProcessor.cs 2010-04-05 07:15:43 UTC (rev 4969) @@ -292,6 +292,9 @@ object value = valueExpression.DynamicInvoke(); value = ConvertType(value, propertyType); + if (value == null) + return ProcessSimpleNullExpression(property, be.NodeType); + if (!_simpleExpressionCreators.ContainsKey(be.NodeType)) throw new Exception("Unhandled simple expression type: " + be.NodeType); @@ -300,6 +303,18 @@ return criterion; } + private static ICriterion ProcessSimpleNullExpression(string property, ExpressionType expressionType) + { + if (expressionType == ExpressionType.Equal) + return Restrictions.IsNull(property); + + if (expressionType == ExpressionType.NotEqual) + return Restrictions.Not( + Restrictions.IsNull(property)); + + throw new Exception("Cannot supply null value to operator " + expressionType); + } + private static ICriterion ProcessMemberExpression(BinaryExpression be) { string leftProperty = FindMemberExpression(be.Left); Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ExpressionProcessorFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ExpressionProcessorFixture.cs 2010-04-05 07:14:54 UTC (rev 4968) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/ExpressionProcessorFixture.cs 2010-04-05 07:15:43 UTC (rev 4969) @@ -61,8 +61,7 @@ { Person person = new Person() { Name = null }; ICriterion criterion = ExpressionProcessor.ProcessExpression<Person>(p => p.Name == person.Name); - SimpleExpression simpleExpression = (SimpleExpression)criterion; - Assert.AreEqual(null, simpleExpression.Value); + Assert.That(criterion, Is.InstanceOfType<NullExpression>()); } [Test] Modified: trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/RestrictionsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/RestrictionsFixture.cs 2010-04-05 07:14:54 UTC (rev 4968) +++ trunk/nhibernate/src/NHibernate.Test/Criteria/Lambda/RestrictionsFixture.cs 2010-04-05 07:15:43 UTC (rev 4969) @@ -171,6 +171,56 @@ AssertCriteriaAreEqual(expected, actual); } + [Test] + public void NullRestriction() + { + ICriteria expected = + CreateTestCriteria(typeof(Person), "personAlias") + .Add(Restrictions.IsNull("Name")) + .Add(Restrictions.IsNull("Name")) + .Add(Restrictions.IsNull("Name")) + .Add(Restrictions.IsNull("Father")) + .Add(Restrictions.IsNull("Father")) + .Add(Restrictions.IsNull("NullableGender")) + .Add(Restrictions.IsNull("NullableAge")) + .Add(Restrictions.IsNull("NullableIsParent")) + .Add(Restrictions.Not(Restrictions.IsNull("Name"))) + .Add(Restrictions.Not(Restrictions.IsNull("Name"))) + .Add(Restrictions.Not(Restrictions.IsNull("Name"))) + .Add(Restrictions.Not(Restrictions.IsNull("Father"))) + .Add(Restrictions.Not(Restrictions.IsNull("Father"))) + .Add(Restrictions.Not(Restrictions.IsNull("NullableGender"))) + .Add(Restrictions.Not(Restrictions.IsNull("NullableAge"))) + .Add(Restrictions.Not(Restrictions.IsNull("NullableIsParent"))) + .Add(Restrictions.IsNull("personAlias.Name")); + + Person personAlias = null; + CustomPerson nullPerson = null; + Person.StaticName = null; + Person emptyPerson = new Person() { Name = null }; + var actual = + CreateTestQueryOver<Person>(() => personAlias) + .Where(p => p.Name == null) + .Where(p => p.Name == Person.StaticName) + .Where(p => p.Name == emptyPerson.Name) + .Where(p => p.Father == null) + .Where(p => p.Father == nullPerson) + .Where(p => p.NullableGender == null) + .Where(p => p.NullableAge == null) + .Where(p => p.NullableIsParent == null) + .Where(p => p.Name != null) + .Where(p => p.Name != Person.StaticName) + .Where(p => p.Name != emptyPerson.Name) + .Where(p => p.Father != null) + .Where(p => p.Father != nullPerson) + .Where(p => p.NullableGender != null) + .Where(p => p.NullableAge != null) + .Where(p => p.NullableIsParent != null) + .Where(() => personAlias.Name == null); + + AssertCriteriaAreEqual(expected, actual); + } + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ric...@us...> - 2010-04-05 07:15:00
|
Revision: 4968 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4968&view=rev Author: ricbrown Date: 2010-04-05 07:14:54 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Removed unused folder from project. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj 2010-03-26 18:58:47 UTC (rev 4967) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/NHibernate.TestDatabaseSetup.csproj 2010-04-05 07:14:54 UTC (rev 4968) @@ -56,9 +56,6 @@ <Name>NHibernate</Name> </ProjectReference> </ItemGroup> - <ItemGroup> - <Folder Include="Properties\" /> - </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Oberlies P. <ac...@ko...> - 2010-03-27 22:12:38
|
"--poor perplexed little mortal! whose difficulties one could not even guess at--"we should be quite sure of things. Miss Catherine tells us from books: He would tell us from His memory. People would not be so cruel to Him now. Queen Victoria would not allow any one to crucify Him." I don't think that W. V., in spite of her confidence in my good faith, was quite convinced of the existence of those old forests of which I had told her, until I explained that they were forests of stone, which, if men did not mar them, would blossom for centuries unchanged, though the hands that planted them had long been blown in dust about the world. She understood all that I meant when we visited York and Westminster, and walked through the long avenues of stone palms and pines, with their overarching boughs, and gazed at the marvellous rose-windows in which all the jewels of the world seemed to have been set, and saw the colours streaming through the gorgeous lancets and high many-lighted casements. After that it was delightful to turn over engravings and photographs of ruined abbeys and famous old churches at home and abroad, and to anticipate the good time when we should visit them together, and perhaps not only descend into the crypts but go through the curious galleries which extend over the pillars of the nave, and even climb up to the leaded roof of the tower, or dare the long windy staircases and ladders which mount into the spire, and so look down on the quaint map of streets, and houses, and gardens, and squares, hundreds of feet below. She liked to hear how some of those miracles of stone had been fashioned and completed--how monks in the days of old had travelled over the land with the relics of saints, collecting treasure of all sorts for the expense of the work; how sometimes the people came in |
From: <aye...@us...> - 2010-03-26 18:59:02
|
Revision: 4967 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4967&view=rev Author: ayenderahien Date: 2010-03-26 18:58:47 +0000 (Fri, 26 Mar 2010) Log Message: ----------- Logging that we opened a new stateless session Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2010-03-23 21:19:52 UTC (rev 4966) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2010-03-26 18:58:47 UTC (rev 4967) @@ -39,6 +39,13 @@ temporaryPersistenceContext = new StatefulPersistenceContext(this); connectionManager = new ConnectionManager(this, connection, ConnectionReleaseMode.AfterTransaction, new EmptyInterceptor()); + + if (log.IsDebugEnabled) + { + log.DebugFormat("[session-id={0}] opened session for session factory: [{1}/{2}]", + SessionId, factory.Name, factory.Uuid); + } + CheckAndUpdateSessionStatus(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2010-03-23 21:20:07
|
Revision: 4966 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4966&view=rev Author: ayenderahien Date: 2010-03-23 21:19:52 +0000 (Tue, 23 Mar 2010) Log Message: ----------- Adding passing test Modified Paths: -------------- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs Modified: branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs =================================================================== --- branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs 2010-03-23 21:04:38 UTC (rev 4965) +++ branches/2.1.x/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1908/Fixture.cs 2010-03-23 21:19:52 UTC (rev 4966) @@ -31,5 +31,31 @@ .List(); } } + + [Test] + public void QueryPropertyInBothFilterAndQuery_WithWith() + { + using (ISession s = OpenSession()) + { + s.EnableFilter("validity") + .SetParameter("date", DateTime.Now); + + s.CreateQuery(@" + select + inv.ID + from + Invoice inv + join inv.Category cat with cat.ValidUntil > :now + left join cat.ParentCategory parentCat with parentCat.ID != :myInt + where + inv.ID = :invId + and inv.Issued < :now + ") + .SetDateTime("now", DateTime.Now) + .SetInt32("invId", -999) + .SetInt32("myInt", -888) + .List(); + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2010-03-23 21:04:45
|
Revision: 4965 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4965&view=rev Author: ayenderahien Date: 2010-03-23 21:04:38 +0000 (Tue, 23 Mar 2010) Log Message: ----------- Adding the ability to append to the configuration listeners vs. override them directly. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2010-03-22 15:17:58 UTC (rev 4964) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2010-03-23 21:04:38 UTC (rev 4965) @@ -27,7 +27,7 @@ using NHibernate.Tool.hbm2ddl; using NHibernate.Type; using NHibernate.Util; -using Array=System.Array; +using Array = System.Array; using System.Runtime.Serialization; namespace NHibernate.Cfg @@ -48,7 +48,7 @@ /// </para> /// </remarks> [Serializable] - public class Configuration:ISerializable + public class Configuration : ISerializable { /// <summary>Default name for hibernate configuration file.</summary> public const string DefaultHibernateCfgFileName = "hibernate.cfg.xml"; @@ -75,7 +75,7 @@ protected IDictionary<string, Mappings.TableDescription> tableNameBinding; protected IDictionary<Table, Mappings.ColumnNames> columnNameBindingPerTable; - private static readonly ILog log = LogManager.GetLogger(typeof (Configuration)); + private static readonly ILog log = LogManager.GetLogger(typeof(Configuration)); protected internal SettingsFactory settingsFactory; @@ -92,7 +92,7 @@ collections = GetSerialedObject<IDictionary<string, NHibernate.Mapping.Collection>>(info, "collections"); columnNameBindingPerTable = GetSerialedObject<IDictionary<Table, Mappings.ColumnNames>>(info, - "columnNameBindingPerTable"); + "columnNameBindingPerTable"); defaultAssembly = GetSerialedObject<string>(info, "defaultAssembly"); defaultNamespace = GetSerialedObject<string>(info, "defaultNamespace"); eventListeners = GetSerialedObject<EventListeners>(info, "eventListeners"); @@ -109,7 +109,7 @@ settingsFactory = GetSerialedObject<SettingsFactory>(info, "settingsFactory"); SqlFunctions = GetSerialedObject<IDictionary<string, ISQLFunction>>(info, "sqlFunctions"); SqlResultSetMappings = GetSerialedObject<IDictionary<string, ResultSetMappingDefinition>>(info, - "sqlResultSetMappings"); + "sqlResultSetMappings"); tableNameBinding = GetSerialedObject<IDictionary<string, Mappings.TableDescription>>(info, "tableNameBinding"); tables = GetSerialedObject<IDictionary<string, Table>>(info, "tables"); typeDefs = GetSerialedObject<IDictionary<string, TypeDef>>(info, "typeDefs"); @@ -258,7 +258,7 @@ /// <summary> /// Create a new Configuration object. /// </summary> - public Configuration() : this(new SettingsFactory()) {} + public Configuration() : this(new SettingsFactory()) { } /// <summary> /// The class mappings @@ -509,17 +509,17 @@ } try { - Dialect.Dialect dialect = Dialect.Dialect.GetDialect(properties); - Mappings mappings = CreateMappings(dialect); + Dialect.Dialect dialect = Dialect.Dialect.GetDialect(properties); + Mappings mappings = CreateMappings(dialect); - new MappingRootBinder(mappings, dialect).Bind(mappingDocument); + new MappingRootBinder(mappings, dialect).Bind(mappingDocument); } catch (Exception e) { var message = documentFileName == null - ? "Could not compile deserialized mapping document." - : "Could not compile the mapping document: " + documentFileName; - LogAndThrow(new MappingException(message, e)); + ? "Could not compile deserialized mapping document." + : "Could not compile the mapping document: " + documentFileName; + LogAndThrow(new MappingException(message, e)); } } @@ -531,14 +531,14 @@ { ProcessPreMappingBuildProperties(); return new Mappings(classes, collections, tables, NamedQueries, NamedSQLQueries, SqlResultSetMappings, Imports, - secondPasses, filtersSecondPasses, propertyReferences, namingStrategy, typeDefs, FilterDefinitions, extendsQueue, - auxiliaryDatabaseObjects, tableNameBinding, columnNameBindingPerTable, defaultAssembly, - defaultNamespace, dialect); + secondPasses, filtersSecondPasses, propertyReferences, namingStrategy, typeDefs, FilterDefinitions, extendsQueue, + auxiliaryDatabaseObjects, tableNameBinding, columnNameBindingPerTable, defaultAssembly, + defaultNamespace, dialect); } private void ProcessPreMappingBuildProperties() { - if(preMappingBuildProcessed) + if (preMappingBuildProcessed) { return; } @@ -549,12 +549,12 @@ private void ConfigureCollectionTypeFactory() { var ctfc = GetProperty(Environment.CollectionTypeFactoryClass); - if(string.IsNullOrEmpty(ctfc)) + if (string.IsNullOrEmpty(ctfc)) { return; } var ictfc = Environment.BytecodeProvider as IInjectableCollectionTypeFactoryClass; - if(ictfc == null) + if (ictfc == null) { return; } @@ -927,13 +927,13 @@ var filterNames = new HashedSet<string>(); foreach (var filterDefinition in FilterDefinitions) { - if(filterDefinition.Value == null) + if (filterDefinition.Value == null) { // a class/collection has a filter but the filter-def was not added. filterNames.Add(filterDefinition.Key); } } - if(filterNames.Count > 0) + if (filterNames.Count > 0) { var message = new StringBuilder(); message.Append("filter-def for filter named "); @@ -965,7 +965,7 @@ // if you are going to remove this exception at least add a log.Error // because the usage of filter-def, outside its scope, may cause unexpected behaviour // during queries. - log.ErrorFormat("filter-def for filter named '{0}' was never used to filter classes nor collections.\r\nThis may result in unexpected behavior during queries", filterName); + log.ErrorFormat("filter-def for filter named '{0}' was never used to filter classes nor collections.\r\nThis may result in unexpected behavior during queries", filterName); } } } @@ -988,7 +988,7 @@ foreach (var clazz in classes.Values) { clazz.Validate(mapping); - + if (validateProxy) { ICollection<string> errors = ValidateProxyInterface(clazz, pvalidator); @@ -1067,7 +1067,7 @@ } Property prop = clazz.GetReferencedProperty(upr.propertyName); - ((SimpleValue) prop.Value).IsAlternateUniqueKey = true; + ((SimpleValue)prop.Value).IsAlternateUniqueKey = true; } //TODO: Somehow add the newly created foreign keys to the internal collection @@ -1086,11 +1086,11 @@ FilterDefinition filterDef; var filterName = filterSecondPassArgs.FilterName; FilterDefinitions.TryGetValue(filterName, out filterDef); - if(filterDef == null) + if (filterDef == null) { throw new MappingException("filter-def for filter named " + filterName + " was not found."); } - if(string.IsNullOrEmpty(filterDef.DefaultFilterCondition)) + if (string.IsNullOrEmpty(filterDef.DefaultFilterCondition)) { throw new MappingException("no filter condition found for filter: " + filterName); } @@ -1124,7 +1124,7 @@ if (!classes.TryGetValue(referencedEntityName, out referencedClass)) { string message = string.Format("An association from the table {0} refers to an unmapped class: {1}", fk.Table.Name, - referencedEntityName); + referencedEntityName); LogAndThrow(new MappingException(message)); } @@ -1441,7 +1441,7 @@ { // resource does not exist - throw appropriate exception throw new HibernateException("A ManifestResourceStream could not be created for the resource " + resourceName - + " in Assembly " + assembly.FullName); + + " in Assembly " + assembly.FullName); } return Configure(new XmlTextReader(stream)); @@ -1468,7 +1468,7 @@ if (textReader == null) { throw new HibernateConfigException("Could not configure NHibernate.", - new ArgumentException("A null value was passed in.", "textReader")); + new ArgumentException("A null value was passed in.", "textReader")); } try @@ -1556,7 +1556,7 @@ foreach (var lc in factoryConfiguration.Listeners) { log.Debug("Event listener: " + lc.Type + "=" + lc.Class); - SetListeners(lc.Type, new[] {lc.Class}); + SetListeners(lc.Type, new[] { lc.Class }); } if (!string.IsNullOrEmpty(factoryConfiguration.Name)) @@ -1572,7 +1572,7 @@ { try { - return (RootClass) GetClassMapping(clazz); + return (RootClass)GetClassMapping(clazz); } catch (InvalidCastException) { @@ -1669,7 +1669,8 @@ /// </summary> public IDictionary<string, NamedSQLQueryDefinition> NamedSQLQueries { - get; protected set; + get; + protected set; } /// <summary> @@ -1745,7 +1746,7 @@ hbmDocument.Load(reader); return new NamedXmlDocument(name, hbmDocument); } - catch(MappingException) + catch (MappingException) { throw; } @@ -1806,7 +1807,7 @@ private void ValidationHandler(object o, ValidationEventArgs args) { string message = string.Format("{0}({1},{2}): XML validation error: {3}", currentDocumentName, - args.Exception.LineNumber, args.Exception.LinePosition, args.Exception.Message); + args.Exception.LineNumber, args.Exception.LinePosition, args.Exception.Message); LogAndThrow(new MappingException(message, args.Exception)); } @@ -1849,7 +1850,7 @@ } else { - var listeners = (object[]) Array.CreateInstance(eventListeners.GetListenerClassFor(type), listenerClasses.Length); + var listeners = (object[])Array.CreateInstance(eventListeners.GetListenerClassFor(type), listenerClasses.Length); for (int i = 0; i < listeners.Length; i++) { try @@ -1881,7 +1882,7 @@ } else { - var listeners = (object[]) Array.CreateInstance(eventListeners.GetListenerClassFor(type), 1); + var listeners = (object[])Array.CreateInstance(eventListeners.GetListenerClassFor(type), 1); listeners[0] = listener; SetListeners(type, listeners); } @@ -1892,106 +1893,106 @@ switch (type) { case ListenerType.Autoflush: - eventListeners.AutoFlushEventListeners = new IAutoFlushEventListener[] {}; + eventListeners.AutoFlushEventListeners = new IAutoFlushEventListener[] { }; break; case ListenerType.Merge: - eventListeners.MergeEventListeners = new IMergeEventListener[] {}; + eventListeners.MergeEventListeners = new IMergeEventListener[] { }; break; case ListenerType.Create: - eventListeners.PersistEventListeners = new IPersistEventListener[] {}; + eventListeners.PersistEventListeners = new IPersistEventListener[] { }; break; case ListenerType.CreateOnFlush: - eventListeners.PersistOnFlushEventListeners = new IPersistEventListener[] {}; + eventListeners.PersistOnFlushEventListeners = new IPersistEventListener[] { }; break; case ListenerType.Delete: - eventListeners.DeleteEventListeners = new IDeleteEventListener[] {}; + eventListeners.DeleteEventListeners = new IDeleteEventListener[] { }; break; case ListenerType.DirtyCheck: - eventListeners.DirtyCheckEventListeners = new IDirtyCheckEventListener[] {}; + eventListeners.DirtyCheckEventListeners = new IDirtyCheckEventListener[] { }; break; case ListenerType.Evict: - eventListeners.EvictEventListeners = new IEvictEventListener[] {}; + eventListeners.EvictEventListeners = new IEvictEventListener[] { }; break; case ListenerType.Flush: - eventListeners.FlushEventListeners = new IFlushEventListener[] {}; + eventListeners.FlushEventListeners = new IFlushEventListener[] { }; break; case ListenerType.FlushEntity: - eventListeners.FlushEntityEventListeners = new IFlushEntityEventListener[] {}; + eventListeners.FlushEntityEventListeners = new IFlushEntityEventListener[] { }; break; case ListenerType.Load: - eventListeners.LoadEventListeners = new ILoadEventListener[] {}; + eventListeners.LoadEventListeners = new ILoadEventListener[] { }; break; case ListenerType.LoadCollection: - eventListeners.InitializeCollectionEventListeners = new IInitializeCollectionEventListener[] {}; + eventListeners.InitializeCollectionEventListeners = new IInitializeCollectionEventListener[] { }; break; case ListenerType.Lock: - eventListeners.LockEventListeners = new ILockEventListener[] {}; + eventListeners.LockEventListeners = new ILockEventListener[] { }; break; case ListenerType.Refresh: - eventListeners.RefreshEventListeners = new IRefreshEventListener[] {}; + eventListeners.RefreshEventListeners = new IRefreshEventListener[] { }; break; case ListenerType.Replicate: - eventListeners.ReplicateEventListeners = new IReplicateEventListener[] {}; + eventListeners.ReplicateEventListeners = new IReplicateEventListener[] { }; break; case ListenerType.SaveUpdate: - eventListeners.SaveOrUpdateEventListeners = new ISaveOrUpdateEventListener[] {}; + eventListeners.SaveOrUpdateEventListeners = new ISaveOrUpdateEventListener[] { }; break; case ListenerType.Save: - eventListeners.SaveEventListeners = new ISaveOrUpdateEventListener[] {}; + eventListeners.SaveEventListeners = new ISaveOrUpdateEventListener[] { }; break; case ListenerType.PreUpdate: - eventListeners.PreUpdateEventListeners = new IPreUpdateEventListener[] {}; + eventListeners.PreUpdateEventListeners = new IPreUpdateEventListener[] { }; break; case ListenerType.Update: - eventListeners.UpdateEventListeners = new ISaveOrUpdateEventListener[] {}; + eventListeners.UpdateEventListeners = new ISaveOrUpdateEventListener[] { }; break; case ListenerType.PreLoad: - eventListeners.PreLoadEventListeners = new IPreLoadEventListener[] {}; + eventListeners.PreLoadEventListeners = new IPreLoadEventListener[] { }; break; case ListenerType.PreDelete: - eventListeners.PreDeleteEventListeners = new IPreDeleteEventListener[] {}; + eventListeners.PreDeleteEventListeners = new IPreDeleteEventListener[] { }; break; case ListenerType.PreInsert: - eventListeners.PreInsertEventListeners = new IPreInsertEventListener[] {}; + eventListeners.PreInsertEventListeners = new IPreInsertEventListener[] { }; break; case ListenerType.PostLoad: - eventListeners.PostLoadEventListeners = new IPostLoadEventListener[] {}; + eventListeners.PostLoadEventListeners = new IPostLoadEventListener[] { }; break; case ListenerType.PostInsert: - eventListeners.PostInsertEventListeners = new IPostInsertEventListener[] {}; + eventListeners.PostInsertEventListeners = new IPostInsertEventListener[] { }; break; case ListenerType.PostUpdate: - eventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] {}; + eventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] { }; break; case ListenerType.PostDelete: - eventListeners.PostDeleteEventListeners = new IPostDeleteEventListener[] {}; + eventListeners.PostDeleteEventListeners = new IPostDeleteEventListener[] { }; break; case ListenerType.PostCommitUpdate: - eventListeners.PostCommitUpdateEventListeners = new IPostUpdateEventListener[] {}; + eventListeners.PostCommitUpdateEventListeners = new IPostUpdateEventListener[] { }; break; case ListenerType.PostCommitInsert: - eventListeners.PostCommitInsertEventListeners = new IPostInsertEventListener[] {}; + eventListeners.PostCommitInsertEventListeners = new IPostInsertEventListener[] { }; break; case ListenerType.PostCommitDelete: - eventListeners.PostCommitDeleteEventListeners = new IPostDeleteEventListener[] {}; + eventListeners.PostCommitDeleteEventListeners = new IPostDeleteEventListener[] { }; break; case ListenerType.PreCollectionRecreate: - eventListeners.PreCollectionRecreateEventListeners = new IPreCollectionRecreateEventListener[] {}; + eventListeners.PreCollectionRecreateEventListeners = new IPreCollectionRecreateEventListener[] { }; break; case ListenerType.PreCollectionRemove: - eventListeners.PreCollectionRemoveEventListeners = new IPreCollectionRemoveEventListener[] {}; + eventListeners.PreCollectionRemoveEventListeners = new IPreCollectionRemoveEventListener[] { }; break; case ListenerType.PreCollectionUpdate: - eventListeners.PreCollectionUpdateEventListeners = new IPreCollectionUpdateEventListener[] {}; + eventListeners.PreCollectionUpdateEventListeners = new IPreCollectionUpdateEventListener[] { }; break; case ListenerType.PostCollectionRecreate: - eventListeners.PostCollectionRecreateEventListeners = new IPostCollectionRecreateEventListener[] {}; + eventListeners.PostCollectionRecreateEventListeners = new IPostCollectionRecreateEventListener[] { }; break; case ListenerType.PostCollectionRemove: - eventListeners.PostCollectionRemoveEventListeners = new IPostCollectionRemoveEventListener[] {}; + eventListeners.PostCollectionRemoveEventListeners = new IPostCollectionRemoveEventListener[] { }; break; case ListenerType.PostCollectionUpdate: - eventListeners.PostCollectionUpdateEventListeners = new IPostCollectionUpdateEventListener[] {}; + eventListeners.PostCollectionUpdateEventListeners = new IPostCollectionUpdateEventListener[] { }; break; default: log.Warn("Unrecognized listener type [" + type + "]"); @@ -2015,106 +2016,106 @@ switch (type) { case ListenerType.Autoflush: - eventListeners.AutoFlushEventListeners = (IAutoFlushEventListener[]) listeners; + eventListeners.AutoFlushEventListeners = (IAutoFlushEventListener[])listeners; break; case ListenerType.Merge: - eventListeners.MergeEventListeners = (IMergeEventListener[]) listeners; + eventListeners.MergeEventListeners = (IMergeEventListener[])listeners; break; case ListenerType.Create: - eventListeners.PersistEventListeners = (IPersistEventListener[]) listeners; + eventListeners.PersistEventListeners = (IPersistEventListener[])listeners; break; case ListenerType.CreateOnFlush: - eventListeners.PersistOnFlushEventListeners = (IPersistEventListener[]) listeners; + eventListeners.PersistOnFlushEventListeners = (IPersistEventListener[])listeners; break; case ListenerType.Delete: - eventListeners.DeleteEventListeners = (IDeleteEventListener[]) listeners; + eventListeners.DeleteEventListeners = (IDeleteEventListener[])listeners; break; case ListenerType.DirtyCheck: - eventListeners.DirtyCheckEventListeners = (IDirtyCheckEventListener[]) listeners; + eventListeners.DirtyCheckEventListeners = (IDirtyCheckEventListener[])listeners; break; case ListenerType.Evict: - eventListeners.EvictEventListeners = (IEvictEventListener[]) listeners; + eventListeners.EvictEventListeners = (IEvictEventListener[])listeners; break; case ListenerType.Flush: - eventListeners.FlushEventListeners = (IFlushEventListener[]) listeners; + eventListeners.FlushEventListeners = (IFlushEventListener[])listeners; break; case ListenerType.FlushEntity: - eventListeners.FlushEntityEventListeners = (IFlushEntityEventListener[]) listeners; + eventListeners.FlushEntityEventListeners = (IFlushEntityEventListener[])listeners; break; case ListenerType.Load: - eventListeners.LoadEventListeners = (ILoadEventListener[]) listeners; + eventListeners.LoadEventListeners = (ILoadEventListener[])listeners; break; case ListenerType.LoadCollection: - eventListeners.InitializeCollectionEventListeners = (IInitializeCollectionEventListener[]) listeners; + eventListeners.InitializeCollectionEventListeners = (IInitializeCollectionEventListener[])listeners; break; case ListenerType.Lock: - eventListeners.LockEventListeners = (ILockEventListener[]) listeners; + eventListeners.LockEventListeners = (ILockEventListener[])listeners; break; case ListenerType.Refresh: - eventListeners.RefreshEventListeners = (IRefreshEventListener[]) listeners; + eventListeners.RefreshEventListeners = (IRefreshEventListener[])listeners; break; case ListenerType.Replicate: - eventListeners.ReplicateEventListeners = (IReplicateEventListener[]) listeners; + eventListeners.ReplicateEventListeners = (IReplicateEventListener[])listeners; break; case ListenerType.SaveUpdate: - eventListeners.SaveOrUpdateEventListeners = (ISaveOrUpdateEventListener[]) listeners; + eventListeners.SaveOrUpdateEventListeners = (ISaveOrUpdateEventListener[])listeners; break; case ListenerType.Save: - eventListeners.SaveEventListeners = (ISaveOrUpdateEventListener[]) listeners; + eventListeners.SaveEventListeners = (ISaveOrUpdateEventListener[])listeners; break; case ListenerType.PreUpdate: - eventListeners.PreUpdateEventListeners = (IPreUpdateEventListener[]) listeners; + eventListeners.PreUpdateEventListeners = (IPreUpdateEventListener[])listeners; break; case ListenerType.Update: - eventListeners.UpdateEventListeners = (ISaveOrUpdateEventListener[]) listeners; + eventListeners.UpdateEventListeners = (ISaveOrUpdateEventListener[])listeners; break; case ListenerType.PreLoad: - eventListeners.PreLoadEventListeners = (IPreLoadEventListener[]) listeners; + eventListeners.PreLoadEventListeners = (IPreLoadEventListener[])listeners; break; case ListenerType.PreDelete: - eventListeners.PreDeleteEventListeners = (IPreDeleteEventListener[]) listeners; + eventListeners.PreDeleteEventListeners = (IPreDeleteEventListener[])listeners; break; case ListenerType.PreInsert: - eventListeners.PreInsertEventListeners = (IPreInsertEventListener[]) listeners; + eventListeners.PreInsertEventListeners = (IPreInsertEventListener[])listeners; break; case ListenerType.PostLoad: - eventListeners.PostLoadEventListeners = (IPostLoadEventListener[]) listeners; + eventListeners.PostLoadEventListeners = (IPostLoadEventListener[])listeners; break; case ListenerType.PostInsert: - eventListeners.PostInsertEventListeners = (IPostInsertEventListener[]) listeners; + eventListeners.PostInsertEventListeners = (IPostInsertEventListener[])listeners; break; case ListenerType.PostUpdate: - eventListeners.PostUpdateEventListeners = (IPostUpdateEventListener[]) listeners; + eventListeners.PostUpdateEventListeners = (IPostUpdateEventListener[])listeners; break; case ListenerType.PostDelete: - eventListeners.PostDeleteEventListeners = (IPostDeleteEventListener[]) listeners; + eventListeners.PostDeleteEventListeners = (IPostDeleteEventListener[])listeners; break; case ListenerType.PostCommitUpdate: - eventListeners.PostCommitUpdateEventListeners = (IPostUpdateEventListener[]) listeners; + eventListeners.PostCommitUpdateEventListeners = (IPostUpdateEventListener[])listeners; break; case ListenerType.PostCommitInsert: - eventListeners.PostCommitInsertEventListeners = (IPostInsertEventListener[]) listeners; + eventListeners.PostCommitInsertEventListeners = (IPostInsertEventListener[])listeners; break; case ListenerType.PostCommitDelete: - eventListeners.PostCommitDeleteEventListeners = (IPostDeleteEventListener[]) listeners; + eventListeners.PostCommitDeleteEventListeners = (IPostDeleteEventListener[])listeners; break; case ListenerType.PreCollectionRecreate: - eventListeners.PreCollectionRecreateEventListeners = (IPreCollectionRecreateEventListener[]) listeners; + eventListeners.PreCollectionRecreateEventListeners = (IPreCollectionRecreateEventListener[])listeners; break; case ListenerType.PreCollectionRemove: - eventListeners.PreCollectionRemoveEventListeners = (IPreCollectionRemoveEventListener[]) listeners; + eventListeners.PreCollectionRemoveEventListeners = (IPreCollectionRemoveEventListener[])listeners; break; case ListenerType.PreCollectionUpdate: - eventListeners.PreCollectionUpdateEventListeners = (IPreCollectionUpdateEventListener[]) listeners; + eventListeners.PreCollectionUpdateEventListeners = (IPreCollectionUpdateEventListener[])listeners; break; case ListenerType.PostCollectionRecreate: - eventListeners.PostCollectionRecreateEventListeners = (IPostCollectionRecreateEventListener[]) listeners; + eventListeners.PostCollectionRecreateEventListeners = (IPostCollectionRecreateEventListener[])listeners; break; case ListenerType.PostCollectionRemove: - eventListeners.PostCollectionRemoveEventListeners = (IPostCollectionRemoveEventListener[]) listeners; + eventListeners.PostCollectionRemoveEventListeners = (IPostCollectionRemoveEventListener[])listeners; break; case ListenerType.PostCollectionUpdate: - eventListeners.PostCollectionUpdateEventListeners = (IPostCollectionUpdateEventListener[]) listeners; + eventListeners.PostCollectionUpdateEventListeners = (IPostCollectionUpdateEventListener[])listeners; break; default: log.Warn("Unrecognized listener type [" + type + "]"); @@ -2122,6 +2123,130 @@ } } + + /// <summary> + /// Append the listeners to the end of the currently configured + /// listeners + /// </summary> + public void AppendListeners(ListenerType type, object[] listeners) + { + switch (type) + { + case ListenerType.Autoflush: + eventListeners.AutoFlushEventListeners = AppendListeners(eventListeners.AutoFlushEventListeners, (IAutoFlushEventListener[])listeners); + break; + case ListenerType.Merge: + eventListeners.MergeEventListeners = AppendListeners(eventListeners.MergeEventListeners, (IMergeEventListener[])listeners); + break; + case ListenerType.Create: + eventListeners.PersistEventListeners = AppendListeners(eventListeners.PersistEventListeners, (IPersistEventListener[])listeners); + break; + case ListenerType.CreateOnFlush: + eventListeners.PersistOnFlushEventListeners = AppendListeners(eventListeners.PersistOnFlushEventListeners, (IPersistEventListener[])listeners); + break; + case ListenerType.Delete: + eventListeners.DeleteEventListeners = AppendListeners(eventListeners.DeleteEventListeners, (IDeleteEventListener[])listeners); + break; + case ListenerType.DirtyCheck: + eventListeners.DirtyCheckEventListeners = AppendListeners(eventListeners.DirtyCheckEventListeners, (IDirtyCheckEventListener[])listeners); + break; + case ListenerType.Evict: + eventListeners.EvictEventListeners = AppendListeners(eventListeners.EvictEventListeners, (IEvictEventListener[])listeners); + break; + case ListenerType.Flush: + eventListeners.FlushEventListeners = AppendListeners(eventListeners.FlushEventListeners, (IFlushEventListener[])listeners); + break; + case ListenerType.FlushEntity: + eventListeners.FlushEntityEventListeners = AppendListeners(eventListeners.FlushEntityEventListeners, (IFlushEntityEventListener[])listeners); + break; + case ListenerType.Load: + eventListeners.LoadEventListeners = AppendListeners(eventListeners.LoadEventListeners, (ILoadEventListener[])listeners); + break; + case ListenerType.LoadCollection: + eventListeners.InitializeCollectionEventListeners = AppendListeners(eventListeners.InitializeCollectionEventListeners, (IInitializeCollectionEventListener[])listeners); + break; + case ListenerType.Lock: + eventListeners.LockEventListeners = AppendListeners(eventListeners.LockEventListeners, (ILockEventListener[])listeners); + break; + case ListenerType.Refresh: + eventListeners.RefreshEventListeners = AppendListeners(eventListeners.RefreshEventListeners, (IRefreshEventListener[])listeners); + break; + case ListenerType.Replicate: + eventListeners.ReplicateEventListeners = AppendListeners(eventListeners.ReplicateEventListeners, (IReplicateEventListener[])listeners); + break; + case ListenerType.SaveUpdate: + eventListeners.SaveOrUpdateEventListeners = AppendListeners(eventListeners.SaveOrUpdateEventListeners, (ISaveOrUpdateEventListener[])listeners); + break; + case ListenerType.Save: + eventListeners.SaveEventListeners = AppendListeners(eventListeners.SaveEventListeners, (ISaveOrUpdateEventListener[])listeners); + break; + case ListenerType.PreUpdate: + eventListeners.PreUpdateEventListeners = AppendListeners(eventListeners.PreUpdateEventListeners, (IPreUpdateEventListener[])listeners); + break; + case ListenerType.Update: + eventListeners.UpdateEventListeners = AppendListeners(eventListeners.UpdateEventListeners, (ISaveOrUpdateEventListener[])listeners); + break; + case ListenerType.PreLoad: + eventListeners.PreLoadEventListeners = AppendListeners(eventListeners.PreLoadEventListeners, (IPreLoadEventListener[])listeners); + break; + case ListenerType.PreDelete: + eventListeners.PreDeleteEventListeners = AppendListeners(eventListeners.PreDeleteEventListeners, (IPreDeleteEventListener[])listeners); + break; + case ListenerType.PreInsert: + eventListeners.PreInsertEventListeners = AppendListeners(eventListeners.PreInsertEventListeners, (IPreInsertEventListener[])listeners); + break; + case ListenerType.PostLoad: + eventListeners.PostLoadEventListeners = AppendListeners(eventListeners.PostLoadEventListeners, (IPostLoadEventListener[])listeners); + break; + case ListenerType.PostInsert: + eventListeners.PostInsertEventListeners = AppendListeners(eventListeners.PostInsertEventListeners, (IPostInsertEventListener[])listeners); + break; + case ListenerType.PostUpdate: + eventListeners.PostUpdateEventListeners = AppendListeners(eventListeners.PostUpdateEventListeners, (IPostUpdateEventListener[])listeners); + break; + case ListenerType.PostDelete: + eventListeners.PostDeleteEventListeners = AppendListeners(eventListeners.PostDeleteEventListeners, (IPostDeleteEventListener[])listeners); + break; + case ListenerType.PostCommitUpdate: + eventListeners.PostCommitUpdateEventListeners = AppendListeners(eventListeners.PostCommitUpdateEventListeners, (IPostUpdateEventListener[])listeners); + break; + case ListenerType.PostCommitInsert: + eventListeners.PostCommitInsertEventListeners = AppendListeners(eventListeners.PostCommitInsertEventListeners, (IPostInsertEventListener[])listeners); + break; + case ListenerType.PostCommitDelete: + eventListeners.PostCommitDeleteEventListeners = AppendListeners(eventListeners.PostCommitDeleteEventListeners, (IPostDeleteEventListener[])listeners); + break; + case ListenerType.PreCollectionRecreate: + eventListeners.PreCollectionRecreateEventListeners = AppendListeners(eventListeners.PreCollectionRecreateEventListeners, (IPreCollectionRecreateEventListener[])listeners); + break; + case ListenerType.PreCollectionRemove: + eventListeners.PreCollectionRemoveEventListeners = AppendListeners(eventListeners.PreCollectionRemoveEventListeners, (IPreCollectionRemoveEventListener[])listeners); + break; + case ListenerType.PreCollectionUpdate: + eventListeners.PreCollectionUpdateEventListeners = AppendListeners(eventListeners.PreCollectionUpdateEventListeners, (IPreCollectionUpdateEventListener[])listeners); + break; + case ListenerType.PostCollectionRecreate: + eventListeners.PostCollectionRecreateEventListeners = AppendListeners(eventListeners.PostCollectionRecreateEventListeners, (IPostCollectionRecreateEventListener[])listeners); + break; + case ListenerType.PostCollectionRemove: + eventListeners.PostCollectionRemoveEventListeners = AppendListeners(eventListeners.PostCollectionRemoveEventListeners, (IPostCollectionRemoveEventListener[])listeners); + break; + case ListenerType.PostCollectionUpdate: + eventListeners.PostCollectionUpdateEventListeners = AppendListeners(eventListeners.PostCollectionUpdateEventListeners, (IPostCollectionUpdateEventListener[])listeners); + break; + default: + log.Warn("Unrecognized listener type [" + type + "]"); + break; + } + } + + private static T[] AppendListeners<T>(T[] existing, T[] listenersToAdd) + { + var list = new List<T>(existing ?? new T[0]); + list.AddRange(listenersToAdd); + return list.ToArray(); + } + ///<summary> /// Generate DDL for altering tables ///</summary> @@ -2139,7 +2264,7 @@ if (table.IsPhysicalTable && IncludeAction(table.SchemaActions, SchemaAction.Update)) { ITableMetadata tableInfo = databaseMetadata.GetTableMetadata(table.Name, table.Schema ?? defaultSchema, - table.Catalog ?? defaultCatalog, table.IsQuoted); + table.Catalog ?? defaultCatalog, table.IsQuoted); if (tableInfo == null) { script.Add(table.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); @@ -2160,7 +2285,7 @@ if (table.IsPhysicalTable && IncludeAction(table.SchemaActions, SchemaAction.Update)) { ITableMetadata tableInfo = databaseMetadata.GetTableMetadata(table.Name, table.Schema, table.Catalog, - table.IsQuoted); + table.IsQuoted); if (dialect.HasAlterTable) { @@ -2169,9 +2294,9 @@ if (fk.HasPhysicalConstraint && IncludeAction(fk.ReferencedTable.SchemaActions, SchemaAction.Update)) { bool create = tableInfo == null - || - (tableInfo.GetForeignKeyMetadata(fk.Name) == null - && (!(dialect is MySQLDialect) || tableInfo.GetIndexMetadata(fk.Name) == null)); + || + (tableInfo.GetForeignKeyMetadata(fk.Name) == null + && (!(dialect is MySQLDialect) || tableInfo.GetIndexMetadata(fk.Name) == null)); if (create) { script.Add(fk.SqlCreateString(dialect, mapping, defaultCatalog, defaultSchema)); @@ -2226,8 +2351,8 @@ table.isQuoted());*/ ITableMetadata tableInfo = databaseMetadata.GetTableMetadata( table.Name, - table.Schema??defaultSchema, - table.Catalog??defaultCatalog, + table.Schema ?? defaultSchema, + table.Catalog ?? defaultCatalog, table.IsQuoted); if (tableInfo == null) throw new HibernateException("Missing table: " + table.Name); @@ -2242,7 +2367,7 @@ string key = generator.GeneratorKey(); if (!databaseMetadata.IsSequence(key) && !databaseMetadata.IsTable(key)) { - throw new HibernateException(string.Format("Missing sequence or table: "+ key)); + throw new HibernateException(string.Format("Missing sequence or table: " + key)); } } } @@ -2258,7 +2383,7 @@ if (!pc.IsInherited) { var ig = - pc.Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, (RootClass) pc) as + pc.Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, (RootClass)pc) as IPersistentIdentifierGenerator; if (ig != null) @@ -2273,8 +2398,8 @@ if (collection.IsIdentified) { var ig = - ((IdentifierCollection) collection).Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, - null) as IPersistentIdentifierGenerator; + ((IdentifierCollection)collection).Identifier.CreateIdentifierGenerator(dialect, defaultCatalog, defaultSchema, + null) as IPersistentIdentifierGenerator; if (ig != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Spraker B. <ha...@sc...> - 2010-03-22 15:44:57
|
Nigh indecipherable, but there is a Latin legend below, which runs thus: "Qualiter S. Bertrandus liberavit hominem quem diabolus diu volebat strangulare." (How St. Bertrand delivered a man whom the Devil long sought to strangle.) Dennistoun was turning to the sacristan with a smile and a jocular remark of some sort on his lips, but he was confounded to see the old man on his knees, gazing at the picture with the eye of a suppliant in agony |
From: <ste...@us...> - 2010-03-22 15:18:05
|
Revision: 4964 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4964&view=rev Author: steverstrong Date: 2010-03-22 15:17:58 +0000 (Mon, 22 Mar 2010) Log Message: ----------- Added support for Query Caching in the Linq provider Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs trunk/nhibernate/src/NHibernate/Linq/NhRelinqQueryParser.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Linq/TypeHelperExtensionMethods.cs trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCacheable.cs trunk/nhibernate/src/NHibernate.Test/Linq/QueryCacheableTests.cs Modified: trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs 2010-03-17 17:16:04 UTC (rev 4963) +++ trunk/nhibernate/src/NHibernate/Linq/LinqExtensionMethods.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Linq; +using System.Linq.Expressions; namespace NHibernate.Linq { @@ -11,47 +10,31 @@ return new NhQueryable<T>(session); } - public static void ForEach<T>(this IEnumerable<T> query, Action<T> method) + public static IQueryable<T> Cacheable<T>(this IQueryable<T> query) { - foreach (T item in query) - { - method(item); - } - } + var method = ReflectionHelper.GetMethod(() => Cacheable<object>(null)).MakeGenericMethod(typeof(T)); - public static bool IsEnumerableOfT(this System.Type type) - { - return type.IsGenericType && type.GetGenericTypeDefinition() == typeof (IEnumerable<>); - } + var callExpression = Expression.Call(method, query.Expression); - public static bool IsNullable(this System.Type type) - { - return (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); + return new NhQueryable<T>(query.Provider, callExpression); } - public static bool IsNullableOrReference(this System.Type type) + public static IQueryable<T> CacheMode<T>(this IQueryable<T> query, CacheMode cacheMode) { - return !type.IsValueType || type.IsNullable(); - } + var method = ReflectionHelper.GetMethod(() => CacheMode<object>(null, NHibernate.CacheMode.Normal)).MakeGenericMethod(typeof(T)); - public static System.Type NullableOf(this System.Type type) - { - return type.GetGenericArguments()[0]; - } + var callExpression = Expression.Call(method, query.Expression, Expression.Constant(cacheMode)); - public static bool IsPrimitive(this System.Type type) - { - return (type.IsValueType || type.IsNullable() || type == typeof (string)); + return new NhQueryable<T>(query.Provider, callExpression); } - public static bool IsNonPrimitive(this System.Type type) + public static IQueryable<T> CacheRegion<T>(this IQueryable<T> query, string region) { - return !type.IsPrimitive(); - } + var method = ReflectionHelper.GetMethod(() => CacheRegion<object>(null, null)).MakeGenericMethod(typeof(T)); - public static T As<T>(this object source) - { - return (T) source; + var callExpression = Expression.Call(method, query.Expression, Expression.Constant(region)); + + return new NhQueryable<T>(query.Provider, callExpression); } - } + } } \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Linq/NhRelinqQueryParser.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/NhRelinqQueryParser.cs 2010-03-17 17:16:04 UTC (rev 4963) +++ trunk/nhibernate/src/NHibernate/Linq/NhRelinqQueryParser.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -1,7 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using Remotion.Data.Linq; +using Remotion.Data.Linq.Clauses; +using Remotion.Data.Linq.Clauses.StreamedData; using Remotion.Data.Linq.EagerFetching.Parsing; using Remotion.Data.Linq.Parsing.Structure; using Remotion.Data.Linq.Parsing.Structure.IntermediateModel; @@ -40,6 +43,14 @@ MethodCallRegistry.Register(new[] { typeof(EagerFetchingExtensionMethods).GetMethod("ThenFetch") }, typeof(ThenFetchOneExpressionNode)); MethodCallRegistry.Register(new[] { typeof(EagerFetchingExtensionMethods).GetMethod("ThenFetchMany") }, typeof(ThenFetchManyExpressionNode)); + MethodCallRegistry.Register( + new[] + { + typeof(LinqExtensionMethods).GetMethod("Cacheable"), + typeof(LinqExtensionMethods).GetMethod("CacheMode"), + typeof(LinqExtensionMethods).GetMethod("CacheRegion"), + }, typeof(CacheableExpressionNode)); + } public static QueryModel Parse(Expression expression) @@ -47,4 +58,57 @@ return new QueryParser(new ExpressionTreeParser(MethodCallRegistry)).GetParsedQuery(expression); } } + + public class CacheableExpressionNode : ResultOperatorExpressionNodeBase + { + private readonly MethodCallExpressionParseInfo _parseInfo; + private readonly ConstantExpression _data; + + public CacheableExpressionNode(MethodCallExpressionParseInfo parseInfo, ConstantExpression data) : base(parseInfo, null, null) + { + _parseInfo = parseInfo; + _data = data; + } + + public override Expression Resolve(ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext) + { + throw new NotImplementedException(); + } + + protected override ResultOperatorBase CreateResultOperator(ClauseGenerationContext clauseGenerationContext) + { + return new CacheableResultOperator(_parseInfo, _data); + } + } + + public class CacheableResultOperator : ResultOperatorBase + { + public MethodCallExpressionParseInfo ParseInfo { get; private set; } + public ConstantExpression Data { get; private set; } + + public CacheableResultOperator(MethodCallExpressionParseInfo parseInfo, ConstantExpression data) + { + ParseInfo = parseInfo; + Data = data; + } + + public override IStreamedData ExecuteInMemory(IStreamedData input) + { + throw new NotImplementedException(); + } + + public override IStreamedDataInfo GetOutputDataInfo(IStreamedDataInfo inputInfo) + { + return inputInfo; + } + + public override ResultOperatorBase Clone(CloneContext cloneContext) + { + throw new NotImplementedException(); + } + + public override void TransformExpressions(Func<Expression, Expression> transformation) + { + } + } } \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Linq/TypeHelperExtensionMethods.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/TypeHelperExtensionMethods.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/TypeHelperExtensionMethods.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; + +namespace NHibernate.Linq +{ + public static class TypeHelperExtensionMethods + { + public static void ForEach<T>(this IEnumerable<T> query, Action<T> method) + { + foreach (T item in query) + { + method(item); + } + } + + public static bool IsEnumerableOfT(this System.Type type) + { + return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>); + } + + public static bool IsNullable(this System.Type type) + { + return (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)); + } + + public static bool IsNullableOrReference(this System.Type type) + { + return !type.IsValueType || type.IsNullable(); + } + + public static System.Type NullableOf(this System.Type type) + { + return type.GetGenericArguments()[0]; + } + + public static bool IsPrimitive(this System.Type type) + { + return (type.IsValueType || type.IsNullable() || type == typeof(string)); + } + + public static bool IsNonPrimitive(this System.Type type) + { + return !type.IsPrimitive(); + } + + public static T As<T>(this object source) + { + return (T)source; + } + } +} Modified: trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-03-17 17:16:04 UTC (rev 4963) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/QueryModelVisitor.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -62,6 +62,7 @@ static QueryModelVisitor() { + // TODO - reflection to build map ResultOperatorMap = new ResultOperatorMap(); ResultOperatorMap.Add<AggregateResultOperator, ProcessAggregate>(); @@ -77,6 +78,7 @@ ResultOperatorMap.Add<AllResultOperator, ProcessAll>(); ResultOperatorMap.Add<FetchOneRequest, ProcessFetchOne>(); ResultOperatorMap.Add<FetchManyRequest, ProcessFetchMany>(); + ResultOperatorMap.Add<CacheableResultOperator, ProcessCacheable>(); } private QueryModelVisitor(VisitorParameters visitorParameters, bool root, QueryModel queryModel) Added: trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCacheable.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCacheable.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Linq/Visitors/ResultOperatorProcessors/ProcessCacheable.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -0,0 +1,41 @@ +namespace NHibernate.Linq.Visitors.ResultOperatorProcessors +{ + public class ProcessCacheable : IResultOperatorProcessor<CacheableResultOperator> + { + public void Process(CacheableResultOperator resultOperator, QueryModelVisitor queryModelVisitor, IntermediateHqlTree tree) + { + NamedParameter parameterName; + + switch (resultOperator.ParseInfo.ParsedExpression.Method.Name) + { + case "Cacheable": + tree.AddAdditionalCriteria((q, p) => q.SetCacheable(true)); + break; + case "CacheMode": + queryModelVisitor.VisitorParameters.ConstantToParameterMap.TryGetValue(resultOperator.Data, + out parameterName); + if (parameterName != null) + { + tree.AddAdditionalCriteria((q, p) => q.SetCacheMode((CacheMode) p[parameterName.Name].First)); + } + else + { + tree.AddAdditionalCriteria((q, p) => q.SetCacheMode((CacheMode) resultOperator.Data.Value)); + } + break; + case "CacheRegion": + queryModelVisitor.VisitorParameters.ConstantToParameterMap.TryGetValue(resultOperator.Data, + out parameterName); + if (parameterName != null) + { + tree.AddAdditionalCriteria((q, p) => q.SetCacheRegion((string) p[parameterName.Name].First)); + } + else + { + tree.AddAdditionalCriteria((q, p) => q.SetCacheRegion((string) resultOperator.Data.Value)); + } + break; + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-03-17 17:16:04 UTC (rev 4963) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2010-03-22 15:17:58 UTC (rev 4964) @@ -649,6 +649,7 @@ <Compile Include="Impl\SessionIdLoggingContext.cs" /> <Compile Include="Linq\Expressions\AggregateExpressionNode.cs" /> <Compile Include="Linq\EagerFetchingExtensionMethods.cs" /> + <Compile Include="Linq\TypeHelperExtensionMethods.cs" /> <Compile Include="Linq\Visitors\NameUnNamedParameters.cs" /> <Compile Include="Linq\NhRelinqQueryParser.cs" /> <Compile Include="Linq\ResultOperators\AggregateResultOperator.cs" /> @@ -681,6 +682,7 @@ <Compile Include="Linq\ReWriters\RemoveUnnecessaryBodyOperators.cs" /> <Compile Include="Linq\Clauses\LeftJoinClause.cs" /> <Compile Include="Linq\IntermediateHqlTree.cs" /> + <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessCacheable.cs" /> <Compile Include="Linq\Visitors\QuerySourceLocator.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessFetch.cs" /> <Compile Include="Linq\Visitors\ResultOperatorProcessors\ProcessFetchMany.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/Linq/QueryCacheableTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Linq/QueryCacheableTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/Linq/QueryCacheableTests.cs 2010-03-22 15:17:58 UTC (rev 4964) @@ -0,0 +1,72 @@ +using System.Linq; +using NHibernate.Cfg; +using NHibernate.Linq; +using NUnit.Framework; + +namespace NHibernate.Test.Linq +{ + [TestFixture] + public class QueryCacheableTests : LinqTestCase + { + protected override void Configure(Configuration cfg) + { + cfg.SetProperty(Environment.UseQueryCache, "true"); + cfg.SetProperty(Environment.GenerateStatistics, "true"); + base.Configure(cfg); + } + + [Test] + public void QueryIsCacheable() + { + Sfi.Statistics.Clear(); + Sfi.QueryCache.Clear(); + + var x = (from c in db.Customers + select c).Cacheable().ToList(); + + var x2 = (from c in db.Customers + select c).Cacheable().ToList(); + + Assert.That(Sfi.Statistics.QueryExecutionCount, Is.EqualTo(1)); + Assert.That(Sfi.Statistics.QueryCachePutCount, Is.EqualTo(1)); + Assert.That(Sfi.Statistics.QueryCacheHitCount, Is.EqualTo(1)); + } + + [Test] + public void QueryIsCacheable2() + { + Sfi.Statistics.Clear(); + Sfi.QueryCache.Clear(); + + var x = (from c in db.Customers + select c).Cacheable().ToList(); + + var x2 = (from c in db.Customers + select c).ToList(); + + Assert.That(Sfi.Statistics.QueryExecutionCount, Is.EqualTo(2)); + Assert.That(Sfi.Statistics.QueryCachePutCount, Is.EqualTo(1)); + Assert.That(Sfi.Statistics.QueryCacheHitCount, Is.EqualTo(0)); + } + + [Test] + public void QueryIsCacheableWithRegion() + { + Sfi.Statistics.Clear(); + Sfi.QueryCache.Clear(); + + var x = (from c in db.Customers + select c).Cacheable().CacheRegion("test").ToList(); + + var x2 = (from c in db.Customers + select c).Cacheable().CacheRegion("test").ToList(); + + var x3 = (from c in db.Customers + select c).Cacheable().CacheRegion("other").ToList(); + + Assert.That(Sfi.Statistics.QueryExecutionCount, Is.EqualTo(2)); + Assert.That(Sfi.Statistics.QueryCachePutCount, Is.EqualTo(2)); + Assert.That(Sfi.Statistics.QueryCacheHitCount, Is.EqualTo(1)); + } + } +} Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-03-17 17:16:04 UTC (rev 4963) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2010-03-22 15:17:58 UTC (rev 4964) @@ -420,6 +420,7 @@ <Compile Include="Linq\PatientTests.cs" /> <Compile Include="Linq\ProjectionsTests.cs" /> <Compile Include="Linq\PropertyMethodMappingTests.cs" /> + <Compile Include="Linq\QueryCacheableTests.cs" /> <Compile Include="Linq\QueryReuseTests.cs" /> <Compile Include="Linq\ReadonlyTestCase.cs" /> <Compile Include="Linq\RegresstionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-03-17 17:16:10
|
Revision: 4963 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4963&view=rev Author: steverstrong Date: 2010-03-17 17:16:04 +0000 (Wed, 17 Mar 2010) Log Message: ----------- Trying hardcoding the connection string Modified Paths: -------------- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2010-03-17 16:58:31 UTC (rev 4962) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2010-03-17 17:16:04 UTC (rev 4963) @@ -13,7 +13,7 @@ var cfg = new Cfg.Configuration(); var connStr = cfg.Properties["connection.connection_string"]; - Console.WriteLine("Connecting to database {0}", connStr); + connStr = @"Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI"; using (var conn = new SqlConnection(connStr)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-03-17 16:58:38
|
Revision: 4962 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4962&view=rev Author: steverstrong Date: 2010-03-17 16:58:31 +0000 (Wed, 17 Mar 2010) Log Message: ----------- Now adding debug info to database setup. This sucks. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config 2010-03-17 16:47:18 UTC (rev 4961) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config 2010-03-17 16:58:31 UTC (rev 4962) @@ -8,7 +8,7 @@ <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory name="NHibernate.TestDatabaseSetup"> <property name="connection.connection_string"> - Server=.\sqlexpress;initial catalog=nhibernate;Integrated Security=SSPI + Server=.\SQLExpress;initial catalog=master;Integrated Security=SSPI </property> </session-factory> </hibernate-configuration> Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2010-03-17 16:47:18 UTC (rev 4961) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2010-03-17 16:58:31 UTC (rev 4962) @@ -11,8 +11,11 @@ public void SetupDatabase() { var cfg = new Cfg.Configuration(); + var connStr = cfg.Properties["connection.connection_string"]; - using (var conn = new SqlConnection(cfg.Properties["connection.connection_string"])) + Console.WriteLine("Connecting to database {0}", connStr); + + using (var conn = new SqlConnection(connStr)) { conn.Open(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2010-03-17 16:47:25
|
Revision: 4961 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4961&view=rev Author: steverstrong Date: 2010-03-17 16:47:18 +0000 (Wed, 17 Mar 2010) Log Message: ----------- Changed app.config to match (hopefully) teamcity setup. Still investigating why the nant scripts didn't update it... Modified Paths: -------------- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config 2010-03-17 16:26:33 UTC (rev 4960) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/App.config 2010-03-17 16:47:18 UTC (rev 4961) @@ -8,7 +8,7 @@ <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory name="NHibernate.TestDatabaseSetup"> <property name="connection.connection_string"> - Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + Server=.\sqlexpress;initial catalog=nhibernate;Integrated Security=SSPI </property> </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |