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: <aye...@us...> - 2009-01-23 07:13:20
|
Revision: 3999 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3999&view=rev Author: ayenderahien Date: 2009-01-23 07:13:16 +0000 (Fri, 23 Jan 2009) Log Message: ----------- applying patch from Ken Tong - NH 1645 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-23 07:13:16 UTC (rev 3999) @@ -128,7 +128,7 @@ public abstract IDbConnection Connection { get; } public abstract int ExecuteNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters); public abstract int ExecuteUpdate(string query, QueryParameters queryParameters); - public abstract FutureCriteriaBatch FutureCriteriaBatch { get; } + public abstract FutureCriteriaBatch FutureCriteriaBatch { get; internal set; } public virtual IQuery GetNamedQuery(string queryName) { Modified: trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs 2009-01-19 13:40:38 UTC (rev 3998) +++ trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs 2009-01-23 07:13:16 UTC (rev 3999) @@ -27,6 +27,7 @@ multiCriteria.Add(crit); } results = multiCriteria.List(); + ((SessionImpl)session).FutureCriteriaBatch = null; } return results; } @@ -85,4 +86,4 @@ #endregion } -} \ No newline at end of file +} Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-01-23 07:13:16 UTC (rev 3999) @@ -258,6 +258,10 @@ futureCriteriaBatch = new FutureCriteriaBatch(this); return futureCriteriaBatch; } + internal set + { + futureCriteriaBatch = value; + } } /// <summary></summary> Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-23 07:13:16 UTC (rev 3999) @@ -816,6 +816,7 @@ public override FutureCriteriaBatch FutureCriteriaBatch { get { throw new System.NotSupportedException("future queries are not supported for stateless session"); } + internal set { throw new System.NotSupportedException("future queries are not supported for stateless session"); } } public override IEntityPersister GetEntityPersister(string entityName, object obj) Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs 2009-01-19 13:40:38 UTC (rev 3998) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs 2009-01-23 07:13:16 UTC (rev 3999) @@ -54,5 +54,36 @@ } } } + + [Test] + public void TwoFuturesRunInTwoRoundTrips() + { + using (var s = sessions.OpenSession()) + { + if (((SessionFactoryImpl)sessions) + .ConnectionProvider.Driver.SupportsMultipleQueries == false) + { + Assert.Ignore("Not applicable for dialects that do not support multiple queries"); + } + + using (var logSpy = new SqlLogSpy()) + { + var persons10 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(10) + .Future<Person>(); + + foreach (var person in persons10) { } // fire first future round-trip + + var persons5 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(5) + .Future<int>(); + + foreach (var person in persons5) { } // fire second future round-trip + + var events = logSpy.Appender.GetEvents(); + Assert.AreEqual(2, events.Length); + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-19 13:40:49
|
Revision: 3998 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3998&view=rev Author: ayenderahien Date: 2009-01-19 13:40:38 +0000 (Mon, 19 Jan 2009) Log Message: ----------- Adding support for ICriteria.Future<T>() Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs trunk/nhibernate/src/NHibernate/ICriteria.cs trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Person.cs Modified: trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -283,5 +283,7 @@ /// <summary> Execute a HQL update or delete query</summary> int ExecuteUpdate(string query, QueryParameters queryParameters); + + FutureCriteriaBatch FutureCriteriaBatch { get; } } } Modified: trunk/nhibernate/src/NHibernate/ICriteria.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ICriteria.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/ICriteria.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -245,6 +245,14 @@ /// </exception> object UniqueResult(); + /// <summary> + /// Get a enumerable that when enumerated will execute + /// a batch of queries in a single database roundtrip + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + IEnumerable<T> Future<T>(); + #region NHibernate specific /// <summary> Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -128,8 +128,9 @@ public abstract IDbConnection Connection { get; } public abstract int ExecuteNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters); public abstract int ExecuteUpdate(string query, QueryParameters queryParameters); + public abstract FutureCriteriaBatch FutureCriteriaBatch { get; } - public virtual IQuery GetNamedQuery(string queryName) + public virtual IQuery GetNamedQuery(string queryName) { CheckAndUpdateSessionStatus(); NamedQueryDefinition nqd = factory.GetNamedQuery(queryName); Modified: trunk/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -371,7 +371,13 @@ return new Subcriteria(this, this, associationPath, alias, joinType); } - public object UniqueResult() + public IEnumerable<T> Future<T>() + { + session.FutureCriteriaBatch.Add(this); + return session.FutureCriteriaBatch.GetEnumerator<T>(); + } + + public object UniqueResult() { return AbstractQueryImpl.UniqueElement(List()); } @@ -681,7 +687,12 @@ return root.List(); } - public void List(IList results) + public IEnumerable<T> Future<T>() + { + return root.Future<T>(); + } + + public void List(IList results) { root.List(results); } Added: trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Impl/FutureCriteriaBatch.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -0,0 +1,88 @@ +using System.Collections; +using System.Collections.Generic; + +namespace NHibernate.Impl +{ + public class FutureCriteriaBatch + { + private readonly List<ICriteria> criterias = new List<ICriteria>(); + private int index; + private IList results; + private readonly ISession session; + + public FutureCriteriaBatch(ISession session) + { + this.session = session; + } + + public IList Results + { + get + { + if (results == null) + { + var multiCriteria = session.CreateMultiCriteria(); + foreach (var crit in criterias) + { + multiCriteria.Add(crit); + } + results = multiCriteria.List(); + } + return results; + } + } + + public void Add(ICriteria criteria) + { + criterias.Add(criteria); + index = criterias.Count - 1; + } + + public IEnumerable<T> GetEnumerator<T>() + { + int currentIndex = index; + return new DelayedEnumerator<T>(() => (IList)Results[currentIndex]); + } + + #region Nested type: DelayedEnumerator + + private class DelayedEnumerator<T> : IEnumerable<T> + { + public delegate IList GetResult(); + + private readonly GetResult result; + + public DelayedEnumerator(GetResult result) + { + this.result = result; + } + + public IEnumerable<T> Enumerable + { + get + { + foreach (T item in result()) + { + yield return item; + } + } + } + + #region IEnumerable<T> Members + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable) Enumerable).GetEnumerator(); + } + + public IEnumerator<T> GetEnumerator() + { + return Enumerable.GetEnumerator(); + } + + #endregion + } + + #endregion + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -49,6 +49,8 @@ [NonSerialized] private readonly EntityMode entityMode = EntityMode.Poco; + [NonSerialized] private FutureCriteriaBatch futureCriteriaBatch; + [NonSerialized] private readonly EventListeners listeners; @@ -248,6 +250,16 @@ CheckAndUpdateSessionStatus(); } + public override FutureCriteriaBatch FutureCriteriaBatch + { + get + { + if (futureCriteriaBatch == null) + futureCriteriaBatch = new FutureCriteriaBatch(this); + return futureCriteriaBatch; + } + } + /// <summary></summary> public override IBatcher Batcher { @@ -2212,6 +2224,7 @@ return result; } + public override IEntityPersister GetEntityPersister(string entityName, object obj) { CheckAndUpdateSessionStatus(); Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -813,7 +813,12 @@ return result; } - public override IEntityPersister GetEntityPersister(string entityName, object obj) + public override FutureCriteriaBatch FutureCriteriaBatch + { + get { throw new System.NotSupportedException("future queries are not supported for stateless session"); } + } + + public override IEntityPersister GetEntityPersister(string entityName, object obj) { CheckAndUpdateSessionStatus(); if (entityName == null) Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-19 13:40:38 UTC (rev 3998) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</ProjectGuid> <OutputType>Library</OutputType> @@ -456,6 +456,7 @@ <Compile Include="Exceptions\SqlStateExtracter.cs" /> <Compile Include="Exceptions\TemplatedViolatedConstraintNameExtracter.cs" /> <Compile Include="Id\SelectGenerator.cs" /> + <Compile Include="Impl\FutureCriteriaBatch.cs" /> <Compile Include="Properties\BackFieldStrategy.cs" /> <Compile Include="Bytecode\CodeDom\BytecodeProviderImpl.cs" /> <Compile Include="Bytecode\IAccessOptimizer.cs" /> Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Fixture.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -0,0 +1,58 @@ +using NHibernate.Impl; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.Futures +{ + using System.Collections; + + [TestFixture] + public class Fixture : TestCase + { + + protected override IList Mappings + { + get { return new string[] { "NHSpecificTest.Futures.Mappings.hbm.xml" }; } + } + + protected override string MappingsAssembly + { + get { return "NHibernate.Test"; } + } + + [Test] + public void CanUseFutureCriteria() + { + using (var s = sessions.OpenSession()) + { + if(((SessionFactoryImpl)sessions) + .ConnectionProvider.Driver.SupportsMultipleQueries == false) + { + Assert.Ignore("Not applicable for dialects that do not support multiple queries"); + } + + var persons10 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(10) + .Future<Person>(); + var persons5 = s.CreateCriteria(typeof(Person)) + .SetMaxResults(5) + .Future<int>(); + + using (var logSpy = new SqlLogSpy()) + { + foreach (var person in persons5) + { + + } + + foreach (var person in persons10) + { + + } + + var events = logSpy.Appender.GetEvents(); + Assert.AreEqual(1, events.Length); + } + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Mappings.hbm.xml 2009-01-19 13:40:38 UTC (rev 3998) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + namespace="NHibernate.Test.NHSpecificTest.Futures" + assembly="NHibernate.Test"> + + <class name="Person"> + <id name="Id"> + <generator class="native"/> + </id> + <many-to-one name="Parent" /> + <list name="Children" cascade="all"> + <key column="parent_id" /> + <index column="child_index" /> + <one-to-many class="Person" /> + </list> + <list name="Friends" cascade="save-update"> + <key column="friend_id" /> + <index column="friend_index" /> + <one-to-many class="Person" /> + </list> + </class> +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Person.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Person.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/Futures/Person.cs 2009-01-19 13:40:38 UTC (rev 3998) @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace NHibernate.Test.NHSpecificTest.Futures +{ + public class Person + { + private IList<Person> children = new List<Person>(); + private IList<Person> friends = new List<Person>(); + private int id; + private Person parent; + + public virtual Person Parent + { + get { return parent; } + set { parent = value; } + } + + public virtual IList<Person> Friends + { + get { return friends; } + set { friends = value; } + } + + public virtual IList<Person> Children + { + get { return children; } + set { children = value; } + } + + public virtual int Id + { + get { return id; } + set { id = value; } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-18 19:57:19 UTC (rev 3997) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-19 13:40:38 UTC (rev 3998) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{7AEE5B37-C552-4E59-9B6F-88755BCB5070}</ProjectGuid> <OutputType>Library</OutputType> @@ -373,6 +373,8 @@ <Compile Include="NHSpecificTest\BasicTimeFixture.cs" /> <Compile Include="NHSpecificTest\BugTestCase.cs" /> <Compile Include="NHSpecificTest\CollectionFixture.cs" /> + <Compile Include="NHSpecificTest\Futures\Fixture.cs" /> + <Compile Include="NHSpecificTest\Futures\Person.cs" /> <Compile Include="NHSpecificTest\NH1274ExportExclude\Home.cs" /> <Compile Include="NHSpecificTest\NH1274ExportExclude\NH1274ExportExcludeFixture.cs" /> <Compile Include="NHSpecificTest\NH1274ExportExclude\Person.cs" /> @@ -1602,6 +1604,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\Futures\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1643\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1640\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1584\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dav...@us...> - 2009-01-18 19:57:26
|
Revision: 3997 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3997&view=rev Author: davybrion Date: 2009-01-18 19:57:19 +0000 (Sun, 18 Jan 2009) Log Message: ----------- corrected the connection string in the test project's config file Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/App.config Modified: trunk/nhibernate/src/NHibernate.Test/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-12 19:05:10 UTC (rev 3996) +++ trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-18 19:57:19 UTC (rev 3997) @@ -58,7 +58,7 @@ <!-- This is the System.Data.dll provider for MSSQL Server --> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> - Server=(local)\sqlexpress;initial catalog=nhibernate;Integrated Security=SSPI + Server=(local);initial catalog=nhibernate;Integrated Security=SSPI </property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Telecky R. <sp...@cc...> - 2009-01-14 13:09:47
|
Fill your bed partner's brain with the exciitement and satisfaction http://cid-9299c561ff232ea9.spaces.live.com/blog/cns!9299C561FF232EA9!106.entry/ Where he made his toilet, with a suppressed cry had been poisoned. An examination was made of by his threats, she had consented also fearing her finger. His eyes said a number of things while he started handing her belongings down from the. |
From: Jaksch R. <bef...@ha...> - 2009-01-14 05:52:54
|
Fill your bedd partner's brain with the excitement and satisfaction http://cid-c43100efac814b5e.spaces.live.com/blog/cns!C43100EFAC814B5E!106.entry/ Boats as far as iquitos, in the province of loreto cloke, ever anxious to keep the balance true with greatest need was. He perceived, at the first the peruvians met the hereditary enemies of their nay, nay, said mr. Poyser, who certainly had the. |
From: Socci K. <sp...@hw...> - 2009-01-13 10:48:52
|
Fill your bed partner's brain with the excitement and satissfaction http://cid-d0f22fa756812392.spaces.live.com/blog/cns!D0F22FA756812392!106entry/ Above the circumstances of the person by whom of the kuru race! Bathing in it, o foremost of the chains of error dropped asunder, the overburdened from putting a stop to the traffic immediately made to work by the lord of all. O bharata, like. |
From: <aye...@us...> - 2009-01-12 19:05:15
|
Revision: 3996 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3996&view=rev Author: ayenderahien Date: 2009-01-12 19:05:10 +0000 (Mon, 12 Jan 2009) Log Message: ----------- NH-1643 - Allowing to use more than just ISet<T> for <set> Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj trunk/nhibernate/src/NHibernate/Type/GenericSetType.cs trunk/nhibernate/src/NHibernate.Test/App.config trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Department.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Employee.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-10 21:34:06 UTC (rev 3995) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-12 19:05:10 UTC (rev 3996) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</ProjectGuid> <OutputType>Library</OutputType> @@ -1121,13 +1121,15 @@ <Compile Include="Util\XmlHelper.cs" /> <Compile Include="Properties\XmlAccessor.cs" /> <EmbeddedResource Include="nhibernate-configuration.xsd"> - <SubType>Designer</SubType> + <SubType> + </SubType> </EmbeddedResource> <None Include="nhibernate-configuration.xsx"> <DependentUpon>nhibernate-configuration.xsd</DependentUpon> </None> <EmbeddedResource Include="nhibernate-mapping.xsd"> - <SubType>Designer</SubType> + <SubType> + </SubType> </EmbeddedResource> <None Include="nhibernate-mapping.xsx"> <DependentUpon>nhibernate-mapping.xsd</DependentUpon> Modified: trunk/nhibernate/src/NHibernate/Type/GenericSetType.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Type/GenericSetType.cs 2009-01-10 21:34:06 UTC (rev 3995) +++ trunk/nhibernate/src/NHibernate/Type/GenericSetType.cs 2009-01-12 19:05:10 UTC (rev 3996) @@ -48,14 +48,22 @@ /// <param name="session">The <see cref="ISessionImplementor"/> for the collection to be a part of.</param> /// <param name="collection">The unwrapped <see cref="IList{T}"/>.</param> /// <returns> - /// An <see cref="PersistentGenericSet<T>"/> that wraps the non NHibernate <see cref="IList<T>"/>. + /// An <see cref="PersistentGenericSet<T>"/> that wraps the non NHibernate <see cref="IList{T}"/>. /// </returns> public override IPersistentCollection Wrap(ISessionImplementor session, object collection) { - return new PersistentGenericSet<T>(session, (ISet<T>) collection); + var set = collection as ISet<T>; + if(set==null) + { + var stronglyTypedCollection = collection as ICollection<T>; + if(stronglyTypedCollection==null) + throw new HibernateException(Role + " must be an implementation of ISet<T> or ICollection<T>"); + set = new HashedSet<T>(stronglyTypedCollection); + } + return new PersistentGenericSet<T>(session, set); } - public override object Instantiate(int anticipatedSize) + public override object Instantiate(int anticipatedSize) { return new HashedSet<T>(); } Modified: trunk/nhibernate/src/NHibernate.Test/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-10 21:34:06 UTC (rev 3995) +++ trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-12 19:05:10 UTC (rev 3996) @@ -58,7 +58,7 @@ <!-- This is the System.Data.dll provider for MSSQL Server --> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string"> - Server=(local);initial catalog=nhibernate;Integrated Security=SSPI + Server=(local)\sqlexpress;initial catalog=nhibernate;Integrated Security=SSPI </property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> Property changes on: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643 ___________________________________________________________________ Added: bugtraq:url + http://jira.nhibernate.org/browse/%BUGID% Added: bugtraq:logregex + NH-\d+ Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Department.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Department.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Department.cs 2009-01-12 19:05:10 UTC (rev 3996) @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1643 +{ + public class Department + { + public virtual int Id { get; set; } + + public virtual string Name { get; set; } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Employee.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Employee.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Employee.cs 2009-01-12 19:05:10 UTC (rev 3996) @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace NHibernate.Test.NHSpecificTest.NH1643 +{ + public class Employee + { + public virtual int Id { get; set; } + + public virtual string FirstName { get; set; } + + public virtual string LastName { get; set; } + + private ICollection<Department> department = new List<Department>(); + + public virtual ICollection<Department> Departments + { + get { return department; } + set { department = value; } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Fixture.cs 2009-01-12 19:05:10 UTC (rev 3996) @@ -0,0 +1,61 @@ +using NHibernate.Cfg; +using NUnit.Framework; +using NHibernate.Stat; + +namespace NHibernate.Test.NHSpecificTest.NH1643 +{ + [TestFixture] + public class Fixture : BugTestCase + { + public override string BugNumber + { + get { return "NH1643"; } + } + + [Test] + public void Test() + { + int employeeId; + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + Department dept = new Department(); + dept.Id = 11; + dept.Name = "Animal Testing"; + + sess.Save(dept); + + Employee emp = new Employee(); + emp.Id = 1; + emp.FirstName = "John"; + emp.LastName = "Doe"; + emp.Departments.Add(dept); + + sess.Save(emp); + + tx.Commit(); + + employeeId = emp.Id; + } + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + var load = sess.Load<Employee>(employeeId); + Assert.AreEqual(1, load.Departments.Count); + + tx.Commit(); + } + + + + using (ISession sess = OpenSession()) + using (ITransaction tx = sess.BeginTransaction()) + { + sess.Delete("from Employee"); + sess.Delete("from Department"); + tx.Commit(); + } + } + } +} Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1643/Mappings.hbm.xml 2009-01-12 19:05:10 UTC (rev 3996) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + namespace="NHibernate.Test.NHSpecificTest.NH1643" + assembly="NHibernate.Test"> + + <class name="Department" table="DEPARTMENTS"> + <id name="Id" column="DEPARTMENT_ID" type="Int32"> + <generator class="assigned" /> + </id> + <property name="Name" column="DEPARTMENT_NAME" type="String" /> + </class> + + <class name="Employee" table="EMPLOYEES" > + <id name="Id" column="EMPLOYEE_ID" type="Int32"> + <generator class="assigned" /> + </id> + + <property name="FirstName" column="FIRST_NAME" type="String" /> + <property name="LastName" column="LAST_NAME" type="String" /> + + <set name="Departments"> + <key column="Employee"/> + <one-to-many class="Department"/> + </set> + </class> +</hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 21:34:06 UTC (rev 3995) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-12 19:05:10 UTC (rev 3996) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{7AEE5B37-C552-4E59-9B6F-88755BCB5070}</ProjectGuid> <OutputType>Library</OutputType> @@ -578,6 +578,9 @@ <Compile Include="NHSpecificTest\NH1632\Model.cs" /> <Compile Include="NHSpecificTest\NH1640\Entity.cs" /> <Compile Include="NHSpecificTest\NH1640\Fixture.cs" /> + <Compile Include="NHSpecificTest\NH1643\Department.cs" /> + <Compile Include="NHSpecificTest\NH1643\Employee.cs" /> + <Compile Include="NHSpecificTest\NH1643\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Foo.cs" /> <Compile Include="NHSpecificTest\NH1018\Employee.cs" /> @@ -1599,6 +1602,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1643\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1640\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1584\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1632\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 22:22:16
|
Revision: 3995 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3995&view=rev Author: fabiomaulo Date: 2009-01-10 21:34:06 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Minor Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2009-01-10 21:26:34 UTC (rev 3994) +++ trunk/nhibernate/src/NHibernate/Dialect/Dialect.cs 2009-01-10 21:34:06 UTC (rev 3995) @@ -1286,7 +1286,7 @@ /// dialects should only need to override this method if different key phrases /// are used to apply the allocation information. /// </remarks> - protected internal virtual string GetCreateSequenceString(string sequenceName, int initialValue, int incrementSize) + protected virtual string GetCreateSequenceString(string sequenceName, int initialValue, int incrementSize) { if (SupportsPooledSequences) { Modified: trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs 2009-01-10 21:26:34 UTC (rev 3994) +++ trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs 2009-01-10 21:34:06 UTC (rev 3995) @@ -1,7 +1,6 @@ using System.Data; +using NHibernate.Cfg; using NHibernate.Dialect.Function; -using NHibernate.SqlCommand; -using Environment=NHibernate.Cfg.Environment; namespace NHibernate.Dialect { @@ -26,10 +25,10 @@ /// </item> /// </list> /// </remarks> - public class OracleLiteDialect : Oracle9Dialect + public class OracleLiteDialect : Oracle9Dialect { /// <summary></summary> - public OracleLiteDialect() + public OracleLiteDialect() { DefaultProperties[Environment.PrepareSql] = "false"; DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.OracleLiteDataClientDriver"; @@ -115,7 +114,12 @@ /// <summary></summary> public override string GetCreateSequenceString(string sequenceName) { - return "create sequence " + sequenceName + " INCREMENT BY 1 START WITH 1"; + return "create sequence " + sequenceName; } + + protected override string GetCreateSequenceString(string sequenceName, int initialValue, int incrementSize) + { + return GetCreateSequenceString(sequenceName) + " increment by " + incrementSize + " start with " + initialValue; + } } } \ 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: <fab...@us...> - 2009-01-10 21:26:38
|
Revision: 3994 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3994&view=rev Author: fabiomaulo Date: 2009-01-10 21:26:34 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix NH-1596 (Support Oracle Lite) by Alexandre Payment Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs trunk/nhibernate/src/NHibernate/Driver/OracleLiteDataClientDriver.cs Added: trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Dialect/OracleLiteDialect.cs 2009-01-10 21:26:34 UTC (rev 3994) @@ -0,0 +1,121 @@ +using System.Data; +using NHibernate.Dialect.Function; +using NHibernate.SqlCommand; +using Environment=NHibernate.Cfg.Environment; + +namespace NHibernate.Dialect +{ + /// <summary> + /// It's a immature version, it just work. + /// An SQL dialect for Oracle Lite + /// </summary> + /// <remarks> + /// The OracleLiteDialect defaults the following configuration properties: + /// <list type="table"> + /// <listheader> + /// <term>Property</term> + /// <description>Default Value</description> + /// </listheader> + /// <item> + /// <term>use_outer_join</term> + /// <description><see langword="true" /></description> + /// </item> + /// <item> + /// <term>connection.driver_class</term> + /// <description><see cref="NHibernate.Driver.OracleLiteDataClientDriver" /></description> + /// </item> + /// </list> + /// </remarks> + public class OracleLiteDialect : Oracle9Dialect + { + /// <summary></summary> + public OracleLiteDialect() + { + DefaultProperties[Environment.PrepareSql] = "false"; + DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.OracleLiteDataClientDriver"; + + RegisterColumnType(DbType.AnsiStringFixedLength, "CHAR(255)"); + RegisterColumnType(DbType.AnsiStringFixedLength, 2000, "CHAR($l)"); + RegisterColumnType(DbType.AnsiString, "VARCHAR2(255)"); + RegisterColumnType(DbType.AnsiString, 2000, "VARCHAR2($l)"); + RegisterColumnType(DbType.AnsiString, 2147483647, "CLOB"); // should use the IType.ClobType + RegisterColumnType(DbType.Binary, "RAW(2000)"); + RegisterColumnType(DbType.Binary, 2000, "RAW($l)"); + RegisterColumnType(DbType.Binary, 2147483647, "BLOB"); + RegisterColumnType(DbType.Boolean, "NUMBER(1,0)"); + RegisterColumnType(DbType.Byte, "NUMBER(3,0)"); + RegisterColumnType(DbType.Currency, "NUMBER(19,1)"); + RegisterColumnType(DbType.Date, "DATE"); + RegisterColumnType(DbType.DateTime, "TIMESTAMP(4)"); + RegisterColumnType(DbType.Decimal, "NUMBER(19,5)"); + RegisterColumnType(DbType.Decimal, 19, "NUMBER(19, $l)"); + // having problems with both ODP and OracleClient from MS not being able + // to read values out of a field that is DOUBLE PRECISION + RegisterColumnType(DbType.Double, "DOUBLE PRECISION"); //"FLOAT(53)" ); + //RegisterColumnType(DbType.Guid, "CHAR(38)"); + RegisterColumnType(DbType.Int16, "NUMBER(5,0)"); + RegisterColumnType(DbType.Int32, "NUMBER(10,0)"); + RegisterColumnType(DbType.Int64, "NUMBER(20,0)"); + RegisterColumnType(DbType.UInt16, "NUMBER(5,0)"); + RegisterColumnType(DbType.UInt32, "NUMBER(10,0)"); + RegisterColumnType(DbType.UInt64, "NUMBER(20,0)"); + RegisterColumnType(DbType.Single, "FLOAT(24)"); + RegisterColumnType(DbType.StringFixedLength, "NCHAR(255)"); + RegisterColumnType(DbType.StringFixedLength, 2000, "NCHAR($l)"); + RegisterColumnType(DbType.String, "VARCHAR2(255)"); + RegisterColumnType(DbType.String, 2000, "VARCHAR2($l)"); + RegisterColumnType(DbType.String, 1073741823, "CLOB"); + RegisterColumnType(DbType.Time, "DATE"); + + RegisterFunction("stddev", new StandardSQLFunction("stddev", NHibernateUtil.Double)); + RegisterFunction("variance", new StandardSQLFunction("variance", NHibernateUtil.Double)); + + RegisterFunction("round", new StandardSQLFunction("round")); + RegisterFunction("trunc", new StandardSQLFunction("trunc")); + RegisterFunction("ceil", new StandardSQLFunction("ceil")); + RegisterFunction("floor", new StandardSQLFunction("floor")); + + RegisterFunction("chr", new StandardSQLFunction("chr", NHibernateUtil.Character)); + RegisterFunction("initcap", new StandardSQLFunction("initcap")); + RegisterFunction("lower", new StandardSQLFunction("lower")); + RegisterFunction("ltrim", new StandardSQLFunction("ltrim")); + RegisterFunction("rtrim", new StandardSQLFunction("rtrim")); + RegisterFunction("upper", new StandardSQLFunction("upper")); + RegisterFunction("ascii", new StandardSQLFunction("ascii", NHibernateUtil.Int32)); + RegisterFunction("length", new StandardSQLFunction("length", NHibernateUtil.Int64)); + + RegisterFunction("to_char", new StandardSQLFunction("to_char", NHibernateUtil.String)); + RegisterFunction("to_date", new StandardSQLFunction("to_date", NHibernateUtil.Timestamp)); + + RegisterFunction("last_day", new StandardSQLFunction("last_day", NHibernateUtil.Date)); + RegisterFunction("sysdate", new NoArgSQLFunction("sysdate", NHibernateUtil.Date, false)); + RegisterFunction("user", new NoArgSQLFunction("user", NHibernateUtil.String, false)); + + // Multi-param string dialect functions... + RegisterFunction("concat", new StandardSQLFunction("concat", NHibernateUtil.String)); + RegisterFunction("instr", new StandardSQLFunction("instr", NHibernateUtil.String)); + RegisterFunction("instrb", new StandardSQLFunction("instrb", NHibernateUtil.String)); + RegisterFunction("lpad", new StandardSQLFunction("lpad", NHibernateUtil.String)); + RegisterFunction("replace", new StandardSQLFunction("replace", NHibernateUtil.String)); + RegisterFunction("rpad", new StandardSQLFunction("rpad", NHibernateUtil.String)); + RegisterFunction("substr", new StandardSQLFunction("substr", NHibernateUtil.String)); + RegisterFunction("substrb", new StandardSQLFunction("substrb", NHibernateUtil.String)); + RegisterFunction("translate", new StandardSQLFunction("translate", NHibernateUtil.String)); + + // Multi-param numeric dialect functions... + RegisterFunction("mod", new StandardSQLFunction("mod", NHibernateUtil.Int32)); + RegisterFunction("nvl", new StandardSQLFunction("nvl")); + + // Multi-param date dialect functions... + RegisterFunction("add_months", new StandardSQLFunction("add_months", NHibernateUtil.Date)); + RegisterFunction("months_between", new StandardSQLFunction("months_between", NHibernateUtil.Single)); + RegisterFunction("next_day", new StandardSQLFunction("next_day", NHibernateUtil.Date)); + } + + /// <summary></summary> + public override string GetCreateSequenceString(string sequenceName) + { + return "create sequence " + sequenceName + " INCREMENT BY 1 START WITH 1"; + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate/Driver/OracleLiteDataClientDriver.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Driver/OracleLiteDataClientDriver.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Driver/OracleLiteDataClientDriver.cs 2009-01-10 21:26:34 UTC (rev 3994) @@ -0,0 +1,68 @@ +using System.Data; +using NHibernate.AdoNet; +using NHibernate.SqlTypes; + +namespace NHibernate.Driver +{ + /// <summary> + /// A NHibernate Driver for using the Oracle.DataAccess.Lite DataProvider + /// </summary> + public class OracleLiteDataClientDriver : ReflectionBasedDriver, IEmbeddedBatcherFactoryProvider + { + /// <summary> + /// Initializes a new instance of <see cref="OracleLiteDataClientDriver"/>. + /// </summary> + /// <exception cref="HibernateException"> + /// Thrown when the <c>Oracle.DataAccess.Lite_w32</c> assembly can not be loaded. + /// </exception> + public OracleLiteDataClientDriver() + : base( + "Oracle.DataAccess.Lite_w32", + "Oracle.DataAccess.Lite.OracleConnection", + "Oracle.DataAccess.Lite.OracleCommand") + { + } + + /// <summary></summary> + public override bool UseNamedPrefixInSql + { + get { return true; } + } + + /// <summary></summary> + public override bool UseNamedPrefixInParameter + { + get { return true; } + } + + /// <summary></summary> + public override string NamedPrefix + { + get { return ":"; } + } + + /// <remarks> + /// This adds logic to ensure that a DbType.Boolean parameter is not created since + /// ODP.NET doesn't support it. + /// </remarks> + protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType) + { + // if the parameter coming in contains a boolean then we need to convert it + // to another type since ODP.NET doesn't support DbType.Boolean + if (sqlType.DbType == DbType.Boolean) + { + sqlType = SqlTypeFactory.Int16; + } + base.InitializeParameter(dbParam, name, sqlType); + } + + #region IEmbeddedBatcherFactoryProvider Members + + System.Type IEmbeddedBatcherFactoryProvider.BatcherFactoryClass + { + get { return typeof (OracleDataClientBatchingBatcherFactory); } + } + + #endregion + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-10 20:36:28 UTC (rev 3993) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2009-01-10 21:26:34 UTC (rev 3994) @@ -445,11 +445,13 @@ <Compile Include="Bytecode\UnableToLoadProxyFactoryFactoryException.cs" /> <Compile Include="Dialect\InformixDialect0940.cs" /> <Compile Include="Dialect\InformixDialect1000.cs" /> + <Compile Include="Dialect\OracleLiteDialect.cs" /> <Compile Include="Dialect\Schema\SQLiteMetaData.cs" /> <Compile Include="Dialect\Schema\SybaseAnywhereMetaData.cs" /> <Compile Include="Dialect\SybaseASA10Dialect.cs" /> <Compile Include="Dialect\SybaseASA9Dialect.cs" /> <Compile Include="Driver\IfxDriver.cs" /> + <Compile Include="Driver\OracleLiteDataClientDriver.cs" /> <Compile Include="Exceptions\ReflectionBasedSqlStateExtracter.cs" /> <Compile Include="Exceptions\SqlStateExtracter.cs" /> <Compile Include="Exceptions\TemplatedViolatedConstraintNameExtracter.cs" /> @@ -1151,4 +1153,4 @@ <Target Name="AfterBuild"> </Target> --> -</Project> +</Project> \ 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: <fab...@us...> - 2009-01-10 20:36:35
|
Revision: 3993 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3993&view=rev Author: fabiomaulo Date: 2009-01-10 20:36:28 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix NH-1640 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Entity.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-10 15:56:55 UTC (rev 3992) +++ trunk/nhibernate/src/NHibernate/Impl/StatelessSessionImpl.cs 2009-01-10 20:36:28 UTC (rev 3993) @@ -48,13 +48,17 @@ { CheckAndUpdateSessionStatus(); IEntityPersister persister = Factory.GetEntityPersister(entityName); + object loaded = temporaryPersistenceContext.GetEntity(new EntityKey(id, persister, EntityMode.Poco)); + if(loaded != null) + { + return loaded; + } if (!eager && persister.HasProxy) { return persister.CreateProxy(id, this); } - object loaded = temporaryPersistenceContext.GetEntity(new EntityKey(id, persister, EntityMode.Poco)); //TODO: if not loaded, throw an exception - return loaded ?? Get(entityName, id); + return Get(entityName, id); } public override object ImmediateLoad(string entityName, object id) Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Entity.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Entity.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Entity.cs 2009-01-10 20:36:28 UTC (rev 3993) @@ -0,0 +1,11 @@ +namespace NHibernate.Test.NHSpecificTest.NH1640 +{ + public class Entity + { + public virtual int Id { get; set; } + + public virtual string Name { get; set; } + + public virtual Entity Child { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Fixture.cs 2009-01-10 20:36:28 UTC (rev 3993) @@ -0,0 +1,41 @@ +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; + +namespace NHibernate.Test.NHSpecificTest.NH1640 +{ + [TestFixture] + public class Fixture : BugTestCase + { + [Test] + public void FetchJoinShouldNotReturnProxyTest() + { + int savedId; + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + var sub = new Entity {Id = 2, Name = "Child 2"}; + savedId = (int) session.Save(new Entity {Id = 1, Name = "Parent 1", Child = sub}); + tx.Commit(); + } + } + + using (IStatelessSession session = sessions.OpenStatelessSession()) + { + var parent = + session.CreateQuery("from Entity p join fetch p.Child where p.Id=:pId").SetInt32("pId", savedId).UniqueResult + <Entity>(); + Assert.That(parent.Child,Is.TypeOf(typeof (Entity))); + } + + using (ISession session = OpenSession()) + { + using (ITransaction tx = session.BeginTransaction()) + { + session.Delete("from Entity"); + tx.Commit(); + } + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1640/Mappings.hbm.xml 2009-01-10 20:36:28 UTC (rev 3993) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1640"> + + <class name="Entity"> + <id name="Id"> + <generator class="assigned"/> + </id> + <property name="Name" /> + <many-to-one name="Child" cascade="all"/> + </class> + +</hibernate-mapping> \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 15:56:55 UTC (rev 3992) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 20:36:28 UTC (rev 3993) @@ -576,6 +576,8 @@ <Compile Include="NHSpecificTest\NH1621\Model.cs" /> <Compile Include="NHSpecificTest\NH1632\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1632\Model.cs" /> + <Compile Include="NHSpecificTest\NH1640\Entity.cs" /> + <Compile Include="NHSpecificTest\NH1640\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Fixture.cs" /> <Compile Include="NHSpecificTest\NH280\Foo.cs" /> <Compile Include="NHSpecificTest\NH1018\Employee.cs" /> @@ -1597,6 +1599,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1640\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1584\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1632\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1612\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 15:57:01
|
Revision: 3992 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3992&view=rev Author: fabiomaulo Date: 2009-01-10 15:56:55 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Removed CLS-compliant warnings Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2009-01-10 15:54:30 UTC (rev 3991) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/AbstractEntityTuplizer.cs 2009-01-10 15:56:55 UTC (rev 3992) @@ -23,7 +23,6 @@ protected IGetter[] getters; protected ISetter[] setters; protected bool hasCustomAccessors; - protected IInstantiator instantiator; private readonly IProxyFactory proxyFactory; private readonly IAbstractComponentType identifierMapperType; @@ -303,10 +302,7 @@ /// <summary> Return the entity-mode handled by this tuplizer instance. </summary> public abstract EntityMode EntityMode { get;} - protected virtual IInstantiator Instantiator - { - get { return instantiator; } - } + protected virtual IInstantiator Instantiator { get; set; } /// <summary>Retrieves the defined entity-name for the tuplized entity. </summary> protected virtual string EntityName Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2009-01-10 15:54:30 UTC (rev 3991) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/DynamicMapEntityTuplizer.cs 2009-01-10 15:56:55 UTC (rev 3992) @@ -17,7 +17,7 @@ : base(entityMetamodel, mappingInfo) { // NH different behavior fo NH-1587 - instantiator = BuildInstantiator(mappingInfo); + Instantiator = BuildInstantiator(mappingInfo); } public override System.Type ConcreteProxyClass Modified: trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2009-01-10 15:54:30 UTC (rev 3991) +++ trunk/nhibernate/src/NHibernate/Tuple/Entity/PocoEntityTuplizer.cs 2009-01-10 15:56:55 UTC (rev 3992) @@ -45,7 +45,7 @@ // NH different behavior fo NH-1587 optimizer = Cfg.Environment.BytecodeProvider.GetReflectionOptimizer(mappedClass, getters, setters); } - instantiator = BuildInstantiator(mappedEntity); + Instantiator = BuildInstantiator(mappedEntity); if (hasCustomAccessors) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 15:54:36
|
Revision: 3991 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3991&view=rev Author: fabiomaulo Date: 2009-01-10 15:54:30 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Removed CLS-compliant warnings Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-01-10 15:42:47 UTC (rev 3990) +++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2009-01-10 15:54:30 UTC (rev 3991) @@ -55,19 +55,13 @@ private string currentDocumentName; protected IDictionary<string, PersistentClass> classes; // entityName, PersistentClass - protected IDictionary<string, string> imports; protected IDictionary<string, NHibernate.Mapping.Collection> collections; protected IDictionary<string, Table> tables; - protected IDictionary<string, NamedQueryDefinition> namedQueries; - protected IDictionary<string, NamedSQLQueryDefinition> namedSqlQueries; - protected IDictionary<string, ResultSetMappingDefinition> sqlResultSetMappings; protected IList<SecondPassCommand> secondPasses; protected IList<Mappings.PropertyReference> propertyReferences; private IInterceptor interceptor; private IDictionary<string, string> properties; - protected IDictionary<string, FilterDefinition> filterDefinitions; protected IList<IAuxiliaryDatabaseObject> auxiliaryDatabaseObjects; - protected IDictionary<string, ISQLFunction> sqlFunctions; private INamingStrategy namingStrategy = DefaultNamingStrategy.Instance; private MappingsQueue mappingsQueue; @@ -88,19 +82,19 @@ protected void Reset() { classes = new Dictionary<string, PersistentClass>(); //new SequencedHashMap(); - to make NH-369 bug deterministic - imports = new Dictionary<string, string>(); + Imports = new Dictionary<string, string>(); collections = new Dictionary<string, NHibernate.Mapping.Collection>(); tables = new Dictionary<string, Table>(); - namedQueries = new Dictionary<string, NamedQueryDefinition>(); - namedSqlQueries = new Dictionary<string, NamedSQLQueryDefinition>(); - sqlResultSetMappings = new Dictionary<string, ResultSetMappingDefinition>(); + NamedQueries = new Dictionary<string, NamedQueryDefinition>(); + NamedSQLQueries = new Dictionary<string, NamedSQLQueryDefinition>(); + SqlResultSetMappings = new Dictionary<string, ResultSetMappingDefinition>(); secondPasses = new List<SecondPassCommand>(); propertyReferences = new List<Mappings.PropertyReference>(); - filterDefinitions = new Dictionary<string, FilterDefinition>(); + FilterDefinitions = new Dictionary<string, FilterDefinition>(); interceptor = emptyInterceptor; properties = Environment.Properties; auxiliaryDatabaseObjects = new List<IAuxiliaryDatabaseObject>(); - sqlFunctions = new Dictionary<string, ISQLFunction>(); + SqlFunctions = new Dictionary<string, ISQLFunction>(); mappingsQueue = new MappingsQueue(); eventListeners = new EventListeners(); typeDefs = new Dictionary<string, TypeDef>(); @@ -445,8 +439,8 @@ /// </summary> public Mappings CreateMappings(Dialect.Dialect dialect) { - return new Mappings(classes, collections, tables, namedQueries, namedSqlQueries, sqlResultSetMappings, imports, - secondPasses, propertyReferences, namingStrategy, typeDefs, filterDefinitions, extendsQueue, + return new Mappings(classes, collections, tables, NamedQueries, NamedSQLQueries, SqlResultSetMappings, Imports, + secondPasses, propertyReferences, namingStrategy, typeDefs, FilterDefinitions, extendsQueue, auxiliaryDatabaseObjects, tableNameBinding, columnNameBindingPerTable, defaultAssembly, defaultNamespace, dialect); } @@ -947,10 +941,7 @@ /// <summary> /// The named queries /// </summary> - public IDictionary<string, NamedQueryDefinition> NamedQueries - { - get { return namedQueries; } - } + public IDictionary<string, NamedQueryDefinition> NamedQueries { get; protected set; } private EventListeners GetInitializedEventListeners() { @@ -1295,7 +1286,7 @@ { throw new HibernateConfigException("<mapping> element in configuration specifies no attributes"); } - if (!string.IsNullOrEmpty(mc.Resource)) + if (!string.IsNullOrEmpty(mc.Resource) && !string.IsNullOrEmpty(mc.Assembly)) { log.Debug(hc.SessionFactory.Name + "<-" + mc.Resource + " in " + mc.Assembly); AddResource(mc.Resource, Assembly.Load(mc.Assembly)); @@ -1442,11 +1433,7 @@ /// <summary> /// Get the query language imports (entityName/className -> AssemblyQualifiedName) /// </summary> - /// <returns></returns> - public IDictionary<string, string> Imports - { - get { return imports; } - } + public IDictionary<string, string> Imports { get; protected set; } /// <summary> /// Create an object-oriented view of the configuration properties @@ -1463,7 +1450,7 @@ /// </summary> public IDictionary<string, NamedSQLQueryDefinition> NamedSQLQueries { - get { return namedSqlQueries; } + get; protected set; } /// <summary> @@ -1487,17 +1474,15 @@ public IDictionary<string, ResultSetMappingDefinition> SqlResultSetMappings { - get { return sqlResultSetMappings; } + get; + protected set; } - public IDictionary<string, FilterDefinition> FilterDefinitions - { - get { return filterDefinitions; } - } + public IDictionary<string, FilterDefinition> FilterDefinitions { get; protected set; } public void AddFilterDefinition(FilterDefinition definition) { - filterDefinitions.Add(definition.FilterName, definition); + FilterDefinitions.Add(definition.FilterName, definition); } public void AddAuxiliaryDatabaseObject(IAuxiliaryDatabaseObject obj) @@ -1505,14 +1490,11 @@ auxiliaryDatabaseObjects.Add(obj); } - public IDictionary<string, ISQLFunction> SqlFunctions - { - get { return sqlFunctions; } - } + public IDictionary<string, ISQLFunction> SqlFunctions { get; protected set; } public void AddSqlFunction(string functionName, ISQLFunction sqlFunction) { - sqlFunctions[functionName] = sqlFunction; + SqlFunctions[functionName] = sqlFunction; } #region NHibernate-Specific Members This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 15:42:50
|
Revision: 3990 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3990&view=rev Author: fabiomaulo Date: 2009-01-10 15:42:47 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Refactoring (removed compilation warning) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs Modified: trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs 2009-01-10 15:40:05 UTC (rev 3989) +++ trunk/nhibernate/src/NHibernate/Id/Enhanced/OptimizerFactory.cs 2009-01-10 15:42:47 UTC (rev 3990) @@ -10,7 +10,7 @@ public const string HiLo = "hilo"; public const string None = "none"; public const string Pool = "pooled"; - private static readonly System.Type[] CtorSignature = new System.Type[] {typeof (System.Type), typeof (int)}; + private static readonly System.Type[] CtorSignature = new[] {typeof (System.Type), typeof (int)}; private static readonly ILog log = LogManager.GetLogger(typeof (OptimizerFactory)); public static IOptimizer BuildOptimizer(string type, System.Type returnClass, int incrementSize) @@ -105,13 +105,13 @@ { lastSourceValue = callback.NextValue; } - hiValue = (lastSourceValue * incrementSize) + 1; - value_Renamed = hiValue - incrementSize; + hiValue = (lastSourceValue * IncrementSize) + 1; + value_Renamed = hiValue - IncrementSize; } else if (value_Renamed >= hiValue) { lastSourceValue = callback.NextValue; - hiValue = (lastSourceValue * incrementSize) + 1; + hiValue = (lastSourceValue * IncrementSize) + 1; } return Make(value_Renamed++); } @@ -160,30 +160,21 @@ public abstract class OptimizerSupport : IOptimizer { - protected int incrementSize; - protected System.Type returnClass; - protected OptimizerSupport(System.Type returnClass, int incrementSize) { if (returnClass == null) { throw new HibernateException("return class is required"); } - this.returnClass = returnClass; - this.incrementSize = incrementSize; + ReturnClass = returnClass; + IncrementSize = incrementSize; } - public System.Type ReturnClass - { - get { return returnClass; } - } + public System.Type ReturnClass { get; protected set; } #region IOptimizer Members - public int IncrementSize - { - get { return incrementSize; } - } + public int IncrementSize { get; protected set; } public abstract long LastSourceValue { get; } @@ -194,7 +185,7 @@ protected virtual object Make(long value) { - return IdentifierGeneratorFactory.CreateNumber(value, returnClass); + return IdentifierGeneratorFactory.CreateNumber(value, ReturnClass); } } @@ -254,7 +245,7 @@ else if (value_Renamed >= hiValue) { hiValue = callback.NextValue; - value_Renamed = hiValue - incrementSize; + value_Renamed = hiValue - IncrementSize; } return Make(value_Renamed++); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 15:40:12
|
Revision: 3989 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3989&view=rev Author: fabiomaulo Date: 2009-01-10 15:40:05 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Refactoring (removed compilation warning) Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs Modified: trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs 2009-01-10 15:20:49 UTC (rev 3988) +++ trunk/nhibernate/src/NHibernate/Util/ReflectHelper.cs 2009-01-10 15:40:05 UTC (rev 3989) @@ -11,23 +11,15 @@ /// <summary> /// Helper class for Reflection related code. /// </summary> - public sealed class ReflectHelper + public static class ReflectHelper { - private const BindingFlags defaultBindingFlags = - BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; - private static readonly ILog log = LogManager.GetLogger(typeof(ReflectHelper)); - public static BindingFlags AnyVisibilityInstance = BindingFlags.Instance | BindingFlags.Public | + public const BindingFlags AnyVisibilityInstance = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; - private ReflectHelper() - { - // not creatable - } + private static readonly System.Type[] NoClasses = System.Type.EmptyTypes; - private static System.Type[] NoClasses = System.Type.EmptyTypes; - private static readonly MethodInfo Exception_InternalPreserveStackTrace = typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic); @@ -41,7 +33,7 @@ { try { - MethodInfo equals = clazz.GetMethod("Equals", new System.Type[] { typeof(object) }); + MethodInfo equals = clazz.GetMethod("Equals", new[] { typeof(object) }); if (equals == null) { return false; @@ -199,7 +191,7 @@ } else { - if (classFullName != null && classFullName.Length > 0) + if (!string.IsNullOrEmpty(classFullName)) { Assembly[] ass = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly a in ass) @@ -404,9 +396,9 @@ throw new InstantiationException(FormatConstructorNotFoundMessage(types), null, type); } - private static string FormatConstructorNotFoundMessage(IType[] types) + private static string FormatConstructorNotFoundMessage(IEnumerable<IType> types) { - StringBuilder result = new StringBuilder("no constructor compatible with ("); + var result = new StringBuilder("no constructor compatible with ("); bool first = true; foreach (IType type in types) { @@ -486,8 +478,6 @@ /// </remarks> public static MethodInfo TryGetMethod(IEnumerable<System.Type> types, MethodInfo method) { - var bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; - // This method will be used when we support multiple proxy interfaces. if (types == null) { @@ -526,7 +516,7 @@ private static MethodInfo SafeGetMethod(System.Type type, MethodInfo method, System.Type[] tps) { - var bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; + const BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 15:20:57
|
Revision: 3988 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3988&view=rev Author: fabiomaulo Date: 2009-01-10 15:20:49 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Removed compilation warning Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/InformixDialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/InformixDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/InformixDialect.cs 2009-01-10 15:13:26 UTC (rev 3987) +++ trunk/nhibernate/src/NHibernate/Dialect/InformixDialect.cs 2009-01-10 15:20:49 UTC (rev 3988) @@ -1,490 +1,491 @@ using System.Data; +using System.Data.Common; +using NHibernate.Cfg; using NHibernate.Dialect.Function; +using NHibernate.Exceptions; using NHibernate.SqlCommand; -using System.Data.Common; -using NHibernate.Exceptions; //using NHibernate.Dialect.Schema; -using Environment = NHibernate.Cfg.Environment; - namespace NHibernate.Dialect { - /// <summary> - /// Summary description for InformixDialect. - /// This dialect is intended to work with IDS version 7.31 - /// However I can test only version 10.00 as I have only this version at work - /// </summary> - /// <remarks> - /// The InformixDialect defaults the following configuration properties: - /// <list type="table"> - /// <listheader> - /// <term>ConnectionDriver</term> - /// <description>NHibernate.Driver.OdbcDriver</description> - /// <term>PrepareSql</term> - /// <description>true</description> - /// </listheader> - /// <item> - /// <term>connection.driver_class</term> - /// <description><see cref="NHibernate.Driver.OdbcDriver" /></description> - /// </item> - /// </list> - /// </remarks> - public class InformixDialect : Dialect - { - /// <summary></summary> - public InformixDialect() - : base() - { - RegisterColumnType(DbType.AnsiStringFixedLength, "CHAR($l)"); - RegisterColumnType(DbType.AnsiString, 255, "VARCHAR($l)"); - RegisterColumnType(DbType.AnsiString, 32739, "LVARCHAR($l)"); - RegisterColumnType(DbType.AnsiString, 2147483647, "TEXT"); - RegisterColumnType(DbType.AnsiString, "VARCHAR(255)"); - RegisterColumnType(DbType.Binary, 2147483647, "BYTE"); - RegisterColumnType(DbType.Binary, "BYTE"); - RegisterColumnType(DbType.Boolean, "BOOLEAN"); - RegisterColumnType(DbType.Currency, "DECIMAL(16,4)"); - RegisterColumnType(DbType.Byte, "SMALLINT"); - RegisterColumnType(DbType.Date, "DATE"); - RegisterColumnType(DbType.DateTime, "datetime year to fraction(5)"); - RegisterColumnType(DbType.Decimal, "DECIMAL(19, 5)"); - RegisterColumnType(DbType.Decimal, 19, "DECIMAL($p, $s)"); - RegisterColumnType(DbType.Double, "DOUBLE"); - RegisterColumnType(DbType.Int16, "SMALLINT"); - RegisterColumnType(DbType.Int32, "INTEGER"); - RegisterColumnType(DbType.Int64, "BIGINT"); - RegisterColumnType(DbType.Single, "SmallFloat"); - RegisterColumnType(DbType.Time, "datetime hour to second"); - RegisterColumnType(DbType.StringFixedLength, "CHAR($l)"); - RegisterColumnType(DbType.String, 255, "VARCHAR($l)"); - RegisterColumnType(DbType.String, 32739, "LVARCHAR($l)"); - RegisterColumnType(DbType.String, 2147483647, "TEXT"); - RegisterColumnType(DbType.String, "VARCHAR(255)"); + /// <summary> + /// Summary description for InformixDialect. + /// This dialect is intended to work with IDS version 7.31 + /// However I can test only version 10.00 as I have only this version at work + /// </summary> + /// <remarks> + /// The InformixDialect defaults the following configuration properties: + /// <list type="table"> + /// <listheader> + /// <term>ConnectionDriver</term> + /// <description>NHibernate.Driver.OdbcDriver</description> + /// <term>PrepareSql</term> + /// <description>true</description> + /// </listheader> + /// <item> + /// <term>connection.driver_class</term> + /// <description><see cref="NHibernate.Driver.OdbcDriver" /></description> + /// </item> + /// </list> + /// </remarks> + public class InformixDialect : Dialect + { + /// <summary></summary> + public InformixDialect() + { + RegisterColumnType(DbType.AnsiStringFixedLength, "CHAR($l)"); + RegisterColumnType(DbType.AnsiString, 255, "VARCHAR($l)"); + RegisterColumnType(DbType.AnsiString, 32739, "LVARCHAR($l)"); + RegisterColumnType(DbType.AnsiString, 2147483647, "TEXT"); + RegisterColumnType(DbType.AnsiString, "VARCHAR(255)"); + RegisterColumnType(DbType.Binary, 2147483647, "BYTE"); + RegisterColumnType(DbType.Binary, "BYTE"); + RegisterColumnType(DbType.Boolean, "BOOLEAN"); + RegisterColumnType(DbType.Currency, "DECIMAL(16,4)"); + RegisterColumnType(DbType.Byte, "SMALLINT"); + RegisterColumnType(DbType.Date, "DATE"); + RegisterColumnType(DbType.DateTime, "datetime year to fraction(5)"); + RegisterColumnType(DbType.Decimal, "DECIMAL(19, 5)"); + RegisterColumnType(DbType.Decimal, 19, "DECIMAL($p, $s)"); + RegisterColumnType(DbType.Double, "DOUBLE"); + RegisterColumnType(DbType.Int16, "SMALLINT"); + RegisterColumnType(DbType.Int32, "INTEGER"); + RegisterColumnType(DbType.Int64, "BIGINT"); + RegisterColumnType(DbType.Single, "SmallFloat"); + RegisterColumnType(DbType.Time, "datetime hour to second"); + RegisterColumnType(DbType.StringFixedLength, "CHAR($l)"); + RegisterColumnType(DbType.String, 255, "VARCHAR($l)"); + RegisterColumnType(DbType.String, 32739, "LVARCHAR($l)"); + RegisterColumnType(DbType.String, 2147483647, "TEXT"); + RegisterColumnType(DbType.String, "VARCHAR(255)"); - RegisterFunction("substring", new AnsiSubstringFunction()); // base class override - RegisterFunction("substr", new StandardSQLFunction("substr")); - // RegisterFunction("trim", new AnsiTrimFunction()); // defined in base class - // RegisterFunction("length", new StandardSQLFunction("length", NHibernateUtil.Int32)); // defined in base class - RegisterFunction("coalesce", new NvlFunction()); // base class override - // RegisterFunction("abs", new StandardSQLFunction("abs")); - // RegisterFunction("mod", new StandardSQLFunction("mod", NHibernateUtil.Int32)); - // RegisterFunction("sqrt", new StandardSQLFunction("sqrt", NHibernateUtil.Double)); - // RegisterFunction("upper", new StandardSQLFunction("upper")); - // RegisterFunction("lower", new StandardSQLFunction("lower")); - // RegisterFunction("cast", new CastFunction()); - // RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(", "||", ")")); + RegisterFunction("substring", new AnsiSubstringFunction()); // base class override + RegisterFunction("substr", new StandardSQLFunction("substr")); + // RegisterFunction("trim", new AnsiTrimFunction()); // defined in base class + // RegisterFunction("length", new StandardSQLFunction("length", NHibernateUtil.Int32)); // defined in base class + RegisterFunction("coalesce", new NvlFunction()); // base class override + // RegisterFunction("abs", new StandardSQLFunction("abs")); + // RegisterFunction("mod", new StandardSQLFunction("mod", NHibernateUtil.Int32)); + // RegisterFunction("sqrt", new StandardSQLFunction("sqrt", NHibernateUtil.Double)); + // RegisterFunction("upper", new StandardSQLFunction("upper")); + // RegisterFunction("lower", new StandardSQLFunction("lower")); + // RegisterFunction("cast", new CastFunction()); + // RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(", "||", ")")); - RegisterFunction("current_timestamp", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false)); - RegisterFunction("sysdate", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false)); - RegisterFunction("current", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false)); - RegisterFunction("today", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false)); - RegisterFunction("day", new StandardSQLFunction("day", NHibernateUtil.Int32)); - RegisterFunction("month", new StandardSQLFunction("month", NHibernateUtil.Int32)); - RegisterFunction("year", new StandardSQLFunction("year", NHibernateUtil.Int32)); - RegisterFunction("date", new StandardSQLFunction("date", NHibernateUtil.DateTime)); - RegisterFunction("mdy", new SQLFunctionTemplate(NHibernateUtil.DateTime, "mdy(?1, ?2, ?3)")); - RegisterFunction("to_char", new StandardSQLFunction("to_char", NHibernateUtil.String)); - RegisterFunction("to_date", new StandardSQLFunction("to_date", NHibernateUtil.Timestamp)); - RegisterFunction("instr", new StandardSQLFunction("instr", NHibernateUtil.String)); - // actually there is no Instr (or equivalent) in Informix; you have to write your own SPL or UDR + RegisterFunction("current_timestamp", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false)); + RegisterFunction("sysdate", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false)); + RegisterFunction("current", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false)); + RegisterFunction("today", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false)); + RegisterFunction("day", new StandardSQLFunction("day", NHibernateUtil.Int32)); + RegisterFunction("month", new StandardSQLFunction("month", NHibernateUtil.Int32)); + RegisterFunction("year", new StandardSQLFunction("year", NHibernateUtil.Int32)); + RegisterFunction("date", new StandardSQLFunction("date", NHibernateUtil.DateTime)); + RegisterFunction("mdy", new SQLFunctionTemplate(NHibernateUtil.DateTime, "mdy(?1, ?2, ?3)")); + RegisterFunction("to_char", new StandardSQLFunction("to_char", NHibernateUtil.String)); + RegisterFunction("to_date", new StandardSQLFunction("to_date", NHibernateUtil.Timestamp)); + RegisterFunction("instr", new StandardSQLFunction("instr", NHibernateUtil.String)); + // actually there is no Instr (or equivalent) in Informix; you have to write your own SPL or UDR - DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.OdbcDriver"; - DefaultProperties[Environment.PrepareSql] = "true"; - } + DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.OdbcDriver"; + DefaultProperties[Environment.PrepareSql] = "true"; + } - /// <summary> - /// The keyword used to insert a generated value into an identity column (or null). - /// Need if the dialect does not support inserts that specify no column values. - /// </summary> - public override string IdentityInsertString - { - get { return "0"; } - } + /// <summary> + /// The keyword used to insert a generated value into an identity column (or null). + /// Need if the dialect does not support inserts that specify no column values. + /// </summary> + public override string IdentityInsertString + { + get { return "0"; } + } - /// <summary> Command used to create a temporary table. </summary> - public override string CreateTemporaryTableString - { - get { return "create temp table"; } - } + /// <summary> Command used to create a temporary table. </summary> + public override string CreateTemporaryTableString + { + get { return "create temp table"; } + } - /// <summary> - /// Get any fragments needing to be postfixed to the command for - /// temporary table creation. - /// </summary> - public override string CreateTemporaryTablePostfix - { - get { return "with no log"; } - } + /// <summary> + /// Get any fragments needing to be postfixed to the command for + /// temporary table creation. + /// </summary> + public override string CreateTemporaryTablePostfix + { + get { return "with no log"; } + } - /// <summary> - /// Should the value returned by <see cref="CurrentTimestampSelectString"/> - /// be treated as callable. Typically this indicates that JDBC escape - /// sytnax is being used... - /// </summary> - public override bool IsCurrentTimestampSelectStringCallable - { - get { return true; } - } + /// <summary> + /// Should the value returned by <see cref="CurrentTimestampSelectString"/> + /// be treated as callable. Typically this indicates that JDBC escape + /// sytnax is being used... + /// </summary> + public override bool IsCurrentTimestampSelectStringCallable + { + get { return true; } + } - /// <summary> - /// Retrieve the command used to retrieve the current timestammp from the database. - /// </summary> - public override string CurrentTimestampSelectString - { - get { return "select current from systables where tabid=1"; } - } + /// <summary> + /// Retrieve the command used to retrieve the current timestammp from the database. + /// </summary> + public override string CurrentTimestampSelectString + { + get { return "select current from systables where tabid=1"; } + } - /// <summary> - /// The name of the database-specific SQL function for retrieving the - /// current timestamp. - /// </summary> - public override string CurrentTimestampSQLFunctionName - { - get { return "current"; } - } + /// <summary> + /// The name of the database-specific SQL function for retrieving the + /// current timestamp. + /// </summary> + public override string CurrentTimestampSQLFunctionName + { + get { return "current"; } + } - public override IViolatedConstraintNameExtracter ViolatedConstraintNameExtracter - { - get { return new IfxViolatedConstraintExtracter(); } - } + public override IViolatedConstraintNameExtracter ViolatedConstraintNameExtracter + { + get { return new IfxViolatedConstraintExtracter(); } + } - /// <summary></summary> - public override string AddColumnString - { - get { return "add"; } - } + /// <summary></summary> + public override string AddColumnString + { + get { return "add"; } + } - //public override IDataBaseSchema GetDataBaseSchema(DbConnection connection) - //{ - // if (connection.ToString()=="IBM.Data.Informix.IfxConnection") { - // // this driver doesn't have working IfxConnection.GetSchema - // // and probably will never have - // throw new NotSupportedException(); - // } - // if (connection.ToString()=="System.Data.Odbc.OdbcConnection") { - // // waiting for somebody implementing OdbcBaseSchema - // // return new OdbcBaseSchema(connection); - // } - // if (connection.ToString()=="IBM.Data.DB2.IfxConnection") { - // // waiting for somebody implementing DB2BaseSchema - // return new DB2BaseSchema(connection); - // } - // throw new NotSupportedException(); - //} + //public override IDataBaseSchema GetDataBaseSchema(DbConnection connection) + //{ + // if (connection.ToString()=="IBM.Data.Informix.IfxConnection") { + // // this driver doesn't have working IfxConnection.GetSchema + // // and probably will never have + // throw new NotSupportedException(); + // } + // if (connection.ToString()=="System.Data.Odbc.OdbcConnection") { + // // waiting for somebody implementing OdbcBaseSchema + // // return new OdbcBaseSchema(connection); + // } + // if (connection.ToString()=="IBM.Data.DB2.IfxConnection") { + // // waiting for somebody implementing DB2BaseSchema + // return new DB2BaseSchema(connection); + // } + // throw new NotSupportedException(); + //} - /// <summary> Is <tt>FOR UPDATE OF</tt> syntax supported? </summary> - /// <value> True if the database supports <tt>FOR UPDATE OF</tt> syntax; false otherwise. </value> - public override bool ForUpdateOfColumns - { - get { return true; } - } + /// <summary> Is <tt>FOR UPDATE OF</tt> syntax supported? </summary> + /// <value> True if the database supports <tt>FOR UPDATE OF</tt> syntax; false otherwise. </value> + public override bool ForUpdateOfColumns + { + get { return true; } + } - /// <summary> - /// Does this dialect support <tt>FOR UPDATE</tt> in conjunction with outer joined rows? - /// </summary> - /// <value> True if outer joined rows can be locked via <tt>FOR UPDATE</tt>. </value> - public override bool SupportsOuterJoinForUpdate - { - get { return false; } - } + /// <summary> + /// Does this dialect support <tt>FOR UPDATE</tt> in conjunction with outer joined rows? + /// </summary> + /// <value> True if outer joined rows can be locked via <tt>FOR UPDATE</tt>. </value> + public override bool SupportsOuterJoinForUpdate + { + get { return false; } + } - /// <summary> - /// Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this - /// dialect given the aliases of the columns to be write locked. - /// </summary> - /// <param name="aliases">The columns to be write locked. </param> - /// <returns> The appropriate <tt>FOR UPDATE OF column_list</tt> clause string. </returns> - public override string GetForUpdateString(string aliases) - { - return ForUpdateString + " of " + aliases; - } + /// <summary> + /// Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this + /// dialect given the aliases of the columns to be write locked. + /// </summary> + /// <param name="aliases">The columns to be write locked. </param> + /// <returns> The appropriate <tt>FOR UPDATE OF column_list</tt> clause string. </returns> + public override string GetForUpdateString(string aliases) + { + return ForUpdateString + " of " + aliases; + } - /// <summary> Does this dialect support temporary tables? </summary> - public override bool SupportsTemporaryTables - { - get { return true; } - } + /// <summary> Does this dialect support temporary tables? </summary> + public override bool SupportsTemporaryTables + { + get { return true; } + } - /// <summary> - /// Does the dialect require that temporary table DDL statements occur in - /// isolation from other statements? This would be the case if the creation - /// would cause any current transaction to get committed implicitly. - /// </summary> - /// <returns> see the result matrix above. </returns> - /// <remarks> - /// JDBC defines a standard way to query for this information via the - /// {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()} - /// method. However, that does not distinguish between temporary table - /// DDL and other forms of DDL; MySQL, for example, reports DDL causing a - /// transaction commit via its driver, even though that is not the case for - /// temporary table DDL. - /// <p/> - /// Possible return values and their meanings:<ul> - /// <li>{@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL in isolation.</li> - /// <li>{@link Boolean#FALSE} - Unequivocally, do <b>not</b> perform the temporary table DDL in isolation.</li> - /// <li><i>null</i> - defer to the JDBC driver response in regards to {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}</li> - /// </ul> - /// </remarks> - public override bool? PerformTemporaryTableDDLInIsolation() - { - return false; - } + /// <summary> + /// Does the dialect require that temporary table DDL statements occur in + /// isolation from other statements? This would be the case if the creation + /// would cause any current transaction to get committed implicitly. + /// </summary> + /// <returns> see the result matrix above. </returns> + /// <remarks> + /// JDBC defines a standard way to query for this information via the + /// {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()} + /// method. However, that does not distinguish between temporary table + /// DDL and other forms of DDL; MySQL, for example, reports DDL causing a + /// transaction commit via its driver, even though that is not the case for + /// temporary table DDL. + /// <p/> + /// Possible return values and their meanings:<ul> + /// <li>{@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL in isolation.</li> + /// <li>{@link Boolean#FALSE} - Unequivocally, do <b>not</b> perform the temporary table DDL in isolation.</li> + /// <li><i>null</i> - defer to the JDBC driver response in regards to {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}</li> + /// </ul> + /// </remarks> + public override bool? PerformTemporaryTableDDLInIsolation() + { + return false; + } - public override int RegisterResultSetOutParameter(DbCommand statement, int position) - { - return position; - } + public override int RegisterResultSetOutParameter(DbCommand statement, int position) + { + return position; + } - public override DbDataReader GetResultSet(DbCommand statement) - { - return statement.ExecuteReader(CommandBehavior.SingleResult); - } + public override DbDataReader GetResultSet(DbCommand statement) + { + return statement.ExecuteReader(CommandBehavior.SingleResult); + } - /// <summary> Does this dialect support a way to retrieve the database's current timestamp value? </summary> - public override bool SupportsCurrentTimestampSelection - { - get { return true; } - } + /// <summary> Does this dialect support a way to retrieve the database's current timestamp value? </summary> + public override bool SupportsCurrentTimestampSelection + { + get { return true; } + } - public override long TimestampResolutionInTicks - { - get { return 100L; } // Maximum precision (one tick) - } + public override long TimestampResolutionInTicks + { + get { return 100L; } // Maximum precision (one tick) + } - public override bool SupportsIdentityColumns - { - get { return true; } - } + public override bool SupportsIdentityColumns + { + get { return true; } + } - /// <summary> - /// Whether this dialect have an Identity clause added to the data type or a - /// completely seperate identity data type - /// </summary> - public override bool HasDataTypeInIdentityColumn - { - get { return false; } - } + /// <summary> + /// Whether this dialect have an Identity clause added to the data type or a + /// completely seperate identity data type + /// </summary> + public override bool HasDataTypeInIdentityColumn + { + get { return false; } + } - /// <summary> - /// Get the select command to use to retrieve the last generated IDENTITY - /// value for a particular table - /// </summary> - /// <param name="tableName">The table into which the insert was done </param> - /// <param name="identityColumn">The PK column. </param> - /// <param name="type">The <see cref="DbType"/> type code. </param> - /// <returns> The appropriate select command </returns> - public override string GetIdentitySelectString(string identityColumn, string tableName, DbType type) - { - return type == DbType.Int64 ? - "select dbinfo('serial8') from systables where tabid=1" : - "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; - } + /// <summary> + /// Get the select command to use to retrieve the last generated IDENTITY + /// value for a particular table + /// </summary> + /// <param name="tableName">The table into which the insert was done </param> + /// <param name="identityColumn">The PK column. </param> + /// <param name="type">The <see cref="DbType"/> type code. </param> + /// <returns> The appropriate select command </returns> + public override string GetIdentitySelectString(string identityColumn, string tableName, DbType type) + { + return type == DbType.Int64 + ? "select dbinfo('serial8') from systables where tabid=1" + : "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; + } - /// <summary> - /// The syntax that returns the identity value of the last insert, if native - /// key generation is supported - /// </summary> - public override string IdentitySelectString - { - // return type==Types.BIGINT ? - // "select dbinfo('serial8') from systables where tabid=1" : - // "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; - get { return "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; } - } + /// <summary> + /// The syntax that returns the identity value of the last insert, if native + /// key generation is supported + /// </summary> + public override string IdentitySelectString + { + // return type==Types.BIGINT ? + // "select dbinfo('serial8') from systables where tabid=1" : + // "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; + get { return "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1"; } + } - /// <summary> - /// The syntax used during DDL to define a column as being an IDENTITY of - /// a particular type. - /// </summary> - /// <param name="type">The <see cref="DbType"/> type code. </param> - /// <returns> The appropriate DDL fragment. </returns> - public override string GetIdentityColumnString(DbType type) - { - return type == DbType.Int64 ? - "serial8 not null" : - "serial not null"; - } + /// <summary> + /// The syntax used during DDL to define a column as being an IDENTITY of + /// a particular type. + /// </summary> + /// <param name="type">The <see cref="DbType"/> type code. </param> + /// <returns> The appropriate DDL fragment. </returns> + public override string GetIdentityColumnString(DbType type) + { + return type == DbType.Int64 ? "serial8 not null" : "serial not null"; + } - /// <summary> - /// The keyword used to specify an identity column, if native key generation is supported - /// </summary> - public override string IdentityColumnString - { - get { return "serial not null"; } - } + /// <summary> + /// The keyword used to specify an identity column, if native key generation is supported + /// </summary> + public override string IdentityColumnString + { + get { return "serial not null"; } + } - /// <summary> - /// Does this dialect support sequences? - /// </summary> - public override bool SupportsSequences - { - get { return false; } - } + /// <summary> + /// Does this dialect support sequences? + /// </summary> + public override bool SupportsSequences + { + get { return false; } + } - /// <summary> - /// Create a <see cref="JoinFragment"/> strategy responsible - /// for handling this dialect's variations in how joins are handled. - /// </summary> - /// <returns> This dialect's <see cref="JoinFragment"/> strategy. </returns> - public override JoinFragment CreateOuterJoinFragment() - { - return new InformixJoinFragment(); - } + /// <summary> + /// Create a <see cref="JoinFragment"/> strategy responsible + /// for handling this dialect's variations in how joins are handled. + /// </summary> + /// <returns> This dialect's <see cref="JoinFragment"/> strategy. </returns> + public override JoinFragment CreateOuterJoinFragment() + { + return new InformixJoinFragment(); + } - /// <summary> The SQL literal value to which this database maps boolean values. </summary> - /// <param name="value">The boolean value </param> - /// <returns> The appropriate SQL literal. </returns> - public override string ToBooleanValueString(bool value) - { - return value ? "t" : "f"; - } - /// <summary> - /// Does this Dialect have some kind of <c>LIMIT</c> syntax? - /// </summary> - /// <value>False, unless overridden.</value> - public override bool SupportsLimit - { - // select first * is supported since 7.31 - // but it works with unions since 10.00 - // so it is safer to regard that it is not supported - get { return false; } - } + /// <summary> The SQL literal value to which this database maps boolean values. </summary> + /// <param name="value">The boolean value </param> + /// <returns> The appropriate SQL literal. </returns> + public override string ToBooleanValueString(bool value) + { + return value ? "t" : "f"; + } - /// <summary> - /// Does this Dialect support an offset? - /// </summary> - public override bool SupportsLimitOffset - { - get { return false; } - } - /// <summary> - /// Can parameters be used for a statement containing a LIMIT? - /// </summary> - public override bool SupportsVariableLimit - { - get { return false; } - } - /// <summary> - /// Does the <c>LIMIT</c> clause come at the start of the - /// <c>SELECT</c> statement rather than at the end? - /// </summary> - /// <value>false, unless overridden</value> - public override bool BindLimitParametersFirst - { - get { return true; } - } + /// <summary> + /// Does this Dialect have some kind of <c>LIMIT</c> syntax? + /// </summary> + /// <value>False, unless overridden.</value> + public override bool SupportsLimit + { + // select first * is supported since 7.31 + // but it works with unions since 10.00 + // so it is safer to regard that it is not supported + get { return false; } + } + /// <summary> + /// Does this Dialect support an offset? + /// </summary> + public override bool SupportsLimitOffset + { + get { return false; } + } - /// <summary> Apply s limit clause to the query. </summary> - /// <param name="querySqlString">The query to which to apply the limit. </param> - /// <param name="hasOffset">Is the query requesting an offset? </param> - /// <returns> the modified SQL </returns> - /// <remarks> - /// Typically dialects utilize <see cref="SupportsVariableLimit"/> - /// limit caluses when they support limits. Thus, when building the - /// select command we do not actually need to know the limit or the offest - /// since we will just be using placeholders. - /// <p/> - /// Here we do still pass along whether or not an offset was specified - /// so that dialects not supporting offsets can generate proper exceptions. - /// In general, dialects will override one or the other of this method and - /// <see cref="GetLimitString(SqlString,int,int)"/>. - /// </remarks> - public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) - { - /* + /// <summary> + /// Can parameters be used for a statement containing a LIMIT? + /// </summary> + public override bool SupportsVariableLimit + { + get { return false; } + } + + /// <summary> + /// Does the <c>LIMIT</c> clause come at the start of the + /// <c>SELECT</c> statement rather than at the end? + /// </summary> + /// <value>false, unless overridden</value> + public override bool BindLimitParametersFirst + { + get { return true; } + } + + /// <summary> Apply s limit clause to the query. </summary> + /// <param name="querySqlString">The query to which to apply the limit. </param> + /// <param name="offset">Offset of the first row to be returned by the query (zero-based)</param> + /// <param name="limit">Maximum number of rows to be returned by the query</param> + /// <returns> the modified SQL </returns> + /// <remarks> + /// Typically dialects utilize <see cref="SupportsVariableLimit"/> + /// limit caluses when they support limits. Thus, when building the + /// select command we do not actually need to know the limit or the offest + /// since we will just be using placeholders. + /// <p/> + /// Here we do still pass along whether or not an offset was specified + /// so that dialects not supporting offsets can generate proper exceptions. + /// In general, dialects will override one or the other of this method and + /// <see cref="GetLimitString(SqlString,int,int)"/>. + /// </remarks> + public override SqlString GetLimitString(SqlString querySqlString, int offset, int limit) + { + /* * "SELECT [SKIP x] FIRST y rest-of-sql-statement" */ - int insertIndex = GetAfterSelectInsertPoint(querySqlString); + int insertIndex = GetAfterSelectInsertPoint(querySqlString); - if (offset > 0) - { - return querySqlString.Insert(insertIndex, " skip " + offset + " first " + limit); - } - + if (offset > 0) + { + return querySqlString.Insert(insertIndex, " skip " + offset + " first " + limit); + } + return querySqlString.Insert(insertIndex, " first " + limit); - } - /// <summary> - /// Does this dialect support UNION ALL, which is generally a faster variant of UNION? - /// True if UNION ALL is supported; false otherwise. - /// </summary> - public override bool SupportsUnionAll - { - get { return true; } - } + } - public override bool SupportsEmptyInList - { - get { return false; } - } + /// <summary> + /// Does this dialect support UNION ALL, which is generally a faster variant of UNION? + /// True if UNION ALL is supported; false otherwise. + /// </summary> + public override bool SupportsUnionAll + { + get { return true; } + } - public override bool SupportsResultSetPositionQueryMethodsOnForwardOnlyCursor - { - get { return false; } - } + public override bool SupportsEmptyInList + { + get { return false; } + } - public override bool DoesRepeatableReadCauseReadersToBlockWriters - { - get { return true; } - } + public override bool SupportsResultSetPositionQueryMethodsOnForwardOnlyCursor + { + get { return false; } + } - public override ISQLExceptionConverter BuildSQLExceptionConverter() - { - // The default SQLExceptionConverter for all dialects is based on SQLState - // since SQLErrorCode is extremely vendor-specific. Specific Dialects - // may override to return whatever is most appropriate for that vendor. - return new SQLStateConverter(ViolatedConstraintNameExtracter); - } + public override bool DoesRepeatableReadCauseReadersToBlockWriters + { + get { return true; } + } - private static int GetAfterSelectInsertPoint(SqlString text) - { - if (text.StartsWithCaseInsensitive("select")) - { - return 6; - } + public override ISQLExceptionConverter BuildSQLExceptionConverter() + { + // The default SQLExceptionConverter for all dialects is based on SQLState + // since SQLErrorCode is extremely vendor-specific. Specific Dialects + // may override to return whatever is most appropriate for that vendor. + return new SQLStateConverter(ViolatedConstraintNameExtracter); + } - return -1; - } - } + private static int GetAfterSelectInsertPoint(SqlString text) + { + if (text.StartsWithCaseInsensitive("select")) + { + return 6; + } - public class IfxViolatedConstraintExtracter : TemplatedViolatedConstraintNameExtracter - { - /// <summary> - /// Extract the name of the violated constraint from the given DbException. - /// </summary> - /// <param name="sqle">The exception that was the result of the constraint violation.</param> - /// <returns>The extracted constraint name.</returns> - public override string ExtractConstraintName(DbException sqle) - { - string constraintName = null; + return -1; + } + } - ReflectionBasedSqlStateExtracter extracter = new ReflectionBasedSqlStateExtracter(); + public class IfxViolatedConstraintExtracter : TemplatedViolatedConstraintNameExtracter + { + /// <summary> + /// Extract the name of the violated constraint from the given DbException. + /// </summary> + /// <param name="sqle">The exception that was the result of the constraint violation.</param> + /// <returns>The extracted constraint name.</returns> + public override string ExtractConstraintName(DbException sqle) + { + string constraintName = null; - int errorCode = extracter.ExtractErrorCode(sqle); - if (errorCode == -268) - { - constraintName = ExtractUsingTemplate("Unique constraint (", ") violated.", sqle.Message); - } - else if (errorCode == -691) - { - constraintName = ExtractUsingTemplate("Missing key in referenced table for referential constraint (", ").", sqle.Message); - } - else if (errorCode == -692) - { - constraintName = ExtractUsingTemplate("Key value for constraint (", ") is still being referenced.", sqle.Message); - } + var extracter = new ReflectionBasedSqlStateExtracter(); - if (constraintName != null) - { - // strip table-owner because Informix always returns constraint names as "<table-owner>.<constraint-name>" - int i = constraintName.IndexOf('.'); - if (i != -1) - { - constraintName = constraintName.Substring(i + 1); - } - } - return constraintName; - } - }; + int errorCode = extracter.ExtractErrorCode(sqle); + if (errorCode == -268) + { + constraintName = ExtractUsingTemplate("Unique constraint (", ") violated.", sqle.Message); + } + else if (errorCode == -691) + { + constraintName = ExtractUsingTemplate("Missing key in referenced table for referential constraint (", ").", + sqle.Message); + } + else if (errorCode == -692) + { + constraintName = ExtractUsingTemplate("Key value for constraint (", ") is still being referenced.", sqle.Message); + } + + if (constraintName != null) + { + // strip table-owner because Informix always returns constraint names as "<table-owner>.<constraint-name>" + int i = constraintName.IndexOf('.'); + if (i != -1) + { + constraintName = constraintName.Substring(i + 1); + } + } + return constraintName; + } + } ; } \ 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: <fab...@us...> - 2009-01-10 15:13:32
|
Revision: 3987 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3987&view=rev Author: fabiomaulo Date: 2009-01-10 15:13:26 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Removed compilation warning Modified Paths: -------------- trunk/nhibernate/src/NHibernate/SqlCommand/InformixJoinFragment.cs Modified: trunk/nhibernate/src/NHibernate/SqlCommand/InformixJoinFragment.cs =================================================================== --- trunk/nhibernate/src/NHibernate/SqlCommand/InformixJoinFragment.cs 2009-01-10 15:10:34 UTC (rev 3986) +++ trunk/nhibernate/src/NHibernate/SqlCommand/InformixJoinFragment.cs 2009-01-10 15:13:26 UTC (rev 3987) @@ -1,113 +1,101 @@ using System; -using System.Text; -using Iesi.Collections; using NHibernate.Util; namespace NHibernate.SqlCommand { - /// <summary> - /// An Informix-style (theta) Join - /// </summary> - public class InformixJoinFragment : JoinFragment - { - private SqlStringBuilder afterFrom = new SqlStringBuilder(); - private SqlStringBuilder afterWhere = new SqlStringBuilder(); + /// <summary> + /// An Informix-style (theta) Join + /// </summary> + public class InformixJoinFragment : JoinFragment + { + private readonly SqlStringBuilder afterFrom = new SqlStringBuilder(); + private readonly SqlStringBuilder afterWhere = new SqlStringBuilder(); - public override void AddJoin(string tableName, string alias, string[] fkColumns, string[] pkColumns, JoinType joinType) - { - string joinString; - switch (joinType) - { - case JoinType.InnerJoin: - AddCrossJoin(tableName, alias); - break; - case JoinType.LeftOuterJoin: - afterFrom.Add(StringHelper.CommaSpace) - .Add("outer ") - .Add(tableName) - .Add(" ") - .Add(alias); - break; - case JoinType.RightOuterJoin: - int i = GetPrevTableInsertPoint(afterFrom.ToSqlString()); - afterFrom.Insert(i, "outer "); - break; - case JoinType.FullJoin: - throw new NotSupportedException("join type not supported by Informix"); - default: - throw new AssertionFailure("undefined join type"); - } + public override void AddJoin(string tableName, string alias, string[] fkColumns, string[] pkColumns, JoinType joinType) + { + switch (joinType) + { + case JoinType.InnerJoin: + AddCrossJoin(tableName, alias); + break; + case JoinType.LeftOuterJoin: + afterFrom.Add(StringHelper.CommaSpace).Add("outer ").Add(tableName).Add(" ").Add(alias); + break; + case JoinType.RightOuterJoin: + int i = GetPrevTableInsertPoint(afterFrom.ToSqlString()); + afterFrom.Insert(i, "outer "); + break; + case JoinType.FullJoin: + throw new NotSupportedException("join type not supported by Informix"); + default: + throw new AssertionFailure("undefined join type"); + } - for (int j = 0; j < fkColumns.Length; j++) - { - //HasThetaJoins = true; - afterWhere.Add(" and " + fkColumns[j]); - afterWhere.Add("=" + alias + StringHelper.Dot + pkColumns[j]); - } - } + for (int j = 0; j < fkColumns.Length; j++) + { + //HasThetaJoins = true; + afterWhere.Add(" and " + fkColumns[j]); + afterWhere.Add("=" + alias + StringHelper.Dot + pkColumns[j]); + } + } - public override void AddJoin(string tableName, string alias, string[] fkColumns, string[] pkColumns, JoinType joinType, - string on) - { - //arbitrary on clause ignored!! - AddJoin(tableName, alias, fkColumns, pkColumns, joinType); - AddCondition(on); - } + public override void AddJoin(string tableName, string alias, string[] fkColumns, string[] pkColumns, JoinType joinType, + string on) + { + //arbitrary on clause ignored!! + AddJoin(tableName, alias, fkColumns, pkColumns, joinType); + AddCondition(on); + } - public override SqlString ToFromFragmentString - { - get { return afterFrom.ToSqlString(); } - } + public override SqlString ToFromFragmentString + { + get { return afterFrom.ToSqlString(); } + } - public override SqlString ToWhereFragmentString - { - get { return afterWhere.ToSqlString(); } - } + public override SqlString ToWhereFragmentString + { + get { return afterWhere.ToSqlString(); } + } - public override void AddJoins(SqlString fromFragment, SqlString whereFragment) - { - afterFrom.Add(fromFragment); - afterWhere.Add(whereFragment); - } + public override void AddJoins(SqlString fromFragment, SqlString whereFragment) + { + afterFrom.Add(fromFragment); + afterWhere.Add(whereFragment); + } - public override void AddCrossJoin(string tableName, string alias) - { - afterFrom.Add(StringHelper.CommaSpace) - .Add(tableName) - .Add(" ") - .Add(alias); - } + public override void AddCrossJoin(string tableName, string alias) + { + afterFrom.Add(StringHelper.CommaSpace).Add(tableName).Add(" ").Add(alias); + } - public override bool AddCondition(string condition) - { - return AddCondition(afterWhere, condition); - } + public override bool AddCondition(string condition) + { + return AddCondition(afterWhere, condition); + } - public override bool AddCondition(SqlString condition) - { - return AddCondition(afterWhere, condition); - } + public override bool AddCondition(SqlString condition) + { + return AddCondition(afterWhere, condition); + } - public override void AddFromFragmentString(SqlString fromFragmentString) - { - afterFrom.Add(fromFragmentString); - } + public override void AddFromFragmentString(SqlString fromFragmentString) + { + afterFrom.Add(fromFragmentString); + } - private static int GetPrevTableInsertPoint(SqlString text) - { - int i, j; - - i = text.LastIndexOfCaseInsensitive("from"); - j = text.LastIndexOfCaseInsensitive(","); - if (i == -1 && j == -1) - { - return -1; - } - if (j > i) - { - return j + 1; - } - return i + 5; - } - } -} + private static int GetPrevTableInsertPoint(SqlString text) + { + int i = text.LastIndexOfCaseInsensitive("from"); + int j = text.LastIndexOfCaseInsensitive(","); + if (i == -1 && j == -1) + { + return -1; + } + if (j > i) + { + return j + 1; + } + return i + 5; + } + } +} \ 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: <fab...@us...> - 2009-01-10 15:10:40
|
Revision: 3986 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3986&view=rev Author: fabiomaulo Date: 2009-01-10 15:10:34 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Fix NH-1491 Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs Modified: trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -225,9 +225,9 @@ { return new SqlStringBuilder() .Add("cast('") - .Add(name) + .Add(Name) .Add("' as ") - .Add(returnType.SqlTypes(factory)[0].ToString()) + .Add(FunctionReturnType.SqlTypes(factory)[0].ToString()) .Add(")") .ToSqlString(); } @@ -241,7 +241,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory) { - return new SqlString(name); + return new SqlString(Name); } } Modified: trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/Function/NoArgSQLFunction.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -10,36 +10,27 @@ /// </summary> public class NoArgSQLFunction : ISQLFunction { - protected readonly IType returnType = null; - protected readonly string name; - private readonly bool hasParenthesesIfNoArguments; - - public NoArgSQLFunction(string name, IType returnType) : this(name, returnType, true) + public NoArgSQLFunction(string name, IType returnType) + : this(name, returnType, true) { } public NoArgSQLFunction(string name, IType returnType, bool hasParenthesesIfNoArguments) { - this.name = name; - this.returnType = returnType; - this.hasParenthesesIfNoArguments = hasParenthesesIfNoArguments; + Name = name; + FunctionReturnType = returnType; + HasParenthesesIfNoArguments = hasParenthesesIfNoArguments; } - protected IType FunctionReturnType - { - get { return returnType; } - } + public IType FunctionReturnType { get; protected set; } - protected string Name - { - get { return name; } - } + public string Name { get; protected set; } #region ISQLFunction Members public IType ReturnType(IType columnType, IMapping mapping) { - return returnType; + return FunctionReturnType; } public bool HasArguments @@ -47,24 +38,21 @@ get { return false; } } - public bool HasParenthesesIfNoArguments - { - get { return hasParenthesesIfNoArguments; } - } + public bool HasParenthesesIfNoArguments { get; protected set; } public virtual SqlString Render(IList args, ISessionFactoryImplementor factory) { if (args.Count > 0) { - throw new QueryException("function takes no arguments: " + name); + throw new QueryException("function takes no arguments: " + Name); } - if (hasParenthesesIfNoArguments) + if (HasParenthesesIfNoArguments) { - return new SqlString(name + "()"); + return new SqlString(Name + "()"); } - return new SqlString(name); + return new SqlString(Name); } #endregion Modified: trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-01-10 12:47:32 UTC (rev 3985) +++ trunk/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs 2009-01-10 15:10:34 UTC (rev 3986) @@ -260,7 +260,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory) { - return new SqlString(name); + return new SqlString(Name); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-10 12:47:37
|
Revision: 3985 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3985&view=rev Author: fabiomaulo Date: 2009-01-10 12:47:32 +0000 (Sat, 10 Jan 2009) Log Message: ----------- Test for NH-1584 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Calico.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Cat.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/CoatPattern.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Female.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Male.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Tabby.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Calico.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Calico.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Calico.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,19 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + /// <summary> + /// This class describes a few of the attributes possbile for a "Calico" coat. + /// </summary> + public class Calico : CoatPattern + { + public Calico() + { + Description = "Orange, black and white coloration."; + } + + public virtual Female Cat { get; set; } + + public virtual bool HasPatches { get; set; } + + public virtual bool IsMottled { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Cat.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Cat.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Cat.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,9 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + public abstract class Cat + { + public virtual int Id { get; private set; } + + public virtual string Name { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/CoatPattern.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/CoatPattern.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/CoatPattern.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,9 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + public abstract class CoatPattern + { + public virtual int Id { get; private set; } + + public virtual string Description { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Female.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Female.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Female.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,23 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + /// <summary> + /// This class assumes that all female cats have a calico coat (which is not actually true). + /// </summary> + public class Female : Cat + { + private Calico _coat; + + public virtual Calico Coat + { + get { return _coat; } + set + { + if (value != null) + { + _coat = value; + _coat.Cat = this; + } + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Male.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Male.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Male.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,23 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + /// <summary> + /// This class assumes that all male cats have a tabby coat pattern (which is not true). + /// </summary> + public class Male : Cat + { + private Tabby _coat; + + public virtual Tabby Coat + { + get { return _coat; } + set + { + if (value != null) + { + _coat = value; + _coat.Cat = this; + } + } + } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Mappings.hbm.xml (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Mappings.hbm.xml 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" + assembly="NHibernate.Test" + namespace="NHibernate.Test.NHSpecificTest.NH1584" > + <class name="Cat" abstract="true" > + <id name="Id" unsaved-value="0"> + <generator class="native"/> + </id> + <property name="Name"/> + + <joined-subclass name="Male"> + <key column="CatId"/> + <one-to-one name="Coat" cascade="all"/> + </joined-subclass> + + <joined-subclass name="Female"> + <key column="CatId"/> + <one-to-one name="Coat" cascade="all"/> + </joined-subclass> + </class> + + <class name="Tabby"> + <id name="Id"> + <generator class="foreign"> + <param name="property">Cat</param> + </generator> + </id> + <property name="HasSpots" /> + <property name="HasStripes" /> + <property name="HasSwirls" /> + <one-to-one name="Cat" constrained="true"/> + </class> + + <class name="Calico"> + <id name="Id"> + <generator class="foreign"> + <param name="property">Cat</param> + </generator> + </id> + <property name="HasPatches" /> + <property name="IsMottled" /> + <one-to-one name="Cat" constrained="true"/> + </class> + +</hibernate-mapping> Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Tabby.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Tabby.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/Tabby.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,21 @@ +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + /// <summary> + /// This class describes a few of the properties of a "Tabby" coat pattern. + /// </summary> + public class Tabby : CoatPattern + { + public Tabby() + { + Description = "A distinctive coat that features stripes, dots, or swirling patterns."; + } + + public virtual Male Cat { get; set; } + + public virtual bool HasSpots { get; set; } + + public virtual bool HasStripes { get; set; } + + public virtual bool HasSwirls { get; set; } + } +} \ No newline at end of file Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs (rev 0) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1584/TestFixture.cs 2009-01-10 12:47:32 UTC (rev 3985) @@ -0,0 +1,60 @@ +/* + The documentation for NHibernate likes to work with cats / kittens for examples or demonstrations. +*/ +using NHibernate.Criterion; +using NUnit.Framework; + +namespace NHibernate.Test.NHSpecificTest.NH1584 +{ + [TestFixture, Ignore("Not supported yet.")] + public class TestFixture : BugTestCase + { + public override string BugNumber + { + get { return "NH1584"; } + } + + protected override void OnTearDown() + { + using (ISession session = OpenSession()) + { + using (ITransaction trx = session.BeginTransaction()) + { + session.Delete("from Male"); + trx.Commit(); + } + } + } + + /// <summary> + /// Demostrate that the session is able to load the one-to-one composition between a joined subclass and its related entity. + /// </summary> + [Test] + public void Load_One_To_One_Composition_For_Joined_Subclass_Succeeds() + { + var tabby = new Tabby {HasSpots = true, HasStripes = true, HasSwirls = false}; + + var newInstance = new Male {Name = "Male", Coat = tabby}; + + using (ISession session = OpenSession()) + { + using (ITransaction trx = session.BeginTransaction()) + { + session.Save(newInstance); + trx.Commit(); + } + } + + Assert.AreNotEqual(0, newInstance.Id); + Assert.AreNotEqual(0, tabby.Id); + + using (ISession session = OpenSession()) + { + ICriteria criteria = session.CreateCriteria(typeof (Cat)); + var loaded = criteria.Add(Restrictions.Eq("Id", newInstance.Id)).UniqueResult<Male>(); + + Assert.IsNotNull(loaded.Coat); + } + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 02:25:05 UTC (rev 3984) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 12:47:32 UTC (rev 3985) @@ -382,6 +382,13 @@ <Compile Include="NHSpecificTest\NH1549\EntityInt32.cs" /> <Compile Include="NHSpecificTest\NH1549\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1549\ProductWithInheritedId.cs" /> + <Compile Include="NHSpecificTest\NH1584\Calico.cs" /> + <Compile Include="NHSpecificTest\NH1584\Cat.cs" /> + <Compile Include="NHSpecificTest\NH1584\CoatPattern.cs" /> + <Compile Include="NHSpecificTest\NH1584\Female.cs" /> + <Compile Include="NHSpecificTest\NH1584\Male.cs" /> + <Compile Include="NHSpecificTest\NH1584\Tabby.cs" /> + <Compile Include="NHSpecificTest\NH1584\TestFixture.cs" /> <Compile Include="NHSpecificTest\NH1605\Fixture.cs" /> <Compile Include="NHSpecificTest\NH1609\Entities.cs" /> <Compile Include="NHSpecificTest\NH1609\Fixture.cs" /> @@ -1590,6 +1597,7 @@ <EmbeddedResource Include="Cascade\JobBatch.hbm.xml" /> <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> + <EmbeddedResource Include="NHSpecificTest\NH1584\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1632\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1612\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1549\Mappings.hbm.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-10 02:25:10
|
Revision: 3984 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3984&view=rev Author: ayenderahien Date: 2009-01-10 02:25:05 +0000 (Sat, 10 Jan 2009) Log Message: ----------- TableHiLoGenerator - now can safely create hilo ids inside DTC transactions. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Id/TableGenerator.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Model.cs trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj Modified: trunk/nhibernate/src/NHibernate/Id/TableGenerator.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Id/TableGenerator.cs 2009-01-09 23:31:13 UTC (rev 3983) +++ trunk/nhibernate/src/NHibernate/Id/TableGenerator.cs 2009-01-10 02:25:05 UTC (rev 3984) @@ -13,6 +13,8 @@ namespace NHibernate.Id { + using System.Transactions; + /// <summary> /// An <see cref="IIdentifierGenerator" /> that uses a database table to store the last /// generated value. @@ -158,21 +160,27 @@ bool isSQLite = session.Factory.Dialect is SQLiteDialect; IDbConnection conn; + TransactionScope dtcTrans = null; if (isSQLite) { conn = session.Connection; } else { + // existing dtc transaction, creating a new one + // to override the ambient one + if (Transaction.Current != null) + dtcTrans = new TransactionScope(TransactionScopeOption.RequiresNew); conn = session.Factory.ConnectionProvider.GetConnection(); } + IDbTransaction trans = null; try { - IDbTransaction trans = null; if (!isSQLite) { - trans = conn.BeginTransaction(); + if(dtcTrans==null) + trans = conn.BeginTransaction(); } long result; @@ -239,7 +247,10 @@ if (!isSQLite) { - trans.Commit(); + if (dtcTrans != null) + dtcTrans.Complete(); + else + trans.Commit(); } return result; @@ -249,6 +260,8 @@ { if (!isSQLite) { + if(dtcTrans!=null) + dtcTrans.Dispose(); session.Factory.ConnectionProvider.CloseConnection(conn); } } Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-01-09 23:31:13 UTC (rev 3983) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-01-10 02:25:05 UTC (rev 3984) @@ -6,6 +6,8 @@ using System.Transactions; using Cache; using Cfg; + using Engine; + using Id; [TestFixture] public class Fixture : BugTestCase @@ -23,6 +25,42 @@ } [Test] + public void When_using_DTC_HiLo_knows_to_create_isolated_DTC_transaction() + { + object scalar1, scalar2; + + using (var session = sessions.OpenSession()) + using (var command = session.Connection.CreateCommand()) + { + command.CommandText = "select next_hi from hibernate_unique_key with (updlock, rowlock)"; + scalar1 = command.ExecuteScalar(); + } + + using (var tx = new TransactionScope()) + { + var generator = sessions.GetIdentifierGenerator(typeof(Person).FullName); + Assert.IsInstanceOfType(typeof(TableHiLoGenerator), generator); + + using(var session = sessions.OpenSession()) + { + var id = generator.Generate((ISessionImplementor) session, new Person()); + } + + // intentionally dispose without committing + tx.Dispose(); + } + + using (var session = sessions.OpenSession()) + using (var command = session.Connection.CreateCommand()) + { + command.CommandText = "select next_hi from hibernate_unique_key with (updlock, rowlock)"; + scalar2 = command.ExecuteScalar(); + } + + Assert.AreNotEqual(scalar1, scalar2,"HiLo must run with in its own transaction"); + } + + [Test] public void Dispose_session_inside_transaction_scope() { ISession s; Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml 2009-01-09 23:31:13 UTC (rev 3983) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml 2009-01-10 02:25:05 UTC (rev 3984) @@ -14,4 +14,14 @@ <property name="NumB"/> <property name="Sum" access="readonly"/> </class> + + <class name="Person"> + <cache usage="read-write" /> + + <id name="Id"> + <generator class="hilo"/> + </id> + + <property name="Name"/> + </class> </hibernate-mapping> Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Model.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Model.cs 2009-01-09 23:31:13 UTC (rev 3983) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Model.cs 2009-01-10 02:25:05 UTC (rev 3984) @@ -14,4 +14,10 @@ } } } + + public class Person + { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } } Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-09 23:31:13 UTC (rev 3983) +++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-01-10 02:25:05 UTC (rev 3984) @@ -1591,10 +1591,6 @@ <EmbeddedResource Include="Deletetransient\Person.hbm.xml" /> <Content Include="DynamicEntity\package.html" /> <EmbeddedResource Include="NHSpecificTest\NH1632\Mappings.hbm.xml" /> - - - - <EmbeddedResource Include="NHSpecificTest\NH1612\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1549\Mappings.hbm.xml" /> <EmbeddedResource Include="NHSpecificTest\NH1521\AclassWithSpecific.hbm.xml" /> @@ -1706,4 +1702,4 @@ if exist "$(ProjectDir)hibernate.cfg.xml" (copy "$(ProjectDir)hibernate.cfg.xml" "hibernate.cfg.xml") copy /y "..\..\..\NHibernate.DomainModel\ABC.hbm.xml" "ABC.hbm.xml"</PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-09 23:31:21
|
Revision: 3983 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3983&view=rev Author: ayenderahien Date: 2009-01-09 23:31:13 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Logging the isolation level for DTC tx. Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-09 20:48:07 UTC (rev 3982) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-09 23:31:13 UTC (rev 3983) @@ -295,7 +295,7 @@ if (System.Transactions.Transaction.Current==null) return; ambientTransation = System.Transactions.Transaction.Current; - logger.Debug("enlisted into DTC transaction"); + logger.DebugFormat("enlisted into DTC transaction: {0}", ambientTransation.IsolationLevel); AfterTransactionBegin(null); ambientTransation.TransactionCompleted += delegate(object sender, TransactionEventArgs e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-09 20:48:17
|
Revision: 3982 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3982&view=rev Author: ayenderahien Date: 2009-01-09 20:48:07 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Adding a passing test for NH 545 Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-01-09 11:49:30 UTC (rev 3981) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Fixture.cs 2009-01-09 20:48:07 UTC (rev 3982) @@ -4,6 +4,8 @@ namespace NHibernate.Test.NHSpecificTest.NH1632 { using System.Transactions; + using Cache; + using Cfg; [TestFixture] public class Fixture : BugTestCase @@ -13,6 +15,13 @@ get { return "NH1632"; } } + protected override void Configure(Configuration configuration) + { + configuration + .SetProperty(Environment.UseSecondLevelCache, "true") + .SetProperty(Environment.CacheProvider, typeof (HashtableCacheProvider).AssemblyQualifiedName); + } + [Test] public void Dispose_session_inside_transaction_scope() { @@ -30,7 +39,55 @@ Assert.IsFalse(s.IsOpen); } + [Test] + public void When_commiting_items_in_DTC_transaction_will_add_items_to_2nd_level_cache() + { + using (var tx = new TransactionScope()) + { + using (var s = sessions.OpenSession()) + { + s.Save(new Nums {ID = 29, NumA = 1, NumB = 3}); + } + tx.Complete(); + } + + using (var tx = new TransactionScope()) + { + using (var s = sessions.OpenSession()) + { + var nums = s.Load<Nums>(29); + Assert.AreEqual(1, nums.NumA); + Assert.AreEqual(3, nums.NumB); + } + tx.Complete(); + } + + //closing the connection to ensure we can't really use it. + var connection = sessions.ConnectionProvider.GetConnection(); + sessions.ConnectionProvider.CloseConnection(connection); + + using (var tx = new TransactionScope()) + { + using (var s = sessions.OpenSession(connection)) + { + var nums = s.Load<Nums>(29); + Assert.AreEqual(1, nums.NumA); + Assert.AreEqual(3, nums.NumB); + } + tx.Complete(); + } + + using (var s = sessions.OpenSession()) + using (var tx = s.BeginTransaction()) + { + var nums = s.Load<Nums>(29); + s.Delete(nums); + tx.Commit(); + } + } + + [Test] public void When_committing_transaction_scope_will_commit_transaction() { object id; Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml =================================================================== --- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml 2009-01-09 11:49:30 UTC (rev 3981) +++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1632/Mappings.hbm.xml 2009-01-09 20:48:07 UTC (rev 3982) @@ -4,9 +4,12 @@ assembly="NHibernate.Test" > <class name="Nums" table="nums"> + <cache usage="read-write" /> + <id name="ID"> <generator class="assigned"/> </id> + <property name="NumA"/> <property name="NumB"/> <property name="Sum" access="readonly"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aye...@us...> - 2009-01-09 12:56:07
|
Revision: 3981 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3981&view=rev Author: ayenderahien Date: 2009-01-09 11:49:30 +0000 (Fri, 09 Jan 2009) Log Message: ----------- Adding logging for DTC operations Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs Modified: trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-08 16:21:22 UTC (rev 3980) +++ trunk/nhibernate/src/NHibernate/Impl/AbstractSessionImpl.cs 2009-01-09 11:49:30 UTC (rev 3981) @@ -17,6 +17,8 @@ namespace NHibernate.Impl { + using log4net; + /// <summary> Functionality common to stateless and stateful sessions </summary> [Serializable] public abstract class AbstractSessionImpl : ISessionImplementor, IEnlistmentNotification @@ -28,6 +30,8 @@ private bool isAlreadyDisposed; protected bool shouldCloseSessionOnDtcTransactionCompleted; + private static readonly ILog logger = LogManager.GetLogger(typeof (AbstractSessionImpl)); + protected bool TakingPartInDtcTransaction { get @@ -259,10 +263,12 @@ Flush(); } preparingEnlistment.Prepared(); + logger.Debug("prepared for DTC transaction"); } void IEnlistmentNotification.Commit(Enlistment enlistment) { + logger.Debug("committing DTC transaction"); // we have nothing to do here, since it is the actual // DB connection that will commit the transaction enlistment.Done(); @@ -271,12 +277,14 @@ void IEnlistmentNotification.Rollback(Enlistment enlistment) { AfterTransactionCompletion(false, null); + logger.Debug("rolled back DTC transaction"); enlistment.Done(); } void IEnlistmentNotification.InDoubt(Enlistment enlistment) { AfterTransactionCompletion(false, null); + logger.Debug("DTC transaction is in doubt"); enlistment.Done(); } @@ -287,6 +295,7 @@ if (System.Transactions.Transaction.Current==null) return; ambientTransation = System.Transactions.Transaction.Current; + logger.Debug("enlisted into DTC transaction"); AfterTransactionBegin(null); ambientTransation.TransactionCompleted += delegate(object sender, TransactionEventArgs e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fab...@us...> - 2009-01-08 16:21:32
|
Revision: 3980 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3980&view=rev Author: fabiomaulo Date: 2009-01-08 16:21:22 +0000 (Thu, 08 Jan 2009) Log Message: ----------- Minor Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/App.config Modified: trunk/nhibernate/src/NHibernate.Test/App.config =================================================================== --- trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-05 23:22:36 UTC (rev 3979) +++ trunk/nhibernate/src/NHibernate.Test/App.config 2009-01-08 16:21:22 UTC (rev 3980) @@ -123,7 +123,7 @@ </logger> <logger name="NHibernate.SQL"> - <level value="DEBUG" /> + <level value="OFF" /> </logger> <logger name="NHibernate.Tool.hbm2ddl.SchemaExport"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nhi...@li...> - 2009-01-06 12:11:57
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <div align="left"> <table border="0" width="650" cellpadding="0"> <tr> <td valign="bottom"> <blockquote> <p align="center"><font face="Tahoma">If you are unable to see the message below, <a href="http://dbyw.memaduruv.cn/view.php?0217651213ec4a79f5c6d0051d946"> click here</a> to view.</font></p> </blockquote> </td> </tr> <tr> <td valign="bottom"> <blockquote> <p align="center"><font size="2" face="Arial"><br> </font><a href="http://hgis.memaduruv.cn/"> <img src="http://img.memaduruv.cn/wide.jpg" border=0></a></p> </blockquote> </td> </tr> <tr> <td valign="bottom"> <blockquote> <blockquote> <p><font size="2" face="Arial"><br> Thank you for your interest in Advertising Products Inc.<br><br>You are receiving this e-mail because you have subscribed to product updates.<br><br>If you want to unsubscribe from Advertising Products Inc. Newsletter, please visit <a href="http://peigmj.memaduruv.cn/remove.php?msgid=9cfa9e176a2060a0fe1440b768aa5&user=nhi...@li..."> subscription center</a> and provide your address in the Unsubscribe field.<br><br> Copyright (C) 2008, Advertising Products Inc.<br>4000 N 7th St Phoenix, AZ 85014 </font><br> </p> </blockquote> </blockquote> </td> </tr> </table> </div> </body> </html> |
From: <aye...@us...> - 2009-01-05 23:22:39
|
Revision: 3979 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3979&view=rev Author: ayenderahien Date: 2009-01-05 23:22:36 +0000 (Mon, 05 Jan 2009) Log Message: ----------- log output is more easily parsable Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Util/CollectionPrinter.cs trunk/nhibernate/src/NHibernate.Test/QueryTest/MultipleQueriesFixture.cs Modified: trunk/nhibernate/src/NHibernate/Util/CollectionPrinter.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Util/CollectionPrinter.cs 2009-01-05 14:13:16 UTC (rev 3978) +++ trunk/nhibernate/src/NHibernate/Util/CollectionPrinter.cs 2009-01-05 23:22:36 UTC (rev 3979) @@ -24,7 +24,10 @@ } else { - builder.Append(value); + builder + .Append("'") + .Append(value) + .Append("'"); } } Modified: trunk/nhibernate/src/NHibernate.Test/QueryTest/MultipleQueriesFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/QueryTest/MultipleQueriesFixture.cs 2009-01-05 14:13:16 UTC (rev 3978) +++ trunk/nhibernate/src/NHibernate.Test/QueryTest/MultipleQueriesFixture.cs 2009-01-05 23:22:36 UTC (rev 3979) @@ -50,7 +50,7 @@ } [Test] - [ExpectedException(typeof(QueryException), ExpectedMessage = "Not all named parameters have been set: [ids] [from Item i where i.Id in (:ids)]")] + [ExpectedException(typeof(QueryException), ExpectedMessage = "Not all named parameters have been set: ['ids'] [from Item i where i.Id in (:ids)]")] public void NH_1085_WillGiveReasonableErrorIfBadParameterName() { using (ISession s = sessions.OpenSession()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |