You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fab...@us...> - 2011-04-12 17:50:40
|
Revision: 5678 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5678&view=rev Author: fabiomaulo Date: 2011-04-12 17:50:33 +0000 (Tue, 12 Apr 2011) Log Message: ----------- ConventionModelMapper with convention for joined-subclass key column Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ConventionModelMapper.cs trunk/nhibernate/src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/ trunk/nhibernate/src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/JoinedSubclassKeyAsRootIdColumnTest.cs Added: trunk/nhibernate/src/NHibernate/Mapping/ByCode/ConventionModelMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ConventionModelMapper.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/ConventionModelMapper.cs 2011-04-12 17:50:33 UTC (rev 5678) @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace NHibernate.Mapping.ByCode +{ + public class ConventionModelMapper : ModelMapper + { + public ConventionModelMapper() + : base(new SimpleModelInspector()) + { + AppendDefaultEvents(); + } + + protected virtual void AppendDefaultEvents() + { + BeforeMapJoinedSubclass += JoinedSubclassKeyAsRootIdColumn; + } + + protected void JoinedSubclassKeyAsRootIdColumn(IModelInspector modelInspector, System.Type type, IJoinedSubclassAttributesMapper joinedSubclassCustomizer) + { + var idMember = type.GetProperties().Cast<MemberInfo>().Concat(type.GetFields()).FirstOrDefault(mi => ModelInspector.IsPersistentId(mi.GetMemberFromDeclaringType())); + if (idMember != null) + { + joinedSubclassCustomizer.Key(km => km.Column(idMember.Name)); + } + } + + protected SimpleModelInspector SimpleModelInspector + { + get { return (SimpleModelInspector) base.ModelInspector; } + } + + public void IsRootEntity(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsRootEntity(match); + } + + public void IsComponent(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsComponent(match); + } + + public void IsEntity(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsEntity(match); + } + + public void IsTablePerClass(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsTablePerClass(match); + } + + public void IsTablePerClassHierarchy(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsTablePerClassHierarchy(match); + } + + public void IsTablePerConcreteClass(Func<System.Type, bool, bool> match) + { + SimpleModelInspector.IsTablePerConcreteClass(match); + } + + public void IsOneToOne(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsOneToOne(match); + } + + public void IsManyToOne(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsManyToOne(match); + } + + public void IsManyToMany(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsManyToMany(match); + } + + public void IsOneToMany(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsOneToMany(match); + } + + public void IsAny(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsAny(match); + } + + public void IsPersistentId(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsPersistentId(match); + } + + public void IsVersion(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsVersion(match); + } + + public void IsMemberOfNaturalId(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsMemberOfNaturalId(match); + } + + public void IsPersistentProperty(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsPersistentProperty(match); + } + + public void IsSet(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsSet(match); + } + + public void IsBag(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsBag(match); + } + + public void IsIdBag(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsIdBag(match); + } + + public void IsList(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsList(match); + } + + public void IsArray(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsArray(match); + } + + public void IsDictionary(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsDictionary(match); + } + + public void IsProperty(Func<MemberInfo, bool, bool> match) + { + SimpleModelInspector.IsProperty(match); + } + + public void SplitsFor(Func<System.Type, IEnumerable<string>, IEnumerable<string>> getPropertiesSplitsId) + { + SimpleModelInspector.SplitsFor(getPropertiesSplitsId); + } + + public void IsTablePerClassSplit(Func<SplitDefinition, bool, bool> match) + { + SimpleModelInspector.IsTablePerClassSplit(match); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-12 14:27:47 UTC (rev 5677) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-12 17:50:33 UTC (rev 5678) @@ -438,6 +438,7 @@ <Compile Include="Mapping\Column.cs" /> <Compile Include="Mapping\Component.cs" /> <Compile Include="Mapping\Constraint.cs" /> + <Compile Include="Mapping\ByCode\ConventionModelMapper.cs" /> <Compile Include="Mapping\ForeignKey.cs" /> <Compile Include="Mapping\Formula.cs" /> <Compile Include="Mapping\IdentifierBag.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/JoinedSubclassKeyAsRootIdColumnTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/JoinedSubclassKeyAsRootIdColumnTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/ConventionModelMapperTests/JoinedSubclassKeyAsRootIdColumnTest.cs 2011-04-12 17:50:33 UTC (rev 5678) @@ -0,0 +1,53 @@ +using System.Linq; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.ConventionModelMapperTests +{ + public class JoinedSubclassKeyAsRootIdColumnTest + { + private class MyClass + { + public int MyId { get; set; } + public int HisId { get; set; } + } + + private class Inherited : MyClass + { + } + + [Test] + public void WhenBaseIsIdThenUseId() + { + var mapper = new ConventionModelMapper(); + mapper.Class<MyClass>(map=> map.Id(x=> x.MyId)); + var mapping = mapper.CompileMappingFor(new[] { typeof(Inherited), typeof(MyClass) }); + var hbmJoinedClass = mapping.JoinedSubclasses[0]; + + hbmJoinedClass.key.Columns.Single().name.Should().Be("MyId"); + } + + [Test] + public void WhenBaseIsPoIdThenUsePoId() + { + var mapper = new ConventionModelMapper(); + mapper.Class<MyClass>(map => map.Id(x => x.HisId)); + var mapping = mapper.CompileMappingFor(new[] { typeof(Inherited), typeof(MyClass) }); + var hbmJoinedClass = mapping.JoinedSubclasses[0]; + + hbmJoinedClass.key.Columns.Single().name.Should().Be("HisId"); + } + + [Test] + public void WhenNoPoidMemberThenDoesNotSet() + { + var mapper = new ConventionModelMapper(); + mapper.Class<MyClass>(map => { }); + var mapping = mapper.CompileMappingFor(new[] { typeof(Inherited), typeof(MyClass) }); + var hbmJoinedClass = mapping.JoinedSubclasses[0]; + + hbmJoinedClass.key.Columns.Single().name.Should().Not.Be("MyId").And.Not.Be("HisId"); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-12 14:27:47 UTC (rev 5677) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-12 17:50:33 UTC (rev 5678) @@ -511,6 +511,7 @@ <Compile Include="Linq\ByMethod\SumTests.cs" /> <Compile Include="Logging\Log4NetLoggerTest.cs" /> <Compile Include="Logging\LoggerProviderTest.cs" /> + <Compile Include="MappingByCode\ConventionModelMapperTests\JoinedSubclassKeyAsRootIdColumnTest.cs" /> <Compile Include="MappingByCode\ExpliticMappingTests\BagOfNestedComponentsWithParentTest.cs" /> <Compile Include="MappingByCode\ExpliticMappingTests\ClassWithComponentsTest.cs" /> <Compile Include="MappingByCode\ExpliticMappingTests\ConformistMappingRegistrationTests\ClassMappingRegistrationTest.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-12 14:27:53
|
Revision: 5677 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5677&view=rev Author: fabiomaulo Date: 2011-04-12 14:27:47 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Minor (protected property) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ModelMapper.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/ModelMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/ModelMapper.cs 2011-04-12 12:21:04 UTC (rev 5676) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/ModelMapper.cs 2011-04-12 14:27:47 UTC (rev 5677) @@ -491,7 +491,7 @@ #endregion - public IModelInspector ModelInspector + protected IModelInspector ModelInspector { get { return modelInspector; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-12 12:21:10
|
Revision: 5676 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5676&view=rev Author: fabiomaulo Date: 2011-04-12 12:21:04 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Minor ups Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-12 12:19:33 UTC (rev 5675) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-12 12:21:04 UTC (rev 5676) @@ -14,7 +14,7 @@ private readonly ExplicitlyDeclaredModel declaredModel = new ExplicitlyDeclaredModel(); private Func<System.Type, bool, bool> isEntity = (t, declared) => declared; - private Func<System.Type, bool, bool> isRootEntity = (t, declared) => declared; + private Func<System.Type, bool, bool> isRootEntity; private Func<System.Type, bool, bool> isTablePerClass; private Func<SplitDefinition, bool, bool> isTablePerClassSplit = (sd, declared) => declared; private Func<System.Type, bool, bool> isTablePerClassHierarchy = (t, declared) => declared; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-12 12:19:40
|
Revision: 5675 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5675&view=rev Author: fabiomaulo Date: 2011-04-12 12:19:33 +0000 (Tue, 12 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover RootEntities entities Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/RootEntityTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-12 11:08:59 UTC (rev 5674) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-12 12:19:33 UTC (rev 5675) @@ -44,6 +44,7 @@ public SimpleModelInspector() { isEntity = (t, declared) => declared || MatchEntity(t); + isRootEntity = (t, declared) => declared || MatchRootEntity(t); isTablePerClass = (t, declared) => declared || MatchTablePerClass(t); isPersistentId = (m, declared) => declared || MatchPoIdPattern(m); isComponent = (t, declared) => declared || MatchComponentPattern(t); @@ -56,6 +57,11 @@ isOneToMany = (m, declared) => declared || MatchOneToMany(m); } + private bool MatchRootEntity(System.Type type) + { + return type.IsClass && typeof(object).Equals(type.BaseType); + } + private bool MatchTablePerClass(System.Type type) { return !declaredModel.IsTablePerClassHierarchy(type) && !declaredModel.IsTablePerConcreteClass(type); Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/RootEntityTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/RootEntityTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/RootEntityTests.cs 2011-04-12 12:19:33 UTC (rev 5675) @@ -0,0 +1,45 @@ +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class RootEntityTests + { + private class Person + { + public int Id { get; set; } + } + + private class BaseEntity + { + public int Id { get; set; } + } + + private class Product: BaseEntity + { + } + + [Test] + public void ByDefaultInheritedFromObject() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsRootEntity(typeof(Person)).Should().Be.True(); + inspector.IsRootEntity(typeof(Product)).Should().Be.False(); + } + + [Test] + public void WhenCustomizedThenUseCustomizedPredicate() + { + var autoinspector = new SimpleModelInspector(); + autoinspector.IsRootEntity((t, declared) => typeof(BaseEntity).Equals(t.BaseType)); + + var inspector = (IModelInspector)autoinspector; + + inspector.IsRootEntity(typeof(Person)).Should().Be.False(); + inspector.IsRootEntity(typeof(Product)).Should().Be.True(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-12 11:08:59 UTC (rev 5674) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-12 12:19:33 UTC (rev 5675) @@ -552,6 +552,7 @@ <Compile Include="MappingByCode\MixAutomapping\OneToManyTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\RootEntityTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\SetCollectionTests.cs" /> <Compile Include="MappingByCode\ModelExplicitDeclarationsHolderMergeTest.cs" /> <Compile Include="MappingByCode\NatureDemo\Naturalness\Address.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-12 11:09:05
|
Revision: 5674 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5674&view=rev Author: patearl Date: 2011-04-12 11:08:59 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Tests: SQLite does not support having without group by. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/TestDialect.cs trunk/nhibernate/src/NHibernate.Test/TestDialects/SQLiteTestDialect.cs Modified: trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs 2011-04-12 09:36:48 UTC (rev 5673) +++ trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs 2011-04-12 11:08:59 UTC (rev 5674) @@ -85,9 +85,12 @@ Assert.AreEqual(2, result); // Count in where - result = s.CreateQuery("select count(a.id) from Animal a having count(a.id)>1").UniqueResult(); - Assert.AreEqual(typeof(long), result.GetType()); - Assert.AreEqual(2, result); + if (TestDialect.SupportsHavingWithoutGroupBy) + { + result = s.CreateQuery("select count(a.id) from Animal a having count(a.id)>1").UniqueResult(); + Assert.AreEqual(typeof (long), result.GetType()); + Assert.AreEqual(2, result); + } } } @@ -110,9 +113,12 @@ Assert.AreEqual(15D, result); // In where - result = s.CreateQuery("select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0").UniqueResult(); - Assert.AreEqual(typeof(double), result.GetType()); - Assert.AreEqual(15D, result); + if (TestDialect.SupportsHavingWithoutGroupBy) + { + result = s.CreateQuery("select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0").UniqueResult(); + Assert.AreEqual(typeof(double), result.GetType()); + Assert.AreEqual(15D, result); + } } } @@ -133,9 +139,12 @@ Assert.AreEqual(typeof(float), result.GetType()); //use column type Assert.AreEqual(20F, result); - result = s.CreateQuery("select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0").UniqueResult(); - Assert.AreEqual(typeof(float), result.GetType()); //use column type - Assert.AreEqual(20F, result); + if (TestDialect.SupportsHavingWithoutGroupBy) + { + result = s.CreateQuery("select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0").UniqueResult(); + Assert.AreEqual(typeof(float), result.GetType()); //use column type + Assert.AreEqual(20F, result); + } } } @@ -156,9 +165,12 @@ Assert.AreEqual(typeof(float), result.GetType()); //use column type Assert.AreEqual(10F, result); - result = s.CreateQuery("select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0").UniqueResult(); - Assert.AreEqual(typeof(float), result.GetType()); //use column type - Assert.AreEqual(10F, result); + if (TestDialect.SupportsHavingWithoutGroupBy) + { + result = s.CreateQuery("select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0").UniqueResult(); + Assert.AreEqual(typeof(float), result.GetType()); //use column type + Assert.AreEqual(10F, result); + } } } @@ -179,9 +191,12 @@ Assert.AreEqual(typeof(double), result.GetType()); Assert.AreEqual(30D, result); - result = s.CreateQuery("select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0").UniqueResult(); - Assert.AreEqual(typeof(double), result.GetType()); - Assert.AreEqual(30D, result); + if (TestDialect.SupportsHavingWithoutGroupBy) + { + result = s.CreateQuery("select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0").UniqueResult(); + Assert.AreEqual(typeof(double), result.GetType()); + Assert.AreEqual(30D, result); + } } } Modified: trunk/nhibernate/src/NHibernate.Test/TestDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TestDialect.cs 2011-04-12 09:36:48 UTC (rev 5673) +++ trunk/nhibernate/src/NHibernate.Test/TestDialect.cs 2011-04-12 11:08:59 UTC (rev 5674) @@ -49,6 +49,8 @@ public virtual bool SupportsSelectForUpdateOnOuterJoin { get { return true; } } + public virtual bool SupportsHavingWithoutGroupBy { get { return true; } } + public bool SupportsSqlType(SqlType sqlType) { try Modified: trunk/nhibernate/src/NHibernate.Test/TestDialects/SQLiteTestDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/TestDialects/SQLiteTestDialect.cs 2011-04-12 09:36:48 UTC (rev 5673) +++ trunk/nhibernate/src/NHibernate.Test/TestDialects/SQLiteTestDialect.cs 2011-04-12 11:08:59 UTC (rev 5674) @@ -46,5 +46,10 @@ { get { return true; } } + + public override bool SupportsHavingWithoutGroupBy + { + get { return false; } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jul...@us...> - 2011-04-12 09:36:54
|
Revision: 5673 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5673&view=rev Author: julian-maughan Date: 2011-04-12 09:36:48 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Removed references to obsolete 'use_outer_join' setting from documentation and example MSSQL configuration template (NH-2643) Modified Paths: -------------- trunk/nhibernate/doc/reference/modules/configuration.xml trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml Modified: trunk/nhibernate/doc/reference/modules/configuration.xml =================================================================== --- trunk/nhibernate/doc/reference/modules/configuration.xml 2011-04-12 05:30:03 UTC (rev 5672) +++ trunk/nhibernate/doc/reference/modules/configuration.xml 2011-04-12 09:36:48 UTC (rev 5673) @@ -409,18 +409,6 @@ </row> <row> <entry> - <literal>use_outer_join</literal> - </entry> - <entry> - Enables outer join fetching. Deprecated, use <literal>max_fetch_depth</literal>. - <para> - <emphasis role="strong">eg.</emphasis> - <literal>true</literal> | <literal>false</literal> - </para> - </entry> - </row> - <row> - <entry> <literal>max_fetch_depth</literal> </entry> <entry> @@ -942,7 +930,6 @@ <property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;User Id=;Password=</property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> - <property name="use_outer_join">true</property> <!-- mapping files --> <mapping resource="NHibernate.Auction.Item.hbm.xml" assembly="NHibernate.Auction" /> Modified: trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml 2011-04-12 05:30:03 UTC (rev 5672) +++ trunk/nhibernate/src/NHibernate.Config.Templates/MSSQL.cfg.xml 2011-04-12 09:36:48 UTC (rev 5673) @@ -14,7 +14,6 @@ <property name="adonet.batch_size">10</property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property> - <property name="use_outer_join">true</property> <property name="command_timeout">60</property> <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> </session-factory> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-12 05:30:09
|
Revision: 5672 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5672&view=rev Author: patearl Date: 2011-04-12 05:30:03 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Dialects: Improved PostgreSQL and SQLite dialects with regards to limit handling. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2011-04-12 05:28:42 UTC (rev 5671) +++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2011-04-12 05:30:03 UTC (rev 5672) @@ -123,6 +123,11 @@ get { return true; } } + public override bool SupportsLimitOffset + { + get { return true; } + } + public override bool BindLimitParametersInReverseOrder { get { return true; } @@ -139,20 +144,36 @@ /// <returns>A new <see cref="SqlString"/> that contains the <c>LIMIT</c> clause.</returns> public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit, int? offsetParameterIndex, int? limitParameterIndex) { - SqlStringBuilder pagingBuilder = new SqlStringBuilder(); - pagingBuilder.Add(querySqlString); - pagingBuilder.Add(" limit "); - pagingBuilder.Add(Parameter.WithIndex(limitParameterIndex.Value)); + object limitObject = Parameter.WithIndex(limitParameterIndex.Value); + object offsetObject = offset > 0 ? Parameter.WithIndex(offsetParameterIndex.Value) : null; + return GetLimitString(querySqlString, offsetObject, limitObject); + } - if (offset > 0) - { - pagingBuilder.Add(" offset "); - pagingBuilder.Add(Parameter.WithIndex(offsetParameterIndex.Value)); - } + public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) + { + return GetLimitString(querySqlString, new SqlString(offset.ToString()), new SqlString(limit.ToString())); + } - return pagingBuilder.ToSqlString(); - } + private SqlString GetLimitString(SqlString querySqlString, object offset, object limit) + { + SqlStringBuilder pagingBuilder = new SqlStringBuilder(); + pagingBuilder.Add(querySqlString); + if (limit != null) + { + pagingBuilder.Add(" limit "); + pagingBuilder.AddObject(limit); + } + + if (offset != null) + { + pagingBuilder.Add(" offset "); + pagingBuilder.AddObject(offset); + } + + return pagingBuilder.ToSqlString(); + } + public override string GetForUpdateString(string aliases) { return ForUpdateString + " of " + aliases; Modified: trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2011-04-12 05:28:42 UTC (rev 5671) +++ trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2011-04-12 05:30:03 UTC (rev 5672) @@ -164,6 +164,11 @@ get { return true; } } + public override bool SupportsLimitOffset + { + get { return true; } + } + public override string IdentityColumnString { get This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-12 05:28:48
|
Revision: 5671 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5671&view=rev Author: patearl Date: 2011-04-12 05:28:42 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Hql: Don't try to generate limit clauses when we don't need them. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs 2011-04-12 04:41:51 UTC (rev 5670) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs 2011-04-12 05:28:42 UTC (rev 5671) @@ -321,7 +321,8 @@ QueryWriter queryWriter = ((QueryWriter) writer); SqlString sqlString = queryWriter.ToSqlString(); - sqlString = sessionFactory.Dialect.GetLimitString(sqlString, queryWriter.Skip ?? 0, queryWriter.Take ?? int.MaxValue); + if (queryWriter.Take.HasValue || queryWriter.Skip.HasValue) + sqlString = sessionFactory.Dialect.GetLimitString(sqlString, queryWriter.Skip ?? 0, queryWriter.Take ?? int.MaxValue); writer = outputStack[0]; outputStack.RemoveAt(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-12 04:41:57
|
Revision: 5670 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5670&view=rev Author: patearl Date: 2011-04-12 04:41:51 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Tests: Made database drop/create work if there's no existing nhibernate database for SQL Server. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs Modified: trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs =================================================================== --- trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2011-04-11 18:15:31 UTC (rev 5669) +++ trunk/nhibernate/src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs 2011-04-12 04:41:51 UTC (rev 5670) @@ -37,15 +37,13 @@ private static void SetupSqlServer(Cfg.Configuration cfg) { var connStr = cfg.Properties[Cfg.Environment.ConnectionString]; - - using (var conn = new SqlConnection(connStr)) + + using (var conn = new SqlConnection(connStr.Replace("initial catalog=nhibernate", "initial catalog=master"))) { conn.Open(); - using (var cmd = new System.Data.SqlClient.SqlCommand("use master", conn)) + using (var cmd = conn.CreateCommand()) { - cmd.ExecuteNonQuery(); - cmd.CommandText = "drop database nhibernate"; try This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-11 18:15:37
|
Revision: 5669 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5669&view=rev Author: patearl Date: 2011-04-11 18:15:31 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Tests: Fixed minor breakage due to namespace case change. Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2011-04-11 17:41:57 UTC (rev 5668) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH645/HQLFunctionFixture.cs 2011-04-11 18:15:31 UTC (rev 5669) @@ -41,7 +41,7 @@ protected override IList Mappings { - get { return new[] { "HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml" }; } + get { return new[] { "Hql.Animal.hbm.xml", "Hql.MaterialResource.hbm.xml" }; } } protected override bool AppliesTo(Dialect.Dialect dialect) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2011-04-11 17:42:06
|
Revision: 5668 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5668&view=rev Author: patearl Date: 2011-04-11 17:41:57 +0000 (Mon, 11 Apr 2011) Log Message: ----------- HQL: Support SKIP and TAKE. Support having clause without group by. Throw exception on unexpected trailing input. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/MsSql2005Dialect.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlParser.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlSqlWalker.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/SqlGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/HqlSqlWalker.g trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.cs trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/SqlGenerator.g trunk/nhibernate/src/NHibernate.Test/DialectTest/MsSql2005DialectFixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1990/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/MsSql2005Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/MsSql2005Dialect.cs 2011-04-11 17:04:42 UTC (rev 5667) +++ trunk/nhibernate/src/NHibernate/Dialect/MsSql2005Dialect.cs 2011-04-11 17:41:57 UTC (rev 5668) @@ -29,6 +29,13 @@ RegisterKeyword("xml"); } + public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) + { + return GetLimitString(querySqlString, + offset == 0 ? null : new SqlString(offset.ToString()), + limit == int.MaxValue ? null : new SqlString(limit.ToString())); + } + /// <summary> /// Add a <c>LIMIT</c> clause to the given SQL <c>SELECT</c> /// </summary> @@ -43,17 +50,29 @@ /// </remarks> public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit, int? offsetParameterIndex, int? limitParameterIndex) { + object limitObject = limitParameterIndex == null ? Parameter.Placeholder : Parameter.WithIndex(limitParameterIndex.Value); + object offsetObject = null; + if (offset != 0) + offsetObject = offsetParameterIndex == null ? Parameter.Placeholder : Parameter.WithIndex(offsetParameterIndex.Value); + return GetLimitString(querySqlString, offsetObject, limitObject); + } + + private SqlString GetLimitString(SqlString querySqlString, object offset, object limit) + { + if (offset == null && limit == null) + return querySqlString; + SqlStringBuilder result = new SqlStringBuilder(); - if (offset == 0) + if (offset == null) { int insertPoint = this.GetAfterSelectInsertPoint(querySqlString); return result .Add(querySqlString.Substring(0, insertPoint)) .Add(" TOP (") - .Add(limitParameterIndex == null ? Parameter.Placeholder : Parameter.WithIndex(limitParameterIndex.Value)) - .Add(")") + .AddObject(limit) + .Add(") ") .Add(querySqlString.Substring(insertPoint)) .ToSqlString(); } @@ -84,10 +103,12 @@ sortExpressions = new[] {new SqlString("CURRENT_TIMESTAMP"),}; } - result - .Add("SELECT TOP (") - .Add(limitParameterIndex == null ? Parameter.Placeholder : Parameter.WithIndex(limitParameterIndex.Value)) - .Add(") ") + result.Add("SELECT "); + + if (limit != null) + result.Add("TOP (").AddObject(limit).Add(") "); + + result .Add(StringHelper.Join(", ", columnsOrAliases)) .Add(" FROM (") .Add(select) @@ -99,7 +120,7 @@ .Add(") as __hibernate_sort_row ") .Add(fromAndWhere) .Add(") as query WHERE query.__hibernate_sort_row > ") - .Add(offsetParameterIndex == null ? Parameter.Placeholder : Parameter.WithIndex(offsetParameterIndex.Value)) + .AddObject(offset) .Add(" ORDER BY query.__hibernate_sort_row"); return result.ToSqlString(); Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2011-04-11 17:04:42 UTC (rev 5667) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Generated/HqlLexer.cs 2011-04-11 17:41:57 UTC (rev 5668) @@ -1,4 +1,4 @@ -// $ANTLR 3.2 Sep 23, 2009 12:02:23 Hql.g 2011-01-13 10:47:55 +// $ANTLR 3.2 Sep 23, 2009 12:02:23 Hql.g 2011-04-11 10:19:40 // The variable 'variable' is assigned but its value is never used. #pragma warning disable 168, 219 @@ -17,136 +17,138 @@ 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 LT = 107; + public const int EXPONENT = 130; + public const int STAR = 118; + public const int FLOAT_SUFFIX = 131; + public const int LITERAL_by = 56; + public const int CASE = 57; public const int NEW = 37; - public const int FILTER_ENTITY = 74; - public const int PARAM = 121; + public const int FILTER_ENTITY = 76; + public const int PARAM = 123; 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 UNARY_PLUS = 91; + public const int QUOTED_String = 124; + public const int ESCqs = 128; + public const int WEIRD_IDENT = 93; + public const int OPEN_BRACKET = 120; public const int FULL = 23; - public const int ORDER_ELEMENT = 83; - public const int IS_NULL = 78; + public const int ORDER_ELEMENT = 85; + public const int IS_NULL = 80; 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 BOTH = 64; + public const int NUM_DECIMAL = 97; + public const int VERSIONED = 54; + public const int EQ = 102; 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 NE = 105; + public const int GE = 110; + public const int TAKE = 50; + public const int CONCAT = 111; + public const int ID_LETTER = 127; 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 ELSE = 59; + public const int SELECT_FROM = 89; + public const int TRAILING = 70; + public const int ON = 62; + public const int NUM_LONG = 99; + public const int NUM_DOUBLE = 96; + public const int UNARY_MINUS = 90; 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 OF = 69; + public const int METHOD_CALL = 81; + public const int LEADING = 66; + public const int SKIP = 47; + public const int EMPTY = 65; public const int GROUP = 24; - public const int WS = 127; + public const int WS = 129; 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 VECTOR_EXPR = 92; + public const int NOT_IN = 83; + public const int NUM_INT = 95; 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 ALIAS = 72; + public const int JAVA_CONSTANT = 100; + public const int CONSTANT = 94; + public const int GT = 108; + public const int QUERY = 86; + public const int BNOT = 112; + public const int INDEX_OP = 78; + public const int NUM_FLOAT = 98; public const int FROM = 22; - public const int END = 56; + public const int END = 58; 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 CONSTRUCTOR = 73; + public const int T__133 = 133; + public const int T__134 = 134; + public const int CLOSE_BRACKET = 121; + public const int WHERE = 55; public const int CLASS = 11; - public const int MEMBER = 65; + public const int MEMBER = 67; 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 UPDATE = 53; + public const int SQL_NE = 106; public const int AND = 6; - public const int SUM = 48; + public const int SUM = 49; public const int ASCENDING = 8; - public const int EXPR_LIST = 73; + public const int EXPR_LIST = 75; 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 THEN = 60; + public const int OBJECT = 68; + public const int COMMA = 101; public const int IS = 31; public const int AVG = 9; public const int LEFT = 33; - public const int SOME = 47; + public const int SOME = 48; 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 BOR = 113; + public const int IDENT = 125; + public const int CASE2 = 74; + public const int BXOR = 114; + public const int PLUS = 116; public const int EXISTS = 19; public const int DOT = 15; - public const int WITH = 61; + public const int WITH = 63; 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 ID_START_LETTER = 126; + public const int ROW_STAR = 88; + public const int NOT_LIKE = 84; + public const int RANGE = 87; + public const int NOT_BETWEEN = 82; + public const int HEX_DIGIT = 132; 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 IS_NOT_NULL = 79; + public const int MINUS = 117; public const int ELEMENTS = 17; - public const int BAND = 113; - public const int TRUE = 49; + public const int BAND = 115; + public const int TRUE = 51; 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 IN_LIST = 77; + public const int UNION = 52; + public const int OPEN = 103; + public const int COLON = 122; public const int ANY = 5; - public const int CLOSE = 102; - public const int WHEN = 59; - public const int DIV = 117; + public const int CLOSE = 104; + public const int WHEN = 61; + public const int DIV = 119; public const int DESCENDING = 14; - public const int AGGREGATE = 69; + public const int AGGREGATE = 71; public const int BETWEEN = 10; - public const int LE = 107; + public const int LE = 109; // delegates // delegators @@ -1177,6 +1179,30 @@ } // $ANTLR end "SET" + // $ANTLR start "SKIP" + public void mSKIP() // throws RecognitionException [2] + { + try + { + int _type = SKIP; + int _channel = DEFAULT_TOKEN_CHANNEL; + // Hql.g:51:6: ( 'skip' ) + // Hql.g:51:8: 'skip' + { + Match("skip"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "SKIP" + // $ANTLR start "SOME" public void mSOME() // throws RecognitionException [2] { @@ -1184,8 +1210,8 @@ { int _type = SOME; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:51:6: ( 'some' ) - // Hql.g:51:8: 'some' + // Hql.g:52:6: ( 'some' ) + // Hql.g:52:8: 'some' { Match("some"); if (state.failed) return ; @@ -1208,8 +1234,8 @@ { int _type = SUM; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:52:5: ( 'sum' ) - // Hql.g:52:7: 'sum' + // Hql.g:53:5: ( 'sum' ) + // Hql.g:53:7: 'sum' { Match("sum"); if (state.failed) return ; @@ -1225,6 +1251,30 @@ } // $ANTLR end "SUM" + // $ANTLR start "TAKE" + public void mTAKE() // throws RecognitionException [2] + { + try + { + int _type = TAKE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // Hql.g:54:6: ( 'take' ) + // Hql.g:54:8: 'take' + { + Match("take"); if (state.failed) return ; + + + } + + state.type = _type; + state.channel = _channel; + } + finally + { + } + } + // $ANTLR end "TAKE" + // $ANTLR start "TRUE" public void mTRUE() // throws RecognitionException [2] { @@ -1232,8 +1282,8 @@ { int _type = TRUE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:53:6: ( 'true' ) - // Hql.g:53:8: 'true' + // Hql.g:55:6: ( 'true' ) + // Hql.g:55:8: 'true' { Match("true"); if (state.failed) return ; @@ -1256,8 +1306,8 @@ { int _type = UNION; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:54:7: ( 'union' ) - // Hql.g:54:9: 'union' + // Hql.g:56:7: ( 'union' ) + // Hql.g:56:9: 'union' { Match("union"); if (state.failed) return ; @@ -1280,8 +1330,8 @@ { int _type = UPDATE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:55:8: ( 'update' ) - // Hql.g:55:10: 'update' + // Hql.g:57:8: ( 'update' ) + // Hql.g:57:10: 'update' { Match("update"); if (state.failed) return ; @@ -1304,8 +1354,8 @@ { int _type = VERSIONED; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:56:11: ( 'versioned' ) - // Hql.g:56:13: 'versioned' + // Hql.g:58:11: ( 'versioned' ) + // Hql.g:58:13: 'versioned' { Match("versioned"); if (state.failed) return ; @@ -1328,8 +1378,8 @@ { int _type = WHERE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:57:7: ( 'where' ) - // Hql.g:57:9: 'where' + // Hql.g:59:7: ( 'where' ) + // Hql.g:59:9: 'where' { Match("where"); if (state.failed) return ; @@ -1352,8 +1402,8 @@ { int _type = LITERAL_by; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:58:12: ( 'by' ) - // Hql.g:58:14: 'by' + // Hql.g:60:12: ( 'by' ) + // Hql.g:60:14: 'by' { Match("by"); if (state.failed) return ; @@ -1376,8 +1426,8 @@ { int _type = CASE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:59:6: ( 'case' ) - // Hql.g:59:8: 'case' + // Hql.g:61:6: ( 'case' ) + // Hql.g:61:8: 'case' { Match("case"); if (state.failed) return ; @@ -1400,8 +1450,8 @@ { int _type = END; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:60:5: ( 'end' ) - // Hql.g:60:7: 'end' + // Hql.g:62:5: ( 'end' ) + // Hql.g:62:7: 'end' { Match("end"); if (state.failed) return ; @@ -1424,8 +1474,8 @@ { int _type = ELSE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:61:6: ( 'else' ) - // Hql.g:61:8: 'else' + // Hql.g:63:6: ( 'else' ) + // Hql.g:63:8: 'else' { Match("else"); if (state.failed) return ; @@ -1448,8 +1498,8 @@ { int _type = THEN; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:62:6: ( 'then' ) - // Hql.g:62:8: 'then' + // Hql.g:64:6: ( 'then' ) + // Hql.g:64:8: 'then' { Match("then"); if (state.failed) return ; @@ -1472,8 +1522,8 @@ { int _type = WHEN; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:63:6: ( 'when' ) - // Hql.g:63:8: 'when' + // Hql.g:65:6: ( 'when' ) + // Hql.g:65:8: 'when' { Match("when"); if (state.failed) return ; @@ -1496,8 +1546,8 @@ { int _type = ON; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:64:4: ( 'on' ) - // Hql.g:64:6: 'on' + // Hql.g:66:4: ( 'on' ) + // Hql.g:66:6: 'on' { Match("on"); if (state.failed) return ; @@ -1520,8 +1570,8 @@ { int _type = WITH; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:65:6: ( 'with' ) - // Hql.g:65:8: 'with' + // Hql.g:67:6: ( 'with' ) + // Hql.g:67:8: 'with' { Match("with"); if (state.failed) return ; @@ -1544,8 +1594,8 @@ { int _type = BOTH; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:66:6: ( 'both' ) - // Hql.g:66:8: 'both' + // Hql.g:68:6: ( 'both' ) + // Hql.g:68:8: 'both' { Match("both"); if (state.failed) return ; @@ -1568,8 +1618,8 @@ { int _type = EMPTY; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:67:7: ( 'empty' ) - // Hql.g:67:9: 'empty' + // Hql.g:69:7: ( 'empty' ) + // Hql.g:69:9: 'empty' { Match("empty"); if (state.failed) return ; @@ -1592,8 +1642,8 @@ { int _type = LEADING; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:68:9: ( 'leading' ) - // Hql.g:68:11: 'leading' + // Hql.g:70:9: ( 'leading' ) + // Hql.g:70:11: 'leading' { Match("leading"); if (state.failed) return ; @@ -1616,8 +1666,8 @@ { int _type = MEMBER; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:69:8: ( 'member' ) - // Hql.g:69:10: 'member' + // Hql.g:71:8: ( 'member' ) + // Hql.g:71:10: 'member' { Match("member"); if (state.failed) return ; @@ -1640,8 +1690,8 @@ { int _type = OBJECT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:70:8: ( 'object' ) - // Hql.g:70:10: 'object' + // Hql.g:72:8: ( 'object' ) + // Hql.g:72:10: 'object' { Match("object"); if (state.failed) return ; @@ -1664,8 +1714,8 @@ { int _type = OF; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:71:4: ( 'of' ) - // Hql.g:71:6: 'of' + // Hql.g:73:4: ( 'of' ) + // Hql.g:73:6: 'of' { Match("of"); if (state.failed) return ; @@ -1688,8 +1738,8 @@ { int _type = TRAILING; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:72:10: ( 'trailing' ) - // Hql.g:72:12: 'trailing' + // Hql.g:74:10: ( 'trailing' ) + // Hql.g:74:12: 'trailing' { Match("trailing"); if (state.failed) return ; @@ -1705,15 +1755,15 @@ } // $ANTLR end "TRAILING" - // $ANTLR start "T__131" - public void mT__131() // throws RecognitionException [2] + // $ANTLR start "T__133" + public void mT__133() // throws RecognitionException [2] { try { - int _type = T__131; + int _type = T__133; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:73:8: ( 'ascending' ) - // Hql.g:73:10: 'ascending' + // Hql.g:75:8: ( 'ascending' ) + // Hql.g:75:10: 'ascending' { Match("ascending"); if (state.failed) return ; @@ -1727,17 +1777,17 @@ { } } - // $ANTLR end "T__131" + // $ANTLR end "T__133" - // $ANTLR start "T__132" - public void mT__132() // throws RecognitionException [2] + // $ANTLR start "T__134" + public void mT__134() // throws RecognitionException [2] { try { - int _type = T__132; + int _type = T__134; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:74:8: ( 'descending' ) - // Hql.g:74:10: 'descending' + // Hql.g:76:8: ( 'descending' ) + // Hql.g:76:10: 'descending' { Match("descending"); if (state.failed) return ; @@ -1751,7 +1801,7 @@ { } } - // $ANTLR end "T__132" + // $ANTLR end "T__134" // $ANTLR start "EQ" public void mEQ() // throws RecognitionException [2] @@ -1760,8 +1810,8 @@ { int _type = EQ; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:672:3: ( '=' ) - // Hql.g:672:5: '=' + // Hql.g:684:3: ( '=' ) + // Hql.g:684:5: '=' { Match('='); if (state.failed) return ; @@ -1783,8 +1833,8 @@ { int _type = LT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:673:3: ( '<' ) - // Hql.g:673:5: '<' + // Hql.g:685:3: ( '<' ) + // Hql.g:685:5: '<' { Match('<'); if (state.failed) return ; @@ -1806,8 +1856,8 @@ { int _type = GT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:674:3: ( '>' ) - // Hql.g:674:5: '>' + // Hql.g:686:3: ( '>' ) + // Hql.g:686:5: '>' { Match('>'); if (state.failed) return ; @@ -1829,8 +1879,8 @@ { int _type = SQL_NE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:675:7: ( '<>' ) - // Hql.g:675:9: '<>' + // Hql.g:687:7: ( '<>' ) + // Hql.g:687:9: '<>' { Match("<>"); if (state.failed) return ; @@ -1853,7 +1903,7 @@ { int _type = NE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:676:3: ( '!=' | '^=' ) + // Hql.g:688:3: ( '!=' | '^=' ) int alt1 = 2; int LA1_0 = input.LA(1); @@ -1876,7 +1926,7 @@ switch (alt1) { case 1 : - // Hql.g:676:5: '!=' + // Hql.g:688:5: '!=' { Match("!="); if (state.failed) return ; @@ -1884,7 +1934,7 @@ } break; case 2 : - // Hql.g:676:12: '^=' + // Hql.g:688:12: '^=' { Match("^="); if (state.failed) return ; @@ -1909,8 +1959,8 @@ { int _type = LE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:677:3: ( '<=' ) - // Hql.g:677:5: '<=' + // Hql.g:689:3: ( '<=' ) + // Hql.g:689:5: '<=' { Match("<="); if (state.failed) return ; @@ -1933,8 +1983,8 @@ { int _type = GE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:678:3: ( '>=' ) - // Hql.g:678:5: '>=' + // Hql.g:690:3: ( '>=' ) + // Hql.g:690:5: '>=' { Match(">="); if (state.failed) return ; @@ -1957,8 +2007,8 @@ { int _type = BOR; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:680:5: ( '|' ) - // Hql.g:680:8: '|' + // Hql.g:692:5: ( '|' ) + // Hql.g:692:8: '|' { Match('|'); if (state.failed) return ; @@ -1980,8 +2030,8 @@ { int _type = BXOR; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:681:6: ( '^' ) - // Hql.g:681:8: '^' + // Hql.g:693:6: ( '^' ) + // Hql.g:693:8: '^' { Match('^'); if (state.failed) return ; @@ -2003,8 +2053,8 @@ { int _type = BAND; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:682:6: ( '&' ) - // Hql.g:682:8: '&' + // Hql.g:694:6: ( '&' ) + // Hql.g:694:8: '&' { Match('&'); if (state.failed) return ; @@ -2026,8 +2076,8 @@ { int _type = BNOT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:683:6: ( '!' ) - // Hql.g:683:8: '!' + // Hql.g:695:6: ( '!' ) + // Hql.g:695:8: '!' { Match('!'); if (state.failed) return ; @@ -2049,8 +2099,8 @@ { int _type = COMMA; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:685:6: ( ',' ) - // Hql.g:685:8: ',' + // Hql.g:697:6: ( ',' ) + // Hql.g:697:8: ',' { Match(','); if (state.failed) return ; @@ -2072,8 +2122,8 @@ { int _type = OPEN; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:687:5: ( '(' ) - // Hql.g:687:7: '(' + // Hql.g:699:5: ( '(' ) + // Hql.g:699:7: '(' { Match('('); if (state.failed) return ; @@ -2095,8 +2145,8 @@ { int _type = CLOSE; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:688:6: ( ')' ) - // Hql.g:688:8: ')' + // Hql.g:700:6: ( ')' ) + // Hql.g:700:8: ')' { Match(')'); if (state.failed) return ; @@ -2118,8 +2168,8 @@ { int _type = OPEN_BRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:689:13: ( '[' ) - // Hql.g:689:15: '[' + // Hql.g:701:13: ( '[' ) + // Hql.g:701:15: '[' { Match('['); if (state.failed) return ; @@ -2141,8 +2191,8 @@ { int _type = CLOSE_BRACKET; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:690:14: ( ']' ) - // Hql.g:690:16: ']' + // Hql.g:702:14: ( ']' ) + // Hql.g:702:16: ']' { Match(']'); if (state.failed) return ; @@ -2164,8 +2214,8 @@ { int _type = CONCAT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:692:7: ( '||' ) - // Hql.g:692:9: '||' + // Hql.g:704:7: ( '||' ) + // Hql.g:704:9: '||' { Match("||"); if (state.failed) return ; @@ -2188,8 +2238,8 @@ { int _type = PLUS; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:693:5: ( '+' ) - // Hql.g:693:7: '+' + // Hql.g:705:5: ( '+' ) + // Hql.g:705:7: '+' { Match('+'); if (state.failed) return ; @@ -2211,8 +2261,8 @@ { int _type = MINUS; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:694:6: ( '-' ) - // Hql.g:694:8: '-' + // Hql.g:706:6: ( '-' ) + // Hql.g:706:8: '-' { Match('-'); if (state.failed) return ; @@ -2234,8 +2284,8 @@ { int _type = STAR; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:695:5: ( '*' ) - // Hql.g:695:7: '*' + // Hql.g:707:5: ( '*' ) + // Hql.g:707:7: '*' { Match('*'); if (state.failed) return ; @@ -2257,8 +2307,8 @@ { int _type = DIV; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:696:4: ( '/' ) - // Hql.g:696:6: '/' + // Hql.g:708:4: ( '/' ) + // Hql.g:708:6: '/' { Match('/'); if (state.failed) return ; @@ -2280,8 +2330,8 @@ { int _type = COLON; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:697:6: ( ':' ) - // Hql.g:697:8: ':' + // Hql.g:709:6: ( ':' ) + // Hql.g:709:8: ':' { Match(':'); if (state.failed) return ; @@ -2303,8 +2353,8 @@ { int _type = PARAM; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:698:6: ( '?' ) - // Hql.g:698:8: '?' + // Hql.g:710:6: ( '?' ) + // Hql.g:710:8: '?' { Match('?'); if (state.failed) return ; @@ -2326,11 +2376,11 @@ { int _type = IDENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:701:2: ( ID_START_LETTER ( ID_LETTER )* ) - // Hql.g:701:4: ID_START_LETTER ( ID_LETTER )* + // Hql.g:713:2: ( ID_START_LETTER ( ID_LETTER )* ) + // Hql.g:713:4: ID_START_LETTER ( ID_LETTER )* { mID_START_LETTER(); if (state.failed) return ; - // Hql.g:701:20: ( ID_LETTER )* + // Hql.g:713:20: ( ID_LETTER )* do { int alt2 = 2; @@ -2345,7 +2395,7 @@ switch (alt2) { case 1 : - // Hql.g:701:22: ID_LETTER + // Hql.g:713:22: ID_LETTER { mID_LETTER(); if (state.failed) return ; @@ -2377,7 +2427,7 @@ { try { - // Hql.g:706:5: ( '_' | '$' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0080' .. '\\ufffe' ) + // Hql.g:718:5: ( '_' | '$' | 'a' .. 'z' | 'A' .. 'Z' | '\\u0080' .. '\\ufffe' ) // Hql.g: { if ( input.LA(1) == '$' || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u0080' && input.LA(1) <= '\uFFFE') ) @@ -2407,7 +2457,7 @@ { try { - // Hql.g:715:5: ( ID_START_LETTER | '0' .. '9' ) + // Hql.g:727:5: ( ID_START_LETTER | '0' .. '9' ) // Hql.g: { if ( input.LA(1) == '$' || (input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'Z') || input.LA(1) == '_' || (input.LA(1) >= 'a' && input.LA(1) <= 'z') || (input.LA(1) >= '\u0080' && input.LA(1) <= '\uFFFE') ) @@ -2439,11 +2489,11 @@ { int _type = QUOTED_String; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:720:4: ( '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' ) - // Hql.g:720:6: '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' + // Hql.g:732:4: ( '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' ) + // Hql.g:732:6: '\\'' ( ( ESCqs )=> ESCqs | ~ '\\'' )* '\\'' { Match('\''); if (state.failed) return ; - // Hql.g:720:11: ( ( ESCqs )=> ESCqs | ~ '\\'' )* + // Hql.g:732:11: ( ( ESCqs )=> ESCqs | ~ '\\'' )* do { int alt3 = 3; @@ -2469,14 +2519,14 @@ switch (alt3) { case 1 : - // Hql.g:720:13: ( ESCqs )=> ESCqs + // Hql.g:732:13: ( ESCqs )=> ESCqs { mESCqs(); if (state.failed) return ; } break; case 2 : - // Hql.g:720:31: ~ '\\'' + // Hql.g:732:31: ~ '\\'' { if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '&') || (input.LA(1) >= '(' && input.LA(1) <= '\uFFFF') ) { @@ -2520,8 +2570,8 @@ { try { - // Hql.g:725:2: ( '\\'' '\\'' ) - // Hql.g:726:3: '\\'' '\\'' + // Hql.g:737:2: ( '\\'' '\\'' ) + // Hql.g:738:3: '\\'' '\\'' { Match('\''); if (state.failed) return ; Match('\''); if (state.failed) return ; @@ -2542,10 +2592,10 @@ { int _type = WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // Hql.g:729:5: ( ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) ) - // Hql.g:729:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) + // Hql.g:741:5: ( ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) ) + // Hql.g:741:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) { - // Hql.g:729:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) + // Hql.g:741:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) int alt4 = 5; switch ( input.LA(1) ) { @@ -2588,21 +2638,21 @@ switch (alt4) { case 1 : - // Hql.g:729:13: ' ' + // Hql.g:741:13: ' ' { Match(' '); if (state.failed) return ; } break; case 2 : - // Hql.g:730:7: '\\t' + // Hql.g:742:7: '\\t' { Match('\t'); if (state.failed) return ; } break; case 3 : - // Hql.g:731:7: '\\r' '\\n' + // Hql.g:743:7: '\\r' '\\n' { Match('\r'); if (state.failed) return ; Match('\n'); if (state.failed) return ; @@ -2610,14 +2660,14 @@ } break; case 4 : - // Hql.g:732:7: '\\n' + // Hql.g:744:7: '\\n' { Match('\n'); if (state.failed) return ; } break; case 5 : - // Hql.g:733:7: '\\r' + // Hql.g:745:7: '\\r' { Match('\r'); if (state.failed) return ; @@ -2655,7 +2705,7 @@ IToken f4 = null; bool isDecimal=false; IToken t=null; - // Hql.g:742:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? ) + // Hql.g:754:2: ( '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? | ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? ) int alt20 = 2; int LA20_0 = input.LA(1); @@ -2678,14 +2728,14 @@ switch (alt20) { case 1 : - // Hql.g:742:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? + // Hql.g:754:6: '.' ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? { Match('.'); if (state.failed) return ; if ( (state.backtracking==0) ) { _type = DOT; } - // Hql.g:743:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? + // Hql.g:755:4: ( ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? )? int alt8 = 2; int LA8_0 = input.LA(1); @@ -2696,9 +2746,9 @@ switch (alt8) { case 1 : - // Hql.g:743:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? + // Hql.g:755:6: ( '0' .. '9' )+ ( EXPONENT )? (f1= FLOAT_SUFFIX )? { - // Hql.g:743:6: ( '0' .. '9' )+ + // Hql.g:755:6: ( '0' .. '9' )+ int cnt5 = 0; do { @@ -2714,7 +2764,7 @@ switch (alt5) { case 1 : - // Hql.g:743:7: '0' .. '9' + // Hql.g:755:7: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -2734,7 +2784,7 @@ loop5: ; // Stops C# compiler whining that label 'loop5' has no statements - // Hql.g:743:18: ( EXPONENT )? + // Hql.g:755:18: ( EXPONENT )? int alt6 = 2; int LA6_0 = input.LA(1); @@ -2745,7 +2795,7 @@ switch (alt6) { case 1 : - // Hql.g:743:19: EXPONENT + // Hql.g:755:19: EXPONENT { mEXPONENT(); if (state.failed) return ; @@ -2754,7 +2804,7 @@ } - // Hql.g:743:30: (f1= FLOAT_SUFFIX )? + // Hql.g:755:30: (f1= FLOAT_SUFFIX )? int alt7 = 2; int LA7_0 = input.LA(1); @@ -2765,11 +2815,11 @@ switch (alt7) { case 1 : - // Hql.g:743:31: f1= FLOAT_SUFFIX + // Hql.g:755:31: f1= FLOAT_SUFFIX { - int f1Start1018 = CharIndex; + int f1Start1034 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; - f1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f1Start1018, CharIndex-1); + f1 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f1Start1034, CharIndex-1); if ( (state.backtracking==0) ) { t=f1; @@ -2807,9 +2857,9 @@ } break; case 2 : - // Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? + // Hql.g:771:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? { - // Hql.g:759:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) + // Hql.g:771:4: ( '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? | ( '1' .. '9' ) ( '0' .. '9' )* ) int alt13 = 2; int LA13_0 = input.LA(1); @@ -2832,14 +2882,14 @@ switch (alt13) { case 1 : - // Hql.g:759:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? + // Hql.g:771:6: '0' ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? { Match('0'); if (state.failed) return ; if ( (state.backtracking==0) ) { isDecimal = true; } - // Hql.g:760:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? + // Hql.g:772:4: ( ( 'x' ) ( HEX_DIGIT )+ | ( '0' .. '7' )+ )? int alt11 = 3; int LA11_0 = input.LA(1); @@ -2854,16 +2904,16 @@ switch (alt11) { case 1 : - // Hql.g:760:6: ( 'x' ) ( HEX_DIGIT )+ + // Hql.g:772:6: ( 'x' ) ( HEX_DIGIT )+ { - // Hql.g:760:6: ( 'x' ) - // Hql.g:760:7: 'x' + // Hql.g:772:6: ( 'x' ) + // Hql.g:772:7: 'x' { Match('x'); if (state.failed) return ; } - // Hql.g:761:5: ( HEX_DIGIT )+ + // Hql.g:773:5: ( HEX_DIGIT )+ int cnt9 = 0; do { @@ -2929,7 +2979,7 @@ switch (alt9) { case 1 : - // Hql.g:768:7: HEX_DIGIT + // Hql.g:780:7: HEX_DIGIT { mHEX_DIGIT(); if (state.failed) return ; @@ -2953,9 +3003,9 @@ } break; case 2 : - // Hql.g:770:6: ( '0' .. '7' )+ + // Hql.g:782:6: ( '0' .. '7' )+ { - // Hql.g:770:6: ( '0' .. '7' )+ + // Hql.g:782:6: ( '0' .. '7' )+ int cnt10 = 0; do { @@ -2971,7 +3021,7 @@ switch (alt10) { case 1 : - // Hql.g:770:7: '0' .. '7' + // Hql.g:782:7: '0' .. '7' { MatchRange('0','7'); if (state.failed) return ; @@ -3001,16 +3051,16 @@ } break; case 2 : - // Hql.g:772:5: ( '1' .. '9' ) ( '0' .. '9' )* + // Hql.g:784:5: ( '1' .. '9' ) ( '0' .. '9' )* { - // Hql.g:772:5: ( '1' .. '9' ) - // Hql.g:772:6: '1' .. '9' + // Hql.g:784:5: ( '1' .. '9' ) + // Hql.g:784:6: '1' .. '9' { MatchRange('1','9'); if (state.failed) return ; } - // Hql.g:772:16: ( '0' .. '9' )* + // Hql.g:784:16: ( '0' .. '9' )* do { int alt12 = 2; @@ -3025,7 +3075,7 @@ switch (alt12) { case 1 : - // Hql.g:772:17: '0' .. '9' + // Hql.g:784:17: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -3050,7 +3100,7 @@ } - // Hql.g:774:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? + // Hql.g:786:3: ( ( 'l' ) | {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) )? int alt19 = 3; int LA19_0 = input.LA(1); @@ -3065,10 +3115,10 @@ switch (alt19) { case 1 : - // Hql.g:774:5: ( 'l' ) + // Hql.g:786:5: ( 'l' ) { - // Hql.g:774:5: ( 'l' ) - // Hql.g:774:6: 'l' + // Hql.g:786:5: ( 'l' ) + // Hql.g:786:6: 'l' { Match('l'); if (state.failed) return ; @@ -3082,14 +3132,14 @@ } break; case 2 : - // Hql.g:777:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) + // Hql.g:789:5: {...}? ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) { if ( !((isDecimal)) ) { if ( state.backtracking > 0 ) {state.failed = true; return ;} throw new FailedPredicateException(input, "NUM_INT", "isDecimal"); } - // Hql.g:778:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) + // Hql.g:790:4: ( '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? | EXPONENT (f3= FLOAT_SUFFIX )? | f4= FLOAT_SUFFIX ) int alt18 = 3; switch ( input.LA(1) ) { @@ -3121,10 +3171,10 @@ switch (alt18) { case 1 : - // Hql.g:778:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? + // Hql.g:790:8: '.' ( '0' .. '9' )* ( EXPONENT )? (f2= FLOAT_SUFFIX )? { Match('.'); if (state.failed) return ; - // Hql.g:778:12: ( '0' .. '9' )* + // Hql.g:790:12: ( '0' .. '9' )* do { int alt14 = 2; @@ -3139,7 +3189,7 @@ switch (alt14) { case 1 : - // Hql.g:778:13: '0' .. '9' + // Hql.g:790:13: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -3154,7 +3204,7 @@ loop14: ; // Stops C# compiler whining that label 'loop14' has no statements - // Hql.g:778:24: ( EXPONENT )? + // Hql.g:790:24: ( EXPONENT )? int alt15 = 2; int LA15_0 = input.LA(1); @@ -3165,7 +3215,7 @@ switch (alt15) { case 1 : - // Hql.g:778:25: EXPONENT + // Hql.g:790:25: EXPONENT { mEXPONENT(); if (state.failed) return ; @@ -3174,7 +3224,7 @@ } - // Hql.g:778:36: (f2= FLOAT_SUFFIX )? + // Hql.g:790:36: (f2= FLOAT_SUFFIX )? int alt16 = 2; int LA16_0 = input.LA(1); @@ -3185,11 +3235,11 @@ switch (alt16) { case 1 : - // Hql.g:778:37: f2= FLOAT_SUFFIX + // Hql.g:790:37: f2= FLOAT_SUFFIX { - int f2Start1220 = CharIndex; + int f2Start1236 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; - f2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f2Start1220, CharIndex-1); + f2 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f2Start1236, CharIndex-1); if ( (state.backtracking==0) ) { t=f2; @@ -3204,10 +3254,10 @@ } break; case 2 : - // Hql.g:779:8: EXPONENT (f3= FLOAT_SUFFIX )? + // Hql.g:791:8: EXPONENT (f3= FLOAT_SUFFIX )? { mEXPONENT(); if (state.failed) return ; - // Hql.g:779:17: (f3= FLOAT_SUFFIX )? + // Hql.g:791:17: (f3= FLOAT_SUFFIX )? int alt17 = 2; int LA17_0 = input.LA(1); @@ -3218,11 +3268,11 @@ switch (alt17) { case 1 : - // Hql.g:779:18: f3= FLOAT_SUFFIX + // Hql.g:791:18: f3= FLOAT_SUFFIX { - int f3Start1238 = CharIndex; + int f3Start1254 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; - f3 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f3Start1238, CharIndex-1); + f3 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f3Start1254, CharIndex-1); if ( (state.backtracking==0) ) { t=f3; @@ -3237,11 +3287,11 @@ } break; case 3 : - // Hql.g:780:8: f4= FLOAT_SUFFIX + // Hql.g:792:8: f4= FLOAT_SUFFIX { - int f4Start1253 = CharIndex; + int f4Start1269 = CharIndex; mFLOAT_SUFFIX(); if (state.failed) return ; - f4 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f4Start1253, CharIndex-1); + f4 = new CommonToken(input, Token.INVALID_TOKEN_TYPE, Token.DEFAULT_CHANNEL, f4Start1269, CharIndex-1); if ( (state.backtracking==0) ) { t=f4; @@ -3294,8 +3344,8 @@ { try { - // Hql.g:802:2: ( ( '0' .. '9' | 'a' .. 'f' ) ) - // Hql.g:802:4: ( '0' .. '9' | 'a' .. 'f' ) + // Hql.g:814:2: ( ( '0' .. '9' | 'a' .. 'f' ) ) + // Hql.g:814:4: ( '0' .. '9' | 'a' .. 'f' ) { if ( (input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { @@ -3324,17 +3374,17 @@ { try { - // Hql.g:808:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ ) - // Hql.g:808:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ + // Hql.g:820:2: ( ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ ) + // Hql.g:820:4: ( 'e' ) ( '+' | '-' )? ( '0' .. '9' )+ { - // Hql.g:808:4: ( 'e' ) - // Hql.g:808:5: 'e' + // Hql.g:820:4: ( 'e' ) + // Hql.g:820:5: 'e' { Match('e'); if (state.failed) return ; } - // Hql.g:808:10: ( '+' | '-' )? + // Hql.g:820:10: ( '+' | '-' )? int alt21 = 2; int LA21_0 = input.LA(1); @@ -3365,7 +3415,7 @@ } - // Hql.g:808:21: ( '0' .. '9' )+ + // Hql.g:820:21: ( '0' .. '9' )+ int cnt22 = 0; do { @@ -3381,7 +3431,7 @@ switch (alt22) { case 1 : - // Hql.g:808:22: '0' .. '9' + // Hql.g:820:22: '0' .. '9' { MatchRange('0','9'); if (state.failed) return ; @@ -3416,7 +3466,7 @@ { try { - // Hql.g:813:2: ( 'f' | 'd' | 'm' ) + // Hql.g:825:2: ( 'f' | 'd' | 'm' ) // Hql.g: { if ( input.LA(1) == 'd' || input.LA(1) == 'f' || input.LA(1) == 'm' ) @@ -3443,8 +3493,8 @@ override public void mTokens() // throws RecognitionException { - // Hql.g:1:8: ( ALL | ANY | AND | AS | ASCENDING | AVG | BETWEEN | CLASS | COUNT | DELETE | DESCENDING | DISTINCT | ELEMENTS | ESCAPE | EXISTS | FALSE | FETCH | FROM | FULL | GROUP | HAVING | IN | INDICES | INNER | INSERT | INTO | IS | JOIN | LEFT | LIKE | MAX | MIN | NEW | NOT | NULL | OR | ORDER | OUTER | PROPERTIES | RIGHT | SELECT | SET | SOME | SUM | TRUE | UNION | UPDATE | VERSIONED | WHERE | LITERAL_by | CASE | END | ELSE | THEN | WHEN | ON | WITH | BOTH | EMPTY | LEADING | MEMBER | OBJECT | OF | TRAILING | T__131 | T__132 | EQ | LT | GT | SQL_NE | NE | LE | GE | BOR | BXOR | BAND | BNOT | COMMA | OPEN | CLOSE | OPEN_BRACKET | CLOSE_BRACKET | CONCAT | PLUS | MINUS | STAR | DIV | COLON | PARAM | IDENT | QUOTED_String | WS | NUM_INT ) - int alt23 = 93; + // Hql.g:1:8: ( ALL | ANY | AND | AS | ASCENDING | AVG | BETWEEN | CLASS | COUNT | DELETE | DESCENDING | DISTINCT | ELEMENTS | ESCAPE | EXISTS | FALSE | FETCH | FROM | FULL | GROUP | HAVING | IN | INDICES | INNER | INSERT | INTO | IS | JOIN | LEFT | LIKE | MAX | MIN | NEW | NOT | NULL | OR | ORDER | OUTER | PROPERTIES | RIGHT | SELECT | SET | SKIP | SOME | SUM | TAKE | TRUE | UNION | UPDATE | VERSIONED | WHERE | LITERAL_by | CASE | END | ELSE | THEN | WHEN | ON | WITH | BOTH | EMPTY | LEADING | MEMBER | OBJECT | OF | TRAILING | T__133 | T__134 | EQ | LT | GT | SQL_NE | NE | LE | GE | BOR | BXOR | BAND | BNOT | COMMA | OPEN | CLOSE | OPEN_BRACKET | CLOSE_BRACKET | CONCAT | PLUS | MINUS | STAR | DIV | COLON | PARAM | IDENT | QUOTED_String | WS | NUM_INT ) + int alt23 = 95; alt23 = dfa23.Predict(input); switch (alt23) { @@ -3743,358 +3793,372 @@ } break; case 43 : - // Hql.g:1:255: SOME + // Hql.g:1:255: SKIP { - mSOME(); if (state.failed) return ; + mSKIP(); if (state.failed) return ; } break; case 44 : - // Hql.g:1:260: SUM + // Hql.g:1:260: SOME { - mSUM(); if (state.failed) return ; + mSOME(); if (state.failed) return ; } break; case 45 : - // Hql.g:1:264: TRUE + // Hql.g:1:265: SUM { - mTRUE(); if (state.failed) return ; + mSUM(); if (state.failed) return ; } break; case 46 : - // Hql.g:1:269: UNION + // Hql.g:1:269: TAKE { - mUNION(); if (state.failed) return ; + mTAKE(); if (state.failed) return ; } break; case 47 : - // Hql.g:1:275: UPDATE + // Hql.g:1:274: TRUE { - mUPDATE(); if (state.failed) return ; + mTRUE(); if (state.failed) return ; } break; case 48 : - // Hql.g:1:282: VERSIONED + ... [truncated message content] |
From: <pa...@us...> - 2011-04-11 17:04:49
|
Revision: 5667 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5667&view=rev Author: patearl Date: 2011-04-11 17:04:42 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Improved ANTLR batch files and menus. Modified Paths: -------------- trunk/nhibernate/ShowBuildMenu.bat trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHql.bat trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlDebug.bat trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalker.bat trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalkerDebug.bat trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGenerator.bat Added Paths: ----------- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGeneratorDebug.bat Modified: trunk/nhibernate/ShowBuildMenu.bat =================================================================== --- trunk/nhibernate/ShowBuildMenu.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/ShowBuildMenu.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -122,32 +122,36 @@ echo C. Regenerate SqlGenerator.cs from SqlGenerator.g. echo D. Regenerate Hql.g in debug mode. echo E. Regenerate HqlSqlWalker.g in debug mode. -echo H. Quick instructions on using debug mode. +echo F. Regenerate SqlGenerator.g in debug mode. +echo G. Quick instructions on using debug mode. echo. if exist %SYSTEMROOT%\System32\choice.exe ( goto grammar-prompt-choice ) goto grammar-prompt-set :grammar-prompt-choice -choice /C:abcde +choice /C:abcdefg if errorlevel 255 goto end -if errorlevel 5 goto antlr-debug -if errorlevel 4 goto antlr-hqlsqlwalker-debug -if errorlevel 3 goto antlr-hql-debug +if errorlevel 7 goto antlr-debug +if errorlevel 6 goto antlr-sqlgenerator-debug +if errorlevel 5 goto antlr-hqlsqlwalker-debug +if errorlevel 4 goto antlr-hql-debug +if errorlevel 3 goto antlr-sqlgenerator if errorlevel 2 goto antlr-hqlsqlwalker if errorlevel 1 goto antlr-hql if errorlevel 0 goto end :grammar-prompt-set -set /p OPT=[A, B, C, D, E, H]? +set /p OPT=[A, B, C, D, E, F, G]? if /I "%OPT%"=="A" goto antlr-hql if /I "%OPT%"=="B" goto antlr-hqlsqlwalker if /I "%OPT%"=="C" goto antlr-sqlgenerator if /I "%OPT%"=="D" goto antlr-hql-debug if /I "%OPT%"=="E" goto antlr-hqlsqlwalker-debug -if /I "%OPT%"=="H" goto antlr-debug +if /I "%OPT%"=="F" goto antlr-sqlgenerator +if /I "%OPT%"=="G" goto antlr-debug goto grammar-prompt-set :antlr-hql @@ -170,12 +174,17 @@ call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalkerDebug.bat goto end +:antlr-sqlgenerator-debug +call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGeneratorDebug.bat +goto end + :antlr-debug echo To use the debug grammar: echo 1. Create a unit test that runs the hql parser on the input you're interested in. +echo The one you want to debug must be the first grammar parsed. echo 2. Run the unit test. It will appear to stall. -echo 3. Download and run AntlrWorks. -echo 4. Choose "Debug Remote" and allow the default ports. +echo 3. Download and run AntlrWorks (java -jar AntlrWorks.jar). +echo 4. Choose "Debug Remote" and accept the default port. echo 5. You should now be connected and able to step through your grammar. goto end Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHql.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHql.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHql.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -1,5 +1,5 @@ +@echo off rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. -@echo off pushd %~dp0 java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -o Generated Hql.g popd \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlDebug.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlDebug.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlDebug.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -1,5 +1,5 @@ +@echo off rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. -@echo off pushd %~dp0 java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -debug -o Generated Hql.g popd \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalker.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalker.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalker.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -1,5 +1,5 @@ +@echo off rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. -@echo off pushd %~dp0 java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -o Generated HqlSqlWalker.g popd \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalkerDebug.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalkerDebug.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrHqlSqlWalkerDebug.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -1,5 +1,5 @@ +@echo off rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. -@echo off pushd %~dp0 java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -debug -o Generated HqlSqlWalker.g popd \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGenerator.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGenerator.bat 2011-04-11 11:41:09 UTC (rev 5666) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGenerator.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -1,5 +1,5 @@ +@echo off rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. -@echo off pushd %~dp0 java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -o Generated SqlGenerator.g popd \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGeneratorDebug.bat =================================================================== --- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGeneratorDebug.bat (rev 0) +++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/AntlrSqlGeneratorDebug.bat 2011-04-11 17:04:42 UTC (rev 5667) @@ -0,0 +1,5 @@ +@echo off +rem I wanted to put this in the nant build file, but I had very annoying problems with 64-bit java running from the 32-bit nant process. +pushd %~dp0 +java.exe -cp ..\..\..\..\..\Tools\Antlr\antlr-3.2.jar org.antlr.Tool -debug -o Generated SqlGenerator.g +popd \ 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: <jul...@us...> - 2011-04-11 11:41:16
|
Revision: 5666 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5666&view=rev Author: julian-maughan Date: 2011-04-11 11:41:09 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Unified NHibernate.Test.Hql and NHibernate.Test.HQL namespaces (part 2 of 2) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Address.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BaseFixture.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Classification.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/CrazyCompositeKey.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/DomesticAnimal.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/HqlFixture.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Human.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/IntegerVersioned.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Joiner.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneKeyEntity.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Mammal.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Name.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/ParsingFixture.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/QuerySubstitutionTest.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Reptile.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleAssociatedEntity.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SqlTranslationFixture.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/StateProvince.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/TimestampVersioned.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/User.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicle.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicles.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Versions.hbm.xml trunk/nhibernate/src/NHibernate.Test/Hql/Ast/WithClauseFixture.cs trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Zoo.cs trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs trunk/nhibernate/src/NHibernate.Test/Hql/SqlCommentsFixture.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Address.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Address.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Address.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Address { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using Iesi.Collections; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Animal { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Animal.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast" + namespace="NHibernate.Test.Hql.Ast" default-access="field"> <class name="Animal"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BaseFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BaseFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BaseFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,10 +1,10 @@ using System.Collections; +using System.Collections.Generic; using NHibernate.Hql.Ast.ANTLR; -using System.Collections.Generic; +using NHibernate.Hql.Classic; using NHibernate.Util; -using NHibernate.Hql.Classic; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class BaseFixture: TestCase { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class BooleanLiteralEntity { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BooleanLiteralEntity.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <class name="BooleanLiteralEntity"> <id name="Id"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/BulkManipulation.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -8,7 +8,7 @@ using NUnit.Framework; using SharpTestsEx; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { [TestFixture] public class BulkManipulation : BaseFixture Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Classification.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Classification.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Classification.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public enum Classification { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/CrazyCompositeKey.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/CrazyCompositeKey.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/CrazyCompositeKey.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class CrazyCompositeKey { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/DomesticAnimal.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/DomesticAnimal.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/DomesticAnimal.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class DomesticAnimal: Mammal { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class EntityWithCrazyCompositeKey { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/EntityWithCrazyCompositeKey.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <class name="EntityWithCrazyCompositeKey"> <composite-id name="Id" class="CrazyCompositeKey"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/HqlFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/HqlFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/HqlFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -6,7 +6,7 @@ using NHibernate.Util; using NUnit.Framework; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { [TestFixture] public class HqlFixture : BaseFixture Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Human.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Human.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Human.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ using System.Collections; using Iesi.Collections; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Human: Mammal { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/IntegerVersioned.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/IntegerVersioned.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/IntegerVersioned.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class IntegerVersioned { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Joiner.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Joiner.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Joiner.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Joiner { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class KeyManyToOneEntity { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneEntity.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <class name="KeyManyToOneKeyEntity"> <id name="id" type="long" access="field" > Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneKeyEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneKeyEntity.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/KeyManyToOneKeyEntity.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class KeyManyToOneKeyEntity { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Mammal.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Mammal.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Mammal.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Mammal: Animal { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Name.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Name.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Name.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Name { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/ParsingFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/ParsingFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/ParsingFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -7,7 +7,7 @@ using NHibernate.Tool.hbm2ddl; using NUnit.Framework; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { // This test need the new NUnit //[TestFixture] Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/QuerySubstitutionTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/QuerySubstitutionTest.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/QuerySubstitutionTest.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -4,7 +4,7 @@ using NHibernate.Cfg.Loquacious; using SharpTestsEx; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class QuerySubstitutionTest: BaseFixture { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Reptile.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Reptile.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Reptile.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Reptile: Animal { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleAssociatedEntity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleAssociatedEntity.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleAssociatedEntity.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class SimpleAssociatedEntity { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class SimpleClass { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleClass.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <class name="SimpleClass"> <id type="int"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ using System; using Iesi.Collections; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class SimpleEntityWithAssociation { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SimpleEntityWithAssociation.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <!-- *Very* important for the test cases that these entities have identically named columns! --> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SqlTranslationFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SqlTranslationFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/SqlTranslationFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using NUnit.Framework; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { [TestFixture] public class SqlTranslationFixture : BaseFixture Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/StateProvince.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/StateProvince.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/StateProvince.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class StateProvince { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/TimestampVersioned.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/TimestampVersioned.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/TimestampVersioned.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using System; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class TimestampVersioned { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/User.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/User.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/User.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using System.Collections; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class User { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicle.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicle.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicle.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast"> + namespace="NHibernate.Test.Hql.Ast"> <!-- Vehicle represents an abstract root of a union-subclass hierarchy --> <class name="Vehicle" abstract="true"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicles.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicles.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Vehicles.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,4 +1,4 @@ -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Vehicle { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Versions.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Versions.hbm.xml 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Versions.hbm.xml 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test" - namespace="NHibernate.Test.HQL.Ast" + namespace="NHibernate.Test.Hql.Ast" default-access="field"> <class name="IntegerVersioned"> Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/WithClauseFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/WithClauseFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/WithClauseFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -2,7 +2,7 @@ using NHibernate.Hql.Ast.ANTLR; using NUnit.Framework; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { [TestFixture] public class WithClauseFixture : BaseFixture Modified: trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Zoo.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Zoo.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/Ast/Zoo.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -1,6 +1,6 @@ using System.Collections; -namespace NHibernate.Test.HQL.Ast +namespace NHibernate.Test.Hql.Ast { public class Zoo { Modified: trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/HQLFunctions.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -49,7 +49,7 @@ protected override IList Mappings { - get { return new string[] { "HQL.Animal.hbm.xml", "HQL.MaterialResource.hbm.xml" }; } + get { return new string[] { "Hql.Animal.hbm.xml", "Hql.MaterialResource.hbm.xml" }; } } protected override void OnTearDown() Modified: trunk/nhibernate/src/NHibernate.Test/Hql/SqlCommentsFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/Hql/SqlCommentsFixture.cs 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/Hql/SqlCommentsFixture.cs 2011-04-11 11:41:09 UTC (rev 5666) @@ -2,7 +2,7 @@ using NHibernate.Cfg; using NUnit.Framework; -namespace NHibernate.Test.HQL +namespace NHibernate.Test.Hql { [TestFixture] public class SqlCommentsFixture : TestCase @@ -14,7 +14,7 @@ protected override IList Mappings { - get { return new[] { "HQL.Animal.hbm.xml" }; } + get { return new[] { "Hql.Animal.hbm.xml" }; } } protected override void Configure(Configuration configuration) Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-11 11:32:41 UTC (rev 5665) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-11 11:41:09 UTC (rev 5666) @@ -399,37 +399,37 @@ <Compile Include="GhostProperty\Order.cs" /> <Compile Include="GhostProperty\GhostPropertyFixture.cs" /> <Compile Include="HbmMappingExtensions.cs" /> - <Compile Include="HQL\Animal.cs" /> - <Compile Include="HQL\Ast\Address.cs" /> - <Compile Include="HQL\Ast\Animal.cs" /> - <Compile Include="HQL\Ast\BaseFixture.cs" /> - <Compile Include="HQL\Ast\BooleanLiteralEntity.cs" /> - <Compile Include="HQL\Ast\BulkManipulation.cs" /> - <Compile Include="HQL\Ast\Classification.cs" /> - <Compile Include="HQL\Ast\CrazyCompositeKey.cs" /> - <Compile Include="HQL\Ast\DomesticAnimal.cs" /> - <Compile Include="HQL\Ast\EntityWithCrazyCompositeKey.cs" /> - <Compile Include="HQL\Ast\Human.cs" /> - <Compile Include="HQL\Ast\IntegerVersioned.cs" /> - <Compile Include="HQL\Ast\Joiner.cs" /> - <Compile Include="HQL\Ast\KeyManyToOneEntity.cs" /> - <Compile Include="HQL\Ast\KeyManyToOneKeyEntity.cs" /> - <Compile Include="HQL\Ast\Mammal.cs" /> - <Compile Include="HQL\Ast\Name.cs" /> - <Compile Include="HQL\Ast\ParsingFixture.cs" /> - <Compile Include="HQL\Ast\QuerySubstitutionTest.cs" /> - <Compile Include="HQL\Ast\Reptile.cs" /> - <Compile Include="HQL\Ast\SimpleAssociatedEntity.cs" /> - <Compile Include="HQL\Ast\SimpleClass.cs" /> - <Compile Include="HQL\Ast\SimpleEntityWithAssociation.cs" /> - <Compile Include="HQL\Ast\SqlTranslationFixture.cs" /> - <Compile Include="HQL\Ast\StateProvince.cs" /> - <Compile Include="HQL\Ast\TimestampVersioned.cs" /> - <Compile Include="HQL\Ast\User.cs" /> - <Compile Include="HQL\Ast\Vehicles.cs" /> - <Compile Include="HQL\Ast\WithClauseFixture.cs" /> - <Compile Include="HQL\Ast\Zoo.cs" /> - <Compile Include="HQL\BaseFunctionFixture.cs" /> + <Compile Include="Hql\Animal.cs" /> + <Compile Include="Hql\Ast\Address.cs" /> + <Compile Include="Hql\Ast\Animal.cs" /> + <Compile Include="Hql\Ast\BaseFixture.cs" /> + <Compile Include="Hql\Ast\BooleanLiteralEntity.cs" /> + <Compile Include="Hql\Ast\BulkManipulation.cs" /> + <Compile Include="Hql\Ast\Classification.cs" /> + <Compile Include="Hql\Ast\CrazyCompositeKey.cs" /> + <Compile Include="Hql\Ast\DomesticAnimal.cs" /> + <Compile Include="Hql\Ast\EntityWithCrazyCompositeKey.cs" /> + <Compile Include="Hql\Ast\Human.cs" /> + <Compile Include="Hql\Ast\IntegerVersioned.cs" /> + <Compile Include="Hql\Ast\Joiner.cs" /> + <Compile Include="Hql\Ast\KeyManyToOneEntity.cs" /> + <Compile Include="Hql\Ast\KeyManyToOneKeyEntity.cs" /> + <Compile Include="Hql\Ast\Mammal.cs" /> + <Compile Include="Hql\Ast\Name.cs" /> + <Compile Include="Hql\Ast\ParsingFixture.cs" /> + <Compile Include="Hql\Ast\QuerySubstitutionTest.cs" /> + <Compile Include="Hql\Ast\Reptile.cs" /> + <Compile Include="Hql\Ast\SimpleAssociatedEntity.cs" /> + <Compile Include="Hql\Ast\SimpleClass.cs" /> + <Compile Include="Hql\Ast\SimpleEntityWithAssociation.cs" /> + <Compile Include="Hql\Ast\SqlTranslationFixture.cs" /> + <Compile Include="Hql\Ast\StateProvince.cs" /> + <Compile Include="Hql\Ast\TimestampVersioned.cs" /> + <Compile Include="Hql\Ast\User.cs" /> + <Compile Include="Hql\Ast\Vehicles.cs" /> + <Compile Include="Hql\Ast\WithClauseFixture.cs" /> + <Compile Include="Hql\Ast\Zoo.cs" /> + <Compile Include="Hql\BaseFunctionFixture.cs" /> <Compile Include="IdTest\AssignedClass.cs" /> <Compile Include="IdTest\AssignedFixture.cs" /> <Compile Include="IdTest\TableGeneratorFixture.cs" /> @@ -1127,16 +1127,16 @@ <Compile Include="NHSpecificTest\NH473\Fixture.cs" /> <Compile Include="NHSpecificTest\NH473\Parent.cs" /> <Compile Include="NHSpecificTest\NH645\HQLFunctionFixture.cs" /> - <Compile Include="HQL\HQLFunctions.cs" /> - <Compile Include="HQL\Human.cs" /> - <Compile Include="HQL\MaterialResource.cs" /> - <Compile Include="HQL\Name.cs" /> - <Compile Include="HQL\SimpleFunctionsTest.cs" /> - <Compile Include="HQL\SqlCommentsFixture.cs" /> - <Compile Include="HQL\SQLFunctionTemplateTest.cs" /> + <Compile Include="Hql\HQLFunctions.cs" /> + <Compile Include="Hql\Human.cs" /> + <Compile Include="Hql\MaterialResource.cs" /> + <Compile Include="Hql\Name.cs" /> + <Compile Include="Hql\SimpleFunctionsTest.cs" /> + <Compile Include="Hql\SqlCommentsFixture.cs" /> + <Compile Include="Hql\SQLFunctionTemplateTest.cs" /> <Compile Include="BulkManipulation\NativeSQLBulkOperations.cs" /> <Compile Include="BulkManipulation\Vehicles.cs" /> - <Compile Include="HQL\Ast\HqlFixture.cs" /> + <Compile Include="Hql\Ast\HqlFixture.cs" /> <Compile Include="IdGen\Enhanced\SequenceStyleConfigUnitFixture.cs" /> <Compile Include="IdGen\NativeGuid\NativeGuidFixture.cs" /> <Compile Include="IdGen\NativeGuid\NativeGuidGeneratorFixture.cs" /> @@ -2257,7 +2257,7 @@ <EmbeddedResource Include="NHSpecificTest\NH712\Mappings.hbm.xml" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="HQL\Animal.hbm.xml" /> + <EmbeddedResource Include="Hql\Animal.hbm.xml" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="ExpressionTest\SubQueries\Mappings.hbm.xml" /> @@ -2367,7 +2367,7 @@ <EmbeddedResource Include="NHSpecificTest\NH980\Mappings.hbm.xml" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="HQL\MaterialResource.hbm.xml" /> + <EmbeddedResource Include="Hql\MaterialResource.hbm.xml" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Join\CompositeKey.hbm.xml" /> @@ -2810,20 +2810,20 @@ <EmbeddedResource Include="MappingTest\Wicked.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1393\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1391\Mappings.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\Animal.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\BooleanLiteralEntity.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\EntityWithCrazyCompositeKey.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\Animal.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\BooleanLiteralEntity.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\EntityWithCrazyCompositeKey.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\Logs\Mappings.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\KeyManyToOneEntity.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\Multi.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\SimpleEntityWithAssociation.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\Vehicle.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\Versions.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\KeyManyToOneEntity.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\Multi.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\SimpleEntityWithAssociation.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\Vehicle.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\Versions.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1727\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1742\Mappings.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\SimpleClass.hbm.xml" /> - <EmbeddedResource Include="HQL\Ast\TestQueries.xml" /> - <EmbeddedResource Include="HQL\Ast\TestQueriesWithResults.xml" /> + <EmbeddedResource Include="Hql\Ast\SimpleClass.hbm.xml" /> + <EmbeddedResource Include="Hql\Ast\TestQueries.xml" /> + <EmbeddedResource Include="Hql\Ast\TestQueriesWithResults.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1741\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1716\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\Dates\Mappings\TimeAsTimeSpan.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jul...@us...> - 2011-04-11 11:32:47
|
Revision: 5665 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5665&view=rev Author: julian-maughan Date: 2011-04-11 11:32:41 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Unifying NHibernate.Test.Hql and NHibernate.Test.HQL namespaces (part 1 of 2) Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/Hql/ Removed Paths: ------------- trunk/nhibernate/src/NHibernate.Test/HQL/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-11 11:31:55
|
Revision: 5664 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5664&view=rev Author: fabiomaulo Date: 2011-04-11 11:31:49 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Release notes for the next version Modified Paths: -------------- trunk/nhibernate/releasenotes.txt Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2011-04-11 11:16:38 UTC (rev 5663) +++ trunk/nhibernate/releasenotes.txt 2011-04-11 11:31:49 UTC (rev 5664) @@ -8,6 +8,70 @@ * - ICollectionPersister added property to fix [NH-2489] * [NH-2605] Refactorize MultiQuery/MultiCriteria implementation to delegate responsibility to IDrive (IDrive changed). +Build 3.2.0.Aplha1 (rev5664) +============================= +** Bug + * [NH-1925] - Wrong SQL aliases generated for HQL subselect + * [NH-2480] - AssertByIds test function with unordered Ids + * [NH-2488] - Subclass join does not exclude lazy properties + * [NH-2489] - AbstractPersistentCollection.ReadElementByIndex gives wrong result for missing element with lazy="extra" + * [NH-2490] - Mapping.Join.IsLazy always returns true + * [NH-2491] - ObjectNotFoundException in HQL query when referencing joined subclass + * [NH-2498] - Lazy="no-proxy" does eager load + * [NH-2554] - NHibernate Formula doesnt recognize varbinary as a keyword on Sql Server 2008 or 2008 R2 + * [NH-2565] - session.Persist does not work with entities with lazy properties (no-proxy) + * [NH-2584] - An entity with a lazy property cannot be saved in new session + * [NH-2603] - lazy="extra" return different count than initialized collection. + * [NH-2604] - Problem with MSTest and Relinq (possibly due to ILMerge) + * [NH-2607] - Proxifier should not try to proxy sealed and non public methods + * [NH-2610] - ISQLExceptionConverter doesn't work with MultiCriteria and MultiQuery + * [NH-2622] - Proxying fails for methods with out and ref arguments + * [NH-2626] - LinqExtensionMethods.Query<T> implements wrong NhQueryable<T> + * [NH-2627] - Cloning subcriteria loses WithClause + * [NH-2628] - Fails to create proxy for class with method that has argument "ref of Dictionary<string, string>" + * [NH-2632] - Lazy Properties Causing An Exception If Containing Class Is Set To Not Lazy + * [NH-2633] - MapperByCode don't Register Component + +** Improvement + * [NH-1513] - MultiCriteria, MultiQuery improvements + * [NH-2382] - HQL, Criteria, QueryOver need Set methods for all NHibernate types + * [NH-2418] - Dialect.IsQuoted fails on empty name + * [NH-2495] - Support ISqlQuery in MultiQuery + * [NH-2518] - disable/truncate SQL parameter logging of BLOBs + * [NH-2526] - Sybase ASE 15 support + * [NH-2530] - Include WHERE clause in error message if we aren't able to locate a 'High' value + * [NH-2531] - NHibernate.Impl.CriteriaImpl.cs: Fix for possible ArgumentNullException in sub-criteria alias handling + * [NH-2550] - Allow public access to FieldInterceptor Session + * [NH-2563] - Support calls to ToString() in Linq queries + * [NH-2570] - Full SQLite Support + * [NH-2573] - Ability to retrieve longest registered type for a specified DbType + * [NH-2580] - "Unable to locate persister" exception message should be more helpful + * [NH-2586] - Default ProxyFactory + * [NH-2592] - Add ICriteria functionality missing in QueryOver + * [NH-2593] - Default common values per dialect + * [NH-2601] - Remove Dialect.HasAlterTable + * [NH-2605] - Refactorize MultiQuery/MultiCriteria implementation to delegate responsibility to IDrive + * [NH-2612] - Move the lambda con to the same namespace than Configuration + * [NH-2630] - Truncate SQL parameter logging of very long strings + +** New Feature + * [NH-2015] - Implement Hibernate's Order.IgnoreCase() + * [NH-2426] - postgresql schema metadata + * [NH-2591] - Insert ordering + * [NH-2602] - Mapping <subselct> node in collection, subclass, join and so on + * [NH-2635] - Mapping by code + +** Patch + * [NH-2548] - HQL Select Clause Parameters + * [NH-2590] - Missed registration of Concat function for SQLCE4 + * [NH-2600] - Increase visibility of components in AbstractPersistentCollection + +** Task + * [NH-2561] - Consider current_timestamp semantics + * [NH-2575] - Update documentation for immutable classes + * [NH-2608] - Integrate Remotion 1.13.100 to fix duplicate mscorlib problem + * [NH-2636] - Expose ExpressionTreeVisitor Members + Build 3.1.0.GA (rev5425) ============================= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-11 11:16:44
|
Revision: 5663 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5663&view=rev Author: fabiomaulo Date: 2011-04-11 11:16:38 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Changed version Modified Paths: -------------- trunk/nhibernate/build-common/common.xml Modified: trunk/nhibernate/build-common/common.xml =================================================================== --- trunk/nhibernate/build-common/common.xml 2011-04-10 22:50:06 UTC (rev 5662) +++ trunk/nhibernate/build-common/common.xml 2011-04-11 11:16:38 UTC (rev 5663) @@ -84,7 +84,7 @@ effectively SP0). --> - <property name="project.version" value="3.2.0.GA" overwrite="false" /> + <property name="project.version" value="3.2.0.Alpha1" overwrite="false" /> <!-- Compute short project version (major.minor) using a regex --> <regex input="${project.version}" pattern="^(?'shortversion'\d+\.\d+)" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 22:50:12
|
Revision: 5662 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5662&view=rev Author: fabiomaulo Date: 2011-04-10 22:50:06 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover TablePerClass entities Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DefaultClassHierarchyRepresentationTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 22:20:17 UTC (rev 5661) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 22:50:06 UTC (rev 5662) @@ -15,7 +15,7 @@ private Func<System.Type, bool, bool> isEntity = (t, declared) => declared; private Func<System.Type, bool, bool> isRootEntity = (t, declared) => declared; - private Func<System.Type, bool, bool> isTablePerClass = (t, declared) => declared; + private Func<System.Type, bool, bool> isTablePerClass; private Func<SplitDefinition, bool, bool> isTablePerClassSplit = (sd, declared) => declared; private Func<System.Type, bool, bool> isTablePerClassHierarchy = (t, declared) => declared; private Func<System.Type, bool, bool> isTablePerConcreteClass = (t, declared) => declared; @@ -44,6 +44,7 @@ public SimpleModelInspector() { isEntity = (t, declared) => declared || MatchEntity(t); + isTablePerClass = (t, declared) => declared || MatchTablePerClass(t); isPersistentId = (m, declared) => declared || MatchPoIdPattern(m); isComponent = (t, declared) => declared || MatchComponentPattern(t); isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); @@ -55,6 +56,11 @@ isOneToMany = (m, declared) => declared || MatchOneToMany(m); } + private bool MatchTablePerClass(System.Type type) + { + return !declaredModel.IsTablePerClassHierarchy(type) && !declaredModel.IsTablePerConcreteClass(type); + } + private bool MatchOneToMany(MemberInfo memberInfo) { var modelInspector = (IModelInspector) this; Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DefaultClassHierarchyRepresentationTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DefaultClassHierarchyRepresentationTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DefaultClassHierarchyRepresentationTests.cs 2011-04-10 22:50:06 UTC (rev 5662) @@ -0,0 +1,58 @@ +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class DefaultClassHierarchyRepresentationTests + { + private class MyClass + { + public int Id { get; set; } + } + + private class Inherited: MyClass + { + } + + [Test] + public void WhenNotExplicitlyDeclaredThenIsTablePerClass() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(x => { }); + var inspector = (IModelInspector)autoinspector; + + inspector.IsTablePerClass(typeof(MyClass)).Should().Be.True(); + inspector.IsTablePerClass(typeof(Inherited)).Should().Be.True(); + } + + [Test] + public void WhenExplicitlyDeclaredAsSubclassThenIsNotTablePerClass() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(x => { }); + mapper.Subclass<Inherited>(x => { }); + + var inspector = (IModelInspector)autoinspector; + + inspector.IsTablePerClass(typeof(MyClass)).Should().Be.False(); + inspector.IsTablePerClass(typeof(Inherited)).Should().Be.False(); + } + + [Test] + public void WhenExplicitlyDeclaredAsUnionSubclassThenIsNotTablePerClass() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(x => { }); + mapper.UnionSubclass<Inherited>(x => { }); + + var inspector = (IModelInspector)autoinspector; + + inspector.IsTablePerClass(typeof(MyClass)).Should().Be.False(); + inspector.IsTablePerClass(typeof(Inherited)).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 22:20:17 UTC (rev 5661) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 22:50:06 UTC (rev 5662) @@ -544,6 +544,7 @@ <Compile Include="MappingByCode\MixAutomapping\ArrayCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\DefaultClassHierarchyRepresentationTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\EntityTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ManyToOneTest.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 22:20:24
|
Revision: 5661 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5661&view=rev Author: fabiomaulo Date: 2011-04-10 22:20:17 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Entities Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/EntityTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 21:55:57 UTC (rev 5660) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 22:20:17 UTC (rev 5661) @@ -43,6 +43,7 @@ public SimpleModelInspector() { + isEntity = (t, declared) => declared || MatchEntity(t); isPersistentId = (m, declared) => declared || MatchPoIdPattern(m); isComponent = (t, declared) => declared || MatchComponentPattern(t); isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); @@ -206,6 +207,16 @@ subject.GetFields(flattenHierarchyMembers)).Any(m => modelInspector.IsPersistentId(m)); } + protected bool MatchEntity(System.Type subject) + { + const BindingFlags flattenHierarchyMembers = + BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; + + var modelInspector = (IModelInspector) this; + return subject.IsClass && + subject.GetProperties(flattenHierarchyMembers).Cast<MemberInfo>().Concat(subject.GetFields(flattenHierarchyMembers)).Any(m => modelInspector.IsPersistentId(m)); + } + #region IModelExplicitDeclarationsHolder Members IEnumerable<System.Type> IModelExplicitDeclarationsHolder.RootEntities Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/EntityTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/EntityTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/EntityTests.cs 2011-04-10 22:20:17 UTC (rev 5661) @@ -0,0 +1,78 @@ +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class EntityTests + { + private class AComponent + { + public string S { get; set; } + } + private class AEntity + { + public int Id { get; set; } + } + private class Entity + { + private int id; + } + + private enum Something + { + + } + + [Test] + public void WhenAClassIsExplicitlyDeclaredAsEntityThenIsEntity() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<AComponent>(map => { }); + + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(AComponent)).Should().Be.True(); + } + + [Test] + public void ClassWithPoidIsEntity() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(AEntity)).Should().Be.True(); + } + + [Test] + public void ClassWithoutPoidIsNotEntity() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(AComponent)).Should().Be.False(); + } + + [Test] + public void ClassWithPoidFieldIsEntity() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(Entity)).Should().Be.True(); + } + + [Test] + public void EnumIsNotEntity() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(Something)).Should().Be.False(); + } + + [Test] + public void StringIsNotEntity() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + inspector.IsEntity(typeof(string)).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 21:55:57 UTC (rev 5660) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 22:20:17 UTC (rev 5661) @@ -545,6 +545,7 @@ <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\EntityTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ManyToOneTest.cs" /> <Compile Include="MappingByCode\MixAutomapping\OneToManyTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 21:56:04
|
Revision: 5660 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5660&view=rev Author: fabiomaulo Date: 2011-04-10 21:55:57 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover OneToMany properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/OneToManyTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 21:14:30 UTC (rev 5659) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 21:55:57 UTC (rev 5660) @@ -31,7 +31,7 @@ private Func<MemberInfo, bool, bool> isManyToMany = (m, declared) => declared; private Func<MemberInfo, bool, bool> isManyToOne; private Func<MemberInfo, bool, bool> isMemberOfNaturalId = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isOneToMany = (m, declared) => declared; + private Func<MemberInfo, bool, bool> isOneToMany; private Func<MemberInfo, bool, bool> isOneToOne = (m, declared) => declared; private Func<MemberInfo, bool, bool> isSet; @@ -51,8 +51,24 @@ isBag = (m, declared) => declared || MatchCollection(m, MatchBagMember); isDictionary = (m, declared) => declared || MatchCollection(m, MatchDictionaryMember); isManyToOne = (m, declared) => declared || MatchManyToOne(m); + isOneToMany = (m, declared) => declared || MatchOneToMany(m); } + private bool MatchOneToMany(MemberInfo memberInfo) + { + var modelInspector = (IModelInspector) this; + System.Type from = memberInfo.ReflectedType; + System.Type to = memberInfo.GetPropertyOrFieldType().DetermineCollectionElementOrDictionaryValueType(); + if(to == null) + { + // no generic collection or simple property + return false; + } + bool areEntities = modelInspector.IsEntity(from) && modelInspector.IsEntity(to); + bool isFromComponentToEntity = modelInspector.IsComponent(from) && modelInspector.IsEntity(to); + return !declaredModel.IsManyToMany(memberInfo) && (areEntities || isFromComponentToEntity); + } + private bool MatchManyToOne(MemberInfo memberInfo) { var modelInspector = (IModelInspector)this; Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/OneToManyTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/OneToManyTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/OneToManyTests.cs 2011-04-10 21:55:57 UTC (rev 5660) @@ -0,0 +1,138 @@ +using System.Collections.Generic; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class OneToManyTests + { + private class MyClass + { + public string Something { get; set; } + public IEnumerable<Related> Relateds { get; set; } + public IEnumerable<Bidirectional> Children { get; set; } + public IEnumerable<Component> Components { get; set; } + public IEnumerable<string> Elements { get; set; } + public IDictionary<string, Related> DicRelateds { get; set; } + public IDictionary<string, Bidirectional> DicChildren { get; set; } + } + + private class Related + { + + } + + private class Bidirectional + { + public MyClass MyClass { get; set; } + } + + private class Component + { + } + + private IModelInspector GetConfiguredInspector() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(x => { }); + mapper.Class<Related>(x => { }); + mapper.Class<Bidirectional>(x => { }); + return autoinspector; + } + + [Test] + public void WhenNoCollectionPropertyThenNoMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Something); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.False(); + } + + [Test] + public void WhenCollectionOfComponentsThenNoMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Components); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.False(); + } + + [Test] + public void WhenCollectionBidirectionalThenMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Children); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.True(); + } + + [Test] + public void WhenCollectionOfElementsThenNoMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Elements); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.False(); + } + + [Test] + public void WhenCollectionUnidirectionalThenMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Relateds); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.True(); + } + + [Test] + public void WhenDictionaryBidirectionalThenMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.DicChildren); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.True(); + } + + [Test] + public void WhenDictionaryUnidirectionalThenMatch() + { + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.DicRelateds); + + var inspector = GetConfiguredInspector(); + inspector.IsOneToMany(pi).Should().Be.True(); + } + + [Test] + public void WhenCollectionUnidirectionalDeclaredManyToManyThenNoMatch() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(map => map.Bag(x => x.Relateds, cm => { }, relMap => relMap.ManyToMany())); + mapper.Class<Related>(x => { }); + mapper.Class<Bidirectional>(x => { }); + var inspector = (IModelInspector) autoinspector; + + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.Relateds); + + inspector.IsOneToMany(pi).Should().Be.False(); + } + + [Test] + public void WhenDictionaryUnidirectionalDeclaredManyToManyThenNoMatch() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyClass>(map => map.Bag(x => x.DicRelateds, cm => { }, relMap => relMap.ManyToMany())); + mapper.Class<Related>(x => { }); + mapper.Class<Bidirectional>(x => { }); + var inspector = (IModelInspector)autoinspector; + + var pi = Mapping.ByCode.TypeExtensions.DecodeMemberAccessExpression<MyClass>(x => x.DicRelateds); + + inspector.IsOneToMany(pi).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 21:14:30 UTC (rev 5659) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 21:55:57 UTC (rev 5660) @@ -546,6 +546,7 @@ <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ManyToOneTest.cs" /> + <Compile Include="MappingByCode\MixAutomapping\OneToManyTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\SetCollectionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 21:14:36
|
Revision: 5659 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5659&view=rev Author: fabiomaulo Date: 2011-04-10 21:14:30 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover ManyToOne properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ManyToOneTest.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:48:38 UTC (rev 5658) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 21:14:30 UTC (rev 5659) @@ -29,7 +29,7 @@ private Func<MemberInfo, bool, bool> isProperty = (m, declared) => declared; private Func<MemberInfo, bool, bool> isAny = (m, declared) => declared; private Func<MemberInfo, bool, bool> isManyToMany = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isManyToOne = (m, declared) => declared; + private Func<MemberInfo, bool, bool> isManyToOne; private Func<MemberInfo, bool, bool> isMemberOfNaturalId = (m, declared) => declared; private Func<MemberInfo, bool, bool> isOneToMany = (m, declared) => declared; private Func<MemberInfo, bool, bool> isOneToOne = (m, declared) => declared; @@ -50,8 +50,20 @@ isArray = (m, declared) => declared || MatchCollection(m, MatchArrayMember); isBag = (m, declared) => declared || MatchCollection(m, MatchBagMember); isDictionary = (m, declared) => declared || MatchCollection(m, MatchDictionaryMember); + isManyToOne = (m, declared) => declared || MatchManyToOne(m); } + private bool MatchManyToOne(MemberInfo memberInfo) + { + var modelInspector = (IModelInspector)this; + System.Type from = memberInfo.ReflectedType; + System.Type to = memberInfo.GetPropertyOrFieldType(); + + bool areEntities = modelInspector.IsEntity(from) && modelInspector.IsEntity(to); + bool isFromComponentToEntity = modelInspector.IsComponent(from) && modelInspector.IsEntity(to); + return isFromComponentToEntity || (areEntities && !modelInspector.IsOneToOne(memberInfo)); + } + protected bool MatchArrayMember(MemberInfo subject) { System.Type memberType = subject.GetPropertyOrFieldType(); Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ManyToOneTest.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ManyToOneTest.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ManyToOneTest.cs 2011-04-10 21:14:30 UTC (rev 5659) @@ -0,0 +1,63 @@ +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class ManyToOneTest + { + private class AEntity + { + public int Id { get; set; } + public BEntity B { get; set; } + public string Name { get; set; } + } + + private class BEntity + { + public int Id { get; set; } + } + + [Test] + public void WhenRelationWithTwoEntityThenIsManyToOne() + { + var autoinspector = new SimpleModelInspector(); + autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t)); + + var inspector = (IModelInspector)autoinspector; + inspector.IsManyToOne(typeof(AEntity).GetProperty("B")).Should().Be.True(); + } + + [Test] + public void WhenSimplePropertyThenIsNotManyToOne() + { + var autoinspector = new SimpleModelInspector(); + autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t) || typeof(BEntity).Equals(t)); + + var inspector = (IModelInspector)autoinspector; + inspector.IsManyToOne(typeof(AEntity).GetProperty("Name")).Should().Be.False(); + } + + [Test] + public void WhenRelatedMatchComponentThenIsNotManyToOne() + { + var autoinspector = new SimpleModelInspector(); + autoinspector.IsEntity((t, declared) => typeof(AEntity).Equals(t)); + autoinspector.IsComponent((t, declared) => typeof(BEntity).Equals(t)); + + var inspector = (IModelInspector)autoinspector; + inspector.IsManyToOne(typeof(AEntity).GetProperty("B")).Should().Be.False(); + } + + [Test] + public void WhenRelatedDeclaredAsOneToOneThenIsNotManyToOne() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<AEntity>(map => map.OneToOne(a => a.B, x => { })); + mapper.Class<BEntity>(x=> { }); + var inspector = (IModelInspector)autoinspector; + inspector.IsManyToOne(typeof(AEntity).GetProperty("B")).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:48:38 UTC (rev 5658) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 21:14:30 UTC (rev 5659) @@ -545,6 +545,7 @@ <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\ManyToOneTest.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\SetCollectionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 20:48:44
|
Revision: 5658 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5658&view=rev Author: fabiomaulo Date: 2011-04-10 20:48:38 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Arrays properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ArrayCollectionTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:43:13 UTC (rev 5657) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:48:38 UTC (rev 5658) @@ -39,7 +39,7 @@ private Func<MemberInfo, bool, bool> isBag; private Func<MemberInfo, bool, bool> isDictionary; private Func<MemberInfo, bool, bool> isIdBag = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isList; + private Func<MemberInfo, bool, bool> isList = (m, declared) => declared; public SimpleModelInspector() { @@ -47,12 +47,17 @@ isComponent = (t, declared) => declared || MatchComponentPattern(t); isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); isSet = (m, declared) => declared || MatchCollection(m, MatchSetMember); - isArray = (m, declared) => declared; + isArray = (m, declared) => declared || MatchCollection(m, MatchArrayMember); isBag = (m, declared) => declared || MatchCollection(m, MatchBagMember); isDictionary = (m, declared) => declared || MatchCollection(m, MatchDictionaryMember); - isList = (m, declared) => declared; } + protected bool MatchArrayMember(MemberInfo subject) + { + System.Type memberType = subject.GetPropertyOrFieldType(); + return memberType.IsArray && memberType.GetElementType() != typeof(byte); + } + protected bool MatchDictionaryMember(MemberInfo subject) { System.Type memberType = subject.GetPropertyOrFieldType(); Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ArrayCollectionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ArrayCollectionTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/ArrayCollectionTests.cs 2011-04-10 20:48:38 UTC (rev 5658) @@ -0,0 +1,114 @@ +using System.Collections.Generic; +using System.Reflection; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class ArrayCollectionTests + { + private class Entity + { + private ICollection<string> others; + private string[] emails; + public string[] NickNames { get; set; } + public byte[] Photo { get; set; } + + public ICollection<string> Emails + { + get { return emails; } + } + + public ICollection<string> Others + { + get { return others; } + } + public IList<string> NoArray + { + get { return null; } + } + public string Simple { get; set; } + } + + [Test] + public void MatchWithArrayProperty() + { + var mi = typeof(Entity).GetProperty("NickNames"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.True(); + } + + [Test] + public void MatchWithArrayField() + { + var mi = typeof(Entity).GetField("emails", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.True(); + } + + [Test] + public void MatchWithCollectionPropertyAndArrayField() + { + var mi = typeof(Entity).GetProperty("Emails"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.True(); + } + + [Test] + public void NotMatchWithCollectionField() + { + var mi = typeof(Entity).GetField("others", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithCollectionProperty() + { + var mi = typeof(Entity).GetProperty("Others"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithNoArrayCollectionProperty() + { + var mi = typeof(Entity).GetProperty("NoArray"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithStringProperty() + { + var mi = typeof(Entity).GetProperty("Simple"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithByteArrayProperty() + { + var mi = typeof(Entity).GetProperty("Photo"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsArray(mi).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:43:13 UTC (rev 5657) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:48:38 UTC (rev 5658) @@ -541,6 +541,7 @@ <Compile Include="MappingByCode\MappersTests\IdBagMapperTest.cs" /> <Compile Include="MappingByCode\MappersTests\JoinMapperTests.cs" /> <Compile Include="MappingByCode\MappersTests\SubclassMapperWithJoinPropertiesTest.cs" /> + <Compile Include="MappingByCode\MixAutomapping\ArrayCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 20:43:19
|
Revision: 5657 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5657&view=rev Author: fabiomaulo Date: 2011-04-10 20:43:13 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Dictionaries properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DictionaryCollectionTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:35:45 UTC (rev 5656) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:43:13 UTC (rev 5657) @@ -49,10 +49,24 @@ isSet = (m, declared) => declared || MatchCollection(m, MatchSetMember); isArray = (m, declared) => declared; isBag = (m, declared) => declared || MatchCollection(m, MatchBagMember); - isDictionary = (m, declared) => declared; + isDictionary = (m, declared) => declared || MatchCollection(m, MatchDictionaryMember); isList = (m, declared) => declared; } + protected bool MatchDictionaryMember(MemberInfo subject) + { + System.Type memberType = subject.GetPropertyOrFieldType(); + if (typeof(System.Collections.IDictionary).IsAssignableFrom(memberType)) + { + return true; + } + if (memberType.IsGenericType) + { + return memberType.GetGenericIntercafesTypeDefinitions().Contains(typeof(IDictionary<,>)); + } + return false; + } + protected bool MatchBagMember(MemberInfo subject) { System.Type memberType = subject.GetPropertyOrFieldType(); Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DictionaryCollectionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DictionaryCollectionTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/DictionaryCollectionTests.cs 2011-04-10 20:43:13 UTC (rev 5657) @@ -0,0 +1,78 @@ +using System.Collections.Generic; +using System.Reflection; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class DictionaryCollectionTests + { + private class Entity + { + private ICollection<string> others; + private IDictionary<string, string> emails; + public IDictionary<string, string> NickNames { get; set; } + + public ICollection<KeyValuePair<string, string>> Emails + { + get { return emails; } + } + + public ICollection<string> Others + { + get { return others; } + } + } + + [Test] + public void MatchWithDictionaryProperty() + { + var mi = typeof(Entity).GetProperty("NickNames"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsDictionary(mi).Should().Be.True(); + } + + [Test] + public void MatchWithDictionaryField() + { + var mi = typeof(Entity).GetField("emails", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsDictionary(mi).Should().Be.True(); + } + + [Test] + public void MatchWithCollectionPropertyAndDictionaryField() + { + var mi = typeof(Entity).GetProperty("Emails"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsDictionary(mi).Should().Be.True(); + } + + [Test] + public void NotMatchWithCollectionField() + { + var mi = typeof(Entity).GetField("others", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsDictionary(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithCollectionProperty() + { + var mi = typeof(Entity).GetProperty("Others"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsDictionary(mi).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:35:45 UTC (rev 5656) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:43:13 UTC (rev 5657) @@ -543,6 +543,7 @@ <Compile Include="MappingByCode\MappersTests\SubclassMapperWithJoinPropertiesTest.cs" /> <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\DictionaryCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\SetCollectionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 20:35:51
|
Revision: 5656 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5656&view=rev Author: fabiomaulo Date: 2011-04-10 20:35:45 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Bags properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/BagCollectionTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:04:25 UTC (rev 5655) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:35:45 UTC (rev 5656) @@ -48,13 +48,19 @@ isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); isSet = (m, declared) => declared || MatchCollection(m, MatchSetMember); isArray = (m, declared) => declared; - isBag = (m, declared) => declared; + isBag = (m, declared) => declared || MatchCollection(m, MatchBagMember); isDictionary = (m, declared) => declared; isList = (m, declared) => declared; } - public bool MatchCollection(MemberInfo subject, Predicate<MemberInfo> specificCollectionPredicate) + protected bool MatchBagMember(MemberInfo subject) { + System.Type memberType = subject.GetPropertyOrFieldType(); + return typeof(System.Collections.IEnumerable).IsAssignableFrom(memberType) && !(memberType == typeof(string) || memberType == typeof(byte[])); + } + + protected bool MatchCollection(MemberInfo subject, Predicate<MemberInfo> specificCollectionPredicate) + { const BindingFlags defaultBinding = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; if (specificCollectionPredicate(subject)) return true; Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/BagCollectionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/BagCollectionTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/BagCollectionTests.cs 2011-04-10 20:35:45 UTC (rev 5656) @@ -0,0 +1,75 @@ +using System.Collections.Generic; +using System.Reflection; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class BagCollectionTests + { + // match any IEnumerable + private class Entity + { + private ICollection<string> emails; + public IEnumerable<string> NickNames { get; set; } + public byte[] Bytes { get; set; } + public object Emails + { + get { return emails; } + } + + public string Simple { get; set; } + } + + [Test] + public void MatchWithEnumerableProperty() + { + var mi = typeof(Entity).GetProperty("NickNames"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsBag(mi).Should().Be.True(); + } + + [Test] + public void MatchWithEnumerableField() + { + var mi = typeof(Entity).GetField("emails", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsBag(mi).Should().Be.True(); + } + + [Test] + public void MatchWithObjectPropertyAndEnumerableField() + { + var mi = typeof(Entity).GetProperty("Emails"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsBag(mi).Should().Be.True(); + } + + [Test] + public void NotMatchWithStringProperty() + { + var mi = typeof(Entity).GetProperty("Simple"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsBag(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithByteArrayProperty() + { + var mi = typeof(Entity).GetProperty("Bytes"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsBag(mi).Should().Be.False(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:04:25 UTC (rev 5655) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:35:45 UTC (rev 5656) @@ -541,6 +541,7 @@ <Compile Include="MappingByCode\MappersTests\IdBagMapperTest.cs" /> <Compile Include="MappingByCode\MappersTests\JoinMapperTests.cs" /> <Compile Include="MappingByCode\MappersTests\SubclassMapperWithJoinPropertiesTest.cs" /> + <Compile Include="MappingByCode\MixAutomapping\BagCollectionTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 20:04:32
|
Revision: 5655 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5655&view=rev Author: fabiomaulo Date: 2011-04-10 20:04:25 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Sets properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/SetCollectionTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 19:27:37 UTC (rev 5654) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 20:04:25 UTC (rev 5655) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Iesi.Collections; namespace NHibernate.Mapping.ByCode { @@ -33,20 +34,60 @@ private Func<MemberInfo, bool, bool> isOneToMany = (m, declared) => declared; private Func<MemberInfo, bool, bool> isOneToOne = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isSet = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isArray = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isBag = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isDictionary = (m, declared) => declared; + private Func<MemberInfo, bool, bool> isSet; + private Func<MemberInfo, bool, bool> isArray; + private Func<MemberInfo, bool, bool> isBag; + private Func<MemberInfo, bool, bool> isDictionary; private Func<MemberInfo, bool, bool> isIdBag = (m, declared) => declared; - private Func<MemberInfo, bool, bool> isList = (m, declared) => declared; + private Func<MemberInfo, bool, bool> isList; public SimpleModelInspector() { isPersistentId = (m, declared) => declared || MatchPoIdPattern(m); isComponent = (t, declared) => declared || MatchComponentPattern(t); isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); + isSet = (m, declared) => declared || MatchCollection(m, MatchSetMember); + isArray = (m, declared) => declared; + isBag = (m, declared) => declared; + isDictionary = (m, declared) => declared; + isList = (m, declared) => declared; } + public bool MatchCollection(MemberInfo subject, Predicate<MemberInfo> specificCollectionPredicate) + { + const BindingFlags defaultBinding = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; + + if (specificCollectionPredicate(subject)) return true; + var pi = subject as PropertyInfo; + if (pi != null) + { + var fieldInfo = (from ps in PropertyToField.DefaultStrategies.Values + let fi = subject.DeclaringType.GetField(ps.GetFieldName(pi.Name), defaultBinding) + where fi != null + select fi).FirstOrDefault(); + + if (fieldInfo != null) + { + return specificCollectionPredicate(fieldInfo); + } + } + return false; + } + + protected bool MatchSetMember(MemberInfo subject) + { + var memberType = subject.GetPropertyOrFieldType(); + if (typeof(ISet).IsAssignableFrom(memberType)) + { + return true; + } + if (memberType.IsGenericType) + { + return memberType.GetGenericIntercafesTypeDefinitions().Contains(typeof(Iesi.Collections.Generic.ISet<>)); + } + return false; + } + protected bool MatchNoReadOnlyPropertyPattern(MemberInfo subject) { var isReadOnlyProperty = IsReadOnlyProperty(subject); Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/SetCollectionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/SetCollectionTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/SetCollectionTests.cs 2011-04-10 20:04:25 UTC (rev 5655) @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using System.Reflection; +using Iesi.Collections.Generic; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class SetCollectionTests + { + private class EntityWithSets + { + private ICollection<string> others; + private ISet<string> emails; + public ISet<string> NickNames { get; set; } + + public ICollection<string> Emails + { + get { return emails; } + } + + public ICollection<string> Others + { + get { return others; } + } + } + + [Test] + public void MatchWithSetProperty() + { + var mi = typeof(EntityWithSets).GetProperty("NickNames"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsSet(mi).Should().Be.True(); + } + + [Test] + public void MatchWithSetField() + { + var mi = typeof(EntityWithSets).GetField("emails", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsSet(mi).Should().Be.True(); + } + + [Test] + public void MatchWithCollectionPropertyAndSetField() + { + var mi = typeof(EntityWithSets).GetProperty("Emails"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsSet(mi).Should().Be.True(); + } + + [Test] + public void NotMatchWithCollectionField() + { + var mi = typeof(EntityWithSets).GetField("others", BindingFlags.NonPublic | BindingFlags.Instance); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsSet(mi).Should().Be.False(); + } + + [Test] + public void NotMatchWithCollectionProperty() + { + var mi = typeof(EntityWithSets).GetProperty("Others"); + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsSet(mi).Should().Be.False(); + } + + [Test] + public void WhenExplicitDeclaredThenMatchWithCollectionProperty() + { + var mi = typeof(EntityWithSets).GetProperty("Others"); + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<EntityWithSets>(map => map.Set(x => x.Others, x => { }, y=> {})); + + var inspector = (IModelInspector)autoinspector; + inspector.IsSet(mi).Should().Be.True(); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 19:27:37 UTC (rev 5654) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 20:04:25 UTC (rev 5655) @@ -544,6 +544,7 @@ <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\SetCollectionTests.cs" /> <Compile Include="MappingByCode\ModelExplicitDeclarationsHolderMergeTest.cs" /> <Compile Include="MappingByCode\NatureDemo\Naturalness\Address.cs" /> <Compile Include="MappingByCode\NatureDemo\Naturalness\Animal.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2011-04-10 19:27:43
|
Revision: 5654 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5654&view=rev Author: fabiomaulo Date: 2011-04-10 19:27:37 +0000 (Sun, 10 Apr 2011) Log Message: ----------- SimpleModelInspector with default pattern to discover Persistent properties Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/AccessorPropertyMapper.cs trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyToField.cs trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/PropertiesExclusionTests.cs Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/AccessorPropertyMapper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/AccessorPropertyMapper.cs 2011-04-10 18:32:35 UTC (rev 5653) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/AccessorPropertyMapper.cs 2011-04-10 19:27:37 UTC (rev 5654) @@ -15,16 +15,7 @@ private readonly System.Type declaringType; - private readonly Dictionary<string, IFieldNamingStrategy> fieldNamningStrategies = - new Dictionary<string, IFieldNamingStrategy> - { - {"camelcase", new CamelCaseStrategy()}, - {"camelcase-underscore", new CamelCaseUnderscoreStrategy()}, - {"lowercase", new LowerCaseStrategy()}, - {"lowercase-underscore", new LowerCaseUnderscoreStrategy()}, - {"pascalcase-underscore", new PascalCaseUnderscoreStrategy()}, - {"pascalcase-m-underscore", new PascalCaseMUnderscoreStrategy()}, - }; + private readonly IDictionary<string, IFieldNamingStrategy> fieldNamningStrategies = PropertyToField.DefaultStrategies; private readonly string propertyName; private readonly Action<string> setAccessor; Added: trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyToField.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyToField.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyToField.cs 2011-04-10 19:27:37 UTC (rev 5654) @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using NHibernate.Properties; + +namespace NHibernate.Mapping.ByCode +{ + public class PropertyToField + { + private static readonly Dictionary<string, IFieldNamingStrategy> FieldNamningStrategies = new Dictionary<string, IFieldNamingStrategy> + { + {"camelcase", new CamelCaseStrategy()}, + {"camelcase-underscore", new CamelCaseUnderscoreStrategy()}, + {"lowercase", new LowerCaseStrategy()}, + {"lowercase-underscore", new LowerCaseUnderscoreStrategy()}, + {"pascalcase-underscore", new PascalCaseUnderscoreStrategy()}, + {"pascalcase-m-underscore", new PascalCaseMUnderscoreStrategy()}, + }; + + /// <summary> + /// Dictionary containing the embedded strategies to find a field giving a property name. + /// The key is the "partial-name" of the strategy used in XML mapping. + /// The value is an instance of the strategy. + /// </summary> + public static IDictionary<string, IFieldNamingStrategy> DefaultStrategies + { + get + { + // please leave it as no read-only; the user may need to add his strategies or remove existing if he no want his people use it. + return FieldNamningStrategies; + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 18:32:35 UTC (rev 5653) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs 2011-04-10 19:27:37 UTC (rev 5654) @@ -22,7 +22,7 @@ private Func<System.Type, bool, bool> isComponent; private Func<MemberInfo, bool, bool> isPersistentId; - private Func<MemberInfo, bool, bool> isPersistentProperty = (m, declared) => declared; + private Func<MemberInfo, bool, bool> isPersistentProperty; private Func<MemberInfo, bool, bool> isVersion = (m, declared) => declared; private Func<MemberInfo, bool, bool> isProperty = (m, declared) => declared; @@ -44,8 +44,53 @@ { isPersistentId = (m, declared) => declared || MatchPoIdPattern(m); isComponent = (t, declared) => declared || MatchComponentPattern(t); + isPersistentProperty = (m, declared) => declared || MatchNoReadOnlyPropertyPattern(m); } + protected bool MatchNoReadOnlyPropertyPattern(MemberInfo subject) + { + var isReadOnlyProperty = IsReadOnlyProperty(subject); + return !isReadOnlyProperty; + } + + protected bool IsReadOnlyProperty(MemberInfo subject) + { + const BindingFlags defaultBinding = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; + + var property = subject as PropertyInfo; + if (property == null) + { + return false; + } + if (CanReadCantWriteInsideType(property) || CanReadCantWriteInBaseType(property)) + { + return !PropertyToField.DefaultStrategies.Values.Any(s => subject.DeclaringType.GetField(s.GetFieldName(property.Name), defaultBinding) != null) || IsAutoproperty(property); + } + return false; + } + + protected bool IsAutoproperty(PropertyInfo property) + { + return property.ReflectedType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance + | BindingFlags.DeclaredOnly).Any(pi => pi.Name == string.Concat("<", property.Name, ">k__BackingField")); + } + + protected bool CanReadCantWriteInsideType(PropertyInfo property) + { + return !property.CanWrite && property.CanRead && property.DeclaringType == property.ReflectedType; + } + + protected bool CanReadCantWriteInBaseType(PropertyInfo property) + { + if (property.DeclaringType == property.ReflectedType) + { + return false; + } + var rfprop = property.DeclaringType.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance + | BindingFlags.DeclaredOnly).SingleOrDefault(pi => pi.Name == property.Name); + return rfprop != null && !rfprop.CanWrite && rfprop.CanRead; + } + protected bool MatchPoIdPattern(MemberInfo subject) { var name = subject.Name; Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-10 18:32:35 UTC (rev 5653) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-10 19:27:37 UTC (rev 5654) @@ -290,6 +290,7 @@ <Compile Include="Mapping\ByCode\Conformist\JoinedSubclassMapping.cs" /> <Compile Include="Mapping\ByCode\Conformist\SubclassMapping.cs" /> <Compile Include="Mapping\ByCode\Conformist\UnionSubclassMapping.cs" /> + <Compile Include="Mapping\ByCode\PropertyToField.cs" /> <Compile Include="Mapping\ByCode\SimpleModelInspector.cs" /> <Compile Include="Mapping\ByCode\ExplicitlyDeclaredModel.cs" /> <Compile Include="Mapping\ByCode\FakeModelExplicitDeclarationsHolder.cs" /> Added: trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/PropertiesExclusionTests.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/PropertiesExclusionTests.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/MappingByCode/MixAutomapping/PropertiesExclusionTests.cs 2011-04-10 19:27:37 UTC (rev 5654) @@ -0,0 +1,103 @@ +using System.Reflection; +using NHibernate.Mapping.ByCode; +using NUnit.Framework; +using SharpTestsEx; + +namespace NHibernate.Test.MappingByCode.MixAutomapping +{ + public class PropertiesExclusionTests + { + public class MyEntity + { + private string noReadOnlyWithField; + private string pizza; + + public string ReadOnly + { + get { return ""; } + } + + public string NoReadOnlyWithField + { + get { return noReadOnlyWithField; } + } + + public string NoReadOnly + { + get { return ""; } + set { } + } + + public string WriteOnly + { + set { } + } + + public string AutoPropWithPrivateSet { get; private set; } + } + + [Test] + public void WhenReadonlyDeclaredThenIsPersistentProperty() + { + var autoinspector = new SimpleModelInspector(); + var mapper = new ModelMapper(autoinspector); + mapper.Class<MyEntity>(map => map.Property(x => x.ReadOnly)); + + var inspector = (IModelInspector)autoinspector; + inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")).Should().Be.True(); + } + + [Test] + public void WhenReadonlyNotDeclaredThenIsNotPersistentProperty() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + inspector.IsPersistentProperty(typeof(MyEntity).GetProperty("ReadOnly")).Should().Be.False(); + } + + [Test] + public void IncludesReadOnlyWithField() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + PropertyInfo pi = typeof(MyEntity).GetProperty("NoReadOnlyWithField"); + inspector.IsPersistentProperty(pi).Should().Be.True(); + } + + [Test] + public void IncludesNoReadOnly() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + PropertyInfo pi = typeof(MyEntity).GetProperty("NoReadOnly"); + inspector.IsPersistentProperty(pi).Should().Be.True(); + + pi = typeof(MyEntity).GetProperty("WriteOnly"); + inspector.IsPersistentProperty(pi).Should().Be.True(); + } + + [Test] + public void IncludesFields() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + var pi = typeof(MyEntity).GetField("pizza", BindingFlags.Instance | BindingFlags.NonPublic); + inspector.IsPersistentProperty(pi).Should().Be.True(); + } + + [Test] + public void IncludesAutoprop() + { + var autoinspector = new SimpleModelInspector(); + var inspector = (IModelInspector)autoinspector; + + var pi = typeof(MyEntity).GetProperty("AutoPropWithPrivateSet"); + inspector.IsPersistentProperty(pi).Should().Be.True(); + } + + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 18:32:35 UTC (rev 5653) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-04-10 19:27:37 UTC (rev 5654) @@ -543,6 +543,7 @@ <Compile Include="MappingByCode\MappersTests\SubclassMapperWithJoinPropertiesTest.cs" /> <Compile Include="MappingByCode\MixAutomapping\ComponentsTests.cs" /> <Compile Include="MappingByCode\MixAutomapping\PoidTests.cs" /> + <Compile Include="MappingByCode\MixAutomapping\PropertiesExclusionTests.cs" /> <Compile Include="MappingByCode\ModelExplicitDeclarationsHolderMergeTest.cs" /> <Compile Include="MappingByCode\NatureDemo\Naturalness\Address.cs" /> <Compile Include="MappingByCode\NatureDemo\Naturalness\Animal.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |