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: Kevin W. <kev...@us...> - 2005-04-04 04:23:11
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches/SysCache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27718/SysCache Log Message: Directory /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches/SysCache added to the repository |
From: Kevin W. <kev...@us...> - 2005-04-04 04:22:57
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches/Prevalence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27679/Prevalence Log Message: Directory /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches/Prevalence added to the repository |
From: Kevin W. <kev...@us...> - 2005-04-04 04:22:19
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27599/NHibernate.Caches Log Message: Directory /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Caches added to the repository |
From: Donald L M. Jr. <lu...@us...> - 2005-04-01 20:50:23
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12860/src/Nullables Modified Files: AssemblyInfo.cs NullableSByte.cs Log Message: Added CLSCompliant(true) to the nullable assemblies (and CLSCompiant(false) to the NullableSByte because it isn't. Index: NullableSByte.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables/NullableSByte.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSByte.cs 8 Feb 2005 19:13:11 -0000 1.2 --- NullableSByte.cs 1 Apr 2005 20:49:58 -0000 1.3 *************** *** 5,9 **** namespace Nullables { ! [System.ComponentModel.TypeConverter(typeof(Nullables.TypeConverters.NullableSByteConverter)), Serializable()] public struct NullableSByte : INullableType, IFormattable, IComparable { --- 5,9 ---- namespace Nullables { ! [System.ComponentModel.TypeConverter(typeof(Nullables.TypeConverters.NullableSByteConverter)), Serializable(), CLSCompliant(false)] public struct NullableSByte : INullableType, IFormattable, IComparable { Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables/AssemblyInfo.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AssemblyInfo.cs 1 Mar 2005 16:24:39 -0000 1.8 --- AssemblyInfo.cs 1 Apr 2005 20:49:58 -0000 1.9 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Reflection; using System.Runtime.CompilerServices; *************** *** 12,15 **** --- 13,17 ---- //------------------------------------------------------------------------------ + [assembly: CLSCompliant(true)] [assembly: AssemblyTitleAttribute("Nullables for Microsoft .NET Framework 1.1")] [assembly: AssemblyDescriptionAttribute("A library of Nullable Primitive Types to serve as a bridge to .net-2.0.")] *************** *** 21,23 **** [assembly: AssemblyFileVersionAttribute("0.6.0.0")] //[assembly: AssemblyKeyFileAttribute("..\\NHibernate.snk")] - --- 23,24 ---- |
From: Paul H. <pha...@us...> - 2005-03-31 16:17:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12811/nhibernate/src/NHibernate.DomainModel Modified Files: ParentChild.hbm.xml Log Message: Case error on property Any Index: ParentChild.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ParentChild.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ParentChild.hbm.xml 31 Mar 2005 12:40:23 -0000 1.6 --- ParentChild.hbm.xml 31 Mar 2005 16:16:55 -0000 1.7 *************** *** 11,15 **** <property name="Count" column="count_"/> <one-to-one name="Child"/> ! <property name="any" type="object"> <column name="any_id"/> <column name="any_class"/> --- 11,15 ---- <property name="Count" column="count_"/> <one-to-one name="Child"/> ! <property name="Any" type="object"> <column name="any_id"/> <column name="any_class"/> |
From: Paul H. <pha...@us...> - 2005-03-31 12:42:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19247/nhibernate/src/NHibernate.Test Modified Files: ABCProxyTest.cs ABCTest.cs FooBarTest.cs FumTest.cs MultiTableTest.cs NHibernate.Test-1.1.csproj ParentChildTest.cs SQLFunctionsTest.cs SQLLoaderTest.cs Added Files: BlobClobTest.cs NewerPerformanceTest.cs Log Message: Enhanced test suite as per 2.1 - tests marked with Ignore where not implemented Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** NHibernate.Test-1.1.csproj 28 Mar 2005 12:45:57 -0000 1.68 --- NHibernate.Test-1.1.csproj 31 Mar 2005 12:42:39 -0000 1.69 *************** *** 129,132 **** --- 129,137 ---- /> <File + RelPath = "BlobClobTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "CriteriaTest.cs" SubType = "Code" *************** *** 163,166 **** --- 168,176 ---- /> <File + RelPath = "NewerPerformanceTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NewPerformanceTest.cs" SubType = "Code" Index: SQLFunctionsTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLFunctionsTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SQLFunctionsTest.cs 1 Jan 2005 20:39:38 -0000 1.7 --- SQLFunctionsTest.cs 31 Mar 2005 12:42:39 -0000 1.8 *************** *** 46,49 **** --- 46,54 ---- [Test] + [Ignore("Test not written yet.")] + public void DialectSQLFunctions() + { + } + [Test] public void SetProperties() { *************** *** 61,64 **** --- 66,76 ---- } + + [Test] + [Ignore("Test not written yet.")] + public void Broken() + { + } + [Test] public void NothingToUpdate() *************** *** 87,90 **** --- 99,126 ---- } + + [Test] + [Ignore("Test not written yet.")] + public void CachedQuery() + { + } + [Test] + [Ignore("Test not written yet.")] + public void SQLFunctionAsAlias() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CachedQueryOnInsert() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CachedQueryRegion() + { + } + [Test] public void SQLFunctions() *************** *** 234,243 **** } - [Test] - [Ignore("BLOB/CLOB not implmented like h2.0.3 - http://jira.nhibernate.org:8080/browse/NH-19")] - public void BlobClob() - { - } - } --- 270,273 ---- Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ParentChildTest.cs 17 Jan 2005 03:40:51 -0000 1.12 --- ParentChildTest.cs 31 Mar 2005 12:42:39 -0000 1.13 *************** *** 63,66 **** --- 63,96 ---- [Test] + [Ignore("Test not written yet.")] + public void Replicate() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void QueryOneToOne() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ProxyReuse() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ComplexCriteria() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ClassWhere() + { + } + + [Test] public void CollectionQuery() { *************** *** 697,723 **** } ! // [Test] ! // public void ObjectType() ! // { ! // ISession s = sessions.OpenSession(); ! // Parent g = new Parent(); ! // Foo foo = new Foo(); ! // g.Any = foo; ! // s.Save(g); ! // s.Save(foo); ! // s.Flush(); ! // s.Close(); ! // ! // s = sessions.OpenSession(); ! // g = (Parent)s.Load( typeof(Parent), g.Id ); ! // Assert.IsNotNull( g.Any ); ! // Assert.IsTrue( g.Any is FooProxy ); ! // s.Delete( g.Any ); ! // s.Delete(g); ! // s.Flush(); ! // s.Close(); ! // } ! } } --- 727,751 ---- } ! [Test] ! public void ObjectType() ! { ! ISession s = sessions.OpenSession(); ! Parent g = new Parent(); ! Foo foo = new Foo(); ! g.Any = foo; ! s.Save(g); ! s.Save(foo); ! s.Flush(); ! s.Close(); + s = sessions.OpenSession(); + g = (Parent)s.Load( typeof(Parent), g.Id ); + Assert.IsNotNull( g.Any ); + Assert.IsTrue( g.Any is FooProxy ); + s.Delete( g.Any ); + s.Delete(g); + s.Flush(); + s.Close(); + } } } Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** FumTest.cs 17 Jan 2005 03:40:51 -0000 1.18 --- FumTest.cs 31 Mar 2005 12:42:39 -0000 1.19 *************** *** 65,103 **** #endregion ! public static FumCompositeID FumKey(String str) { - - return FumKey(str,false); } ! ! public static FumCompositeID FumKey(String str, bool aCompositeQueryTest) { - FumCompositeID id = new FumCompositeID(); - // if( dialect is Dialect.MckoiDialect ) - // { - // GregorianCalendar now = new GregorianCalendar(); - // GregorianCalendar cal = new GregorianCalendar( - // now.get(java.util.Calendar.YEAR), - // now.get(java.util.Calendar.MONTH), - // now.get(java.util.Calendar.DATE) - // ); - // id.setDate( cal.getTime() ); - // } - // else - // { - id.Date = new DateTime(2004, 4, 29, 9, 0, 0, 0); - // } - id.String = str; - - if (aCompositeQueryTest) - { - id.Short = fumKeyShort++ ; - } - else - { - id.Short = (short)12 ; - } - - return id; } --- 65,78 ---- #endregion ! [Test] ! [Ignore("Test not written")] ! public void CriteriaCollection() { } ! ! [Test] ! [Ignore("Test not written")] ! public void Criteria() { } *************** *** 135,142 **** s.Flush(); s.Close(); - - } [Test] public void CompositeID() --- 110,151 ---- s.Flush(); s.Close(); } + public static FumCompositeID FumKey(String str) + { + return FumKey(str,false); + } + + public static FumCompositeID FumKey(String str, bool aCompositeQueryTest) + { + FumCompositeID id = new FumCompositeID(); + // if( dialect is Dialect.MckoiDialect ) + // { + // GregorianCalendar now = new GregorianCalendar(); + // GregorianCalendar cal = new GregorianCalendar( + // now.get(java.util.Calendar.YEAR), + // now.get(java.util.Calendar.MONTH), + // now.get(java.util.Calendar.DATE) + // ); + // id.setDate( cal.getTime() ); + // } + // else + // { + id.Date = new DateTime(2004, 4, 29, 9, 0, 0, 0); + // } + id.String = str; + + if (aCompositeQueryTest) + { + id.Short = fumKeyShort++ ; + } + else + { + id.Short = (short)12 ; + } + + return id; + } + [Test] public void CompositeID() *************** *** 421,425 **** - [Test] [Ignore("HQL can't parse a class named 'Order' - http://jira.nhibernate.org:8080/browse/NH-81, this test passes when changed to NHibernate.DomainModel")] --- 430,433 ---- *************** *** 473,476 **** --- 481,504 ---- s.Close(); } + + + [Test] + [Ignore("Test not written")] + public void CompositeKeyPathExpressions() + { + } + + [Test] + [Ignore("Test not written")] + public void UnflushedSessionSerialization() + { + } + + private ISession SpoofSerialization( ISession session) + { + // TODO: Not test method - implement details + + return null; + } } } Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ABCProxyTest.cs 26 Mar 2005 14:10:51 -0000 1.14 --- ABCProxyTest.cs 31 Mar 2005 12:42:39 -0000 1.15 *************** *** 43,47 **** [Test] ! //[Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] public void Subclassing() { --- 43,64 ---- [Test] ! [Ignore("Test not written")] ! public void DiscriminatorFiltering() ! { ! } ! ! [Test] ! [Ignore("Test not written")] ! public void OptionalOneToOneInCollection() ! { ! } ! ! [Test] ! [Ignore("Test not written")] ! public void SharedColumn() ! { ! } ! ! [Test] public void Subclassing() { Index: SQLLoaderTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLLoaderTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SQLLoaderTest.cs 27 Mar 2005 23:30:26 -0000 1.2 --- SQLLoaderTest.cs 31 Mar 2005 12:42:39 -0000 1.3 *************** *** 53,57 **** [Test] ! public void TestTS() { if ( dialect is NHibernate.Dialect.Oracle9Dialect ) --- 53,57 ---- [Test] ! public void TS() { if ( dialect is NHibernate.Dialect.Oracle9Dialect ) *************** *** 74,78 **** [Test] ! public void TestTSNamed() { if ( dialect is NHibernate.Dialect.Oracle9Dialect ) --- 74,78 ---- [Test] ! public void TSNamed() { if ( dialect is NHibernate.Dialect.Oracle9Dialect ) *************** *** 95,99 **** [Test] ! public void TestFindBySQLStar() { ISession session = sessions.OpenSession(); --- 95,99 ---- [Test] ! public void FindBySQLStar() { ISession session = sessions.OpenSession(); *************** *** 127,131 **** [Test] ! public void TestFindBySQLProperties() { ISession session = sessions.OpenSession(); --- 127,131 ---- [Test] ! public void FindBySQLProperties() { ISession session = sessions.OpenSession(); *************** *** 151,155 **** [Test] ! public void TestFindBySQLAssociatedObject() { ISession s = sessions.OpenSession(); --- 151,155 ---- [Test] ! public void FindBySQLAssociatedObject() { ISession s = sessions.OpenSession(); *************** *** 178,182 **** [Test] ! public void TestFindBySQLMultipleObject() { ISession s = sessions.OpenSession(); --- 178,182 ---- [Test] ! public void FindBySQLMultipleObject() { ISession s = sessions.OpenSession(); *************** *** 227,231 **** [Test] [Ignore("Test not written")] ! public void TestFindBySQLParameters() { } --- 227,231 ---- [Test] [Ignore("Test not written")] ! public void FindBySQLParameters() { } *************** *** 233,237 **** [Test] [Ignore("Test not written")] ! public void TestEscapedODBC() { } --- 233,237 ---- [Test] [Ignore("Test not written")] ! public void EscapedODBC() { } *************** *** 239,243 **** [Test] [Ignore("Test not written")] ! public void TestDoubleAliasing() { } --- 239,243 ---- [Test] [Ignore("Test not written")] ! public void DoubleAliasing() { } *************** *** 245,249 **** [Test] [Ignore("Test not written")] ! public void TestEmbeddedCompositeProperties() { } --- 245,249 ---- [Test] [Ignore("Test not written")] ! public void EmbeddedCompositeProperties() { } *************** *** 251,255 **** [Test] [Ignore("Test not written")] ! public void TestComponentStar() { } --- 251,255 ---- [Test] [Ignore("Test not written")] ! public void ComponentStar() { } *************** *** 257,261 **** [Test] [Ignore("Test not written")] ! public void TestComponentNoStar() { } --- 257,261 ---- [Test] [Ignore("Test not written")] ! public void ComponentNoStar() { } *************** *** 267,271 **** [Test] [Ignore("Test not written")] ! public void TestFindSimpleBySQL() { } --- 267,271 ---- [Test] [Ignore("Test not written")] ! public void FindSimpleBySQL() { } *************** *** 273,277 **** [Test] [Ignore("Test not written")] ! public void TestFindBySQLSimpleByDiffSessions() { } --- 273,277 ---- [Test] [Ignore("Test not written")] ! public void FindBySQLSimpleByDiffSessions() { } *************** *** 279,283 **** [Test] [Ignore("Test not written")] ! public void TestFindBySQLDiscriminatorSameSession() { } --- 279,283 ---- [Test] [Ignore("Test not written")] ! public void FindBySQLDiscriminatorSameSession() { } *************** *** 285,289 **** [Test] [Ignore("Test not written")] ! public void TestFindBySQLDiscriminatedDiffSessions() { } --- 285,289 ---- [Test] [Ignore("Test not written")] ! public void FindBySQLDiscriminatedDiffSessions() { } *************** *** 291,295 **** [Test] [Ignore("Test not written")] ! public void TestNamedSQLQuery() { } --- 291,295 ---- [Test] [Ignore("Test not written")] ! public void NamedSQLQuery() { } Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** FooBarTest.cs 29 Mar 2005 05:33:14 -0000 1.89 --- FooBarTest.cs 31 Mar 2005 12:42:39 -0000 1.90 *************** *** 38,48 **** } ! /// <summary> ! /// ! /// </summary> ! /// <remarks> ! /// This test is still not completely working because it depends on Proxies which ! /// has not been implemented yet. ! /// </remarks> [Test] [...964 lines suppressed...] - } - } - - /// <summary> /// This test verifies that the AddAll() method works --- 3933,3936 ---- *************** *** 3786,3790 **** } } ! } } --- 3963,3967 ---- } } ! #endregion } } --- NEW FILE: BlobClobTest.cs --- using System; using NUnit.Framework; using NHibernate; using NHibernate.DomainModel; namespace NHibernate.Test { /// <summary> /// Summary description for BlobClobTest. /// </summary> [TestFixture] public class BlobClobTest : TestCase { [Test] [Ignore("BLOB/CLOB not implmented like h2.0.3 - http://jira.nhibernate.org:8080/browse/NH-19")] public void BlobClob() { } } } --- NEW FILE: NewerPerformanceTest.cs --- using System; using NHibernate.DomainModel; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for NewerPerformanceTest. /// </summary> [TestFixture] public class NewerPerformanceTest : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "Simple.hbm.xml"} ); } [Test] [Ignore("Test not written yet.")] public void Many() { } [Test] [Ignore("Test not written yet.")] public void Simultaneous() { } [Test] [Ignore("Test not written yet.")] public void NHibernateOnly() { } [Test] [Ignore("Test not written yet.")] public void AdoOnly() { } private void NHibernate() { //TODO: add details - not a test method } private void DirectAdo() { //TODO: add details - not a test method } } } Index: MultiTableTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MultiTableTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MultiTableTest.cs 14 Mar 2005 18:56:13 -0000 1.8 --- MultiTableTest.cs 31 Mar 2005 12:42:39 -0000 1.9 *************** *** 22,26 **** [Test] ! public void TestJoins() { ISession s = sessions.OpenSession(); --- 22,33 ---- [Test] ! [Ignore("Test not written yet.")] ! public void FetchManyToOne() ! { ! } ! ! ! [Test] ! public void Joins() { ISession s = sessions.OpenSession(); *************** *** 39,42 **** --- 46,55 ---- } + + [Test] + [Ignore("Test not written yet.")] + public void JoinOpenBug() + { + } [Test] public void SubclassCollection() Index: ABCTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCTest.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ABCTest.cs 1 Jan 2005 20:39:38 -0000 1.10 --- ABCTest.cs 31 Mar 2005 12:42:39 -0000 1.11 *************** *** 47,50 **** --- 47,62 ---- [Test] + [Ignore("Test not written")] + public void HigherLevelIndexDefinition() + { + } + + [Test] + [Ignore("Test not written")] + public void Subselect() + { + } + + [Test] public void Subclassing() { *************** *** 111,114 **** --- 123,132 ---- s.Close(); } + + [Test] + [Ignore("Test not written")] + public void GetSave() + { + } } } |
From: Paul H. <pha...@us...> - 2005-03-31 12:42:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19247/nhibernate/src/NHibernate.Test/ExpressionTest Modified Files: QueryByExampleTest.cs Log Message: Enhanced test suite as per 2.1 - tests marked with Ignore where not implemented Index: QueryByExampleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/QueryByExampleTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryByExampleTest.cs 28 Mar 2005 12:45:58 -0000 1.1 --- QueryByExampleTest.cs 31 Mar 2005 12:42:39 -0000 1.2 *************** *** 46,50 **** [Test] ! [Ignore("Test Fails with Exception - do to with Criteria parameter handling")] public void TestJunctionNotExpressionQBE() { --- 46,50 ---- [Test] ! [Ignore("Test Fails with Exception - do to with Criteria expression/parameter handling")] public void TestJunctionNotExpressionQBE() { |
From: Paul H. <pha...@us...> - 2005-03-31 12:41:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18784/nhibernate/src/NHibernate/Cfg Modified Files: Binder.cs Configuration.cs Log Message: Documentation typos Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Binder.cs 30 Mar 2005 16:28:22 -0000 1.46 --- Binder.cs 31 Mar 2005 12:41:27 -0000 1.47 *************** *** 722,726 **** } ! XmlAttribute fkNode = node.Attributes["foreign-key"]; if ( fkNode != null ) { --- 722,726 ---- } ! XmlAttribute fkNode = node.Attributes[ "foreign-key" ]; if ( fkNode != null ) { Index: Configuration.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Configuration.cs,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Configuration.cs 26 Mar 2005 13:24:36 -0000 1.36 --- Configuration.cs 31 Mar 2005 12:41:27 -0000 1.37 *************** *** 27,31 **** /// <para> /// The <c>Configuration</c> is meant only as an initialization-time object. <c>ISessionFactory</c>s ! /// are immutable and do not retain any assoication back to the <c>Configuration</c> /// </para> /// </remarks> --- 27,31 ---- /// <para> /// The <c>Configuration</c> is meant only as an initialization-time object. <c>ISessionFactory</c>s ! /// are immutable and do not retain any association back to the <c>Configuration</c> /// </para> /// </remarks> |
From: Paul H. <pha...@us...> - 2005-03-31 12:41:04
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18476/nhibernate Modified Files: releasenotes.txt Log Message: Added "foreign-key" attribute to many-to-one, one-to-one etc so primary/foreign column names can differ Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** releasenotes.txt 30 Mar 2005 16:28:08 -0000 1.29 --- releasenotes.txt 31 Mar 2005 12:40:22 -0000 1.30 *************** *** 15,18 **** --- 15,19 ---- - Added "unsaved-value" to version/timestamp as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime - Added SaveOrUpdateCopy which allows synchronisation for detached objects + - Added "foreign-key" attribute to many-to-one, one-to-one, many-to-many, key allowing a different column to be the foreign key target Build 0.7.0.0 |
From: Paul H. <pha...@us...> - 2005-03-31 12:40:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18476/nhibernate/src/NHibernate Modified Files: nhibernate-mapping-2.0.xsd Log Message: Added "foreign-key" attribute to many-to-one, one-to-one etc so primary/foreign column names can differ Index: nhibernate-mapping-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-mapping-2.0.xsd,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** nhibernate-mapping-2.0.xsd 30 Mar 2005 16:28:35 -0000 1.13 --- nhibernate-mapping-2.0.xsd 31 Mar 2005 12:40:24 -0000 1.14 *************** *** 554,557 **** --- 554,558 ---- <xs:attribute name="class" type="xs:string" use="required"/> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> </xs:complexType> </xs:element> *************** *** 575,578 **** --- 576,580 ---- </xs:sequence> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> </xs:complexType> </xs:element> *************** *** 586,589 **** --- 588,592 ---- <xs:attribute name="class" type="xs:string"/> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> </xs:complexType> </xs:element> *************** *** 617,620 **** --- 620,624 ---- <xs:attribute name="class" type="xs:string" use="required"/> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> <xs:attribute name="outer-join" type="outerJoinStrategy" default="auto"/> </xs:complexType> *************** *** 636,639 **** --- 640,644 ---- <xs:attribute name="update" type="xs:boolean" default="true"/> <xs:attribute name="insert" type="xs:boolean" default="true"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> <xs:attribute name="property-ref" type="xs:string"/> </xs:complexType> *************** *** 676,679 **** --- 681,685 ---- <xs:attribute name="outer-join" type="outerJoinStrategy" default="auto"/> <xs:attribute name="constrained" type="xs:boolean" default="false"/> + <xs:attribute name="foreign-key" type="xs:string" use="optional"/> <xs:attribute name="property-ref" type="xs:string"/> </xs:complexType> |
From: Paul H. <pha...@us...> - 2005-03-31 12:40:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18476/nhibernate/src/NHibernate.DomainModel Modified Files: Master.cs MasterDetail.hbm.xml Parent.cs ParentChild.hbm.xml Log Message: Added "foreign-key" attribute to many-to-one, one-to-one etc so primary/foreign column names can differ Index: ParentChild.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ParentChild.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ParentChild.hbm.xml 31 Aug 2004 20:24:23 -0000 1.5 --- ParentChild.hbm.xml 31 Mar 2005 12:40:23 -0000 1.6 *************** *** 1,10 **** <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! ! <class ! name="NHibernate.DomainModel.Parent, NHibernate.DomainModel" ! > <id name="Id" type="Int64" unsaved-value="0"> ! <generator class="native"> <!--seqhilo--> <!--<param>foo_seq</param>--> --- 1,7 ---- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Parent, NHibernate.DomainModel"> <id name="Id" type="Int64" unsaved-value="0"> ! <generator class="native"> <!--seqhilo--> <!--<param>foo_seq</param>--> *************** *** 14,34 **** <property name="Count" column="count_"/> <one-to-one name="Child"/> ! </class> ! ! <class ! name="NHibernate.DomainModel.Child, NHibernate.DomainModel" ! > <id name="Id" type="Int64" unsaved-value="0"> <generator class="assigned"/> </id> <property name="X"/> ! <one-to-one ! name="Parent" ! class="NHibernate.DomainModel.Parent, NHibernate.DomainModel" ! constrained="true" ! /> <property name="Count" column="count_"/> </class> ! ! </hibernate-mapping> \ No newline at end of file --- 11,26 ---- <property name="Count" column="count_"/> <one-to-one name="Child"/> ! <property name="any" type="object"> ! <column name="any_id"/> ! <column name="any_class"/> ! </property> </class> ! <class name="NHibernate.DomainModel.Child, NHibernate.DomainModel"> <id name="Id" type="Int64" unsaved-value="0"> <generator class="assigned"/> </id> <property name="X"/> ! <one-to-one name="Parent" class="NHibernate.DomainModel.Parent, NHibernate.DomainModel" constrained="true" foreign-key="parentfk"/> <property name="Count" column="count_"/> </class> ! </hibernate-mapping> Index: Master.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Master.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Master.cs 14 Mar 2005 19:04:36 -0000 1.6 --- Master.cs 31 Mar 2005 12:40:23 -0000 1.7 *************** *** 18,26 **** private Iesi.Collections.ISet _outgoing = new Iesi.Collections.HashedSet(); private string _name = "master"; ! // since this is a version column a value should be set. NHibernate is unable ! // to set it right now because it checks to see if value==null -> since this ! // is a struct it is not null... ! private DateTime stamp = DateTime.Now; ! // private BigDecimal bigDecimal = new BigDecimal("1234.123"); TODO: how to do in .net private int _x; --- 18,23 ---- private Iesi.Collections.ISet _outgoing = new Iesi.Collections.HashedSet(); private string _name = "master"; ! private DateTime version; ! //private BigDecimal bigDecimal = new BigDecimal("1234.123"); //TODO: how to do in .net private int _x; Index: MasterDetail.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/MasterDetail.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MasterDetail.hbm.xml 23 Aug 2004 02:11:53 -0000 1.4 --- MasterDetail.hbm.xml 31 Mar 2005 12:40:23 -0000 1.5 *************** *** 1,25 **** <?xml version="1.0"?> - <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! ! <class ! name="NHibernate.DomainModel.Master, NHibernate.DomainModel" ! > ! <id ! column="master_key" ! type="Int64" ! unsaved-value="0" ! > <generator class="native"/> </id> - <!--TODO: make sure this type has an equiv .net type--> ! <version ! name="stamp" ! type="Timestamp" ! column="ts_" ! access="field" ! /> ! <property name="Name"/> <property name="X"/> --- 1,10 ---- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Master, NHibernate.DomainModel"> ! <id column="master_key_column" type="Int64" unsaved-value="0"> <generator class="native"/> </id> <!--TODO: make sure this type has an equiv .net type--> ! <version name="version" type="Timestamp" column="ts_" access="field" unsaved-value="1/1/0001"/> <property name="Name"/> <property name="X"/> *************** *** 36,125 **** /> --> ! ! <set ! name="Details" ! inverse="true" ! lazy="true" ! order-by="i asc" ! > <key column="master_key"/> <one-to-many class="NHibernate.DomainModel.Detail, NHibernate.DomainModel"/> </set> ! ! <set ! name="MoreDetails" ! cascade="all" ! lazy="true" ! order-by="i desc" ! > <key column="more_master_key"/> <one-to-many class="NHibernate.DomainModel.Detail, NHibernate.DomainModel"/> </set> ! ! <set ! name="Incoming" ! lazy="true" ! table="mtm" ! > ! <key column="outgoingabcdef"/> ! <many-to-many ! class="NHibernate.DomainModel.Master, NHibernate.DomainModel" ! column="incomingabcdef" ! /> </set> ! ! <set ! name="Outgoing" ! lazy="true" ! table="mtm" ! inverse="true" ! > <key column="incomingabcdef"/> ! <many-to-many ! class="NHibernate.DomainModel.Master, NHibernate.DomainModel" ! column="outgoingabcdef" ! /> </set> - <many-to-one name="OtherMaster"/> </class> ! ! <class ! name="NHibernate.DomainModel.Detail, NHibernate.DomainModel" ! > ! <id ! column="detail_key" ! type="Int64" ! unsaved-value="0" ! > <generator class="native"/> </id> - <property name="X"> ! <column name="x" unique-key="uk"/> </property> <property name="I"> ! <column name="i" unique-key="uk"/> </property> ! <many-to-one name="Master"> ! <column name="master_key" unique-key="uk"/> </many-to-one> ! <set ! name="SubDetails" ! lazy="true" ! cascade="all" ! > <key column="detail_key"/> <one-to-many class="NHibernate.DomainModel.SubDetail, NHibernate.DomainModel"/> </set> </class> ! ! <class ! name="NHibernate.DomainModel.SubDetail, NHibernate.DomainModel" ! > ! <id ! column="subdetail_key" ! type="Int64" ! > <generator class="native"> <param name="sequence">fooseq</param> --- 21,64 ---- /> --> ! <set name="Details" inverse="true" lazy="true" order-by="i asc"> <key column="master_key"/> <one-to-many class="NHibernate.DomainModel.Detail, NHibernate.DomainModel"/> </set> ! <set name="MoreDetails" cascade="all" lazy="true" order-by="i desc"> <key column="more_master_key"/> <one-to-many class="NHibernate.DomainModel.Detail, NHibernate.DomainModel"/> </set> ! <set name="Incoming" lazy="true" table="mtm"> ! <key foreign-key="AA" column="outgoingabcdef"/> ! <many-to-many class="NHibernate.DomainModel.Master, NHibernate.DomainModel" foreign-key="BB"> ! <column name="incomingabcdef" index="IBB"/> ! </many-to-many> </set> ! <set name="Outgoing" lazy="true" table="mtm" inverse="true"> <key column="incomingabcdef"/> ! <many-to-many class="NHibernate.DomainModel.Master, NHibernate.DomainModel" column="outgoingabcdef"/> </set> <many-to-one name="OtherMaster"/> </class> ! <class name="NHibernate.DomainModel.Detail, NHibernate.DomainModel"> ! <id column="detail_key" type="Int64" unsaved-value="0"> <generator class="native"/> </id> <property name="X"> ! <column name="x" unique-key="uk" not-null="true"/> </property> <property name="I"> ! <column name="i" unique-key="uk" not-null="true"/> </property> ! <many-to-one name="Master" foreign-key="CC"> ! <column name="master_key" unique-key="uk" not-null="true"/> </many-to-one> ! <set name="SubDetails" lazy="true" cascade="all"> <key column="detail_key"/> <one-to-many class="NHibernate.DomainModel.SubDetail, NHibernate.DomainModel"/> </set> </class> ! <class name="NHibernate.DomainModel.SubDetail, NHibernate.DomainModel"> ! <id column="subdetail_key" type="Int64"> <generator class="native"> <param name="sequence">fooseq</param> *************** *** 128,136 **** <property name="Name"/> </class> - <query name="all_details"><![CDATA[ from d in class NHibernate.DomainModel.Detail ]]></query> - </hibernate-mapping> --- 67,73 ---- Index: Parent.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Parent.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Parent.cs 31 Aug 2004 20:24:23 -0000 1.4 --- Parent.cs 31 Mar 2005 12:40:23 -0000 1.5 *************** *** 11,14 **** --- 11,15 ---- private int _count; private Child _child; + private object _any; private int _x; *************** *** 31,34 **** --- 32,41 ---- } + public object Any + { + get { return _any; } + set { _any = value; } + } + public int X { |
From: Paul H. <pha...@us...> - 2005-03-30 16:30:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate.DomainModel Modified Files: Category.hbm.xml CustomPersister.cs Fum.cs Fum.hbm.xml Up.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: Up.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Up.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Up.cs 28 Mar 2005 15:20:27 -0000 1.2 --- Up.cs 30 Mar 2005 16:28:11 -0000 1.3 *************** *** 47,51 **** } ! public int GetHashcode() { return id1.GetHashCode(); --- 47,51 ---- } ! public override int GetHashCode() { return id1.GetHashCode(); Index: Category.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Category.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Category.hbm.xml 3 Jun 2004 18:01:24 -0000 1.1 --- Category.hbm.xml 30 Mar 2005 16:28:09 -0000 1.2 *************** *** 1,54 **** <?xml version="1.0"?> ! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! ! <class ! name="NHibernate.DomainModel.Category, NHibernate.DomainModel" ! table="category" ! dynamic-update="true" ! dynamic-insert="true" ! > ! ! <id ! name="Id" ! unsaved-value="0" ! > ! <generator class="native"/> ! </id> ! ! <list ! name="Subcategories" ! lazy="true" ! cascade="all" ! > ! <key column="parent"/> ! <index column="ord"/> ! <one-to-many class="NHibernate.DomainModel.Category, NHibernate.DomainModel"/> ! </list> ! ! <property name="Name"/> ! <many-to-one ! name="Assignable" ! column="`assign able id`" ! /> ! ! </class> ! ! <class ! name="NHibernate.DomainModel.Assignable, NHibernate.DomainModel" ! table="`assign able`" ! > ! <id name="Id"> ! <generator class="assigned"/> ! </id> ! ! <bag ! name="Categories" ! inverse="true" ! cascade="all" ! > ! <key column="`assign able id`"/> ! <one-to-many class="NHibernate.DomainModel.Category, NHibernate.DomainModel"/> ! </bag> ! </class> ! ! </hibernate-mapping> \ No newline at end of file --- 1,30 ---- <?xml version="1.0"?> ! <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:nhibernate-mapping-2.0 ! C:\Devel\Sourceforge\NHibernate\nhibernate\src\NHibernate\nhibernate-mapping-2.0.xsd"> ! <class name="NHibernate.DomainModel.Category, NHibernate.DomainModel" table="category" dynamic-update="true" dynamic-insert="true"> ! <id name="Id" unsaved-value="0" column="category_key_col"> ! <generator class="native"/> ! </id> ! <list name="Subcategories" lazy="true" cascade="all"> ! <key column="parent"/> ! <index column="ord"/> ! <one-to-many class="NHibernate.DomainModel.Category, NHibernate.DomainModel"/> ! </list> ! <property name="Name"/> ! <many-to-one name="Assignable" column="`assign able id`"/> ! </class> ! <class name="NHibernate.DomainModel.Assignable, NHibernate.DomainModel" table="`assign able`"> ! <id name="Id"> ! <generator class="assigned"/> ! </id> ! <bag name="Categories" inverse="true" cascade="all" lazy="true"> ! <key column="`assign able id`"/> ! <one-to-many class="NHibernate.DomainModel.Category, NHibernate.DomainModel"/> ! </bag> ! </class> ! <sql-query name="namedsql"> ! <return alias="category" class="NHibernate.DomainModel.Category, NHibernate.DomainModel"/> ! <return alias="assignable" class="NHibernate.DomainModel.Assignable, NHibernate.DomainModel"/> ! select {category.*}, {assignable.*} from Category {category}, "assign able" {assignable} ! </sql-query> ! </hibernate-mapping> Index: CustomPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/CustomPersister.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CustomPersister.cs 26 Mar 2005 13:24:35 -0000 1.7 --- CustomPersister.cs 30 Mar 2005 16:28:09 -0000 1.8 *************** *** 187,190 **** --- 187,195 ---- } + public bool IsDefaultVersion( object obj ) + { + return false; + } + public bool HasProxy { Index: Fum.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Fum.cs 18 Nov 2004 02:45:43 -0000 1.8 --- Fum.cs 30 Mar 2005 16:28:10 -0000 1.9 *************** *** 24,28 **** // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! m_LastUpdated = DateTime.Now; FumCompositeID fid = new FumCompositeID(); --- 24,28 ---- // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! //m_LastUpdated = DateTime.Now; FumCompositeID fid = new FumCompositeID(); *************** *** 37,41 **** // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! f.LastUpdated = DateTime.Now; _friends.Add( f ); --- 37,41 ---- // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! //f.LastUpdated = DateTime.Now; _friends.Add( f ); Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Fum.hbm.xml 23 Aug 2004 02:11:53 -0000 1.6 --- Fum.hbm.xml 30 Mar 2005 16:28:11 -0000 1.7 *************** *** 1,63 **** ! <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Fum, NHibernate.DomainModel" ! > ! <composite-id ! name="Id" ! unsaved-value="any" ! > <key-property name="String"> ! <column ! name="string_" ! length="10" ! /> </key-property> ! <key-property ! name="Short" ! column="short_" ! /> ! <key-property ! name="Date" ! column="date_" ! type="DateTime" ! /> </composite-id> ! ! <version ! name="LastUpdated" ! type="DateTime" ! access="field.pascalcase-m-underscore" ! /> ! ! <property ! name="FumString" ! not-null="true" ! /> ! <many-to-one name="Fo"> ! <column name="fo_string" length="10" /> ! <column name="fo_short" /> ! <column name="fo_date" /> </many-to-one> - <set name="Friends"> <key> ! <column name="fr_string" length="10" /> ! <column name="fr_short" /> ! <column name="fr_date" /> </key> ! <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> - <array name="QuxArray"> <key> ! <column name="fum_str_" length="10" /> ! <column name="fum_sho_" /> ! <column name="fum_dat_" /> </key> ! <index column="i" /> ! <one-to-many class="NHibernate.DomainModel.Qux, NHibernate.DomainModel" /> </array> </class> ! </hibernate-mapping> \ No newline at end of file --- 1,36 ---- ! <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Fum, NHibernate.DomainModel"> ! <composite-id name="Id" unsaved-value="any"> <key-property name="String"> ! <column name="string_" length="10"/> </key-property> ! <key-property name="Short" column="short_"/> ! <key-property name="Date" column="date_" type="DateTime"/> </composite-id> ! <version name="LastUpdated" type="DateTime" access="field.pascalcase-m-underscore" unsaved-value="1/1/0001"/> ! <property name="FumString" not-null="true"/> <many-to-one name="Fo"> ! <column name="fo_string" length="10"/> ! <column name="fo_short"/> ! <column name="fo_date"/> </many-to-one> <set name="Friends"> <key> ! <column name="fr_string" length="10"/> ! <column name="fr_short"/> ! <column name="fr_date"/> </key> ! <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel"/> </set> <array name="QuxArray"> <key> ! <column name="fum_str_" length="10"/> ! <column name="fum_sho_"/> ! <column name="fum_dat_"/> </key> ! <index column="i"/> ! <one-to-many class="NHibernate.DomainModel.Qux, NHibernate.DomainModel"/> </array> </class> ! </hibernate-mapping> |
From: Paul H. <pha...@us...> - 2005-03-30 16:30:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Impl Modified Files: AbstractQueryImpl.cs SessionFactoryImpl.cs SessionImpl.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** SessionImpl.cs 28 Mar 2005 15:20:28 -0000 1.79 --- SessionImpl.cs 30 Mar 2005 16:28:54 -0000 1.80 *************** *** 853,858 **** if ( persister.IsVersioned ) ! substitute = Versioning.SeedVersion( ! values, persister.VersionProperty, persister.VersionType ) || substitute; if ( persister.HasCollections ) --- 853,857 ---- if ( persister.IsVersioned ) ! substitute = Versioning.SeedVersion( values, persister.VersionProperty, persister.VersionType, persister.IsDefaultVersion( obj ) ) || substitute; if ( persister.HasCollections ) *************** *** 1007,1011 **** if ( persister.IsVersioned ) { ! substitute = Versioning.SeedVersion( values, persister.VersionProperty, persister.VersionType ) || substitute; } } --- 1006,1010 ---- if ( persister.IsVersioned ) { ! substitute = Versioning.SeedVersion( values, persister.VersionProperty, persister.VersionType, persister.IsDefaultVersion( obj ) ) || substitute; } } *************** *** 1257,1294 **** // id is not "unsaved" (that is, we rely on foreign keys to keep // database integrity) - EntityEntry e = GetEntry( obj ); if( e == null ) { ! IClassPersister persister = GetPersister( obj ); ! if( persister.HasIdentifierProperty ) ! { ! object id = persister.GetIdentifier( obj ); ! if( id != null ) ! { ! // see if theres another object that *is* associated with the sesison for that id ! e = GetEntry( GetEntity( new Key( id, persister ) ) ); ! ! if( e == null ) ! { ! // look at the id value ! return persister.IsUnsaved( id ); ! } ! // else use the other object's entry... ! } ! else ! { ! // null id, so have to assume transient (because that's safer) ! return true; ! } ! } ! else ! { ! //can't determine the id, so assume transient (because that's safer) ! return true; ! } } - return e.Status == Status.Saving || ( earlyInsert ? !e.ExistsInDatabase : nullifiables.Contains( new Key( e.Id, e.Persister ) ) --- 1256,1265 ---- // id is not "unsaved" (that is, we rely on foreign keys to keep // database integrity) EntityEntry e = GetEntry( obj ); if( e == null ) { ! return GetPersister( obj ).IsUnsaved( obj ); } return e.Status == Status.Saving || ( earlyInsert ? !e.ExistsInDatabase : nullifiables.Contains( new Key( e.Id, e.Persister ) ) *************** *** 1621,1625 **** } ! object theObj = UnproxyAndReassociate( obj ); EntityEntry e = GetEntry( theObj ); --- 1592,1596 ---- } ! object theObj = UnproxyAndReassociate( obj ); //a proxy is always "update", never "save" EntityEntry e = GetEntry( theObj ); *************** *** 1643,1672 **** { // use unsaved-value ! if( persister.HasIdentifierPropertyOrEmbeddedCompositeIdentifier ) { ! object id = persister.GetIdentifier( theObj ); ! ! if( persister.IsUnsaved( id ) ) ! { ! if( log.IsDebugEnabled ) ! { ! log.Debug( "SaveOrUpdate() unsaved instance with id: " + id ); ! } ! Save( obj ); ! } ! else { ! if( log.IsDebugEnabled ) ! { ! log.Debug( "SaveOrUpdate() previously saved instance with id: " + id ); ! } ! DoUpdate( theObj, id, persister ); } } else { ! // no identifier property ... default to save() ! log.Debug( "SaveOrUpdate() unsaved instance with no identifier property" ); ! Save( obj ); } } --- 1614,1633 ---- { // use unsaved-value ! if( persister.IsUnsaved( theObj ) ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "SaveOrUpdate() unsaved instance" ); } + Save( obj ); } else { ! object id = persister.GetIdentifier( theObj ); ! if( log.IsDebugEnabled ) ! { ! log.Debug( "SaveOrUpdate() previously saved instance with id: " + id ); ! } ! DoUpdate( theObj, id, persister ); } } *************** *** 3612,3626 **** } ! IClassPersister persister = GetPersister( obj ); ! if( !persister.HasIdentifierPropertyOrEmbeddedCompositeIdentifier ) ! { ! return false; ! } // I _think_ that this is reasonable! ! ! object id = persister.GetIdentifier( obj ); ! return !persister.IsUnsaved( id ); } - /// <summary> /// Used by OneToOneType and ManyToOneType to determine what id value --- 3573,3579 ---- } ! return !GetPersister( obj ).IsUnsaved( obj ); } /// <summary> /// Used by OneToOneType and ManyToOneType to determine what id value *************** *** 3659,3674 **** IClassPersister persister = GetPersister( obj ); ! if( !persister.HasIdentifierPropertyOrEmbeddedCompositeIdentifier ) ! { ! ThrowTransientObjectException( obj ); ! } ! ! object id = persister.GetIdentifier( obj ); ! if( persister.IsUnsaved( id ) ) { ThrowTransientObjectException( obj ); } ! return id; } --- 3612,3621 ---- IClassPersister persister = GetPersister( obj ); ! if( persister.IsUnsaved( obj ) ) { ThrowTransientObjectException( obj ); } ! return persister.GetIdentifier( obj ); } Index: AbstractQueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/AbstractQueryImpl.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractQueryImpl.cs 26 Mar 2005 12:30:23 -0000 1.3 --- AbstractQueryImpl.cs 30 Mar 2005 16:28:49 -0000 1.4 *************** *** 87,90 **** --- 87,117 ---- } + /// <summary> + /// + /// </summary> + /// <returns></returns> + public object UniqueResult() + { + return UniqueElement( List() ); + } + + static object UniqueElement( IList list ) + { + int size = list.Count; + if ( size == 0 ) + { + return null; + } + object first = list[ 0 ]; + for ( int i = 1; i < size; i++ ) + { + if ( list[ i ] != first ) + { + throw new NonUniqueResultException( size ); + } + } + return first; + } + protected virtual IType[] TypeArray() { Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** SessionFactoryImpl.cs 6 Mar 2005 12:44:42 -0000 1.43 --- SessionFactoryImpl.cs 30 Mar 2005 16:28:51 -0000 1.44 *************** *** 188,197 **** namedQueries = new Hashtable( cfg.NamedQueries ); namedSqlQueries = new Hashtable( cfg.NamedSQLQueries.Count ); ! foreach ( NamedSQLQuery nsq in cfg.NamedSQLQueries ) { ! namedSqlQueries[ nsq.QueryString ] = new InternalNamedSQLQuery( nsq.QueryString, nsq.ReturnAliases, nsq.ReturnClasses, nsq.SynchronizedTables ); } - imports = new Hashtable( cfg.Imports ); --- 188,197 ---- namedQueries = new Hashtable( cfg.NamedQueries ); namedSqlQueries = new Hashtable( cfg.NamedSQLQueries.Count ); ! foreach ( DictionaryEntry de in cfg.NamedSQLQueries ) { ! NamedSQLQuery nsq = (NamedSQLQuery) de.Value; ! namedSqlQueries[ de.Key ] = new InternalNamedSQLQuery( nsq.QueryString, nsq.ReturnAliases, nsq.ReturnClasses, nsq.SynchronizedTables ); } imports = new Hashtable( cfg.Imports ); |
From: Paul H. <pha...@us...> - 2005-03-30 16:30:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Cfg Modified Files: Binder.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Binder.cs 29 Mar 2005 05:35:32 -0000 1.45 --- Binder.cs 30 Mar 2005 16:28:22 -0000 1.46 *************** *** 336,342 **** if ( val.Type==null ) val.Type = ( ("version".Equals(name)) ? NHibernateUtil.Int32 : NHibernateUtil.Timestamp ); Mapping.Property timestampProp = new Mapping.Property(val); ! BindProperty(subnode, timestampProp, mappings); model.Version = timestampProp; ! model.AddProperty(timestampProp); break; --- 336,343 ---- if ( val.Type==null ) val.Type = ( ("version".Equals(name)) ? NHibernateUtil.Int32 : NHibernateUtil.Timestamp ); Mapping.Property timestampProp = new Mapping.Property(val); ! BindProperty( subnode, timestampProp, mappings ); ! MakeVersion( subnode, val ); model.Version = timestampProp; ! model.AddProperty( timestampProp ); break; *************** *** 1118,1121 **** --- 1119,1132 ---- } + private static void MakeVersion( XmlNode node, SimpleValue model ) + { + // VERSION UNSAVED-VALUE + XmlAttribute nullValueNode = node.Attributes["unsaved-value"]; + if (nullValueNode!=null) + model.NullValue = nullValueNode.Value; + else + model.NullValue = "null"; + } + protected static void PropertiesFromXML(XmlNode node, PersistentClass model, Mappings mappings) { *************** *** 1402,1408 **** { string qname = n.Attributes["name"].Value; ! string query = n.FirstChild.Value; log.Debug("Named query: " + qname + " -> " + query); ! model.AddQuery(qname, query); } --- 1413,1419 ---- { string qname = n.Attributes["name"].Value; ! string query = n.InnerText; log.Debug("Named query: " + qname + " -> " + query); ! model.AddQuery( qname, query ); } *************** *** 1410,1414 **** { string qname = n.Attributes["name"].Value; ! NamedSQLQuery namedQuery = new NamedSQLQuery( n.FirstChild.Value ); foreach(XmlNode returns in n.SelectNodes( nsPrefix + ":return", nsmgr ) ) --- 1421,1425 ---- { string qname = n.Attributes["name"].Value; ! NamedSQLQuery namedQuery = new NamedSQLQuery( n.InnerText ); foreach(XmlNode returns in n.SelectNodes( nsPrefix + ":return", nsmgr ) ) *************** *** 1434,1438 **** log.Debug("Named sql query: " + qname + " -> " + namedQuery.QueryString ); ! model.AddSQLQuery(qname, namedQuery); } --- 1445,1449 ---- log.Debug("Named sql query: " + qname + " -> " + namedQuery.QueryString ); ! model.AddSQLQuery( qname, namedQuery ); } |
From: Paul H. <pha...@us...> - 2005-03-30 16:30:01
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate Modified Files: releasenotes.txt Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** releasenotes.txt 29 Mar 2005 05:43:00 -0000 1.28 --- releasenotes.txt 30 Mar 2005 16:28:08 -0000 1.29 *************** *** 13,16 **** --- 13,18 ---- - Modified discriminator element to use "null" or "not null" as the value. - Modified Dialect to use Hibernate 2.1 methods. + - Added "unsaved-value" to version/timestamp as DateTime can't support null, use 1/1/0001 to align with .NET default value for DateTime + - Added SaveOrUpdateCopy which allows synchronisation for detached objects Build 0.7.0.0 |
From: Paul H. <pha...@us...> - 2005-03-30 16:30:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate Modified Files: IQuery.cs NHibernate-1.1.csproj nhibernate-mapping-2.0.xsd Added Files: NonUniqueResultException.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IQuery.cs 28 Jan 2005 13:33:56 -0000 1.14 --- IQuery.cs 30 Mar 2005 16:28:29 -0000 1.15 *************** *** 94,97 **** --- 94,105 ---- /// <summary> + /// Convenience method to return a single instance that matches + /// the query, or null if the query returns no results. + /// </summary> + /// <returns>the single result or <tt>null</tt></returns> + /// <remarks>throws HibernateException if there is more than one matching result</remarks> + object UniqueResult(); + + /// <summary> /// The maximum number of rows to retrieve /// </summary> Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** NHibernate-1.1.csproj 28 Mar 2005 12:45:57 -0000 1.78 --- NHibernate-1.1.csproj 30 Mar 2005 16:28:33 -0000 1.79 *************** *** 250,253 **** --- 250,258 ---- /> <File + RelPath = "NonUniqueResultException.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ObjectDeletedException.cs" SubType = "Code" --- NEW FILE: NonUniqueResultException.cs --- using System; using System.Runtime.Serialization; using log4net; namespace NHibernate { /// <summary> /// Thrown when the application calls <tt>Query.uniqueResult()</tt> and /// the query returned more than one result. Unlike all other Hibernate /// exceptions, this one is recoverable! /// </summary> [Serializable] public class NonUniqueResultException : HibernateException { /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> public NonUniqueResultException() : this( 0 ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> /// <param name="resultCount">The number of items in the result.</param> public NonUniqueResultException( int resultCount ) : base( "query did not return a unique result: " + resultCount.ToString() ) { LogManager.GetLogger( typeof( NonUniqueResultException ) ).Error( "query did not return a unique result: " + resultCount.ToString(), this ); } /// <summary> /// Initializes a new instance of the <see cref="LazyInitializationException"/> class. /// </summary> /// <param name="innerException"> /// The exception that is the cause of the current exception. If the innerException parameter /// is not a null reference, the current exception is raised in a catch block that handles /// the inner exception. /// </param> public NonUniqueResultException( Exception innerException ) : base( "NHibernate non-unique result problem", innerException ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> /// <param name="message">The message that describes the error. </param> /// <param name="innerException"> /// The exception that is the cause of the current exception. If the innerException parameter /// is not a null reference, the current exception is raised in a catch block that handles /// the inner exception. /// </param> public NonUniqueResultException( string message, Exception innerException ) : base( message, innerException ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class /// with serialized data. /// </summary> /// <param name="info"> /// The <see cref="SerializationInfo"/> that holds the serialized object /// data about the exception being thrown. /// </param> /// <param name="context"> /// The <see cref="StreamingContext"/> that contains contextual information about the source or destination. /// </param> protected NonUniqueResultException( SerializationInfo info, StreamingContext context ) : base( info, context ) { } } } Index: nhibernate-mapping-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-mapping-2.0.xsd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** nhibernate-mapping-2.0.xsd 28 Mar 2005 10:13:56 -0000 1.12 --- nhibernate-mapping-2.0.xsd 30 Mar 2005 16:28:35 -0000 1.13 *************** *** 1,3 **** ! <xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="propertyAccess"> <xs:annotation> --- 1,3 ---- ! <xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:nhibernate-mapping-2.0" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:simpleType name="propertyAccess"> <xs:annotation> *************** *** 90,94 **** <xs:element ref="joined-subclass"/> </xs:choice> ! <xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="schema" type="xs:string" use="optional"> --- 90,95 ---- <xs:element ref="joined-subclass"/> </xs:choice> ! <xs:element name="query" type="query" minOccurs="0" maxOccurs="unbounded"/> ! <xs:element name="sql-query" type="sql-query" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="schema" type="xs:string" use="optional"> *************** *** 248,251 **** --- 249,257 ---- <xs:attribute name="column" type="xs:string"/> <xs:attribute name="type" type="xs:string" default="Int32"/> + <xs:attribute name="unsaved-value" type="xs:string" default="null"> + <xs:annotation> + <xs:documentation>any|none|null|0|-1|... </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> *************** *** 258,261 **** --- 264,272 ---- <xs:attribute name="access" type="propertyAccess"/> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="unsaved-value" type="xs:string" default="null"> + <xs:annotation> + <xs:documentation>any|none|null|0|-1|... </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> *************** *** 694,702 **** </xs:complexType> </xs:element> ! <xs:element name="query"> ! <xs:complexType mixed="true"> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> <xs:element name="list"> <xs:complexType> --- 705,731 ---- </xs:complexType> </xs:element> ! <xs:complexType name="query"> ! <xs:simpleContent> ! <xs:extension base="xs:string"> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:extension> ! </xs:simpleContent> ! </xs:complexType> ! <xs:complexType name="sql-query" mixed="true"> ! <xs:sequence> ! <xs:element name="return" maxOccurs="unbounded"> ! <xs:complexType> ! <xs:attribute name="alias" type="xs:string" use="required"/> ! <xs:attribute name="class" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> ! <xs:element name="synchronize" minOccurs="0" maxOccurs="unbounded"> ! <xs:complexType> ! <xs:attribute name="table" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> ! </xs:sequence> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:complexType> <xs:element name="list"> <xs:complexType> |
From: Paul H. <pha...@us...> - 2005-03-30 16:29:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Persister Modified Files: AbstractEntityPersister.cs IClassPersister.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: IClassPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/IClassPersister.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** IClassPersister.cs 26 Mar 2005 13:24:37 -0000 1.12 --- IClassPersister.cs 30 Mar 2005 16:29:02 -0000 1.13 *************** *** 98,106 **** /// <summary> ! /// Does the given identifier value indicate that this is a new transient instance? /// </summary> ! /// <param name="id"></param> /// <returns></returns> ! bool IsUnsaved( object id ); /// <summary> --- 98,113 ---- /// <summary> ! /// Is this a new transient instance? /// </summary> ! /// <param name="obj"></param> /// <returns></returns> ! bool IsUnsaved( object obj ); ! ! /// <summary> ! /// Does this object have the default version ! /// </summary> ! /// <param name="obj"></param> ! /// <returns></returns> ! bool IsDefaultVersion( object obj ); /// <summary> Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** AbstractEntityPersister.cs 28 Mar 2005 15:20:42 -0000 1.38 --- AbstractEntityPersister.cs 30 Mar 2005 16:29:00 -0000 1.39 *************** *** 94,98 **** private readonly IGetter versionGetter; private readonly int versionProperty; ! //private Cascades.VersionValue unsavedVersionValues; //private readonly bool batchVersionData; --- 94,98 ---- private readonly IGetter versionGetter; private readonly int versionProperty; ! private Cascades.VersionValue unsavedVersionValue; //private readonly bool batchVersionData; *************** *** 564,574 **** /// /// </summary> ! /// <param name="id"></param> /// <returns></returns> ! public virtual bool IsUnsaved( object id ) { return unsavedIdentifierValue.IsUnsaved( id ); } /// <summary></summary> public virtual string[ ] PropertyNames --- 564,622 ---- /// /// </summary> ! /// <param name="obj"></param> /// <returns></returns> ! public bool IsUnsaved( object obj ) { + object id; + if ( HasIdentifierPropertyOrEmbeddedCompositeIdentifier ) + { + id = GetIdentifier( obj ); + } + else + { + id = null; + } + // we always assume a transient instance with a null + // identifier or no identifier property is unsaved! + if ( id == null ) + { + return true; + } + + if ( IsVersioned ) + { + // let this take precedence if defined, since it works for assigned identifiers + object result = unsavedVersionValue.IsUnsaved( GetVersion( obj ) ); + if ( result != null ) + { + return (bool) result; + } + } return unsavedIdentifierValue.IsUnsaved( id ); } + /// <summary> + /// + /// </summary> + /// <param name="obj"></param> + /// <returns></returns> + public bool IsDefaultVersion( object obj ) + { + // Can't quite factor this out as per IsUnsaved as the true/false decision differs + if ( IsVersioned ) + { + object result = unsavedVersionValue.IsUnsaved( GetVersion( obj ) ); + if ( result != null ) + { + return (bool) result; + } + return true; + } + else + { + return false; + } + } + /// <summary></summary> public virtual string[ ] PropertyNames *************** *** 850,854 **** } - // TODO: 2.1 Bring versioning up to standards if( model.IsVersioned ) { --- 898,901 ---- *************** *** 856,874 **** versioned = true; versionGetter = model.Version.GetGetter( mappedClass ); ! // TODO: determine if this block is kept ! // this if-else block is extra logic in nhibernate - not sure if I like it - would rather throw ! // an exception if there is a bad mapping ! if( !( model.Version.Type is IVersionType ) ) ! { ! log.Warn( model.Name + " has version column " + model.Version.Name + ", but the column type " + model.Version.Type.Name + " is not versionable" ); ! //versionPropertyName = null; ! versioned = false; ! versionType = null; ! versionGetter = null; ! } ! else ! { ! versionType = ( IVersionType ) model.Version.Type; ! } } else --- 903,907 ---- versioned = true; versionGetter = model.Version.GetGetter( mappedClass ); ! versionType = ( IVersionType ) model.Version.Type; } else *************** *** 876,881 **** //versionPropertyName = null; versioned = false; - versionType = null; versionGetter = null; } --- 909,956 ---- //versionPropertyName = null; versioned = false; versionGetter = null; + versionType = null; + } + + // VERSION UNSAVED-VALUE: + string versionUnsavedValue = null; + if ( model.IsVersioned ) + { + versionUnsavedValue = model.Version.NullValue; + } + + if ( versionUnsavedValue == null || "undefined".Equals( versionUnsavedValue ) ) + { + unsavedVersionValue = Cascades.VersionValue.VersionUndefined; + } + else if ( "null".Equals( versionUnsavedValue ) ) + { + unsavedVersionValue = Cascades.VersionValue.VersionSaveNull; + } + else if ( "negative".Equals( versionUnsavedValue ) ) + { + unsavedVersionValue = Cascades.VersionValue.VersionNegative; + /* + * used to be none and any strategies but this is kind of a nonsense for version + * especially for none since an 'update where' would be generated + * Lot's of hack to support none ? + */ + } + else + { + // NB This is NHibernate specific - needed so we can specify a default value for dates as we don't have null as a possibility + IType idType = model.Identifier.Type; + try + { + unsavedVersionValue = new Cascades.VersionValue( ( ( IVersionType ) versionType ).StringToObject( versionUnsavedValue ) ); + } + catch( InvalidCastException ) + { + throw new MappingException( "Bad version type: " + idType.GetType().Name ); + } + catch( Exception ) + { + throw new MappingException( "Could not parse version unsaved-value: " + versionUnsavedValue ); + } } |
From: Paul H. <pha...@us...> - 2005-03-30 16:29:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Engine Modified Files: Cascades.cs Versioning.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: Versioning.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Versioning.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Versioning.cs 31 Dec 2004 17:36:41 -0000 1.6 --- Versioning.cs 30 Mar 2005 16:28:28 -0000 1.7 *************** *** 50,57 **** /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion( object[ ] fields, int versionProperty, IVersionType versionType ) { ! if( fields[ versionProperty ] == null ) { fields[ versionProperty ] = Seed( versionType ); --- 50,58 ---- /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> + /// <param name="force">Force the version to initialize</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion( object[ ] fields, int versionProperty, IVersionType versionType, bool force ) { ! if( fields[ versionProperty ] == null || force ) { fields[ versionProperty ] = Seed( versionType ); Index: Cascades.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Cascades.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Cascades.cs 14 Mar 2005 18:52:11 -0000 1.18 --- Cascades.cs 30 Mar 2005 16:28:26 -0000 1.19 *************** *** 187,197 **** public override void Cascade( ISessionImplementor session, object child, object anything ) { ! log.Debug( "cascading to Replicate()" ); ! // TODO: 2.1 implement copy ! //session.Copy( child, (ReplicationMode) anything ); } public override ICollection CascadableChildrenCollection( PersistentCollectionType collectionType, object collection ) { return Cascades.GetLoadedElementsCollection( collectionType, collection ); } --- 187,197 ---- public override void Cascade( ISessionImplementor session, object child, object anything ) { ! log.Debug( "cascading to Copy()" ); ! session.Copy( child, (IDictionary) anything ); } public override ICollection CascadableChildrenCollection( PersistentCollectionType collectionType, object collection ) { + // saves / updates don't cascade to uninitialized collections return Cascades.GetLoadedElementsCollection( collectionType, collection ); } *************** *** 212,217 **** { log.Debug( "cascading to Replicate()" ); ! // TODO: 2.1 implement replication ! //session.Replicate( child, (ReplicationMode) anything ); } --- 212,216 ---- { log.Debug( "cascading to Replicate()" ); ! session.Replicate( child, (ReplicationMode) anything ); } *************** *** 460,464 **** /// Does the given identifier belong to a new instance /// </summary> ! public virtual bool IsUnsaved( object version ) { if( log.IsDebugEnabled ) --- 459,463 ---- /// Does the given identifier belong to a new instance /// </summary> ! public virtual object IsUnsaved( object version ) { if( log.IsDebugEnabled ) *************** *** 473,481 **** /// is null, otherwise assume it is a detached instance. /// </summary> ! public static VersionValue VersionNull = new VersionNullClass(); ! private class VersionNullClass : VersionValue { ! public override bool IsUnsaved( object version ) { log.Debug( "version unsaved-value strategy NULL" ); --- 472,480 ---- /// is null, otherwise assume it is a detached instance. /// </summary> ! public static VersionValue VersionSaveNull = new VersionSaveNullClass(); ! private class VersionSaveNullClass : VersionValue { ! public override object IsUnsaved( object version ) { log.Debug( "version unsaved-value strategy NULL" ); *************** *** 484,488 **** } - /* /// <summary> /// Assume the transient instance is newly instantiated if the version --- 483,486 ---- *************** *** 491,503 **** public static VersionValue VersionUndefined = new VersionUndefinedClass(); ! private class SaveNoneClass : IdentifierValue { ! public override bool IsUnsaved( object id ) { log.Debug( "version unsaved-value strategy UNDEFINED" ); ! return false; } } - */ /// <summary> --- 489,508 ---- public static VersionValue VersionUndefined = new VersionUndefinedClass(); ! private class VersionUndefinedClass : VersionValue { ! public override object IsUnsaved( object version ) { log.Debug( "version unsaved-value strategy UNDEFINED" ); ! //return version == null ? true : null; ! if ( version == null ) ! { ! return true; ! } ! else ! { ! return null; ! } } } /// <summary> *************** *** 509,513 **** private class VersionNegativeClass : VersionValue { ! public override bool IsUnsaved( object version ) { log.Debug( "version unsaved-value strategy NEGATIVE" ); --- 514,518 ---- private class VersionNegativeClass : VersionValue { ! public override object IsUnsaved( object version ) { log.Debug( "version unsaved-value strategy NEGATIVE" ); |
From: Paul H. <pha...@us...> - 2005-03-30 16:29:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Mapping Modified Files: NamedSQLQuery.cs RootClass.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: RootClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/RootClass.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RootClass.cs 29 Mar 2005 05:41:04 -0000 1.15 --- RootClass.cs 30 Mar 2005 16:28:59 -0000 1.16 *************** *** 186,190 **** { get { return version; } ! set { version = value; } } --- 186,193 ---- { get { return version; } ! set { ! log.Debug( "Hello world" ); ! version = value; ! } } Index: NamedSQLQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/NamedSQLQuery.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamedSQLQuery.cs 6 Mar 2005 12:44:44 -0000 1.2 --- NamedSQLQuery.cs 30 Mar 2005 16:28:58 -0000 1.3 *************** *** 31,35 **** public string[] ReturnAliases { ! get { return (string[]) aliases.ToArray( typeof( string[ ] ) ); } } --- 31,35 ---- public string[] ReturnAliases { ! get { return (string[]) aliases.ToArray( typeof( string ) ); } } *************** *** 39,43 **** public System.Type[] ReturnClasses { ! get { return (System.Type[]) aliasedClasses.ToArray( typeof( string[ ] ) ); } } --- 39,43 ---- public System.Type[] ReturnClasses { ! get { return (System.Type[]) aliasedClasses.ToArray( typeof( System.Type ) ); } } |
From: Paul H. <pha...@us...> - 2005-03-30 16:29:43
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate/Collection Modified Files: Map.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Map.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Map.cs 14 Mar 2005 18:51:48 -0000 1.22 --- Map.cs 30 Mar 2005 16:28:24 -0000 1.23 *************** *** 80,83 **** --- 80,90 ---- /// <summary> + /// + /// </summary> + internal Map( ) : base( ) + { + } + + /// <summary> /// Construct an uninitialized Map. /// </summary> |
From: Paul H. <pha...@us...> - 2005-03-30 16:29:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate.Test Modified Files: MasterDetailTest.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MasterDetailTest.cs 28 Mar 2005 15:20:27 -0000 1.20 --- MasterDetailTest.cs 30 Mar 2005 16:28:11 -0000 1.21 *************** *** 52,64 **** [Test] - [Ignore( "Test not written" )] public void Copy() { } [Test] - [Ignore( "Test not written" )] public void CopyCascade() { } --- 52,131 ---- [Test] public void Copy() { + Category catWA = new Category(); + catWA.Name = "HSQL workaround"; + Category cat = new Category(); + cat.Name = "foo"; + Category subCatBar = new Category(); + subCatBar.Name = "bar"; + Category subCatBaz = new Category(); + subCatBaz.Name = "baz"; + cat.Subcategories.Add( subCatBar ); + cat.Subcategories.Add( subCatBaz ); + + ISession s = sessions.OpenSession(); + s.Save( catWA ); + s.Save( cat ); + s.Flush(); + s.Close(); + + cat.Name = "new foo"; + subCatBar.Name = "new bar"; + cat.Subcategories.Remove( subCatBaz ); + Category newCat = new Category(); + newCat.Name = "new"; + cat.Subcategories.Add( newCat ); + Category newSubCat = new Category(); + newSubCat.Name = "new sub"; + newCat.Subcategories.Add( newSubCat ); + + s = sessions.OpenSession(); + s.SaveOrUpdateCopy( cat ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + cat = (Category) s.CreateQuery( "from Category cat where cat.Name='new foo'").UniqueResult(); + newSubCat = (Category) s.CreateQuery( "from Category cat where cat.Name='new sub'").UniqueResult(); + newSubCat.Subcategories.Add( cat ); + subCatBaz = (Category) s.SaveOrUpdateCopy( newSubCat, subCatBaz.Id ); + Assert.IsTrue( subCatBaz.Name.Equals( "new sub" ) ); + Assert.IsTrue( subCatBaz.Subcategories.Count == 1 && subCatBaz.Subcategories[0] == cat ); + newSubCat.Subcategories.Remove( cat ); + s.Delete( cat ); + s.Delete( subCatBaz ); + s.Delete( catWA ); + s.Flush(); + s.Close(); } [Test] public void CopyCascade() { + ISession s = sessions.OpenSession(); + Category child = new Category(); + child.Name = "child"; + s.Save( child ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + Category parent = new Category(); + parent.Name = "parent"; + parent.Subcategories.Add( child ); + child.Name = "child2"; + + // Save parent and cascade update detached child + Category persistentParent = (Category) s.SaveOrUpdateCopy( parent ); + Assert.IsTrue( persistentParent.Subcategories.Count == 1 ); + Assert.AreEqual( ( (Category) persistentParent.Subcategories[ 0 ] ).Name, "child2" ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + s.Delete( parent ); + s.Flush(); + s.Close(); } |
From: Paul H. <pha...@us...> - 2005-03-30 16:09:29
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10241/nhibernate/src/NHibernate/Type Modified Files: DynamicComponentType.cs EntityType.cs IVersionType.cs ManyToOneType.cs OneToOneType.cs PersistentCollectionType.cs PersistentEnumType.cs TicksType.cs TimeSpanType.cs TimestampType.cs TypeFactory.cs Log Message: Enhanced IVersionType and implemented Copy Index: PersistentCollectionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PersistentCollectionType.cs 14 Mar 2005 18:54:20 -0000 1.23 --- PersistentCollectionType.cs 30 Mar 2005 16:08:39 -0000 1.24 *************** *** 188,192 **** if( id == null ) { ! throw new AssertionFailure( "bug re-assembling collection reference" ); } return ResolveIdentifier( id, session, owner ); --- 188,192 ---- if( id == null ) { ! throw new AssertionFailure( "owner id unknown when re-assembling collection reference" ); } return ResolveIdentifier( id, session, owner ); Index: OneToOneType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/OneToOneType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** OneToOneType.cs 14 Mar 2005 18:54:20 -0000 1.10 --- OneToOneType.cs 30 Mar 2005 16:08:39 -0000 1.11 *************** *** 134,137 **** --- 134,160 ---- } + + /// <summary> + /// + /// </summary> + /// <param name="cached"></param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <returns></returns> + public override object Assemble( object cached, ISessionImplementor session, object owner ) + { + return ResolveIdentifier( session.GetEntityIdentifier( owner ), session, owner ); + } + + /// <summary> + /// + /// </summary> + /// <param name="value"></param> + /// <param name="session"></param> + /// <returns></returns> + public override object Disassemble( object value, ISessionImplementor session ) + { + return null; + } } } \ No newline at end of file Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TicksType.cs 31 Dec 2004 23:55:53 -0000 1.8 --- TicksType.cs 30 Mar 2005 16:08:40 -0000 1.9 *************** *** 128,131 **** --- 128,141 ---- } + /// <summary> + /// + /// </summary> + /// <param name="xml"></param> + /// <returns></returns> + public object StringToObject( string xml ) + { + return long.Parse( xml ); + } + #endregion Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TimestampType.cs 31 Dec 2004 23:56:09 -0000 1.10 --- TimestampType.cs 30 Mar 2005 16:08:40 -0000 1.11 *************** *** 146,149 **** --- 146,159 ---- } + /// <summary> + /// + /// </summary> + /// <param name="xml"></param> + /// <returns></returns> + public object StringToObject( string xml ) + { + return DateTime.Parse( xml ); + } + #endregion Index: IVersionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IVersionType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IVersionType.cs 31 Dec 2004 23:53:39 -0000 1.6 --- IVersionType.cs 30 Mar 2005 16:08:39 -0000 1.7 *************** *** 19,23 **** object Seed { get; } ! } } \ No newline at end of file --- 19,34 ---- object Seed { get; } ! /// <summary> ! /// When implemented by a class, converts the xml string from the ! /// mapping file to the .NET object. ! /// </summary> ! /// <param name="xml">The value of <c>discriminator-value</c> or <c>unsaved-value</c> attribute.</param> ! /// <returns>The string converted to the object.</returns> ! /// <remarks> ! /// This method needs to be able to handle any string. It should not just ! /// call System.Type.Parse without verifying that it is a parsable value ! /// for the System.Type. ! /// </remarks> ! object StringToObject( string xml ); } } \ No newline at end of file Index: DynamicComponentType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DynamicComponentType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DynamicComponentType.cs 1 Mar 2005 16:24:50 -0000 1.1 --- DynamicComponentType.cs 30 Mar 2005 16:08:38 -0000 1.2 *************** *** 1,11 **** using System.Collections; using NHibernate; using NHibernate.Engine; using NHibernate.Loader; using NHibernate.Util; namespace NHibernate.Type { - /* /// <summary> /// Handles "dynamic" components, represented as <tt>Map</tt>s --- 1,12 ---- using System.Collections; using NHibernate; + using NHibernate.Collection; using NHibernate.Engine; using NHibernate.Loader; + using NHibernate.SqlTypes; using NHibernate.Util; namespace NHibernate.Type { /// <summary> /// Handles "dynamic" components, represented as <tt>Map</tt>s *************** *** 16,246 **** private IType[] propertyTypes; private int propertySpan; ! private Cascades.CascadeStyle[] cascade; ! private OuterJoinFetchStrategy[] joinedFetch; public DynamicComponentType( string[] propertyNames, IType[] propertyTypes, ! int propertySpan, ! Cascades.CascadeStyle[] cascade, ! OuterJoinFetchStrategy[] joinedFetch ) { this.propertyNames = propertyNames; this.propertyTypes = propertyTypes; - this.propertySpan = propertySpan; this.cascade = cascade; this.joinedFetch = joinedFetch; } #region IAbstractComponentType Members ! public IType[] Subtypes { ! get { return propertyTypes; } } public string[] PropertyNames { get { ! // TODO: Add DynamicComponentType.PropertyNames getter implementation ! return null; } } ! public object[] GetPropertyValues(object component, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.GetPropertyValues implementation ! return null; } ! public void SetPropertyValues(object component, object[] values) { ! // TODO: Add DynamicComponentType.SetPropertyValues implementation } ! public object GetPropertyValue(object component, int i, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.GetPropertyValue implementation ! return null; } ! public NHibernate.Engine.Cascades.CascadeStyle Cascade(int i) { ! // TODO: Add DynamicComponentType.Cascade implementation ! return null; } ! public NHibernate.Loader.OuterJoinFetchStrategy EnableJoinedFetch(int i) { ! // TODO: Add DynamicComponentType.EnableJoinedFetch implementation ! return null; } ! #endregion ! ! #region IType Members ! ! public bool IsAssociationType { ! get ! { ! // TODO: Add DynamicComponentType.IsAssociationType getter implementation ! return false; ! } } ! public bool IsPersistentCollectionType { ! get { ! // TODO: Add DynamicComponentType.IsPersistentCollectionType getter implementation ! return false; } } ! public bool IsComponentType { ! get { ! // TODO: Add DynamicComponentType.IsComponentType getter implementation ! return false; } - } ! public bool IsEntityType ! { ! get { ! // TODO: Add DynamicComponentType.IsEntityType getter implementation ! return false; } ! } ! public bool IsObjectType ! { ! get ! { ! // TODO: Add DynamicComponentType.IsObjectType getter implementation ! return false; ! } } ! public NHibernate.SqlTypes.SqlType[] SqlTypes(IMapping mapping) ! { ! // TODO: Add DynamicComponentType.SqlTypes implementation ! return null; ! } ! public int GetColumnSpan(IMapping mapping) { ! // TODO: Add DynamicComponentType.GetColumnSpan implementation ! return 0; } ! public System.Type ReturnedClass { ! get ! { ! // TODO: Add DynamicComponentType.ReturnedClass getter implementation ! return null; ! } } ! public bool Equals(object x, object y) { ! // TODO: Add DynamicComponentType.Equals implementation ! return false; } ! public bool IsDirty(object old, object current, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.IsDirty implementation ! return false; } ! public object NullSafeGet(System.Data.IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! // TODO: Add DynamicComponentType.NullSafeGet implementation ! return null; } ! object NHibernate.Type.IType.NullSafeGet(System.Data.IDataReader rs, string name, ISessionImplementor session, System.Object owner) { ! // TODO: Add DynamicComponentType.NHibernate.Type.IType.NullSafeGet implementation ! return null; } ! public void NullSafeSet(System.Data.IDbCommand st, object value, int index, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.NullSafeSet implementation } ! public string ToXML(object value, ISessionFactoryImplementor factory) { ! // TODO: Add DynamicComponentType.ToXML implementation ! return null; } ! public string Name { ! get { ! // TODO: Add DynamicComponentType.Name getter implementation ! return null; } - } ! public object DeepCopy(object val) ! { ! // TODO: Add DynamicComponentType.DeepCopy implementation ! return null; } ! public bool IsMutable { ! get { - // TODO: Add DynamicComponentType.IsMutable getter implementation return false; } } ! public object Disassemble(object value, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.Disassemble implementation return null; } ! public object Assemble(object cached, ISessionImplementor session, object owner) { ! // TODO: Add DynamicComponentType.Assemble implementation return null; } ! public bool HasNiceEquals { ! get ! { ! // TODO: Add DynamicComponentType.HasNiceEquals getter implementation ! return false; ! } } ! public object Hydrate(System.Data.IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! // TODO: Add DynamicComponentType.Hydrate implementation return null; } ! public object ResolveIdentifier(object value, ISessionImplementor session, object owner) { ! // TODO: Add DynamicComponentType.ResolveIdentifier implementation ! return null; } #endregion } - */ } --- 17,397 ---- private IType[] propertyTypes; private int propertySpan; ! private readonly Cascades.CascadeStyle[] cascade; ! private readonly OuterJoinFetchStrategy[] joinedFetch; + /// <summary> + /// + /// </summary> + /// <param name="propertyNames"></param> + /// <param name="propertyTypes"></param> + /// <param name="joinedFetch"></param> + /// <param name="cascade"></param> public DynamicComponentType( string[] propertyNames, IType[] propertyTypes, ! OuterJoinFetchStrategy[] joinedFetch, ! Cascades.CascadeStyle[] cascade ) { this.propertyNames = propertyNames; this.propertyTypes = propertyTypes; this.cascade = cascade; this.joinedFetch = joinedFetch; + propertySpan = propertyTypes.Length; } #region IAbstractComponentType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public Cascades.CascadeStyle Cascade( int i ) { ! return cascade[ i ]; ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public OuterJoinFetchStrategy EnableJoinedFetch( int i ) ! { ! return joinedFetch[ i ]; } + /// <summary> + /// + /// </summary> public string[] PropertyNames { get { ! return propertyNames; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="i"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public object GetPropertyValue( object component, int i, ISessionImplementor session ) { ! return GetPropertyValue( component, i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public object[] GetPropertyValues( object component, ISessionImplementor session ) { ! return GetPropertyValues( component ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public object GetPropertyValue( object component, int i ) { ! return ( (Map) component)[ propertyNames[ i ] ]; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <returns></returns> ! public object[] GetPropertyValues( object component ) { ! Map bean = (Map) component; ! object[] result = new object[ propertySpan ]; ! for ( int i = 0; i < propertySpan; i++ ) ! { ! result[ i ] = bean[ propertyNames[ i ] ]; ! } ! return result; } ! /// <summary> ! /// ! /// </summary> ! public IType[] Subtypes { ! get { return propertyTypes; } } ! /// <summary> ! /// ! /// </summary> ! /// <returns></returns> ! public object Instantiate() { ! return new Map(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="values"></param> ! public void SetPropertyValues( object component, object[] values ) { ! Map map = component as Map; ! for ( int i = 0; i < propertySpan; i++ ) { ! map[ propertyNames[ i ] ] = values[ i ]; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <returns></returns> ! public override object DeepCopy( object component ) { ! if ( component == null ) { ! return null; } ! object[] values = GetPropertyValues( component ); ! for ( int i = 0; i < propertySpan; i++ ) { ! values[ i ] = propertyTypes[ i ].DeepCopy( values[ i ] ); } ! object result = Instantiate(); ! SetPropertyValues( result, values ); ! return result; } ! #endregion ! #region IType Members ! ! /// <summary></summary> ! public override bool IsAssociationType { ! // TODO: Add DynamicComponentType.IsAssociationType getter implementation ! get { return false; } } ! /// <summary></summary> ! public override bool IsPersistentCollectionType { ! // TODO: Add DynamicComponentType.IsPersistentCollectionType getter implementation ! get { return false; } } ! /// <summary></summary> ! public override bool IsComponentType { ! // TODO: Add DynamicComponentType.IsComponentType getter implementation ! get { return false; } } ! /// <summary></summary> ! public override bool IsEntityType { ! // TODO: Add DynamicComponentType.IsEntityType getter implementation ! get { return false; } } ! /// <summary></summary> ! public override bool IsObjectType { ! // TODO: Add DynamicComponentType.IsObjectType getter implementation ! get { return false; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="mapping"></param> ! /// <returns></returns> ! public override SqlType[] SqlTypes(IMapping mapping) { ! // Not called at runtime so it doesn't matter if it's slow :-) ! SqlType[] sqlTypes = new SqlType[ GetColumnSpan( mapping ) ]; ! int n = 0; ! for ( int i = 0; i < propertySpan; i++ ) ! { ! SqlType[] subtypes = propertyTypes[ i ].SqlTypes( mapping ); ! for ( int j = 0; j < subtypes.Length; j++ ) ! { ! sqlTypes[ n++ ] = subtypes[ j ]; ! } ! } ! return sqlTypes; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="mapping"></param> ! /// <returns></returns> ! public override int GetColumnSpan(IMapping mapping) { ! // TODO: Add DynamicComponentType.GetColumnSpan implementation ! return 0; } ! /// <summary> ! /// ! /// </summary> ! public override System.Type ReturnedClass { ! // TODO: Add DynamicComponentType.ReturnedClass getter implementation ! get { return null; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if ( x == y ) { ! return true; ! } ! if ( x == null || y == null ) ! { ! return false; ! } ! Map xbean = x as Map; ! Map ybean = y as Map; ! for ( int i = 0; i < propertySpan; i++ ) ! { ! if ( !propertyTypes[ i ].Equals( xbean[ propertyNames[ i ] ], ybean[ propertyNames[ i ] ] ) ) ! { ! return false; ! } } ! return true; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="old"></param> ! /// <param name="current"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override bool IsDirty( object old, object current, ISessionImplementor session ) { ! if ( old == current ) { return false; } + if ( old == null || current == null ) + { + return true; + } + Map xbean = old as Map; + Map ybean = current as Map; + for ( int i = 0; i < propertySpan; i++ ) + { + if ( propertyTypes[ i ].IsDirty( xbean[ propertyNames[ i ] ], ybean[ propertyNames[ i ] ], session ) ) + { + return true; + } + } + return false; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="names"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet(System.Data.IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! // TODO: Add DynamicComponentType.NullSafeGet implementation return null; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet(System.Data.IDataReader rs, string name, ISessionImplementor session, System.Object owner) { ! // TODO: Add DynamicComponentType.NHibernate.Type.IType.NullSafeGet implementation return null; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! /// <param name="session"></param> ! public override void NullSafeSet(System.Data.IDbCommand st, object value, int index, ISessionImplementor session) { ! // TODO: Add DynamicComponentType.NullSafeSet implementation } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="factory"></param> ! /// <returns></returns> ! public override string ToXML(object value, ISessionFactoryImplementor factory) { ! // TODO: Add DynamicComponentType.ToXML implementation return null; } ! /// <summary> ! /// ! /// </summary> ! public override string Name { ! // TODO: ! get { return typeof(Map).Name; } ! } ! ! /// <summary> ! /// ! /// </summary> ! public override bool IsMutable ! { ! get { return true; } ! } ! ! /// <summary> ! /// ! /// </summary> ! public override bool HasNiceEquals ! { ! get { return false; } } #endregion } } Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PersistentEnumType.cs 31 Dec 2004 23:54:56 -0000 1.9 --- PersistentEnumType.cs 30 Mar 2005 16:08:40 -0000 1.10 *************** *** 224,228 **** { return GetInstance( cached ); - ; } } --- 224,227 ---- Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TimeSpanType.cs 31 Dec 2004 23:55:53 -0000 1.9 --- TimeSpanType.cs 30 Mar 2005 16:08:40 -0000 1.10 *************** *** 117,120 **** --- 117,130 ---- } + /// <summary> + /// + /// </summary> + /// <param name="xml"></param> + /// <returns></returns> + public object StringToObject( string xml ) + { + return TimeSpan.Parse( xml ); + } + #endregion Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** TypeFactory.cs 28 Mar 2005 10:18:37 -0000 1.47 --- TypeFactory.cs 30 Mar 2005 16:08:40 -0000 1.48 *************** *** 1139,1142 **** --- 1139,1177 ---- /// /// </summary> + /// <param name="row"></param> + /// <param name="types"></param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <returns></returns> + public static object[] Assemble( object[] row, IType[] types, ISessionImplementor session, object owner ) + { + object[] assembled = new object[ row.Length ]; + for ( int i = 0; i < row.Length; i++ ) + { + assembled[ i ] = types[ i ].Assemble( row[ i ], session, owner ); + } + return assembled; + } + + /// <summary> + /// + /// </summary> + /// <param name="row"></param> + /// <param name="types"></param> + /// <param name="session"></param> + /// <returns></returns> + public static object[] Disassemble( object[] row, IType[] types, ISessionImplementor session) + { + object[] disassembled = new object[ row.Length ]; + for ( int i = 0; i < row.Length; i++ ) + { + disassembled[ i ] = types[ i ].Disassemble( row[ i ], session ); + } + return disassembled; + } + + /// <summary> + /// + /// </summary> /// <param name="original"></param> /// <param name="target"></param> Index: EntityType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/EntityType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EntityType.cs 26 Mar 2005 13:24:37 -0000 1.10 --- EntityType.cs 30 Mar 2005 16:08:39 -0000 1.11 *************** *** 144,170 **** /// /// </summary> - /// <param name="value"></param> - /// <param name="session"></param> - /// <returns></returns> - public override object Disassemble( object value, ISessionImplementor session ) - { - if( value == null ) - { - return null; - } - else - { - object id = session.GetIdentifier( value ); - if( id == null ) - { - throw new AssertionFailure( "cannot cache a reference to an object with a null id" ); - } - return GetIdentifierType( session ).Disassemble( id, session ); - } - } - - /// <summary> - /// - /// </summary> /// <param name="session"></param> /// <returns></returns> --- 144,147 ---- Index: ManyToOneType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ManyToOneType.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ManyToOneType.cs 14 Mar 2005 18:54:20 -0000 1.12 --- ManyToOneType.cs 30 Mar 2005 16:08:39 -0000 1.13 *************** *** 116,119 **** --- 116,165 ---- return session.InternalLoad( AssociatedClass, id ); } + + /// <summary> + /// + /// </summary> + /// <param name="oid"></param> + /// <param name="session"></param> + /// <param name="owner"></param> + /// <returns></returns> + public override object Assemble( object oid, ISessionImplementor session, object owner ) + { + object id = GetIdentifierType( session ).Assemble( oid, session, owner ); + if ( id == null ) + { + return null; + } + else + { + return ResolveIdentifier( id, session ); + } + } + + /// <summary> + /// + /// </summary> + /// <param name="value"></param> + /// <param name="session"></param> + /// <returns></returns> + public override object Disassemble( object value, ISessionImplementor session ) + { + if ( value == null ) + { + return null; + } + else + { + // cache the actual id of the object, not the value of the + // property-ref, which might not be initialized + object id = session.GetEntityIdentifierIfNotUnsaved( value ); + if ( id == null ) + { + throw new AssertionFailure( "cannot cache a reference to an object with a null id: " + AssociatedClass.Name ); + } + return GetIdentifierType( session ).Disassemble( id, session ); + } + } + } } \ No newline at end of file |
From: Michael D. <mik...@us...> - 2005-03-29 05:43:23
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15441 Modified Files: releasenotes.txt Log Message: Looking through all of Paul's changes to see what effect on public api they have. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** releasenotes.txt 22 Feb 2005 02:47:19 -0000 1.27 --- releasenotes.txt 29 Mar 2005 05:43:00 -0000 1.28 *************** *** 1,2 **** --- 1,17 ---- + Build 0.8.0.0 + ======================== + - Added "namespace" and "assembly" attributes to hibernate-mapping element. + - Added lazy="true" as short hand for proxy="full type name" + - Added insert attribute to discriminator element. + - Added ability to set INamingStrategy on Configuration class. + - Added property-ref attribute on many-to-one and one-to-one elements. + - Added foreign-key attribute on many-to-one and one-to-one elements. + - Added check attribute to column element. + - Added sql-query element. + - Fixed one-to-one so that two queries are no longer issued when one side is null. + - Fixed bug with ISet.AddAll(ICollection) not being implemented. (Bill Hawes) + - Modified discriminator element to use "null" or "not null" as the value. + - Modified Dialect to use Hibernate 2.1 methods. + Build 0.7.0.0 ======================== |
From: Michael D. <mik...@us...> - 2005-03-29 05:41:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13882/NHibernate/Mapping Modified Files: Any.cs Array.cs Collection.cs Component.cs Constraint.cs Formula.cs IValue.cs Map.cs OneToMany.cs OneToOne.cs PrimitiveArray.cs Property.cs RootClass.cs SimpleValue.cs Log Message: Added a few comments found in h2.1 while looking through code to see what the changes have been. Index: Formula.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Formula.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Formula.cs 14 Mar 2005 14:36:26 -0000 1.6 --- Formula.cs 29 Mar 2005 05:41:04 -0000 1.7 *************** *** 5,9 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Formula { --- 5,11 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A formula is a derived column value. ! /// </summary> public class Formula { Index: Collection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Collection.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Collection.cs 14 Mar 2005 14:36:26 -0000 1.9 --- Collection.cs 29 Mar 2005 05:41:04 -0000 1.10 *************** *** 7,11 **** namespace NHibernate.Mapping { ! /// <summary></summary> public abstract class Collection : IFetchable, IValue { --- 7,14 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Mapping for a collection. Subclasses specialize to particular ! /// collection styles. ! /// </summary> public abstract class Collection : IFetchable, IValue { *************** *** 252,255 **** --- 255,259 ---- private void CreateForeignKeys( ) { + // for inverse collections, let the "other end" hanlde it if ( !IsInverse ) { Index: Any.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Any.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Any.cs 14 Mar 2005 14:36:26 -0000 1.7 --- Any.cs 29 Mar 2005 05:41:04 -0000 1.8 *************** *** 4,12 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Any : SimpleValue { private IType identifierType; ! private IType metaType = TypeFactory.GetTypeType(); /// <summary> --- 4,17 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A NHibernate <c>any</c> type. ! /// </summary> ! /// <remarks> ! /// Polymorphic association to one of several tables. ! /// </remarks> public class Any : SimpleValue { private IType identifierType; ! private IType metaType = NHibernateUtil.Class; /// <summary> *************** *** 18,27 **** } - /// <summary></summary> - public override bool IsAny - { - get { return true; } - } - /// <summary> /// Get or set the identifier type --- 23,26 ---- Index: Property.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Property.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Property.cs 14 Mar 2005 19:02:12 -0000 1.14 --- Property.cs 29 Mar 2005 05:41:04 -0000 1.15 *************** *** 6,10 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Property { --- 6,13 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Mapping for a property of a .NET class (entity ! /// or component). ! /// </summary> public class Property { Index: OneToOne.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/OneToOne.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OneToOne.cs 26 Mar 2005 13:24:36 -0000 1.7 --- OneToOne.cs 29 Mar 2005 05:41:04 -0000 1.8 *************** *** 5,9 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class OneToOne : ToOne { --- 5,11 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A mapping for a <c>one-to-one</c> association. ! /// </summary> public class OneToOne : ToOne { *************** *** 47,51 **** { if( constrained && ReferencedPropertyName == null ) - //if( constrained ) { // TODO: 2.1+ handle the case of a foreign key to something other than the pk --- 49,52 ---- Index: SimpleValue.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/SimpleValue.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleValue.cs 14 Mar 2005 14:36:26 -0000 1.2 --- SimpleValue.cs 29 Mar 2005 05:41:04 -0000 1.3 *************** *** 234,243 **** /// <summary></summary> - public virtual bool IsAny - { - get { return false; } - } - - /// <summary></summary> public Formula Formula { --- 234,237 ---- Index: OneToMany.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/OneToMany.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OneToMany.cs 1 Mar 2005 16:24:49 -0000 1.5 --- OneToMany.cs 29 Mar 2005 05:41:04 -0000 1.6 *************** *** 6,10 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class OneToMany : IValue { --- 6,12 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A mapping for a <c>one-to-many</c> association. ! /// </summary> public class OneToMany : IValue { Index: RootClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/RootClass.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RootClass.cs 14 Mar 2005 14:36:26 -0000 1.14 --- RootClass.cs 29 Mar 2005 05:41:04 -0000 1.15 *************** *** 9,13 **** { /// <summary> ! /// Declaration of a System.Type mapped with the <c><class></c> element. /// </summary> public class RootClass : PersistentClass --- 9,15 ---- { /// <summary> ! /// Declaration of a System.Type mapped with the <c><class></c> element that ! /// is the root class of a table-per-sublcass, or table-per-concrete-class ! /// inheritance heirarchy. /// </summary> public class RootClass : PersistentClass Index: Array.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Array.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Array.cs 14 Mar 2005 14:36:26 -0000 1.6 --- Array.cs 29 Mar 2005 05:41:04 -0000 1.7 *************** *** 1,3 **** - using NHibernate.Collection; using NHibernate.Type; --- 1,2 ---- Index: Constraint.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Constraint.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Constraint.cs 14 Mar 2005 14:36:26 -0000 1.8 --- Constraint.cs 29 Mar 2005 05:41:04 -0000 1.9 *************** *** 1,4 **** using System.Collections; - using System.Text; using NHibernate.Engine; --- 1,3 ---- *************** *** 6,10 **** { /// <summary> ! /// Base class for Constraints in the database. /// </summary> public abstract class Constraint : IRelationalModel --- 5,9 ---- { /// <summary> ! /// Base class for relational constraints in the database. /// </summary> public abstract class Constraint : IRelationalModel Index: IValue.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/IValue.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IValue.cs 1 Mar 2005 16:24:49 -0000 1.1 --- IValue.cs 29 Mar 2005 05:41:04 -0000 1.2 *************** *** 16,55 **** { /// <summary> ! /// /// </summary> int ColumnSpan { get; } /// <summary> ! /// /// </summary> ICollection ColumnCollection { get; } /// <summary> ! /// /// </summary> IType Type { get; } /// <summary> ! /// /// </summary> Table Table { get; } /// <summary> ! /// /// </summary> Formula Formula { get; } /// <summary> ! /// /// </summary> bool IsUnique { get; } /// <summary> ! /// /// </summary> bool IsNullable { get; } /// <summary> ! /// /// </summary> bool IsSimpleValue { get; } --- 16,62 ---- { /// <summary> ! /// Gets the number of columns that this value spans in the table. /// </summary> int ColumnSpan { get; } /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Column"/> objects ! /// that this value is stored in. /// </summary> ICollection ColumnCollection { get; } /// <summary> ! /// Gets the <see cref="IType"/> to read/write the Values. /// </summary> IType Type { get; } /// <summary> ! /// Gets the <see cref="Table"/> this Value is stored in. /// </summary> Table Table { get; } /// <summary> ! /// Gets the <see cref="Formula"/> used to populate the Value. /// </summary> + /// <remarks> + /// If a <see cref="Formula"/> is not used then this will be + /// <c>null</c>. + /// </remarks> Formula Formula { get; } /// <summary> ! /// Gets a <see cref="bool"/> indicating if this Value is unique. /// </summary> bool IsUnique { get; } /// <summary> ! /// Gets a <see cref="bool"/> indicating if this Value can have ! /// null values. /// </summary> bool IsNullable { get; } /// <summary> ! /// Gets a <see cref="bool"/> indicating if this is a SimpleValue ! /// that does not involve foreign keys. /// </summary> bool IsSimpleValue { get; } *************** *** 61,68 **** /// <summary> ! /// /// </summary> ! /// <param name="mapping"></param> ! /// <returns></returns> bool IsValid( IMapping mapping ); --- 68,83 ---- /// <summary> ! /// Determines if the Value is part of a valid mapping. /// </summary> ! /// <param name="mapping">The <see cref="IMapping"/> to validate.</param> ! /// <returns> ! /// <c>true</c> if the Value is part of a valid mapping, <c>false</c> ! /// otherwise. ! /// </returns> ! /// <exception cref="MappingException"></exception> ! /// <remarks> ! /// Mainly used to make sure that Value maps to the correct number ! /// of columns. ! /// </remarks> bool IsValid( IMapping mapping ); Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Map.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Map.cs 14 Mar 2005 14:36:26 -0000 1.9 --- Map.cs 29 Mar 2005 05:41:04 -0000 1.10 *************** *** 3,7 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Map : IndexedCollection { --- 3,10 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A map has a primary key consisting of the key columns ! /// + index columns. ! /// </summary> public class Map : IndexedCollection { Index: Component.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Component.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Component.cs 14 Mar 2005 14:36:26 -0000 1.8 --- Component.cs 29 Mar 2005 05:41:04 -0000 1.9 *************** *** 4,8 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Component : SimpleValue { --- 4,11 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// The mapping for a component, composite element, composite identifier, ! /// etc. ! /// </summary> public class Component : SimpleValue { Index: PrimitiveArray.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PrimitiveArray.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PrimitiveArray.cs 31 Dec 2004 21:27:42 -0000 1.4 --- PrimitiveArray.cs 29 Mar 2005 05:41:04 -0000 1.5 *************** *** 1,5 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class PrimitiveArray : Array { --- 1,8 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A primitive array has a primary key consisting ! /// of the key columns + index column. ! /// </summary> public class PrimitiveArray : Array { |
From: Michael D. <mik...@us...> - 2005-03-29 05:35:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10129/NHibernate/Cfg Modified Files: Binder.cs Mappings.cs Log Message: Renamed Assembly and Namespace to DefaultAssembly and DefaultNamespace so we aren't using a C# keyword as a field name. Index: Mappings.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Mappings.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Mappings.cs 26 Mar 2005 13:24:36 -0000 1.14 --- Mappings.cs 29 Mar 2005 05:35:35 -0000 1.15 *************** *** 26,31 **** private IList propertyReferences; private string defaultAccess; ! private string @namespace; ! private string assembly; private IDictionary caches; private INamingStrategy namingStrategy; --- 26,31 ---- private IList propertyReferences; private string defaultAccess; ! private string defaultNamespace; ! private string defaultAssembly; private IDictionary caches; private INamingStrategy namingStrategy; *************** *** 143,150 **** /// The default namespace for persistent classes /// </summary> ! public string Namespace { ! get { return @namespace; } ! set { @namespace = value; } } --- 143,150 ---- /// The default namespace for persistent classes /// </summary> ! public string DefaultNamespace { ! get { return defaultNamespace; } ! set { defaultNamespace = value; } } *************** *** 152,159 **** /// The default assembly for persistent classes /// </summary> ! public string Assembly { ! get { return assembly; } ! set { assembly = value; } } --- 152,159 ---- /// The default assembly for persistent classes /// </summary> ! public string DefaultAssembly { ! get { return defaultAssembly; } ! set { defaultAssembly = value; } } Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Binder.cs 28 Mar 2005 10:14:52 -0000 1.44 --- Binder.cs 29 Mar 2005 05:35:32 -0000 1.45 *************** *** 39,46 **** string[] parts = className.Split( ',' ); string name = parts[ 0 ]; ! if ( name.IndexOf( '.' ) == -1 && mapping.Namespace != null ) { // No namespace - use the default ! name = mapping.Namespace + "." + name; } --- 39,46 ---- string[] parts = className.Split( ',' ); string name = parts[ 0 ]; ! if ( name.IndexOf( '.' ) == -1 && mapping.DefaultNamespace != null ) { // No namespace - use the default ! name = mapping.DefaultNamespace + "." + name; } *************** *** 48,52 **** if ( parts.Length == 1 ) { ! if ( mapping.Assembly == null ) { // No default, let it try and find it automatically --- 48,52 ---- if ( parts.Length == 1 ) { ! if ( mapping.DefaultAssembly == null ) { // No default, let it try and find it automatically *************** *** 56,60 **** { // No assembly - use the default ! assm = ", " + mapping.Assembly; } } --- 56,60 ---- { // No assembly - use the default ! assm = ", " + mapping.DefaultAssembly; } } *************** *** 1369,1375 **** model.IsAutoImport = (aiNode==null) ? true : "true".Equals( aiNode.Value ); XmlAttribute nsNode = hmNode.Attributes["namespace"]; ! model.Namespace = (nsNode==null) ? null : nsNode.Value ; XmlAttribute assemblyNode = hmNode.Attributes["assembly"]; ! model.Assembly = (assemblyNode==null) ? null : assemblyNode.Value ; nsmgr = new XmlNamespaceManager(doc.NameTable); --- 1369,1375 ---- model.IsAutoImport = (aiNode==null) ? true : "true".Equals( aiNode.Value ); XmlAttribute nsNode = hmNode.Attributes["namespace"]; ! model.DefaultNamespace = (nsNode==null) ? null : nsNode.Value ; XmlAttribute assemblyNode = hmNode.Attributes["assembly"]; ! model.DefaultAssembly = (assemblyNode==null) ? null : assemblyNode.Value ; nsmgr = new XmlNamespaceManager(doc.NameTable); *************** *** 1499,1502 **** --- 1499,1504 ---- } + // TODO: rename this to something like SecondPassBase so we can rename the + // method secondPass(...) to .net conventions. public abstract class SecondPass { *************** *** 1516,1519 **** --- 1518,1522 ---- if ( log.IsDebugEnabled ) log.Debug("Second pass for collection: " + collection.Role ); secondPass(persistentClasses); + //TODO: h2.1 has a call to collection.createAllKeys(); here if ( log.IsDebugEnabled ) { |