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: Michael D. <mik...@us...> - 2004-06-18 13:48:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22528/NHibernate.Test Modified Files: FumTest.cs Log Message: Modified some properties to follow .net naming standards and wrote more test for composite ids. Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FumTest.cs 9 Jun 2004 01:05:46 -0000 1.5 --- FumTest.cs 18 Jun 2004 13:48:11 -0000 1.6 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Collections; using NHibernate.DomainModel; *************** *** 9,13 **** /// <summary> ! /// Summary description for FumTest. /// </summary> [TestFixture] --- 10,14 ---- /// <summary> ! /// FumTest handles testing Composite Ids. /// </summary> [TestFixture] *************** *** 80,92 **** [Test] - [Ignore("Test not yet written")] public void ListIdentifiers() { } [Test] - [Ignore("Test not yet written")] public void CompositeID() { } --- 81,165 ---- [Test] public void ListIdentifiers() { + ISession s = sessions.OpenSession(); + Fum fum = new Fum( FumTest.FumKey("fum") ); + fum.FumString = "fo fee fi"; + s.Save(fum); + + fum = new Fum( FumTest.FumKey("fi") ); + fum.FumString = "fee fi fo"; + s.Save(fum); + + // not doing a flush because the Find will do an auto flush unless we tell the session a + // different FlushMode + IList list = s.Find("select fum.Id from fum in class NHibernate.DomainModel.Fum where not fum.FumString = 'FRIEND'"); + + Assert.AreEqual(2, list.Count, "List Identifiers"); + + IEnumerator enumerator = s.Enumerable("select fum.Id from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'").GetEnumerator(); + int i = 0; + while(enumerator.MoveNext()) + { + Assert.IsTrue(enumerator.Current is FumCompositeID, "Iterating Identifiers"); + i++; + } + + Assert.AreEqual(2, i, "Number of Ids found."); + + // clean up by deleting the 2 Fum objects that were added. + s.Delete( s.Load( typeof(Fum), list[0] ) ); + s.Delete( s.Load( typeof(Fum), list[1] ) ); + s.Flush(); + s.Close(); + + } [Test] public void CompositeID() { + ISession s = sessions.OpenSession(); + Fum fum = new Fum( FumTest.FumKey("fum") ); + fum.FumString = "fee fi fo"; + s.Save(fum); + + Assert.AreSame( fum, s.Load( typeof(Fum), FumTest.FumKey("fum"), LockMode.Upgrade ) ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + fum = (Fum) s.Load( typeof(Fum), FumTest.FumKey("fum"), LockMode.Upgrade ); + Assert.IsNotNull(fum, "Load by composite key"); + + Fum fum2 = new Fum( FumTest.FumKey("fi") ); + fum2.FumString = "fee fo fi"; + fum.Fo = fum2; + s.Save(fum2); + + IList list = s.Find("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'"); + Assert.AreEqual(2, list.Count, "Find a List of Composite Keyed objects"); + + IList list2 = s.Find("select fum from fum in class NHibernate.DomainModel.Fum where fum.FumString='fee fi fo'"); + Assert.AreEqual(fum, (Fum)list2[0], "Find one Composite Keyed object"); + + fum.Fo = null; + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + IEnumerator enumerator = s.Enumerable("from fum in class NHibernate.DomainModel.Fum where not fum.FumString='FRIEND'").GetEnumerator(); + int i = 0; + while(enumerator.MoveNext()) + { + fum = (Fum) enumerator.Current; + s.Delete(fum); + i++; + } + + Assert.AreEqual(2, i, "Iterate on Composite Key"); + s.Flush(); + s.Close(); + } *************** *** 96,100 **** ISession s = sessions.OpenSession(); Fum fum = new Fum( FumKey("fum") ); ! fum.fum = "fee fi fo"; //s.Save(fum); commented out in h2.0.3 Fumm fumm = new Fumm(); --- 169,173 ---- ISession s = sessions.OpenSession(); Fum fum = new Fum( FumKey("fum") ); ! fum.FumString = "fee fi fo"; //s.Save(fum); commented out in h2.0.3 Fumm fumm = new Fumm(); |
From: Michael D. <mik...@us...> - 2004-06-18 13:43:57
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19751/NHibernate/Hql Modified Files: QueryTranslator.cs Log Message: Added fix/hack to GetEnumerable to so it would work. Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** QueryTranslator.cs 28 May 2004 09:08:57 -0000 1.30 --- QueryTranslator.cs 18 Jun 2004 13:43:45 -0000 1.31 *************** *** 923,933 **** IDictionary namedParams, IDictionary lockModes, ISessionImplementor session) { IDbCommand st = PrepareQueryStatement( ! ApplyLocks(SqlString, lockModes, session.Factory.Dialect).ToString(), values, types, namedParams, selection, false, session); try { SetMaxRows(st, selection); IDataReader rs = st.ExecuteReader(); Advance(rs, selection, session); return new EnumerableImpl(rs, session, ReturnTypes, ScalarColumnNames ); --- 923,958 ---- IDictionary namedParams, IDictionary lockModes, ISessionImplementor session) { + //TODO: this is a major hack - apply locks is not working with a string of Sql so we need + // to give it a SqlString... + //http://jira.nhibernate.org:8080/browse/NH-64 + // ApplyLocks(SqlString, lockModes, session.Factory.Dialect).ToString(), + // this works because it is just appending strings and not doing any + string sqlWithLock = ApplyLocks(new SqlString(SQLString), lockModes, session.Factory.Dialect).ToString(); + + IDbCommand st = PrepareQueryStatement( ! sqlWithLock, values, types, namedParams, selection, false, session); try { SetMaxRows(st, selection); + + //TODO: H2.0.3 - uses session.Batcher.GetResultSet(st) instead + // of directly executing the reader - the Batcher can be smarter + // about when to wrap the IDataReader in an NDataReader IDataReader rs = st.ExecuteReader(); + + //TODO: make this a much smarter implementation that looks at the Type + // that is being loaded and determines wether or not to wrap this IDataReader + // in a NDataReader. I believe the problem of multiple readers being opened + // are occuring in <composite-id> with <many-to-one> and <component> with + // a <collection>, <many-to-one>, and <one-to-one> inside of them. I believe + // this is caused when the NullSafeGet() method calls other methods that can + // potentially perform a Load of another object. + if(!session.Factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders) + { + rs = new Driver.NDataReader(rs); + } + Advance(rs, selection, session); return new EnumerableImpl(rs, session, ReturnTypes, ScalarColumnNames ); |
From: Michael D. <mik...@us...> - 2004-06-17 21:19:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13398 Modified Files: ClassWithCompositeIdFixture.cs Log Message: Added an hql test for a composite-id Index: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/ClassWithCompositeIdFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassWithCompositeIdFixture.cs 11 Jun 2004 20:09:30 -0000 1.2 --- ClassWithCompositeIdFixture.cs 17 Jun 2004 21:18:57 -0000 1.3 *************** *** 17,21 **** private DateTime firstDateTime = new DateTime(2003, 8, 16); private DateTime secondDateTime = new DateTime(2003, 8, 17); ! [SetUp] --- 17,22 ---- private DateTime firstDateTime = new DateTime(2003, 8, 16); private DateTime secondDateTime = new DateTime(2003, 8, 17); ! private CompositeId id; ! private CompositeId secondId; [SetUp] *************** *** 23,26 **** --- 24,29 ---- { ExportSchema( new string[] { "NHSpecific.ClassWithCompositeId.hbm.xml" } ); + id = new CompositeId("stringKey", 3, firstDateTime); + secondId = new CompositeId("stringKey2", 5, secondDateTime); } *************** *** 54,59 **** public void TestSimpleCRUD() { - CompositeId id = new CompositeId("stringKey", 3, firstDateTime); - CompositeId secondId = new CompositeId("stringKey2", 5, secondDateTime); // insert the new objects --- 57,60 ---- *************** *** 176,179 **** --- 177,213 ---- } + [Test] + public void Hql() + { + // insert the new objects + ISession s = sessions.OpenSession(); + ITransaction t = s.BeginTransaction(); + + ClassWithCompositeId theClass = new ClassWithCompositeId(); + theClass.Id = id; + theClass.OneProperty = 5; + + ClassWithCompositeId theSecondClass = new ClassWithCompositeId(); + theSecondClass.Id = secondId; + theSecondClass.OneProperty = 10; + + s.Save(theClass); + s.Save(theSecondClass); + + t.Commit(); + s.Close(); + + ISession s2 = sessions.OpenSession(); + + IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString"); + + hql.SetString("keyString", id.KeyString); + + IList results = hql.List(); + + Assert.AreEqual(1, results.Count); + + } + } |
From: Michael D. <mik...@us...> - 2004-06-17 21:18:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12520 Modified Files: ABCProxyTest.cs ABCTest.cs Log Message: Minor changes for tests. Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ABCProxyTest.cs 9 Jun 2004 01:05:46 -0000 1.7 --- ABCProxyTest.cs 17 Jun 2004 21:17:54 -0000 1.8 *************** *** 26,30 **** C1 c1 = new C1(); D d = new D(); ! d.amount =213.34f; c1.Address = "foo bar"; c1.Count = 23432; --- 26,30 ---- C1 c1 = new C1(); D d = new D(); ! d.Amount =213.34f; c1.Address = "foo bar"; c1.Count = 23432; *************** *** 32,36 **** c1.D = d; s.Save(c1); ! d.id = c1.Id; s.Save(d); t.Commit(); --- 32,36 ---- c1.D = d; s.Save(c1); ! d.Id = c1.Id; s.Save(d); t.Commit(); *************** *** 56,141 **** s.Close(); ! /* s = sessions.openSession(); ! t = s.beginTransaction(); ! c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( ! c1.getAddress().equals("foo bar") && ! (c1.getCount()==23432) && ! c1.getName().equals("c1") && ! c1.getD().getAmount()>213.3f ); ! t.commit(); ! s.close(); ! s = sessions.openSession(); ! t = s.beginTransaction(); ! c1a = (A) s.load( A.class, c1.getId() ); ! assertTrue( c1a.getName().equals("c1") ); ! c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( ! c1.getAddress().equals("foo bar") && ! (c1.getCount()==23432) && ! c1.getName().equals("c1") && ! c1.getD().getAmount()>213.3f ); ! c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( ! (c1b.getCount()==23432) && ! c1b.getName().equals("c1") ); ! assertTrue( c1a.getName().equals("c1") ); ! t.commit(); ! s.close(); ! s = sessions.openSession(); ! t = s.beginTransaction(); ! c1a = (A) s.load( A.class, c1.getId() ); ! assertTrue( c1a.getName().equals("c1") ); ! c1 = (C1) s.load( C1.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( ! c1.getAddress().equals("foo bar") && ! (c1.getCount()==23432) && ! c1.getName().equals("c1") && ! c1.getD().getAmount()>213.3f ); ! c1b = (B) s.load( B.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( ! (c1b.getCount()==23432) && ! c1b.getName().equals("c1") ); ! assertTrue( c1a.getName().equals("c1") ); ! t.commit(); ! s.close(); ! s = sessions.openSession(); ! t = s.beginTransaction(); ! c1a = (A) s.load( A.class, c1.getId() ); ! c1 = (C1) s.load( C1.class, c1.getId() ); ! c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( c1a.getName().equals("c1") ); ! assertTrue( ! c1.getAddress().equals("foo bar") && ! (c1.getCount()==23432) && ! c1.getName().equals("c1") && ! c1.getD().getAmount()>213.3f ); ! assertTrue( ! (c1b.getCount()==23432) && ! c1b.getName().equals("c1") ); ! System.out.println( s.delete("from a in class A") ); ! t.commit(); ! s.close(); ! s = sessions.openSession(); ! t = s.beginTransaction(); ! s.save( new B() ); ! s.save( new A() ); ! assertTrue( s.find("from b in class B").size()==1 ); ! assertTrue( s.find("from a in class A").size()==2 ); ! s.delete("from a in class A"); ! t.commit(); ! s.close(); ! */ } --- 56,141 ---- s.Close(); ! s = sessions.OpenSession(); ! t = s.BeginTransaction(); ! c1 = (C1) s.Load( typeof(C1), c1.Id ); ! Assert.IsTrue( ! c1.Address.Equals("foo bar") && ! (c1.Count==23432) && ! c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); ! t.Commit(); ! s.Close(); ! s = sessions.OpenSession(); ! t = s.BeginTransaction(); ! c1a = (A) s.Load( typeof(A), c1.Id ); ! Assert.IsTrue( c1a.Name.Equals("c1") ); ! c1 = (C1) s.Load( typeof(C1), c1.Id ); ! Assert.IsTrue( ! c1.Address.Equals("foo bar") && ! (c1.Count==23432) && ! c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); ! c1b = (B) s.Load( typeof(B), c1.Id ); ! Assert.IsTrue( ! (c1b.Count==23432) && ! c1b.Name.Equals("c1") ); ! Assert.IsTrue( c1a.Name.Equals("c1") ); ! t.Commit(); ! s.Close(); ! s = sessions.OpenSession(); ! t = s.BeginTransaction(); ! c1a = (A) s.Load( typeof(A), c1.Id ); ! Assert.IsTrue( c1a.Name.Equals("c1") ); ! c1 = (C1) s.Load( typeof(C1), c1.Id, LockMode.Upgrade ); ! Assert.IsTrue( ! c1.Address.Equals("foo bar") && ! (c1.Count==23432) && ! c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); ! c1b = (B) s.Load( typeof(B), c1.Id, LockMode.Upgrade); ! Assert.IsTrue( ! (c1b.Count==23432) && ! c1b.Name.Equals("c1") ); ! Assert.IsTrue( c1a.Name.Equals("c1") ); ! t.Commit(); ! s.Close(); ! s = sessions.OpenSession(); ! t = s.BeginTransaction(); ! c1a = (A) s.Load( typeof(A), c1.Id ); ! c1 = (C1) s.Load( typeof(C1), c1.Id ); ! c1b = (B) s.Load( typeof(B), c1.Id ); ! Assert.IsTrue( c1a.Name.Equals("c1") ); ! Assert.IsTrue( ! c1.Address.Equals("foo bar") && ! (c1.Count==23432) && ! c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); ! Assert.IsTrue( ! (c1b.Count==23432) && ! c1b.Name.Equals("c1") ); ! System.Console.Out.WriteLine( s.Delete("from a in class A") ); ! t.Commit(); ! s.Close(); ! s = sessions.OpenSession(); ! t = s.BeginTransaction(); ! s.Save( new B() ); ! s.Save( new A() ); ! Assert.IsTrue( s.Find("from b in class B").Count==1 ); ! Assert.IsTrue( s.Find("from a in class A").Count==2 ); ! s.Delete("from a in class A"); ! t.Commit(); ! s.Close(); ! } Index: ABCTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ABCTest.cs 9 Jun 2004 01:05:46 -0000 1.7 --- ABCTest.cs 17 Jun 2004 21:17:54 -0000 1.8 *************** *** 28,32 **** C1 c1 = new C1(); D d = new D(); ! d.amount =213.34f; c1.Address = "foo bar"; c1.Count = 23432; --- 28,32 ---- C1 c1 = new C1(); D d = new D(); ! d.Amount =213.34f; c1.Address = "foo bar"; c1.Count = 23432; *************** *** 34,38 **** c1.D = d; s.Save(c1); ! d.id = c1.Id; s.Save(d); --- 34,38 ---- c1.D = d; s.Save(c1); ! d.Id = c1.Id; s.Save(d); *************** *** 49,53 **** (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.amount>213.3f ); t.Commit(); --- 49,53 ---- (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); t.Commit(); *************** *** 61,65 **** (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.amount>213.3f ); t.Commit(); --- 61,65 ---- (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); t.Commit(); *************** *** 73,77 **** (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.amount>213.3f ); t.Commit(); --- 73,77 ---- (c1.Count==23432) && c1.Name.Equals("c1") && ! c1.D.Amount>213.3f ); t.Commit(); |
From: Michael D. <mik...@us...> - 2004-06-17 21:17:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12086 Modified Files: A.cs ABC.hbm.xml ABCProxy.hbm.xml C1.cs D.cs Log Message: Minor changes for tests. Index: D.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/D.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** D.cs 6 Apr 2004 10:51:42 -0000 1.1 --- D.cs 17 Jun 2004 21:17:13 -0000 1.2 *************** *** 1,12 **** - //------------------------------------------------------------------------------ - // <autogenerated> - // This code was generated by a tool. - // Runtime Version: v1.1.4322 - // - // Changes to this file may cause incorrect behavior and will be lost if - // the code is regenerated. - // </autogenerated> - //------------------------------------------------------------------------------ - using System; --- 1,2 ---- *************** *** 15,23 **** /// <summary> ! /// POJO for D /// </summary> - /// <remark> - /// This class is autogenerated - /// </remark> [Serializable] public class D --- 5,10 ---- /// <summary> ! /// POCO for D /// </summary> [Serializable] public class D *************** *** 25,36 **** #region Fields - /// <summary> - /// Holder for id - /// </summary> - private Int64 _id; ! /// <summary> ! /// Holder for amount ! /// </summary> private Double _amount; --- 12,17 ---- #region Fields ! private Int64 _id; private Double _amount; *************** *** 52,57 **** public D(Int64 id, Double amount) { ! this._id = id; ! this._amount = amount; } --- 33,38 ---- public D(Int64 id, Double amount) { ! _id = id; ! _amount = amount; } *************** *** 62,66 **** public D(Int64 id) { ! this._id = id; } #endregion --- 43,47 ---- public D(Int64 id) { ! _id = id; } #endregion *************** *** 70,98 **** /// Get/set for id /// </summary> ! public Int64 id { ! get ! { ! return this._id; ! } ! set ! { ! this._id = value; ! } } /// <summary> ! /// Get/set for amount /// </summary> ! public Double amount { ! get ! { ! return this._amount; ! } ! set ! { ! this._amount = value; ! } } --- 51,67 ---- /// Get/set for id /// </summary> ! public Int64 Id { ! get { return _id; } ! set { _id = value; } } /// <summary> ! /// Get/set for Amount /// </summary> ! public Double Amount { ! get { return _amount; } ! set { _amount = value; } } Index: A.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/A.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** A.cs 3 Jun 2004 18:01:24 -0000 1.2 --- A.cs 17 Jun 2004 21:17:13 -0000 1.3 *************** *** 52,60 **** get { ! return this._id; } set { ! this._id = value; } } --- 52,60 ---- get { ! return _id; } set { ! _id = value; } } *************** *** 67,75 **** get { ! return this._name; } set { ! this._name = value; } } --- 67,75 ---- get { ! return _name; } set { ! _name = value; } } Index: ABCProxy.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ABCProxy.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ABCProxy.hbm.xml 3 Jun 2004 18:01:24 -0000 1.3 --- ABCProxy.hbm.xml 17 Jun 2004 21:17:13 -0000 1.4 *************** *** 29,36 **** <class name="NHibernate.DomainModel.D, NHibernate.DomainModel" discriminator-value="0" proxy="NHibernate.DomainModel.D, NHibernate.DomainModel"> ! <id name="id" unsaved-value="null" type="Int64"> <generator class="assigned" /> </id> ! <property name="amount" type="Double" /> </class> </hibernate-mapping> \ No newline at end of file --- 29,36 ---- <class name="NHibernate.DomainModel.D, NHibernate.DomainModel" discriminator-value="0" proxy="NHibernate.DomainModel.D, NHibernate.DomainModel"> ! <id name="Id" unsaved-value="null" type="Int64"> <generator class="assigned" /> </id> ! <property name="Amount" type="Double" /> </class> </hibernate-mapping> \ No newline at end of file Index: C1.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/C1.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** C1.cs 3 Jun 2004 18:01:24 -0000 1.3 --- C1.cs 17 Jun 2004 21:17:13 -0000 1.4 *************** *** 78,86 **** get { ! return this._address; } set { ! this._address = value; } } --- 78,86 ---- get { ! return _address; } set { ! _address = value; } } *************** *** 93,101 **** get { ! return this._d; } set { ! this._d = value; } } --- 93,101 ---- get { ! return _d; } set { ! _d = value; } } Index: ABC.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ABC.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ABC.hbm.xml 3 Jun 2004 18:01:24 -0000 1.4 --- ABC.hbm.xml 17 Jun 2004 21:17:13 -0000 1.5 *************** *** 60,64 **** > <id ! name="id" unsaved-value="null" > --- 60,64 ---- > <id ! name="Id" unsaved-value="null" > *************** *** 66,70 **** </id> <property ! name="amount" type="Double" /> --- 66,70 ---- </id> <property ! name="Amount" type="Double" /> |
From: Michael D. <mik...@us...> - 2004-06-11 20:09:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11800 Modified Files: NHibernate.Test-1.1.csproj Log Message: Added a quick test for UserTypes to save an Int32 as a null to the db. Added a quick test for using ICriteria on a CompositeId Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NHibernate.Test-1.1.csproj 9 Jun 2004 01:05:46 -0000 1.24 --- NHibernate.Test-1.1.csproj 11 Jun 2004 20:09:30 -0000 1.25 *************** *** 333,336 **** --- 333,341 ---- /> <File + RelPath = "NHSpecificTest\UserTypeFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SqlCommandTest\SqlDeleteBuilderFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-06-11 20:09:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11800/NHSpecificTest Modified Files: ClassWithCompositeIdFixture.cs Added Files: UserTypeFixture.cs Log Message: Added a quick test for UserTypes to save an Int32 as a null to the db. Added a quick test for using ICriteria on a CompositeId Index: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/ClassWithCompositeIdFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassWithCompositeIdFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- ClassWithCompositeIdFixture.cs 11 Jun 2004 20:09:30 -0000 1.2 *************** *** 149,152 **** --- 149,180 ---- } + [Test] + public void Criteria() + { + CompositeId id = new CompositeId("stringKey", 3, firstDateTime); + ClassWithCompositeId cId = new ClassWithCompositeId(); + cId.Id = id; + cId.OneProperty = 5; + + // add the new instance to the session so I have something to get results + // back for + ISession s = sessions.OpenSession(); + s.Save(cId); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + ICriteria c = s.CreateCriteria(typeof(ClassWithCompositeId)); + c.Add( Expression.Expression.Eq("Id", id) ); + + // right now just want to see if the Criteria is valid + IList results = c.List(); + + Assert.AreEqual(1, results.Count); + + s.Close(); + } + + } } --- NEW FILE: UserTypeFixture.cs --- using System; using System.Data; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for UserTypeFixture. /// </summary> [TestFixture] public class UserTypeFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.ClassWithNullColumns.hbm.xml"}, true ); } /// <summary> /// Does a quick test to make sure that a Property specified with a NullInt32UserType /// persist to the db as a null. /// </summary> [Test] public void InsertNull() { ISession s = sessions.OpenSession(); ClassWithNullColumns userTypeClass = new ClassWithNullColumns(); userTypeClass.Id = 5; userTypeClass.FirstInt32 = 4; userTypeClass.SecondInt32 = 0; // with the user type should set value to null s.Save(userTypeClass); s.Flush(); s.Close(); // manually read from the db Connection.IConnectionProvider provider = Connection.ConnectionProviderFactory.NewConnectionProvider(cfg.Properties); IDbConnection conn = provider.GetConnection(); IDbCommand cmd = conn.CreateCommand(); cmd.Connection = conn; cmd.CommandText = "select * from usertype"; IDataReader reader = cmd.ExecuteReader(); while(reader.Read()) { Assert.AreEqual(5, reader[0]); Assert.AreEqual(4, reader[1]); Assert.AreEqual(DBNull.Value, reader[2]); break; } conn.Close(); } } } |
From: Michael D. <mik...@us...> - 2004-06-11 20:08:55
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10969 Modified Files: NHibernate.DomainModel-1.1.csproj Log Message: Added a quick test for UserTypes to save an Int32 as a null to the db. Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NHibernate.DomainModel-1.1.csproj 9 Jun 2004 01:03:59 -0000 1.18 --- NHibernate.DomainModel-1.1.csproj 11 Jun 2004 20:08:47 -0000 1.19 *************** *** 632,635 **** --- 632,644 ---- /> <File + RelPath = "NHSpecific\ClassWithNullColumns.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecific\ClassWithNullColumns.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "NHSpecific\CompositeId.cs" SubType = "Code" *************** *** 660,663 **** --- 669,677 ---- /> <File + RelPath = "NHSpecific\NullInt32UserType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecific\Parent.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-06-11 20:08:55
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10969/NHSpecific Added Files: ClassWithNullColumns.cs ClassWithNullColumns.hbm.xml NullInt32UserType.cs Log Message: Added a quick test for UserTypes to save an Int32 as a null to the db. --- NEW FILE: NullInt32UserType.cs --- using System; using System.Data; using NHibernate; using NHibernate.SqlTypes; using NHibernate.Type; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Converts a value of 0 to a DbNull /// </summary> public class NullInt32UserType : IUserType { private static NullableType _int32Type = NHibernate.Int32; public NullInt32UserType() { } #region IUserType Members public new bool Equals(object x, object y) { if(x==y) return true; int lhs = (x==null) ? 0 : (int)x; int rhs = (y==null) ? 0 : (int)y; return _int32Type.Equals(lhs, rhs); } public SqlType[] SqlTypes { get { return new SqlType[] { _int32Type.SqlType }; } } public System.Data.DbType[] DbTypes { get { return new DbType[] { _int32Type.SqlType.DbType }; } } public object DeepCopy(object value) { return value; } public void NullSafeSet(System.Data.IDbCommand cmd, object value, int index) { if(value.Equals(0)) { ( (IDbDataParameter)cmd.Parameters[index]).Value = DBNull.Value; } else { _int32Type.Set(cmd, value, index); } } public System.Type ReturnedType { get { return typeof(System.Int32); } } public object NullSafeGet(System.Data.IDataReader rs, string[] names, object owner) { return _int32Type.NullSafeGet(rs, names); } public bool IsMutable { get { return _int32Type.IsMutable; } } #endregion } } --- NEW FILE: ClassWithNullColumns.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for ClassWithNullColumns. /// </summary> public class ClassWithNullColumns { private int _id; private int _firstInt32; private int _secondInt32; public int Id { get { return _id; } set { _id = value; } } public int FirstInt32 { get { return _firstInt32; } set { _firstInt32 = value; } } public int SecondInt32 { get { return _secondInt32; } set { _secondInt32 = value; } } } } --- NEW FILE: ClassWithNullColumns.hbm.xml --- (This appears to be a binary file; contents omitted.) |
From: Michael D. <mik...@us...> - 2004-06-09 01:22:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2313 Modified Files: MultiTableTest.cs NewPerformanceTest.cs ODMGTest.cs ParentChildTest.cs SQLFunctionsTest.cs Log Message: Created shells for more Test Fixtures. Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParentChildTest.cs 9 Jun 2004 01:05:46 -0000 1.1 --- ParentChildTest.cs 9 Jun 2004 01:22:37 -0000 1.2 *************** *** 9,20 **** /// </summary> [TestFixture] ! public class ParentChildTest { ! public ParentChildTest() { - // - // TODO: Add constructor logic here - // } } } --- 9,105 ---- /// </summary> [TestFixture] ! public class ParentChildTest : TestCase { ! [SetUp] ! public void SetUp() ! { ! ExportSchema( new string[] { "FooBar.hbm.xml", ! "Baz.hbm.xml", ! "Qux.hbm.xml", ! "Glarch.hbm.xml", ! "Fum.hbm.xml", ! "Fumm.hbm.xml", ! "Fo.hbm.xml", ! "One.hbm.xml", ! "Many.hbm.xml", ! "Immutable.hbm.xml", ! "Fee.hbm.xml", ! //"Vetoer.hbm.xml", ! "Holder.hbm.xml", ! "ParentChild.hbm.xml", ! "Simple.hbm.xml", ! "Container.hbm.xml", ! "Circular.hbm.xml", ! "Stuff.hbm.xml" ! } ); ! } ! ! [Test] ! [Ignore("Test not yet written")] ! public void CollectionQuery() ! { ! } ! ! [Test] ! [Ignore("Test not yet written")] ! public void ParentChild() ! { ! } ! ! [Test] ! [Ignore("Test not yet written")] ! public void ParentNullChild() { } + + [Test] + [Ignore("Test not yet written")] + public void ManyToMany() + { + } + + [Test] + [Ignore("Test not yet written")] + public void Container() + { + } + + [Test] + [Ignore("Test not yet written")] + public void CascadeCompositeElements() + { + } + + [Test] + [Ignore("Test not yet written")] + public void Bag() + { + } + + [Test] + [Ignore("Test not yet written")] + public void CircularCascade() + { + } + + [Test] + [Ignore("Test not yet written")] + public void DeleteEmpty() + { + } + + [Test] + [Ignore("Test not yet written")] + public void Locking() + { + } + + [Test] + [Ignore("Test not yet written")] + public void ObjectType() + { + } + + } } Index: NewPerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NewPerformanceTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NewPerformanceTest.cs 9 Jun 2004 01:05:46 -0000 1.1 --- NewPerformanceTest.cs 9 Jun 2004 01:22:37 -0000 1.2 *************** *** 9,20 **** /// </summary> [TestFixture] ! public class NewPerformanceTest { ! public NewPerformanceTest() { ! // ! // TODO: Add constructor logic here ! // } } } --- 9,36 ---- /// </summary> [TestFixture] ! public class NewPerformanceTest : TestCase { ! [SetUp] ! public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml"} ); ! } ! ! [Test] ! [Ignore("Test not yet written")] ! public void Performance() ! { ! } ! ! private void Prepare() ! { ! //TODO: add details - not a test method } + + private void Delete() + { + //TODO: add details - not a test method + } + } } Index: ODMGTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ODMGTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ODMGTest.cs 9 Jun 2004 01:05:46 -0000 1.1 --- ODMGTest.cs 9 Jun 2004 01:22:37 -0000 1.2 *************** *** 14,18 **** { // ! // TODO: Add constructor logic here // } --- 14,19 ---- { // ! // TODO: figure out if I even want to port this ! // or just get rid of the ODMG API // } Index: MultiTableTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MultiTableTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MultiTableTest.cs 9 Jun 2004 01:05:46 -0000 1.1 --- MultiTableTest.cs 9 Jun 2004 01:22:37 -0000 1.2 *************** *** 18,69 **** --- 18,95 ---- } + [Test] + [Ignore("Test not yet written")] public void TestJoins() { } + [Test] + [Ignore("Test not yet written")] public void SubclassCollection() { } + [Test] + [Ignore("Test not yet written")] public void CollectionOnly() { } + [Test] + [Ignore("Test not yet written")] public void Queries() { } + [Test] + [Ignore("Test not yet written")] public void Constraints() { } + [Test] + [Ignore("Test not yet written")] public void MultiTable() { } + [Test] + [Ignore("Test not yet written")] public void MutliTableGeneratedId() { } + [Test] + [Ignore("Test not yet written")] public void MultiTableCollections() { } + [Test] + [Ignore("Test not yet written")] public void MultiTableManyToOne() { } + [Test] + [Ignore("Test not yet written")] public void MultiTableNativeId() { } + [Test] + [Ignore("Test not yet written")] public void Collection() { } + [Test] + [Ignore("Test not yet written")] public void OneToOne() { } + [Test] + [Ignore("Test not yet written")] public void CollectionPointer() { Index: SQLFunctionsTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLFunctionsTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SQLFunctionsTest.cs 9 Jun 2004 01:05:46 -0000 1.1 --- SQLFunctionsTest.cs 9 Jun 2004 01:22:37 -0000 1.2 *************** *** 9,20 **** /// </summary> [TestFixture] ! public class SQLFunctionsTest { ! public SQLFunctionsTest() { ! // ! // TODO: Add constructor logic here ! // } } } --- 9,47 ---- /// </summary> [TestFixture] ! public class SQLFunctionsTest : TestCase { ! [SetUp] ! public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml"//, ! //"Blobber.hbm.xml" ! } ); } + + [Test] + [Ignore("Test not yet written")] + public void SetProperties() + { + } + + [Test] + [Ignore("Test not yet written")] + public void NothingToUpdate() + { + } + + [Test] + [Ignore("Test not yet written")] + public void SQLFunctions() + { + } + + [Test] + [Ignore("Test not yet written")] + public void BlobClob() + { + } + + } } |
From: Michael D. <mik...@us...> - 2004-06-09 01:06:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23288/NHSpecificTest Added Files: BasicClassFixture.cs ClassWithCompositeIdFixture.cs JoinedSubclassFixture.cs MapFixture.cs NH47Fixture.cs NodeFixture.cs SimpleComponentFixture.cs SubclassFixture.cs UnsavedValueFixture.cs Log Message: Moved the new Test Fixtures I made to get NHibernate testing up and going to their own namespace because there was some name conflicts with h2.0.3 classes. --- NEW FILE: BasicClassFixture.cs --- using System; using System.Collections; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class BasicClassFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BasicClass.hbm.xml"}, true ); } [Test] public void TestCRUD() { int maxIndex = 22; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // make sure the previous insert went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); Assertion.AssertNotNull(bc[index]); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].Int32Array[1] = 15; bc[index].StringBag[0] = "Replaced Spot 0"; bc[index].StringArray[2] = "Replaced Spot 2"; bc[index].StringList[0] = "Replaced Spot 0"; bc[index].StringMap["keyZero"] = "Replaced Key 0"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].BooleanProperty = false; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // update the Binary property to make sure it picks up that it is dirty BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); bf.Serialize(stream, 4); bc[index].BinaryProperty = stream.ToArray(); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].ByteProperty = Byte.MinValue; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].CharacterProperty = 'b'; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // update a property to make sure it picks up that it is dirty s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].ClassProperty = typeof(System.String); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // 12 = french bc[index].CultureInfoProperty = new System.Globalization.CultureInfo(12); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].DateTimeProperty = DateTime.Parse("2004-02-15 08:00:00 PM"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].DecimalProperty = 5.55555M; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].DoubleProperty = 6458946; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].Int16Property = Int16.MinValue; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].Int32Property = Int32.MinValue; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].Int64Property = Int64.MinValue; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].SerializableProperty = new SerializableClass(); bc[index].SerializableProperty._classId = 1; bc[index].SerializableProperty._classString = "one string"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].SingleProperty = bc[index].SingleProperty * -1; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringProperty = "new string property"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].TicksProperty = DateTime.Now; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].TrueFalseProperty = false; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // make sure the previous updates went through s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].YesNoProperty = false; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY DELETE AssertDelete(id); } [Test] public void TestArrayCRUD() { int maxIndex = 4; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the array so it is updated - should not be recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringArray[0] = "modified string 0"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // change the array to a new array so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringArray = new string[] {"string one", "string two"}; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } [Test] public void TestPrimitiveArrayCRUD() { int maxIndex = 4; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the array so it is updated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); for(int i = 0; i < bc[index].Int32Array.Length; i++) { bc[index].Int32Array[i] = i+1; } s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // modify the array to a new array so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].Int32Array = new int[] {1,2,3,4,5,6}; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } [Test] public void TestMapCRUD() { int maxIndex = 4; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the array so it is updated - should not be recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and update another bc[index].StringMap.Remove("keyOne"); bc[index].StringMap["keyTwo"] = "modified string two"; bc[index].StringMap["keyThree"] = "added key three"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // change the List to a new List so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringMap = new Hashtable(); bc[index].StringMap.Add("keyZero", "new list zero"); bc[index].StringMap.Add("keyOne", "new list one"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } [Test] public void TestSetCRUD() { int maxIndex = 4; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the array so it is updated - should not be recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and add another bc[index].StringSet.Remove("zero"); bc[index].StringSet.Add("two", new object()); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // change the List to a new List so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringSet = new Hashtable(); bc[index].StringSet.Add("zero", new object()); bc[index].StringSet.Add("one", new object()); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } [Test] public void TestBagCRUD() { int maxIndex = 5; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the bag so it is updated - should not be recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and update another bc[index].StringBag.RemoveAt(bc[index].StringBag.Count-1); bc[index].StringBag[1] = "modified string 1"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // add an item to the list s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and update another bc[index].StringBag.Add("inserted into the bag"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // change the List to a new List so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringBag = new ArrayList(); bc[index].StringBag.Add("new bag zero"); bc[index].StringBag.Add("new bag one"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } [Test] public void TestListCRUD() { int maxIndex = 5; ISession[] s = new ISession[maxIndex]; ITransaction[] t = new ITransaction[maxIndex]; BasicClass[] bc = new BasicClass[maxIndex]; int index = 0; int id = 1; bc[index] = InsertBasicClass(id); index++; // modify the array so it is updated - should not be recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and update another bc[index].StringList.RemoveAt(bc[index].StringList.Count-1); bc[index].StringList[2] = "modified string 2"; s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // add an item to the list s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // remove the last one and update another bc[index].StringList.Add("inserted into the list"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // change the List to a new List so it is recreated s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); bc[index].StringList = new ArrayList(); bc[index].StringList.Add("new list zero"); bc[index].StringList.Add("new list one"); s[index].Update(bc[index]); t[index].Commit(); s[index].Close(); index++; // VERIFY PREVIOUS UPDATE & PERFORM DELETE s[index] = sessions.OpenSession(); t[index] = s[index].BeginTransaction(); bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); AssertPropertiesEqual(bc[index-1], bc[index]); // test the delete method s[index].Delete(bc[index]); t[index].Commit(); s[index].Close(); index++; // verify the delete went through AssertDelete(id); } internal void AssertDelete(int id) { ISession s = sessions.OpenSession(); try { BasicClass bc = (BasicClass)s.Load(typeof(BasicClass), id); } catch(ObjectNotFoundException onfe) { // I expect this to be thrown because the object no longer exists... } IList results = s.CreateCriteria(typeof(BasicClass)) .Add(Expression.Expression.Eq("Id", id)) .List(); Assertion.AssertEquals(0, results.Count); s.Close(); } internal BasicClass InsertBasicClass(int id) { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); BasicClass bc = new BasicClass(); InitializeBasicClass(id, ref bc); s.Save(bc); t.Commit(); s.Close(); return bc; } /// <summary> /// Compares the non Collection Properties of the BasicClass /// </summary> /// <param name="expected">The expected values.</param> /// <param name="actual">The Actual values.</param> /// <remarks> /// Passes to the overload with includeCollections=true /// </remarks> internal void AssertPropertiesEqual(BasicClass expected, BasicClass actual) { AssertPropertiesEqual(expected, actual, true); } /// <summary> /// Compares the non Collection Properties of the BasicClass /// </summary> /// <param name="expected">The expected values.</param> /// <param name="actual">The Actual values.</param> internal void AssertPropertiesEqual(BasicClass expected, BasicClass actual, bool includeCollections) { Assert.AreEqual(expected.Id, actual.Id, "Id"); ObjectAssertion.AssertEquals(expected.BinaryProperty, actual.BinaryProperty); Assert.AreEqual(expected.BooleanProperty, actual.BooleanProperty, "BooleanProperty"); Assert.AreEqual(expected.ByteProperty, actual.ByteProperty, "ByteProperty"); Assert.AreEqual(expected.CharacterProperty, actual.CharacterProperty, "CharacterProperty"); Assert.AreEqual(expected.ClassProperty, actual.ClassProperty, "ClassProperty"); Assert.AreEqual(expected.CultureInfoProperty, actual.CultureInfoProperty, "CultureInfoProperty"); Assert.AreEqual(expected.DateTimeProperty, actual.DateTimeProperty, "DateTimeProperty"); Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); Assertion.Assert("DecimalProperty", expected.DecimalProperty.Equals(actual.DecimalProperty)); Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); Assert.AreEqual(expected.Int32Property, actual.Int32Property, "Int32Property"); Assert.AreEqual(expected.Int64Property, actual.Int64Property, "Int64Property"); Assert.AreEqual(expected.SerializableProperty, actual.SerializableProperty, "SerializableProperty"); Assert.AreEqual(expected.SingleProperty, actual.SingleProperty, 0, "SingleProperty"); Assert.AreEqual(expected.StringProperty, actual.StringProperty, "StringProperty"); Assert.AreEqual(expected.TicksProperty, actual.TicksProperty, "TicksProperty"); Assert.AreEqual(expected.TrueFalseProperty, actual.TrueFalseProperty, "TrueFalseProperty"); Assert.AreEqual(expected.YesNoProperty, actual.YesNoProperty, "YesNoProperty"); if(includeCollections) { ObjectAssertion.AssertEquals(expected.StringArray, actual.StringArray); ObjectAssertion.AssertEquals(expected.Int32Array, actual.Int32Array); ObjectAssertion.AssertEquals(expected.StringBag, actual.StringBag, false); ObjectAssertion.AssertEquals(expected.StringList, actual.StringList); ObjectAssertion.AssertEquals(expected.StringMap, actual.StringMap, true); ObjectAssertion.AssertEquals(expected.StringSet, actual.StringSet, false); } } private void InitializeBasicClass(int id, ref BasicClass basicClass) { basicClass.Id = id; BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); bf.Serialize(stream, 5); basicClass.BinaryProperty = stream.ToArray(); basicClass.BooleanProperty = true; basicClass.ByteProperty = Byte.MaxValue; basicClass.CharacterProperty = 'a'; basicClass.ClassProperty = typeof(object); basicClass.CultureInfoProperty = System.Globalization.CultureInfo.CurrentCulture; basicClass.DateTimeProperty = DateTime.Parse("2003-12-01 10:45:21 AM"); basicClass.DecimalProperty = 5.64351M; basicClass.DoubleProperty = 456343; basicClass.Int16Property = Int16.MaxValue; basicClass.Int32Property = Int32.MaxValue; basicClass.Int64Property = Int64.MaxValue; basicClass.SerializableProperty = new SerializableClass(); basicClass.SerializableProperty._classId = 2; basicClass.SerializableProperty._classString = "string"; // more MySql problems - it returns 3.40282E38 // instead of 3.402823E+38 which is Single.MaxValue basicClass.SingleProperty = 3.5F; //Single.MaxValue; basicClass.StringProperty = "string property"; basicClass.TicksProperty = DateTime.Now; basicClass.TrueFalseProperty = true; basicClass.YesNoProperty = true; basicClass.StringArray = new string[] {"3 string", "2 string", "1 string"}; basicClass.Int32Array = new int[] {5,4,3,2,1}; IList stringBag = new ArrayList(3); stringBag.Add("string 0"); stringBag.Add("string 1"); stringBag.Add("string 2"); basicClass.StringBag = stringBag; IList stringList = new ArrayList(5); stringList.Add("new string zero"); stringList.Add("new string one"); stringList.Add("new string two"); stringList.Add("new string three"); stringList.Add("new string four"); basicClass.StringList = stringList; IDictionary stringMap = new Hashtable(); stringMap.Add("keyOne", "string one"); stringMap.Add("keyZero", "string zero"); stringMap.Add("keyTwo", "string two"); basicClass.StringMap = stringMap; basicClass.AddToStringSet("zero"); basicClass.AddToStringSet("one"); basicClass.AddToStringSet("zero"); } } } --- NEW FILE: SubclassFixture.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class SubclassFixture : TestCase { private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { //log4net.Config.DOMConfigurator.Configure(); ExportSchema( new string[] { "NHSpecific.Subclass.hbm.xml" } ); } [Test] public void TestCRUD() { // test the Save ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); JoinedSubclassOne one1 = new JoinedSubclassOne(); one1.Id = 2; one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; one1.TestLong = 6; one1.OneTestLong = 1; s1.Save(one1); JoinedSubclassBase base1 = new JoinedSubclassBase(); base1.Id = 1; base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; base1.TestLong = 5; s1.Save(base1); t1.Commit(); s1.Close(); // lets verify the correct classes were saved ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); // perform a load based on the base class JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 1); JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 2); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; Assertion.AssertNotNull(one2); // lets update the objects base2.TestString = "Did it get updated"; // update the properties from the subclass and base class one2.TestString = "Updated JoinedSubclassOne String"; one2.OneTestLong = 21; // save it through the base class reference and make sure that the // subclass properties get updated. s2.Update(base2); s2.Update(oneBase2); t2.Commit(); s2.Close(); // lets test the Criteria interface for subclassing ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); IList results3 = s3.CreateCriteria(typeof(JoinedSubclassBase)) .Add(Expression.Expression.In("TestString", new string[] {"Did it get updated", "Updated JoinedSubclassOne String" })) .List(); Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; JoinedSubclassOne one3 = null; foreach(JoinedSubclassBase obj in results3) { if(obj is JoinedSubclassOne) one3 = (JoinedSubclassOne)obj; else base3 = obj; } // verify the properties got updated ObjectAssertion.AssertPropertiesEqual(base2, base3); ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); s3.Delete(one3); t3.Commit(); s3.Close(); } } } --- NEW FILE: SimpleComponentFixture.cs --- using System; using System.Data; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class SimpleCompenentFixture : TestCase { private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.SimpleComponent.hbm.xml"} ); } [Test] public void TestLoad() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); TestInsert(); SimpleComponent simpleComp = (SimpleComponent)s.Load(typeof(SimpleComponent), 10); Assertion.AssertEquals(10, simpleComp.Key); Assertion.AssertEquals("TestCreated", simpleComp.Audit.CreatedUserId); Assertion.AssertEquals("TestUpdated", simpleComp.Audit.UpdatedUserId); t.Commit(); s.Close(); } /// <summary> /// Test the ability to insert a new row with a User Assigned Key /// Right now - the only way to verify this is to watch SQL Profiler /// </summary> [Test] public void TestInsert() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); // create a new SimpleComponent simpleComp = new SimpleComponent(); simpleComp.Name = "Simple 1"; simpleComp.Address = "Street 12"; simpleComp.Date = testDateTime; simpleComp.Count = 99; simpleComp.Audit.CreatedDate = System.DateTime.Now; simpleComp.Audit.CreatedUserId = "TestCreated"; simpleComp.Audit.UpdatedDate = System.DateTime.Now; simpleComp.Audit.UpdatedUserId = "TestUpdated"; s.Save(simpleComp, 10); t.Commit(); s.Close(); } } } --- NEW FILE: JoinedSubclassFixture.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class JoinedSubclassFixture : TestCase { private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.JoinedSubclass.hbm.xml" } ); } /// <summary> /// Test the ability to insert a new row with a User Assigned Key /// Right now - the only way to verify this is to watch SQL Profiler /// </summary> [Test] public void TestCRUD() { int one1Id; int base1Id; // test the Save ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); JoinedSubclassOne one1 = new JoinedSubclassOne(); //one1.Id = 2; one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; one1.TestLong = 6; one1.OneTestLong = 1; s1.Save(one1); JoinedSubclassBase base1 = new JoinedSubclassBase(); //base1.Id = 1; base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; base1.TestLong = 5; s1.Save(base1); t1.Commit(); s1.Close(); one1Id = one1.Id; base1Id = base1.Id; // lets verify the correct classes were saved ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); // perform a load based on the base class JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), base1Id); JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), one1Id); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; Assertion.AssertNotNull(one2); // lets update the objects base2.TestString = "Did it get updated"; // update the properties from the subclass and base class one2.TestString = "Updated JoinedSubclassOne String"; one2.OneTestLong = 21; // save it through the base class reference and make sure that the // subclass properties get updated. s2.Update(base2); s2.Update(oneBase2); t2.Commit(); s2.Close(); // lets test the Criteria interface for subclassing ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); IList results3 = s3.CreateCriteria(typeof(JoinedSubclassBase)) .Add(Expression.Expression.In("TestString", new string[] {"Did it get updated", "Updated JoinedSubclassOne String" })) .List(); Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; JoinedSubclassOne one3 = null; foreach(JoinedSubclassBase obj in results3) { if(obj is JoinedSubclassOne) one3 = (JoinedSubclassOne)obj; else base3 = obj; } // verify the properties got updated ObjectAssertion.AssertPropertiesEqual(base2, base3); ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); s3.Delete(one3); t3.Commit(); s3.Close(); } } } --- NEW FILE: UnsavedValueFixture.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for UnsavedValueTest. /// </summary> [TestFixture] public class UnsavedValueFixture : TestCase { public static int newId = 0; [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.UnsavedType.hbm.xml"}); } [Test] public void TestCRUD() { // make a new object outside of the Session UnsavedType unsavedToSave = new UnsavedType(); unsavedToSave.TypeName = "Simple UnsavedValue"; // open the first session to SaveOrUpdate it - should be Save ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); s1.SaveOrUpdate(unsavedToSave); t1.Commit(); s1.Close(); // simple should have been inserted - generating a new key for it Assertion.Assert("Id should not be zero", unsavedToSave.Id != 0); // use the ICriteria interface to get another instance in a different // session ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); IList results2 = s2.CreateCriteria(typeof(UnsavedType)) .Add(Expression.Expression.Eq("Id", unsavedToSave.Id)) .List(); Assertion.AssertEquals("Should have found a match for the new Id", 1, results2.Count); UnsavedType unsavedToUpdate = (UnsavedType)results2[0]; // make sure it has the same Id Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); t2.Commit(); s2.Close(); // passing it to the UI for modification unsavedToUpdate.TypeName = "ui changed it"; // create a new session for the Update ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); s3.SaveOrUpdate(unsavedToUpdate); t3.Commit(); s3.Close(); // make sure it has the same Id - if the Id has changed then that means it // was inserted. Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); // lets get a list of all the rows in the table to make sure // that there has not been any extra inserts ISession s4 = sessions.OpenSession(); ITransaction t4 = s4.BeginTransaction(); IList results4 = s4.CreateCriteria(typeof(UnsavedType)).List(); Assertion.AssertEquals("Should only be one item", 1, results4.Count); // lets make sure the object was updated UnsavedType unsavedToDelete = (UnsavedType)results4[0]; Assertion.AssertEquals(unsavedToUpdate.TypeName, unsavedToDelete.TypeName); s4.Delete(unsavedToDelete); t4.Commit(); s4.Close(); // lets make sure the object was deleted ISession s5 = sessions.OpenSession(); try { UnsavedType unsavedNull = (UnsavedType)s5.Load(typeof(UnsavedType), unsavedToDelete.Id); Assertion.AssertNull(unsavedNull); } catch(ObjectNotFoundException onfe) { // do nothing it was expected } s5.Close(); } } } --- NEW FILE: ClassWithCompositeIdFixture.cs --- using System; using System.Collections; using System.Data; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for ClassWithCompositeIdFixture. /// </summary> [TestFixture] public class ClassWithCompositeIdFixture : TestCase { private DateTime firstDateTime = new DateTime(2003, 8, 16); private DateTime secondDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.ClassWithCompositeId.hbm.xml" } ); } /// <summary> /// Test the basic CRUD operations for a class with a Composite Identifier /// </summary> /// <remarks> /// The following items are tested in this Test Script /// <list type=""> /// <item> /// <term>Save</term> /// </item> /// <item> /// <term>Load</term> /// </item> /// <item> /// <term>Criteria</term> /// </item> /// <item> /// <term>Update</term> /// </item> /// <item> /// <term>Delete</term> /// </item> /// <item> /// <term>Criteria - No Results</term> /// </item> /// </list> /// </remarks> [Test] public void TestSimpleCRUD() { CompositeId id = new CompositeId("stringKey", 3, firstDateTime); CompositeId secondId = new CompositeId("stringKey2", 5, secondDateTime); // insert the new objects ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); ClassWithCompositeId theClass = new ClassWithCompositeId(); theClass.Id = id; theClass.OneProperty = 5; ClassWithCompositeId theSecondClass = new ClassWithCompositeId(); theSecondClass.Id = secondId; theSecondClass.OneProperty = 10; s.Save(theClass); s.Save(theSecondClass); t.Commit(); s.Close(); // verify they were inserted and test the SELECT ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); ClassWithCompositeId theClass2 = (ClassWithCompositeId)s2.Load(typeof(ClassWithCompositeId), id); IList results2 = s2.CreateCriteria(typeof(ClassWithCompositeId)) .Add(Expression.Expression.Eq("Id", secondId)) .List(); Assertion.AssertEquals(1, results2.Count); ClassWithCompositeId theSecondClass2 = (ClassWithCompositeId)results2[0]; ClassWithCompositeId theClass2Copy = (ClassWithCompositeId)s2.Load(typeof(ClassWithCompositeId), id); // verify the same results through Criteria & Load were achieved Assertion.AssertSame(theClass2, theClass2Copy); // compare them to the objects created in the first session Assertion.AssertEquals(theClass.Id, theClass2.Id); Assertion.AssertEquals(theClass.OneProperty, theClass2.OneProperty); Assertion.AssertEquals(theSecondClass.Id, theSecondClass2.Id); Assertion.AssertEquals(theSecondClass.OneProperty, theSecondClass2.OneProperty); // test the update functionallity theClass2.OneProperty = 6; theSecondClass2.OneProperty = 11; s2.Update(theClass2); s2.Update(theSecondClass2); t2.Commit(); s2.Close(); // lets verify the update went through ISession s3 = sessions.OpenSession(); ITransaction t3 = s3.BeginTransaction(); ClassWithCompositeId theClass3 = (ClassWithCompositeId)s3.Load(typeof(ClassWithCompositeId), id); ClassWithCompositeId theSecondClass3 = (ClassWithCompositeId)s3.Load(typeof(ClassWithCompositeId), secondId); // check the update properties Assertion.AssertEquals(theClass3.OneProperty, theClass2.OneProperty); Assertion.AssertEquals(theSecondClass3.OneProperty, theSecondClass2.OneProperty); // test the delete method s3.Delete(theClass3); s3.Delete(theSecondClass3); t3.Commit(); s3.Close(); // lets verify the delete went through ISession s4 = sessions.OpenSession(); try { ClassWithCompositeId theClass4 = (ClassWithCompositeId)s4.Load(typeof(ClassWithCompositeId), id); } catch(ObjectNotFoundException onfe) { // I expect this to be thrown because the object no longer exists... } IList results = s4.CreateCriteria(typeof(ClassWithCompositeId)) .Add(Expression.Expression.Eq("Id", secondId)) .List(); Assertion.AssertEquals(0, results.Count); } } } --- NEW FILE: NH47Fixture.cs --- using System; using System.Data; using System.Collections; using NHibernate; using NExp = NHibernate.Expression; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class NH47Fxiture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.UnsavedType.hbm.xml"}); } public TimeSpan BatchInsert(object[] objs) { System.TimeSpan tspan = TimeSpan.Zero; if (objs != null && objs.Length > 0) { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); int count = objs.Length; Console.WriteLine(); Console.WriteLine("Start batch insert " + count.ToString() + " objects"); DateTime startTime = DateTime.Now; for(int i = 0; i < count; ++i) { s.Save(objs[i]); } t.Commit(); s.Close(); tspan = DateTime.Now.Subtract(startTime); Console.WriteLine("Finish in " + tspan.TotalMilliseconds.ToString() + " milliseconds"); } return tspan; } [Test] [Ignore("Only run this by itself")] public void TestNH47() { int testCount = 100; object[] al = new object[testCount]; TimeSpan tspan = TimeSpan.Zero; int times = 1000; for (int i = 0; i < times; ++i) { for (int j = 0; j < testCount; ++j) { UnsavedType ut = new UnsavedType(); ut.Id = j + 1 + testCount * (i + 1); ut.TypeName = System.Guid.NewGuid().ToString(); al[j] = ut; } tspan = tspan.Add(BatchInsert(al)); } Console.WriteLine("Finish average in " + (tspan.TotalMilliseconds / times).ToString() + " milliseconds for " + times.ToString() + " times"); Console.Read(); } } } --- NEW FILE: NodeFixture.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for NodeFixture. /// </summary> [TestFixture] public class NodeFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.Node.hbm.xml"}, true ); } [Test] public void InsertNodes() { Node startNode = new Node("start"); Node levelOneNode = new Node("1"); Node levelTwoFirstNode = new Node("2-1"); Node levelTwoSecondNode = new Node("2-2"); Node levelThreeNode = new Node("3"); Node endNode = new Node("end"); startNode.AddDestinationNode(levelOneNode); levelOneNode.AddDestinationNode(levelTwoFirstNode); levelOneNode.AddDestinationNode(levelTwoSecondNode); levelTwoFirstNode.AddDestinationNode(levelThreeNode); levelTwoSecondNode.AddDestinationNode(levelThreeNode); levelThreeNode.AddDestinationNode(endNode); ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); s.Save(startNode); s.Save(levelOneNode); s.Save(levelTwoFirstNode); s.Save(levelTwoSecondNode); s.Save(levelThreeNode); s.Save(endNode); s.Flush(); t.Commit(); s.Close(); // verify these nodes were actually saved and can be queried correctly. ISession s2 = sessions.OpenSession(); ITransaction t2 = s2.BeginTransaction(); Node startNode2 = (Node)s2.CreateCriteria(typeof(Node)) .Add(Expression.Expression.Eq("Id", "start")) .List()[0]; Assert.AreEqual(1, startNode2.DestinationNodes.Count, "Start Node goes to 1 Node"); Assert.AreEqual(0, startNode2.PreviousNodes.Count, "Start Node has no previous Nodes"); Assert.IsTrue(startNode2.DestinationNodes.Contains(levelOneNode), "The DestinationNodes contain the LevelOneNode"); Node levelOneNode2 = null; Node levelTwoFirstNode2 = new Node("2-1"); Node levelTwoSecondNode2 = new Node("2-2"); // only one node foreach(Node node in startNode2.DestinationNodes.Keys) { // replace the levelOneNode from previous session with the one from this Session. levelOneNode2 = node; } Assert.AreEqual(2, levelOneNode2.DestinationNodes.Count, "Level One Node goes to 2 Nodes"); Assert.AreEqual(1, levelOneNode2.PreviousNodes.Count, "The Start Node lead into Level 1"); Assert.IsTrue(levelOneNode2.DestinationNodes.Contains(levelTwoFirstNode2), "Level one goes to TwoFirst"); Assert.IsTrue(levelOneNode2.DestinationNodes.Contains(levelTwoSecondNode2), "Level one goes to TwoSecond"); Assert.IsTrue(levelOneNode2.PreviousNodes.Contains(startNode2), "Level One can be reached through Start Node"); // // TODO: get rid of this HACK that was used to find out what was causing the problem // // lets test out my theory that the problem is the "END" node being loaded during flush by just loading // // it before the flush. If it loads before the flush I don't think there will be any problems. See // // http://jira.nhibernate.org:8080/browse/NH-20 for what I think is happening... // foreach(Node node2 in levelOneNode2.DestinationNodes.Keys) // { // System.Diagnostics.Debug.WriteLine("touching node2's destinations = " + node2.DestinationNodes.Count); // foreach(Node node3 in node2.DestinationNodes.Keys) // { // System.Diagnostics.Debug.WriteLine("touching node3's destinations - " + node3.DestinationNodes.Count); // } // } //foreach t2.Commit(); s2.Close(); } } } --- NEW FILE: MapFixture.cs --- using System; using System.Data; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for MapTest. /// </summary> [TestFixture] public class MapFixture : TestCase { private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.Parent.hbm.xml", "NHSpecific.Child.hbm.xml", "NHSpecific.SexType.hbm.xml", "NHSpecific.Team.hbm.xml" }, true); } [Test] [Ignore("Have not written the Test yet.")] public void TestDelete() { //System.Diagnostics.Debug.Write("testing some crap"); } [Test] public void TestSelect() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); TestInsert(); ICriteria chiefsCriteria = s.CreateCriteria(typeof(Team)); chiefsCriteria.Add(Expression.Expression.Eq("Name", "Chiefs")); Team chiefs = (Team)chiefsCriteria.List()[0]; IList players = chiefs.Players; Parent parentDad = (Parent)s.Load(typeof(Parent), 1); Child amyJones = (Child)s.Load(typeof(Child), 2); Child[] friends = amyJones.Friends; Child childOneRef = amyJones.FirstSibling; t.Commit(); s.Close(); } [Test] [Ignore("Code is incomplete")] public void TestInverse() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); TestInsert(); Parent bobJones = (Parent)s.CreateCriteria(typeof(Parent)) .Add(Expression.Expression.Eq("AdultName", "Bob Jones")) .List()[0]; t.Commit(); s.Close(); } [Test] public void TestSort() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); TestInsert(); Parent bobJones = (Parent)s.Load(typeof(Parent), 1); IDictionary friends = bobJones.AdultFriends; int currentId = 0; int previousId = 0; foreach(Parent friend in friends.Keys) { previousId = currentId; currentId = friend.Id; Assertion.Assert("Current should have a higher Id than previous", currentId > previousId); } t.Commit(); s.Close(); } [Test] public void TestInsert() { ISession s = sessions.OpenSession(); ITransaction t = s.BeginTransaction(); SexType male = new SexType(); SexType female = new SexType(); //male.Id = 1; male.TypeName = "Male"; //female.Id = 2; female.TypeName = "Female"; s.Save(male); s.Save(female); Parent bobJones = new Parent(); bobJones.Id = 1; bobJones.AdultName = "Bob Jones"; Parent maryJones = new Parent(); maryJones.Id = 2; maryJones.AdultName = "Mary Jones"; Parent charlieSmith = new Parent(); charlieSmith.Id = 3; charlieSmith.AdultName = "Charlie Smith"; Parent cindySmith = new Parent(); cindySmith.Id = 4; cindySmith.AdultName = "Cindy Smith"; bobJones.AddFriend(cindySmith); bobJones.AddFriend(charlieSmith); bobJones.AddFriend(maryJones); maryJones.AddFriend(cindySmith); s.Save(bobJones, bobJones.Id); s.Save(maryJones, maryJones.Id); s.Save(charlieSmith, charlieSmith.Id); s.Save(cindySmith, cindySmith.Id); Child johnnyJones = new Child(); Child amyJones = new Child(); Child brianSmith = new Child(); Child sarahSmith = new Child(); johnnyJones.Id = 1; johnnyJones.FullName = "Johnny Jones"; johnnyJones.Dad = bobJones; johnnyJones.Mom = maryJones; johnnyJones.Sex = male; johnnyJones.Friends = new Child[]{brianSmith, sarahSmith}; johnnyJones.FavoriteDate = System.DateTime.Parse("2003-08-16"); amyJones.Id = 2; amyJones.FullName = "Amy Jones"; amyJones.Dad = bobJones; amyJones.Mom = maryJones; amyJones.Sex = female; amyJones.FirstSibling = johnnyJones; amyJones.Friends = new Child[]{johnnyJones, sarahSmith}; brianSmith.Id = 11; brianSmith.FullName = "Brian Smith"; brianSmith.Dad = charlieSmith; brianSmith.Mom = cindySmith; brianSmith.Sex = male; brianSmith.Friends = new Child[]{johnnyJones, amyJones, sarahSmith}; sarahSmith.Id = 12; sarahSmith.FullName = "Sarah Smith"; sarahSmith.Dad = charlieSmith; sarahSmith.Mom = cindySmith; sarahSmith.Sex = female; sarahSmith.Friends = new Child[]{brianSmith}; Team royals = new Team(); royals.Name = "Royals"; Team chiefs = new Team(); chiefs.Name = "Chiefs"; royals.Players = new ArrayList(); royals.Players.Add(amyJones); royals.Players.Add(brianSmith); chiefs.Players = new ArrayList(); chiefs.Players.Add(johnnyJones); chiefs.Players.Add(sarahSmith); s.Save(johnnyJones, johnnyJones.Id); s.Save(amyJones, amyJones.Id); s.Save(brianSmith, brianSmith.Id); s.Save(sarahSmith, sarahSmith.Id); s.Save(royals); s.Save(chiefs); t.Commit(); s.Close(); } } } |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22651 Modified Files: ABCProxyTest.cs ABCTest.cs CriteriaTest.cs FooBarTest.cs FumTest.cs NHibernate.Test-1.1.csproj ObjectAssertion.cs SimpleTest.cs Added Files: DemoTest.cs MasterDetailTest.cs MultiTableTest.cs NewPerformanceTest.cs ODMGTest.cs ParentChildTest.cs SQLFunctionsTest.cs Removed Files: BasicTypes.cs ClassWithCompositeIdTest.cs JoinedSubclassTest.cs MapTest.cs NH47.cs NodeFixture.cs SimpleComponentTest.cs SubclassTest.cs UnsavedValueTest.cs Log Message: Created shells for more Test Fixture and move the new ones I made to use to get NHibernate testing up and going to their own namespace because there was some name conflicts with h2.0.3 classes. Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleTest.cs 8 Jun 2004 11:47:37 -0000 1.3 --- SimpleTest.cs 9 Jun 2004 01:05:46 -0000 1.4 *************** *** 7,11 **** namespace NHibernate.Test { - [TestFixture] public class SimpleTest : TestCase --- 7,10 ---- *************** *** 19,23 **** public void SetUp() { - //log4net.Config.DOMConfigurator.Configure(); ExportSchema( new string[] { "Simple.hbm.xml"} ); } --- 18,21 ---- --- UnsavedValueTest.cs DELETED --- --- NEW FILE: SQLFunctionsTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for SQLFunctionsTest. /// </summary> [TestFixture] public class SQLFunctionsTest { public SQLFunctionsTest() { // // TODO: Add constructor logic here // } } } --- ClassWithCompositeIdTest.cs DELETED --- --- BasicTypes.cs DELETED --- --- NEW FILE: DemoTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for DemoTest. /// </summary> [TestFixture] public class DemoTest { [Test] [Ignore("Test not written yet.")] public void Demo() { } } } --- NH47.cs DELETED --- --- JoinedSubclassTest.cs DELETED --- --- NEW FILE: MasterDetailTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for MasterDetailTest. /// </summary> [TestFixture] public class MasterDetailTest : TestCase { [SetUp] public void SetUp() { ExportSchema(new string[] { "MasterDetail.hbm.xml", "Custom.hbm.xml", "Category.hbm.xml", "INameable.hbm.xml", "SingleSeveral.hbm.xml", "WZ.hbm.xml" }, true); } [Test] [Ignore("Test not yet written")] public void SelfManyToOne() { } [Test] [Ignore("Test not yet written")] public void NonLazyBidrectional() { } [Test] [Ignore("Test not yet written")] public void CollectionQuery() { } [Test] [Ignore("Test not yet written")] public void MasterDetail() { } [Test] [Ignore("Test not yet written")] public void IncomingOutgoing() { } [Test] [Ignore("Test not yet written")] public void Cascading() { } [Test] [Ignore("Test not yet written")] public void NamedQuery() { } [Test] [Ignore("Test not yet written")] public void Serialization() { } [Test] [Ignore("Test not yet written")] public void UpdateLazyCollections() { } [Test] [Ignore("Test not yet written")] public void MultiLevelCascade() { } [Test] [Ignore("Test not yet written")] public void MixNativeAssigned() { } [Test] [Ignore("Test not yet written")] public void CollectionReplace2() { } [Test] [Ignore("Test not yet written")] public void CollectionReplace() { } [Test] [Ignore("Test not yet written")] public void Categories() { } [Test] [Ignore("Test not yet written")] public void CollectionRefresh() { } [Test] [Ignore("Test not yet written")] public void CustomPersister() { } [Test] [Ignore("Test not yet written")] public void Interface() { } [Test] [Ignore("Test not yet written")] public void NoUpdatedManyToOne() { } } } Index: ABCTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ABCTest.cs 7 Jun 2004 20:35:43 -0000 1.6 --- ABCTest.cs 9 Jun 2004 01:05:46 -0000 1.7 *************** *** 1,7 **** using System; using NUnit.Framework; using NHibernate; using NHibernate.DomainModel; ! using System.Collections; namespace NHibernate.Test --- 1,9 ---- using System; + using System.Collections; + using NUnit.Framework; using NHibernate; using NHibernate.DomainModel; ! namespace NHibernate.Test --- SimpleComponentTest.cs DELETED --- --- MapTest.cs DELETED --- Index: CriteriaTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CriteriaTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CriteriaTest.cs 8 Jun 2004 11:47:37 -0000 1.3 --- CriteriaTest.cs 9 Jun 2004 01:05:46 -0000 1.4 *************** *** 6,10 **** using NUnit.Framework; ! namespace NHibernate.Test { [TestFixture] --- 6,11 ---- using NUnit.Framework; ! namespace NHibernate.Test ! { [TestFixture] *************** *** 13,17 **** [SetUp] public void SetUp() { - //log4net.Config.DOMConfigurator.Configure(); ExportSchema( new string[] { "Simple.hbm.xml"}, true ); } --- 14,17 ---- Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NHibernate.Test-1.1.csproj 25 May 2004 17:21:45 -0000 1.23 --- NHibernate.Test-1.1.csproj 9 Jun 2004 01:05:46 -0000 1.24 *************** *** 135,149 **** /> <File ! RelPath = "BasicTypes.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "ClassWithCompositeIdTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "CriteriaTest.cs" SubType = "Code" BuildAction = "Compile" --- 135,144 ---- /> <File ! RelPath = "CriteriaTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "DemoTest.cs" SubType = "Code" BuildAction = "Compile" *************** *** 160,174 **** /> <File ! RelPath = "JoinedSubclassTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "MapTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NH47.cs" SubType = "Code" BuildAction = "Compile" --- 155,169 ---- /> <File ! RelPath = "MasterDetailTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "MultiTableTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NewPerformanceTest.cs" SubType = "Code" BuildAction = "Compile" *************** *** 183,202 **** /> <File ! RelPath = "NodeFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ObjectAssertion.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PerformanceTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SimpleComponentTest.cs" SubType = "Code" BuildAction = "Compile" --- 178,197 ---- /> <File ! RelPath = "ObjectAssertion.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ODMGTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "ParentChildTest.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PerformanceTest.cs" SubType = "Code" BuildAction = "Compile" *************** *** 208,212 **** /> <File ! RelPath = "SubclassTest.cs" SubType = "Code" BuildAction = "Compile" --- 203,207 ---- /> <File ! RelPath = "SQLFunctionsTest.cs" SubType = "Code" BuildAction = "Compile" *************** *** 223,231 **** /> <File - RelPath = "UnsavedValueTest.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "CacheTest\CacheFixture.cs" SubType = "Code" --- 218,221 ---- *************** *** 298,301 **** --- 288,336 ---- /> <File + RelPath = "NHSpecificTest\BasicClassFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\ClassWithCompositeIdFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\JoinedSubclassFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\MapFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\NH47Fixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\NodeFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\SimpleComponentFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\SubclassFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\UnsavedValueFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SqlCommandTest\SqlDeleteBuilderFixture.cs" SubType = "Code" --- NEW FILE: MultiTableTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for MultiTableTest. /// </summary> [TestFixture] public class MultiTableTest : TestCase { [SetUp] public void SetUp() { ExportSchema(new string[] { "Multi.hbm.xml"}, true); } public void TestJoins() { } public void SubclassCollection() { } public void CollectionOnly() { } public void Queries() { } public void Constraints() { } public void MultiTable() { } public void MutliTableGeneratedId() { } public void MultiTableCollections() { } public void MultiTableManyToOne() { } public void MultiTableNativeId() { } public void Collection() { } public void OneToOne() { } public void CollectionPointer() { } } } --- NEW FILE: ParentChildTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for ParentChildTest. /// </summary> [TestFixture] public class ParentChildTest { public ParentChildTest() { // // TODO: Add constructor logic here // } } } --- SubclassTest.cs DELETED --- Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FumTest.cs 8 Jun 2004 11:48:22 -0000 1.4 --- FumTest.cs 9 Jun 2004 01:05:46 -0000 1.5 *************** *** 81,91 **** [Test] [Ignore("Test not yet written")] ! public void CompositeID() { } ! [Test] [Ignore("Test not yet written")] ! public void CompositeIDCollections() { } --- 81,91 ---- [Test] [Ignore("Test not yet written")] ! public void ListIdentifiers() { } ! [Test] [Ignore("Test not yet written")] ! public void CompositeID() { } *************** *** 97,101 **** Fum fum = new Fum( FumKey("fum") ); fum.fum = "fee fi fo"; ! //s.Save(fum); Fumm fumm = new Fumm(); fumm.Fum = fum; --- 97,101 ---- Fum fum = new Fum( FumKey("fum") ); fum.fum = "fee fi fo"; ! //s.Save(fum); commented out in h2.0.3 Fumm fumm = new Fumm(); fumm.Fum = fum; *************** *** 106,110 **** s = sessions.OpenSession(); fumm = (Fumm) s.Load( typeof(Fumm), FumKey("fum") ); ! //s.delete(fumm.Fum); s.Delete(fumm); s.Flush(); --- 106,110 ---- s = sessions.OpenSession(); fumm = (Fumm) s.Load( typeof(Fumm), FumKey("fum") ); ! //s.delete(fumm.Fum); commented out in h2.0.3 s.Delete(fumm); s.Flush(); *************** *** 113,118 **** } - - [Test] [Ignore("Test not yet written")] --- 113,116 ---- *************** *** 123,127 **** [Test] [Ignore("Test not yet written")] ! public void CompositeIDs() { } --- 121,125 ---- [Test] [Ignore("Test not yet written")] ! public void CompositeIDCollections() { } *************** *** 135,147 **** [Test] [Ignore("Test not yet written")] ! public void KeyManyToOne() { } [Test] [Ignore("Test not yet written")] ! public void ListIdentifiers() { } } } --- 133,149 ---- [Test] [Ignore("Test not yet written")] ! public void CompositeIDs() { } + + [Test] [Ignore("Test not yet written")] ! public void KeyManyToOne() { } + + } } Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ABCProxyTest.cs 7 Jun 2004 20:35:42 -0000 1.6 --- ABCProxyTest.cs 9 Jun 2004 01:05:46 -0000 1.7 *************** *** 1,7 **** using System; using NUnit.Framework; using NHibernate; using NHibernate.DomainModel; - using System.Collections; namespace NHibernate.Test --- 1,9 ---- using System; + using System.Collections; + using NUnit.Framework; + using NHibernate; using NHibernate.DomainModel; namespace NHibernate.Test --- NEW FILE: ODMGTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for ODMGTest. /// </summary> [TestFixture] public class ODMGTest { public ODMGTest() { // // TODO: Add constructor logic here // } } } Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** FooBarTest.cs 7 Jun 2004 20:35:44 -0000 1.24 --- FooBarTest.cs 9 Jun 2004 01:05:46 -0000 1.25 *************** *** 15,24 **** ExportSchema(new string[] { "FooBar.hbm.xml", ! "Glarch.hbm.xml", ! "Fee.hbm.xml", "Qux.hbm.xml", "Fum.hbm.xml", - "Baz.hbm.xml", - "Simple.hbm.xml", "Fumm.hbm.xml", "Fo.hbm.xml", --- 15,22 ---- ExportSchema(new string[] { "FooBar.hbm.xml", ! "Baz.hbm.xml", "Qux.hbm.xml", + "Glarch.hbm.xml", "Fum.hbm.xml", "Fumm.hbm.xml", "Fo.hbm.xml", *************** *** 26,29 **** --- 24,28 ---- "Many.hbm.xml", "Immutable.hbm.xml" , + "Fee.hbm.xml", //"Vetoer.hbm.xml", "Holder.hbm.xml", *************** *** 31,34 **** --- 30,34 ---- "Stuff.hbm.xml", "Container.hbm.xml", + "Simple.hbm.xml", "XY.hbm.xml" }, true); *************** *** 67,70 **** --- 67,71 ---- } + [Test] public void Sortables() *************** *** 137,140 **** --- 138,142 ---- } + [Test] public void FetchList() *************** *** 164,167 **** --- 166,170 ---- } + [Test] public void BagOneToMany() *************** *** 187,204 **** } [Test] ! [Ignore("won't work without proxy")] ! public void SaveDelete() { - ISession s = sessions.OpenSession(); - Foo f = new Foo(); - s.Save(f); - s.Flush(); - s.Close(); - - s = sessions.OpenSession(); - s.Delete( s.Load( typeof(Foo), f.key ) ); - s.Flush(); - s.Close(); } --- 190,216 ---- } + [Test] ! [Ignore("Test not written yet.")] ! public void QueryLockMode() ! { ! } ! ! [Test] ! [Ignore("Test not written yet.")] ! public void ManyToManyBag() ! { ! } ! ! [Test] ! [Ignore("Test not written yet.")] ! public void IdBag() ! { ! } ! ! [Test] ! [Ignore("Test not written yet.")] ! public void ForceOuterJoin() { } *************** *** 224,227 **** --- 236,562 ---- } + + [Test] + [Ignore("Test not written yet.")] + public void OneToOneGenerator() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Limit() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Custom() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void SaveAddDelete() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void NamedParams() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Dyna() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void FindByCriteria() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void AfterDelete() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CollectionWhere() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ComponentParent() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CollectionCache() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void AssociationId() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CascadeSave() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CompositeKeyPathExpressions() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CollectionsInSelect() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void NewFlushing() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void PersistCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void SaveFlush() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CreateUpdate() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Update() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void UpdateCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Load() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Create() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Callback() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Polymorphism() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void RemoveContains() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CollectionOfSelf() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Find() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Query() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void DeleteRecursive() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Reachability() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void PersistentLifecycle() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Iterators() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Versioning() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void VersionedCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void RecursiveLoad() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ScrollableIterator() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void MultiColumnQueries() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void DeleteTransient() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void UpdateFromTransient() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Databinder() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ArrayOfTimes() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Components() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Enum() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void NoForeignKeyViolations() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void LazyCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void NewSessionLifecycle() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Disconnect() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void OrderBy() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ManyToOne() + { + } + + [Test] + [Ignore("won't work without proxy")] + public void SaveDelete() + { + ISession s = sessions.OpenSession(); + Foo f = new Foo(); + s.Save(f); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + s.Delete( s.Load( typeof(Foo), f.key ) ); + s.Flush(); + s.Close(); + } + + [Test] + [Ignore("Test not written yet.")] + public void ProxyArray() + { + } + [Test] public void Cache() *************** *** 249,252 **** --- 584,703 ---- } + + [Test] + [Ignore("Test not written yet.")] + public void FindLoad() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Refresh() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void AutoFlush() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Veto() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void SerializableType() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void AuotFlushCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void UserProvidedConnection() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void CachedCollection() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ComplicatedQuery() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void LoadAfterDelete() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ObjectType() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Any() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void EmbeddedCompositeID() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void AutosaveChildren() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void OrphanDelete() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void TransientOrphanDelete() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void ProxiesInCollections() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void Service() + { + } + + [Test] + [Ignore("Test not written yet.")] + public void PSCache() + { + } + + } } Index: ObjectAssertion.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ObjectAssertion.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectAssertion.cs 16 Apr 2004 14:06:35 -0000 1.3 --- ObjectAssertion.cs 9 Jun 2004 01:05:46 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- using NUnit.Framework; using NHibernate.DomainModel; + using NHibernate.DomainModel.NHSpecific; namespace NHibernate.Test --- NEW FILE: NewPerformanceTest.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for NewPerformanceTest. /// </summary> [TestFixture] public class NewPerformanceTest { public NewPerformanceTest() { // // TODO: Add constructor logic here // } } } --- NodeFixture.cs DELETED --- |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21841/NHSpecific Added Files: AuditComponent.cs BasicClass.cs BasicClass.hbm.xml Child.cs Child.hbm.xml ClassWithCompositeId.cs ClassWithCompositeId.hbm.xml CompositeId.cs JoinedSubclass.hbm.xml JoinedSubclassBase.cs JoinedSubclassOne.cs Node.cs Node.hbm.xml Parent.cs Parent.hbm.xml ParentComparer.cs SexType.cs SexType.hbm.xml SimpleComponent.cs SimpleComponent.hbm.xml Subclass.hbm.xml Team.cs Team.hbm.xml UnsavedType.cs UnsavedType.hbm.xml Log Message: Move the new class I made to use to get NHibernate testing up and going to their own namespace because there was some name conflicts with h2.0.3 classes. --- NEW FILE: SimpleComponent.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for SimpleComponent. /// </summary> public class SimpleComponent { private int _key; private string _name; private string _address; private int _count; private DateTime _date; private AuditComponent _audit; public SimpleComponent() { _audit = new AuditComponent(); } public int Key { get {return _key;} set {_key = value;} } public string Name { get { return _name; } set { _name = value; } } public string Address { get { return _address; } set { _address = value; } } public int Count { get { return _count; } set { _count = value; } } public DateTime Date { get { return _date; } set { _date = value; } } public AuditComponent Audit { get {return _audit;} set {_audit = value;} } } } --- NEW FILE: Node.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.Node, NHibernate.DomainModel"> <id name="Id" column="id" type="String(10)"> <generator class="assigned" /> </id> <set name="DestinationNodes" table="node_link" lazy="true"> <key column="from_node_id" /> <many-to-many column="to_node_id" class="NHibernate.DomainModel.NHSpecific.Node, NHibernate.DomainModel" /> </set> <set name="PreviousNodes" table="node_link" inverse="true"> <key column="to_node_id" /> <many-to-many column="from_node_id" class="NHibernate.DomainModel.NHSpecific.Node, NHibernate.DomainModel" /> </set> </class> </hibernate-mapping> --- NEW FILE: JoinedSubclassOne.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for JoinedSubclassOne. /// </summary> public class JoinedSubclassOne: JoinedSubclassBase { private long _oneTestLong; public JoinedSubclassOne() {} public long OneTestLong { get {return _oneTestLong;} set {_oneTestLong = value;} } } } --- NEW FILE: Subclass.hbm.xml --- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.JoinedSubclassBase, NHibernate.DomainModel" table="one_tab" discriminator-value="SUPER" > <id name="Id" type="Int32" column="class_id" > <generator class="assigned" /> </id> <discriminator column="disc_column" type="String" /> <property name="TestLong" column="test_long" type="Int64" /> <property name="TestString" column="test_string" type="String" /> <property name="TestDateTime" column="test_date_time" type="DateTime" /> <subclass name="NHibernate.DomainModel.NHSpecific.JoinedSubclassOne, NHibernate.DomainModel" discriminator-value="SUB" > <property name="OneTestLong" column="one_test_long" type="Int64" /> </subclass> </class> </hibernate-mapping> --- NEW FILE: SexType.hbm.xml --- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.SexType, NHibernate.DomainModel" table="s_type" > <id name="Id" column="id"> <generator class="identity" /> </id> <property name="TypeName" type="String" column="type_name" /> <property name="NonpublicString" type="String" column="nonpublic_string" /> </class> </hibernate-mapping> --- NEW FILE: SimpleComponent.hbm.xml --- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.SimpleComponent, NHibernate.DomainModel" table="simp_com" > <id name="Key" type="Int64" column="`i[d]_`" > <generator class="assigned" /> </id> <property name="Name" /> <property name="Address" /> <property name="Count" column="count_" not-null="true" unique="true" /> <property name="Date" column="`d[at]e_`" /> <component name="Audit" class="NHibernate.DomainModel.NHSpecific.AuditComponent, NHibernate.DomainModel"> <property name="CreatedUserId" column="created_user_id" /> <property name="CreatedDate" column="created_date" /> <property name="UpdatedUserId" column="updated_user_id" /> <property name="UpdatedDate" column="updated_date" /> </component> </class> </hibernate-mapping> --- NEW FILE: BasicClass.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { [Serializable] public class SerializableClass { public int _classId; public string _classString; public override int GetHashCode() { // not a good method, but all that is needed for this Class // to be used by tests. return base.GetHashCode(); } public override bool Equals(object obj) { SerializableClass lhs = obj as SerializableClass; if(lhs==null) return false; if(this==lhs) return true; if(this._classId.Equals(lhs._classId) && this._classString.Equals(this._classString)) return true; return false; } } /// <summary> /// Summary description for BasicClass. /// </summary> [Serializable] public class BasicClass { private int _id; private byte[] _binaryProperty; private bool _booleanProperty; private byte _byteProperty; private char _characterProperty; private System.Type _classProperty; private System.Globalization.CultureInfo _cultureInfoProperty; private DateTime _dateTimeProperty; private decimal _decimalProperty; private double _doubleProperty; private short _int16Property; private int _int32Property; private long _int64Property; private SerializableClass _serializableProperty; private float _singleProperty; private string _stringProperty; private DateTime _ticksProperty; private bool _trueFalseProperty; private bool _yesNoProperty; private string[] _stringArray; private int[] _int32Array; private IList _stringBag; private IList _stringList; private IDictionary _stringMap; private IDictionary _stringSet; private object _dummyObject = new object(); public BasicClass() { _serializableProperty = new SerializableClass(); _serializableProperty._classId = 5; _serializableProperty._classString = "serialize me"; } public int Id { get { return _id;} set { _id = value;} } public byte[] BinaryProperty { get {return _binaryProperty;} set {_binaryProperty = value;} } public bool BooleanProperty { get {return _booleanProperty;} set {_booleanProperty = value;} } public byte ByteProperty { get {return _byteProperty;} set {_byteProperty = value;} } public char CharacterProperty { get {return _characterProperty ;} set {_characterProperty = value;} } public System.Type ClassProperty { get {return _classProperty;} set {_classProperty = value;} } public System.Globalization.CultureInfo CultureInfoProperty { get {return _cultureInfoProperty;} set {_cultureInfoProperty = value;} } public DateTime DateTimeProperty { get {return _dateTimeProperty;} set {_dateTimeProperty = value;} } public decimal DecimalProperty { get {return _decimalProperty;} set {_decimalProperty = value;} } public double DoubleProperty { get {return _doubleProperty;} set {_doubleProperty = value;} } public short Int16Property { get {return _int16Property;} set {_int16Property = value;} } public int Int32Property { get {return _int32Property;} set {_int32Property = value;} } public long Int64Property { get {return _int64Property;} set {_int64Property = value;} } public SerializableClass SerializableProperty { get {return _serializableProperty;} set {_serializableProperty = value;} } public float SingleProperty { get {return _singleProperty;} set {_singleProperty = value;} } public string StringProperty { get {return _stringProperty;} set {_stringProperty = value;} } public DateTime TicksProperty { get {return _ticksProperty;} set {_ticksProperty = value;} } public bool TrueFalseProperty { get {return _trueFalseProperty;} set {_trueFalseProperty = value;} } public bool YesNoProperty { get {return _yesNoProperty;} set {_yesNoProperty = value;} } public string[] StringArray { get { return _stringArray; } set { _stringArray = value; } } public int[] Int32Array { get { return _int32Array; } set { _int32Array = value; } } public IList StringBag { get { return _stringBag; } set { _stringBag = value; } } public IList StringList { get { return _stringList; } set { _stringList = value; } } public IDictionary StringMap { get { return _stringMap; } set { _stringMap = value; } } public IDictionary StringSet { get { return _stringSet; } set { _stringSet = value; } } public void AddToStringSet(string stringValue) { if(StringSet==null) StringSet = new Hashtable(); StringSet[stringValue] = _dummyObject; } } } --- NEW FILE: UnsavedType.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Parent.hbm.xml --- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.Parent, NHibernate.DomainModel" table="par" > <id name="Id" column="id"> <generator class="assigned" /> </id> <property name="AdultName" type="String" column="adult_name" /> <set name="AdultFriends" table="par_frnd" sort="NHibernate.DomainModel.NHSpecific.ParentComparer, NHibernate.DomainModel"> <key column="parent_id" /> <many-to-many column="parent_friend_id" class="NHibernate.DomainModel.NHSpecific.Parent, NHibernate.DomainModel" /> </set> </class> </hibernate-mapping> --- NEW FILE: SexType.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for SexType. /// </summary> public class SexType { private int _id; private string _typeName; private string _nonpublicString; public SexType() { } public int Id { get {return _id;} set {_id = value;} } public string TypeName { get {return _typeName;} set {_typeName = value;} } private string NonpublicString { get { if(_typeName.Equals("Male")) return "MALE"; else if(_typeName.Equals("Female")) return "FEMALE"; else return "UNKNOWN"; } set {_nonpublicString = value;} } } } --- NEW FILE: Child.hbm.xml --- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.Child, NHibernate.DomainModel" table="child" > <id name="Id" column="id"> <generator class="assigned" /> </id> <property name="FullName" type="String(45)" column="full_name" /> <property name="FavoriteDate" type="DateTime" column="favorite_date" /> <many-to-one name="Sex" class="NHibernate.DomainModel.NHSpecific.SexType, NHibernate.DomainModel" column="sex_type_id"/> <map name="Parents" table="c_prnt" lazy="true"> <key column="child_id" /> <index column="which_parent" type="String" /> <many-to-many column="parent_id" class="NHibernate.DomainModel.NHSpecific.Parent, NHibernate.DomainModel" /> </map> <list name="Siblings" table="c_sibs" lazy="true"> <key column="child_id" /> <index column="which_sibling" /> <many-to-many column="sibling_child_id" class="NHibernate.DomainModel.NHSpecific.Child, NHibernate.DomainModel" /> </list> <!-- This is not too acurate of real world situations because we can't have a link back and forth, maybe it is - if I think someone is my friend but they don't think I am their friend ;) --> <array name="Friends" table="c_frnds"> <key column="child_id" /> <index column="friend_index" /> <many-to-many column="friend_id" class="NHibernate.DomainModel.NHSpecific.Child, NHibernate.DomainModel" /> </array> </class> </hibernate-mapping> --- NEW FILE: Child.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for Child. /// </summary> public class Child { private int _id; private string _fullName; private IDictionary _parents; private SexType _sex; private IList _siblings; private Child[] _friends; private System.DateTime _favoriteDate; public Child() { _friends = new Child[3]; } public int Id { get {return _id;} set {_id = value;} } public string FullName { get {return _fullName;} set {_fullName = value;} } public IList Siblings { get { if(_siblings==null) _siblings = new ArrayList(); return _siblings; } set {_siblings = value;} } public Child FirstSibling { get{ return (Child)Siblings[0]; } set {Siblings.Insert(0, value);} } public Child SecondSibling { get{ return (Child)Siblings[1]; } set {Siblings.Insert(1, value);} } public IDictionary Parents { get { if(_parents==null) _parents = new Hashtable(); return _parents; } set {_parents = value;} } public Parent Mom { get { return (Parent)Parents["mom"];} set { if(Parents.Contains("mom")==false) { Parents.Add("mom", value); } else { Parents["mom"] = value; } } } public Parent Dad { get { return (Parent)Parents["dad"];} set { if(Parents.Contains("dad")==false) { Parents.Add("dad", value); } else { Parents["dad"] = value; } } } public SexType Sex { get { return _sex;} set { _sex = value;} } public Child[] Friends { get { return _friends;} set { _friends = value;} } public System.DateTime FavoriteDate{ get {return _favoriteDate;} set {_favoriteDate = value;} } } } --- NEW FILE: Node.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for Node. /// </summary> public class Node { private string _id; private IDictionary _previousNodes; private IDictionary _destinationNodes; private Node() { } public Node(string id) { _destinationNodes = new Hashtable(); _previousNodes = new Hashtable(); _id = id; } public string Id { get { return _id; } set { _id = value; } } /// <summary> /// The Nodes that lead into this Node. /// </summary> /// <remarks> /// I would not recommend that mapping of set be made public because /// under the scene they rely on Dictionaries, but this is in here for /// testing. /// /// Any modifications to the "inverse" side should not be persisted - unless /// the modifications are also made to the non-inverse side. /// </remarks> public IDictionary PreviousNodes { get { return _previousNodes; } set { _previousNodes = value; } } private void AddPreviousNode(Node previousNode) { PreviousNodes.Add(previousNode, null); } /// <summary> /// The Nodes this Node can go To. /// </summary> /// <remarks> /// I would not recommend that mapping of set be made public because /// under the scene they rely on Dictionaries, but this is in here for /// testing. The DestinationNodes is the Property that controls which /// modifications get persisted. /// </remarks> public IDictionary DestinationNodes { get { return _destinationNodes; } set { _destinationNodes = value; } } /// <summary> /// This is the only way to hook nodes together right now. /// </summary> /// <param name="node">A Node this Node can go to.</param> public void AddDestinationNode(Node destinationNode) { DestinationNodes.Add(destinationNode, null); // let the destinationNode know that it can be one of the // previous Nodes was this Node destinationNode.AddPreviousNode(this); } public override int GetHashCode() { return _id.GetHashCode(); } public override bool Equals(object obj) { Node rhs = obj as Node; if(rhs==null) return false; return _id.Equals(rhs.Id); } } } --- NEW FILE: ParentComparer.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for ParentComparer. /// </summary> public class ParentComparer : IComparer { public ParentComparer() { } #region IComparer Members public int Compare(Parent x, Parent y) { if(x==null && y==null) return 0; //TODO: don't know if my logic is good, but good enough for compile if(x==null && y!=null) return -1; if(x!=null && y==null) return 1; return x.Id - y.Id; } int IComparer.Compare(object x, object y) { Parent xParent = x as Parent; Parent yParent = y as Parent; return Compare(xParent, yParent); } #endregion } } --- NEW FILE: ClassWithCompositeId.hbm.xml --- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.ClassWithCompositeId, NHibernate.DomainModel" table="class_w_com_id" > <composite-id name="Id" class="NHibernate.DomainModel.NHSpecific.CompositeId, NHibernate.DomainModel"> <key-property name="KeyString" column="string_" type="String(20)" /> <key-property name="KeyShort" column="short_"/> <key-property name="KeyDateTime" column="date_" type="DateTime"/> </composite-id> <property name="OneProperty" column="one_property"/> </class> </hibernate-mapping> --- NEW FILE: AuditComponent.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for AuditComponent. /// </summary> public class AuditComponent{ private string _createdUserId; private System.DateTime _createdDate; private string _updatedUserId; private System.DateTime _updatedDate; public AuditComponent() { } public string CreatedUserId { get {return _createdUserId;} set {_createdUserId = value;} } public System.DateTime CreatedDate { get {return _createdDate;} set {_createdDate = value;} } public string UpdatedUserId { get {return _updatedUserId;} set {_updatedUserId = value;} } public System.DateTime UpdatedDate { get {return _updatedDate;} set {_updatedDate = value;} } } } --- NEW FILE: Parent.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for Parent. /// </summary> public class Parent { private int _id; private string _adultName; private IDictionary _children; private IDictionary _adultFriends; public Parent() { _adultFriends = new SortedList(new ParentComparer()); } public int Id { get {return _id;} set {_id = value;} } public string AdultName { get {return _adultName;} set {_adultName = value;} } public IDictionary Children { get {return _children;} set {_children = value;} } public IDictionary AdultFriends { get {return _adultFriends;} set {_adultFriends = value;} } public void AddFriend(Parent friend) { _adultFriends.Add(friend, friend); } } } --- NEW FILE: UnsavedType.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for UnsavedType. /// </summary> public class UnsavedType { private int _id = 0; private string _typeName; public UnsavedType() { } public int Id { get {return _id;} set {_id = value;} } public string TypeName { get {return _typeName;} set {_typeName = value;} } } } --- NEW FILE: Team.cs --- using System; using System.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for Team. /// </summary> public class Team { private int _id; private string _name; private IList _players; public Team() { } public int Id { get {return _id;} set {_id = value;} } public string Name { get {return _name;} set {_name = value;} } public IList Players { get {return _players;} set {_players = value;} } } } --- NEW FILE: Team.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JoinedSubclassBase.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for JoinedSubclassBase. /// </summary> public class JoinedSubclassBase { private int _id; private long _testLong; private string _testString; private System.DateTime _testDate; public JoinedSubclassBase() { } public int Id { get {return _id;} set {_id = value;} } public long TestLong { get {return _testLong;} set {_testLong = value;} } public string TestString { get {return _testString;} set {_testString = value;} } public System.DateTime TestDateTime { get {return _testDate;} set {_testDate = value;} } } } --- NEW FILE: JoinedSubclass.hbm.xml --- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.JoinedSubclassBase, NHibernate.DomainModel" table="j_sc" > <id name="Id" type="Int32" unsaved-value="null" column="joined_subclass_id" > <generator class="native" /> </id> <property name="TestLong" column="test_long" type="Int64" /> <property name="TestString" column="test_string" type="String" /> <property name="TestDateTime" column="test_date_time" type="DateTime" /> <joined-subclass name="NHibernate.DomainModel.NHSpecific.JoinedSubclassOne, NHibernate.DomainModel" table="j_sc_one" > <key column="joined_subclass_id" /> <property name="OneTestLong" column="one_test_long" type="Int64" /> </joined-subclass> </class> </hibernate-mapping> --- NEW FILE: CompositeId.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for CompositeId. /// </summary> public class CompositeId { private string _keyString; private short _keyShort; private System.DateTime _keyDateTime; public CompositeId() { } public CompositeId(string keyString, short keyShort, System.DateTime keyDateTime) { _keyString = keyString; _keyShort = keyShort; _keyDateTime = keyDateTime; } public string KeyString { get { return _keyString;} set { _keyString = value;} } public short KeyShort { get { return _keyShort;} set {_keyShort = value;} } public System.DateTime KeyDateTime { get { return _keyDateTime;} set {_keyDateTime = value;} } public override int GetHashCode() { return _keyString.GetHashCode(); } public override bool Equals(object obj) { CompositeId otherObj = obj as CompositeId; if(otherObj==null) return false; if(otherObj.KeyString.Equals(this.KeyString)) return true; return false; } } } --- NEW FILE: BasicClass.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.BasicClass, NHibernate.DomainModel" table="bc"> <id name="Id" column="id"> <generator class="assigned" /> </id> <property name="BinaryProperty" type="Byte[]" column="bin_p"/> <property name="BooleanProperty" type="Boolean" column="bool_p"/> <property name="ByteProperty" type="Byte" column="byte_p"/> <property name="CharacterProperty" type="Char" column="char_p"/> <property name="ClassProperty" type="Type" column="class_p"/> <property name="CultureInfoProperty" type="CultureInfo" column="cinfo_p"/> <property name="DateTimeProperty" type="DateTime" column="dtm_p"/> <property name="DecimalProperty" type="Decimal(19,5)" column="decm_p"/> <property name="DoubleProperty" type="Double" column="dbl_p"/> <property name="Int16Property" type="Int16" column="shrt_p" /> <property name="Int32Property" type="Int32" column="int_p"/> <property name="Int64Property" type="Int64" column="lng_p"/> <property name="SerializableProperty" type="NHibernate.DomainModel.NHSpecific.SerializableClass, NHibernate.DomainModel(1000)" column="ser_p"/> <property name="SingleProperty" type="Single" column="flt_p"/> <property name="StringProperty" type="String" column="str_p"/> <property name="TicksProperty" type="Ticks" column="ticks_p"/> <property name="TrueFalseProperty" type="TrueFalse" column="tf_p"/> <property name="YesNoProperty" type="YesNo" column="yn_p"/> <array name="StringArray" table="bc_starr" > <key column="bc_id" /> <index column="sa_idx" /> <element column="str_val" type="String(100)" /> </array> <primitive-array name="Int32Array" table="bc_inarr"> <key column="bc_id" /> <index column="inta_idx" /> <element column="int32_val" type="Int32" /> </primitive-array> <bag name="StringBag" table="bc_stbag"> <key column="bc_id" /> <element column="str_value" type="String(25)" /> </bag> <list name="StringList" table="bc_stlst"> <key column="bc_id" /> <index column="lst_idx" /> <element column="str_val" type="String(300)" /> </list> <map name="StringMap" table="bc_stmap" > <key column="bc_id"/> <index column="strm_idx" type="String(10)" /> <element column="str_val" type="String(50)" /> </map> <set name="StringSet" table="bc_stset"> <key column="bc_id" /> <element column="str_val" type="String(25)"/> </set> </class> </hibernate-mapping> --- NEW FILE: ClassWithCompositeId.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for ClassWithCompositeId. /// </summary> public class ClassWithCompositeId { private CompositeId _id; private int _oneProperty; public ClassWithCompositeId(){} public CompositeId Id { get {return _id;} set {_id = value;} } public int OneProperty { get {return _oneProperty;} set {_oneProperty = value;} } } } |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21374 Modified Files: Child.cs Multi.hbm.xml NHibernate.DomainModel-1.1.csproj Parent.cs Po.cs Added Files: Custom.hbm.xml ParentChild.hbm.xml Removed Files: AuditComponent.cs BasicClass.cs BasicClass.hbm.xml Child.hbm.xml ClassWithCompositeId.cs ClassWithCompositeId.hbm.xml CompositeId.cs JoinedSubclass.hbm.xml JoinedSubclassBase.cs JoinedSubclassOne.cs Node.cs Node.hbm.xml Parent.hbm.xml ParentComparer.cs SexType.cs SexType.hbm.xml SimpleComponent.cs SimpleComponent.hbm.xml Subclass.hbm.xml Team.cs Team.hbm.xml UnsavedType.cs UnsavedType.hbm.xml Log Message: Added more domain classes and move the new ones I made to use to get NHibernate testing up and going to their own namespace because there was some name conflicts with h2.0.3 classes. --- SimpleComponent.cs DELETED --- --- Node.hbm.xml DELETED --- --- JoinedSubclassOne.cs DELETED --- --- Subclass.hbm.xml DELETED --- --- SexType.hbm.xml DELETED --- --- SimpleComponent.hbm.xml DELETED --- --- BasicClass.cs DELETED --- --- UnsavedType.hbm.xml DELETED --- --- Parent.hbm.xml DELETED --- --- SexType.cs DELETED --- --- Child.hbm.xml DELETED --- Index: Po.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Po.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Po.cs 3 Jun 2004 13:31:52 -0000 1.1 --- Po.cs 9 Jun 2004 01:03:59 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- //<set> mapping private IDictionary _set; + private IList _list; public long Id *************** *** 33,36 **** --- 34,42 ---- } + public IList List + { + get { return _list; } + set { _list = value; } + } Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NHibernate.DomainModel-1.1.csproj 3 Jun 2004 18:01:24 -0000 1.17 --- NHibernate.DomainModel-1.1.csproj 9 Jun 2004 01:03:59 -0000 1.18 *************** *** 123,131 **** /> <File - RelPath = "AuditComponent.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "B.cs" SubType = "Code" --- 123,126 ---- *************** *** 143,155 **** /> <File - RelPath = "BasicClass.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "BasicClass.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "BasicNameable.cs" SubType = "Code" --- 138,141 ---- *************** *** 195,202 **** /> <File - RelPath = "Child.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "Circular.cs" SubType = "Code" --- 181,184 ---- *************** *** 208,220 **** /> <File - RelPath = "ClassWithCompositeId.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "ClassWithCompositeId.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "ComponentCollection.cs" SubType = "Code" --- 190,193 ---- *************** *** 227,235 **** /> <File - RelPath = "CompositeId.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Contained.cs" SubType = "Code" --- 200,203 ---- *************** *** 392,409 **** /> <File - RelPath = "JoinedSubclass.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File - RelPath = "JoinedSubclassBase.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "JoinedSubclassOne.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "LessSimple.cs" SubType = "Code" --- 360,363 ---- *************** *** 490,502 **** /> <File - RelPath = "Node.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "Node.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "One.cs" SubType = "Code" --- 444,447 ---- *************** *** 523,535 **** /> <File ! RelPath = "Parent.hbm.xml" BuildAction = "EmbeddedResource" /> <File - RelPath = "ParentComparer.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Po.cs" SubType = "Code" --- 468,475 ---- /> <File ! RelPath = "ParentChild.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "Po.cs" SubType = "Code" *************** *** 561,702 **** /> <File ! RelPath = "SexType.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SexType.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Simple.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Simple.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "SimpleComponent.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SimpleComponent.hbm.xml" ! BuildAction = "EmbeddedResource" /> <File ! RelPath = "Single.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SingleSeveral.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Sortable.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "StringComparator.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Stuff.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Stuff.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Subclass.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "SubDetail.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SubMulti.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Super.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Team.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Team.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Trivial.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "TrivialClass.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "UnsavedType.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "UnsavedType.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Vetoer.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Vetoer.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "W.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "WZ.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "X.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "XY.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Y.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Z.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> --- 501,716 ---- /> <File ! RelPath = "Simple.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Simple.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Single.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SingleSeveral.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "Sortable.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "StringComparator.cs" ! SubType = "Code" ! BuildAction = "Compile" /> <File ! RelPath = "Stuff.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Stuff.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "SubDetail.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "SubMulti.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Super.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Trivial.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "TrivialClass.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "Vetoer.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "Vetoer.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "W.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "WZ.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "X.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "XY.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "Y.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Z.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\AuditComponent.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\BasicClass.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "NHSpecific\BasicClass.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "NHSpecific\Child.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\Child.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "NHSpecific\ClassWithCompositeId.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\ClassWithCompositeId.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "NHSpecific\CompositeId.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\JoinedSubclass.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "NHSpecific\JoinedSubclassBase.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\JoinedSubclassOne.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "NHSpecific\Node.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "NHSpecific\Node.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "NHSpecific\Parent.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\Parent.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "NHSpecific\ParentComparer.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\SexType.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "NHSpecific\SexType.hbm.xml" BuildAction = "EmbeddedResource" /> <File ! RelPath = "NHSpecific\SimpleComponent.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "NHSpecific\SimpleComponent.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "NHSpecific\Subclass.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "NHSpecific\Team.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "NHSpecific\Team.hbm.xml" ! BuildAction = "EmbeddedResource" ! /> ! <File ! RelPath = "NHSpecific\UnsavedType.cs" SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "NHSpecific\UnsavedType.hbm.xml" + BuildAction = "EmbeddedResource" + /> </Include> </Files> --- ParentComparer.cs DELETED --- --- NEW FILE: Custom.hbm.xml --- Index: Child.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Child.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Child.cs 2 Jun 2004 04:53:24 -0000 1.2 --- Child.cs 9 Jun 2004 01:03:59 -0000 1.3 *************** *** 1,8 **** using System; - using System.Collections; namespace NHibernate.DomainModel { - //TODO: this conflicts with a H2.0.3 class for testing... /// <summary> /// Summary description for Child. --- 1,6 ---- *************** *** 10,109 **** public class Child { ! private int id; ! private string fullName; ! private IDictionary parents; ! private SexType sex; ! ! private IList siblings; ! ! private Child[] friends; ! ! private System.DateTime favoriteDate; ! ! public Child() ! { ! friends = new Child[3]; ! } ! public int Id { ! get {return id;} ! set {id = value;} ! } ! ! public string FullName { ! get {return fullName;} ! set {fullName = value;} ! } ! ! public IList Siblings { ! get { ! if(siblings==null) siblings = new ArrayList(); ! return siblings; ! } ! set {siblings = value;} ! } ! ! public Child FirstSibling { ! get{ ! return (Child)Siblings[0]; ! } ! set {Siblings.Insert(0, value);} ! } ! ! ! public Child SecondSibling { ! get{ ! return (Child)Siblings[1]; ! } ! set {Siblings.Insert(1, value);} ! } ! ! public IDictionary Parents { ! get { ! if(parents==null) parents = new Hashtable(); ! return parents; ! } ! set {parents = value;} ! } ! ! public Parent Mom { ! get { return (Parent)Parents["mom"];} ! set { ! if(Parents.Contains("mom")==false) { ! Parents.Add("mom", value); ! } ! else { ! Parents["mom"] = value; ! } ! } ! } ! ! public Parent Dad { ! get { return (Parent)Parents["dad"];} ! set { ! if(Parents.Contains("dad")==false) { ! Parents.Add("dad", value); ! } ! else { ! Parents["dad"] = value; ! } ! ! } } ! public SexType Sex { ! get { return sex;} ! set { sex = value;} } ! public Child[] Friends { ! get { return friends;} ! set { friends = value;} } ! ! public System.DateTime FavoriteDate{ ! get {return favoriteDate;} ! set {favoriteDate = value;} } --- 8,37 ---- public class Child { ! private Parent _parent; ! private int _count; ! private int _x; ! public Parent Parent ! { ! get { return _parent; } ! set { _parent = value; } } ! public int Count ! { ! get { return _count; } ! set { _count = value; } } ! public int X ! { ! get { return _x; } ! set { _x = value; } } ! public long Id ! { ! get { return _parent.Id; } ! set { } } --- ClassWithCompositeId.hbm.xml DELETED --- --- AuditComponent.cs DELETED --- Index: Parent.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Parent.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Parent.cs 3 Jun 2004 14:54:40 -0000 1.2 --- Parent.cs 9 Jun 2004 01:03:59 -0000 1.3 *************** *** 1,8 **** using System; - using System.Collections; namespace NHibernate.DomainModel { - //TODO: replace this with H2.0.3 version /// <summary> /// Summary description for Parent. --- 1,6 ---- *************** *** 10,46 **** public class Parent { ! private int id; ! private string adultName; ! private IDictionary children; ! private IDictionary adultFriends; ! ! ! public Parent() { ! adultFriends = new SortedList(new ParentComparer()); ! } ! ! public int Id { ! get {return id;} ! set {id = value;} } ! public string AdultName { ! get {return adultName;} ! set {adultName = value;} } ! public IDictionary Children { ! get {return children;} ! set {children = value;} } ! public IDictionary AdultFriends { ! get {return adultFriends;} ! set {adultFriends = value;} } ! public void AddFriend(Parent friend) { ! adultFriends.Add(friend, friend); } --- 8,47 ---- public class Parent { ! private long _id; ! private int _count; ! private Child _child; ! private object _any; ! private int _x; ! ! public long Id { ! get { return _id; } ! set { _id = value; } } ! public int Count ! { ! get { return _count; } ! set { _count = value; } } ! public Child Child ! { ! get { return _child; } ! set { _child = value; } } ! ! public object Any ! { ! get { return _any; } ! set { _any = value; } } ! ! public int X ! { ! get { return _x; } ! set { _x = value; } } --- Node.cs DELETED --- --- UnsavedType.cs DELETED --- --- Team.cs DELETED --- --- Team.hbm.xml DELETED --- --- NEW FILE: ParentChild.hbm.xml --- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">> <class name="NHibernate.DomainModel.Parent, NHibernate.DomainModel" > <id name="Id" type="Int64"> <generator class="native"> <!--seqhilo--> <!--<param>foo_seq</param>--> </generator> </id> <property name="X"/> <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"> <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> Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Multi.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Multi.hbm.xml 7 Jun 2004 20:41:06 -0000 1.2 --- Multi.hbm.xml 9 Jun 2004 01:03:59 -0000 1.3 *************** *** 74,82 **** /> <many-to-one ! name="Yetanother" column="other3" class="NHibernate.DomainModel.LessSimple, NHibernate.DomainModel" /> ! <property name="foo"/> <set name="Set" --- 74,82 ---- /> <many-to-one ! name="YetAnother" column="other3" class="NHibernate.DomainModel.LessSimple, NHibernate.DomainModel" /> ! <property name="Foo"/> <set name="Set" *************** *** 94,101 **** <many-to-many column="simple2" ! class="NHibernate.DomainModel.Simple" /> </bag> ! <one-to-one name="Mypo"/> </joined-subclass> --- 94,101 ---- <many-to-many column="simple2" ! class="NHibernate.DomainModel.Simple, NHibernate.DomainModel" /> </bag> ! <one-to-one name="MyPo"/> </joined-subclass> *************** *** 105,109 **** > <key column="sid"/> ! <property name="extraProp"/> <many-to-one name="Other" --- 105,109 ---- > <key column="sid"/> ! <property name="ExtraProp"/> <many-to-one name="Other" *************** *** 114,118 **** <component ! name="comp" class="NHibernate.DomainModel.Multi+Component, NHibernate.DomainModel" > --- 114,118 ---- <component ! name="Comp" class="NHibernate.DomainModel.Multi+Component, NHibernate.DomainModel" > *************** *** 126,130 **** > <key column="sid"/> ! <property name="amount"/> <bag name="Children" --- 126,130 ---- > <key column="sid"/> ! <property name="Amount"/> <bag name="Children" *************** *** 135,140 **** <one-to-many class="NHibernate.DomainModel.SubMulti, NHibernate.DomainModel"/> </bag> ! <many-to-one name="parent"/> ! <list name="moreChildren" lazy="true"> <key column="another_parent"/> <index column="list_ind"/> --- 135,140 ---- <one-to-many class="NHibernate.DomainModel.SubMulti, NHibernate.DomainModel"/> </bag> ! <many-to-one name="Parent"/> ! <list name="MoreChildren" lazy="true"> <key column="another_parent"/> <index column="list_ind"/> *************** *** 162,166 **** /> <list ! name="list" cascade="all" > --- 162,166 ---- /> <list ! name="List" cascade="all" > --- JoinedSubclassBase.cs DELETED --- --- JoinedSubclass.hbm.xml DELETED --- --- CompositeId.cs DELETED --- --- BasicClass.hbm.xml DELETED --- --- ClassWithCompositeId.cs DELETED --- |
From: Michael D. <mik...@us...> - 2004-06-09 00:59:43
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18059/NHSpecific Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific added to the repository |
From: Michael D. <mik...@us...> - 2004-06-09 00:57:57
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16669/NHSpecificTest Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest added to the repository |
From: Michael D. <mik...@us...> - 2004-06-08 11:48:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3542 Modified Files: FumTest.cs Log Message: Uncommented 3 hbm.xml files because they now are configured correctly. Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FumTest.cs 7 Jun 2004 20:35:44 -0000 1.3 --- FumTest.cs 8 Jun 2004 11:48:22 -0000 1.4 *************** *** 35,42 **** "Holder.hbm.xml", "Location.hbm.xml", ! "Stuff.hbm.xml" ! //"Container.hbm.xml", ! //"Simple.hbm.xml", ! //"Middle.hbm.xml" }, true); } --- 35,42 ---- "Holder.hbm.xml", "Location.hbm.xml", ! "Stuff.hbm.xml", ! "Container.hbm.xml", ! "Simple.hbm.xml", ! "Middle.hbm.xml" }, true); } |
From: Michael D. <mik...@us...> - 2004-06-08 11:47:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3428 Modified Files: CriteriaTest.cs PerformanceTest.cs SimpleTest.cs Log Message: Made Simple class look like H2.0.3's Simple class. Index: PerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PerformanceTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PerformanceTest.cs 28 May 2004 11:49:05 -0000 1.3 --- PerformanceTest.cs 8 Jun 2004 11:47:37 -0000 1.4 *************** *** 61,65 **** [Test] ! [Ignore("User should comment this out if they want it to run. Does not test any functions.")] public void Many() { --- 61,65 ---- [Test] ! //[Ignore("User should comment this out if they want it to run. Does not test any functions.")] public void Many() { *************** *** 70,74 **** //for(int n = 0; n < 20; n++) ! for(int n = 0; n < 20; n++) { Simple[] simples = new Simple[n]; --- 70,74 ---- //for(int n = 0; n < 20; n++) ! for(int n = 0; n < 5; n++) { Simple[] simples = new Simple[n]; *************** *** 80,84 **** simples[i].Init(); simples[i].Count = i; - simples[i].Key = (long)i; ids[i] = (long)i; } --- 80,83 ---- *************** *** 161,165 **** for(int i = 0; i < N; i++) { ! s.Save(simples[i]); //, ids[i]); } s.Flush(); --- 160,164 ---- for(int i = 0; i < N; i++) { ! s.Save(simples[i], ids[i]); } s.Flush(); *************** *** 248,252 **** keys[j] = (long)reader[0]; simplesFromReader[j] = new Simple(); - simplesFromReader[j].Key = keys[j]; simplesFromReader[j].Name = (string)reader[1]; simplesFromReader[j].Address = (string)reader[2]; --- 247,250 ---- Index: CriteriaTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CriteriaTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CriteriaTest.cs 24 May 2004 05:46:59 -0000 1.2 --- CriteriaTest.cs 8 Jun 2004 11:47:37 -0000 1.3 *************** *** 23,43 **** ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); ! Simple simple1 = new Simple(); simple1.Address = "Street 12"; simple1.Date = DateTime.Now; - simple1.Key = 15; simple1.Name = "For Criteria Test"; simple1.Count = 16; Simple notSimple1 = new Simple(); notSimple1.Address = "Street 123"; notSimple1.Date = DateTime.Now; - notSimple1.Key = 17; notSimple1.Name = "Don't be found"; notSimple1.Count = 18; ! s1.Save(notSimple1); ! s1.Save(simple1); t1.Commit(); --- 23,43 ---- ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); ! ! long simple1Key = 15; Simple simple1 = new Simple(); simple1.Address = "Street 12"; simple1.Date = DateTime.Now; simple1.Name = "For Criteria Test"; simple1.Count = 16; + long notSimple1Key = 17; Simple notSimple1 = new Simple(); notSimple1.Address = "Street 123"; notSimple1.Date = DateTime.Now; notSimple1.Name = "Don't be found"; notSimple1.Count = 18; ! s1.Save(notSimple1, notSimple1Key); ! s1.Save(simple1, simple1Key); t1.Commit(); *************** *** 56,60 **** Assertion.AssertNotNull("Unable to load object", simple2); - Assertion.AssertEquals("Load failed", simple1.Key, simple2.Key); Assertion.AssertEquals("Load failed", simple1.Count, simple2.Count); Assertion.AssertEquals("Load failed", simple1.Name, simple2.Name); --- 56,59 ---- *************** *** 62,67 **** Assertion.AssertEquals("Load failed", simple1.Date.ToString(), simple2.Date.ToString()); ! s2.Delete(notSimple1); ! s2.Delete(simple2); t2.Commit(); --- 61,65 ---- Assertion.AssertEquals("Load failed", simple1.Date.ToString(), simple2.Date.ToString()); ! s2.Delete("from Simple"); t2.Commit(); Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleTest.cs 16 May 2004 03:49:36 -0000 1.2 --- SimpleTest.cs 8 Jun 2004 11:47:37 -0000 1.3 *************** *** 81,85 **** ITransaction t3 = s3.BeginTransaction(); ! Simple simple3 = (Simple)s3.Load(typeof(Simple), simple2.Key); Simple otherSimple3; --- 81,85 ---- ITransaction t3 = s3.BeginTransaction(); ! Simple simple3 = (Simple)s3.Load(typeof(Simple), key); Simple otherSimple3; *************** *** 92,96 **** // they were loaded in 2 different sessions otherSimple3 = simple3.Other; - Assertion.AssertEquals(simple2.Other.Key, otherSimple3.Key); // the update worked - lets clear out the table --- 92,95 ---- *************** *** 135,139 **** Simple loadedSimple = (Simple)q.List()[0]; - Assert.AreEqual(key, loadedSimple.Key); Assert.AreEqual(99, loadedSimple.Count); Assert.AreEqual("Simple 1", loadedSimple.Name); --- 134,137 ---- |
From: Michael D. <mik...@us...> - 2004-06-08 11:46:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3226 Modified Files: Baz.cs Baz.hbm.xml CompositeElement.cs Middle.hbm.xml Log Message: Fixed naming of properties to follow .net standard Index: Middle.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Middle.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Middle.hbm.xml 3 Jun 2004 18:01:24 -0000 1.1 --- Middle.hbm.xml 8 Jun 2004 11:46:06 -0000 1.2 *************** *** 8,12 **** <composite-id name="Id"> <key-property ! name="akey" type="String(10)" length="10" --- 8,12 ---- <composite-id name="Id"> <key-property ! name="AKey" type="String(10)" length="10" *************** *** 14,18 **** /> <key-property ! name="bkey" type="String(10)" length="10" --- 14,18 ---- /> <key-property ! name="BKey" type="String(10)" length="10" *************** *** 36,40 **** > <composite-id name="Id"> ! <key-many-to-one name="sup"> <column length="10" --- 36,40 ---- > <composite-id name="Id"> ! <key-many-to-one name="Sup"> <column length="10" *************** *** 73,77 **** > <composite-id name="Id"> ! <key-many-to-one name="master"> <column name="AKEY"/> <column name="BKEY"/> --- 73,77 ---- > <composite-id name="Id"> ! <key-many-to-one name="Master"> <column name="AKEY"/> <column name="BKEY"/> *************** *** 80,84 **** </key-many-to-one> <key-property ! name="detailId" type="String(10)" column="ID" --- 80,84 ---- </key-many-to-one> <key-property ! name="DetailId" type="String(10)" column="ID" Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Baz.cs 4 Jun 2004 12:02:44 -0000 1.7 --- Baz.cs 8 Jun 2004 11:46:06 -0000 1.8 *************** *** 611,619 **** CompositeElement ce = new CompositeElement(); ! ce.foo = "foo"; ! ce.bar = "bar"; CompositeElement ce2 = new CompositeElement(); ! ce2.foo = "fooxxx"; ! ce2.bar = "barxxx"; Cached.Add(ce, new object()); Cached.Add(ce2, new object()); --- 611,619 ---- CompositeElement ce = new CompositeElement(); ! ce.Foo = "foo"; ! ce.Bar = "bar"; CompositeElement ce2 = new CompositeElement(); ! ce2.Foo = "fooxxx"; ! ce2.Bar = "barxxx"; Cached.Add(ce, new object()); Cached.Add(ce2, new object()); Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Baz.hbm.xml 4 Jun 2004 12:02:44 -0000 1.10 --- Baz.hbm.xml 8 Jun 2004 11:46:06 -0000 1.11 *************** *** 285,290 **** <key column="baz"/> <composite-element class="NHibernate.DomainModel.CompositeElement, NHibernate.DomainModel"> ! <property name="foo"/> ! <property name="bar"/> </composite-element> </set> --- 285,290 ---- <key column="baz"/> <composite-element class="NHibernate.DomainModel.CompositeElement, NHibernate.DomainModel"> ! <property name="Foo"/> ! <property name="Bar"/> </composite-element> </set> *************** *** 295,300 **** <index-many-to-many column="another_baz" class="NHibernate.DomainModel.Baz, NHibernate.DomainModel"/> <composite-element class="NHibernate.DomainModel.CompositeElement, NHibernate.DomainModel"> ! <property name="foo"/> ! <property name="bar"/> </composite-element> </map> --- 295,300 ---- <index-many-to-many column="another_baz" class="NHibernate.DomainModel.Baz, NHibernate.DomainModel"/> <composite-element class="NHibernate.DomainModel.CompositeElement, NHibernate.DomainModel"> ! <property name="Foo"/> ! <property name="Bar"/> </composite-element> </map> Index: CompositeElement.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/CompositeElement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompositeElement.cs 8 Apr 2004 14:59:32 -0000 1.1 --- CompositeElement.cs 8 Jun 2004 11:46:06 -0000 1.2 *************** *** 1,12 **** - //------------------------------------------------------------------------------ - // <autogenerated> - // This code was generated by a tool. - // Runtime Version: v1.1.4322 - // - // Changes to this file may cause incorrect behavior and will be lost if - // the code is regenerated. - // </autogenerated> - //------------------------------------------------------------------------------ - using System; --- 1,2 ---- *************** *** 14,23 **** { - /// <summary> - /// POJO for CompositeElement - /// </summary> - /// <remark> - /// This class is autogenerated - /// </remark> [Serializable] public class CompositeElement : IComparable --- 4,7 ---- *************** *** 25,36 **** #region Fields - /// <summary> - /// Holder for foo - /// </summary> private String _foo; - - /// <summary> - /// Holder for bar - /// </summary> private String _bar; --- 9,13 ---- *************** *** 62,75 **** /// Get/set for foo /// </summary> ! public String foo { ! get ! { ! return this._foo; ! } ! set ! { ! this._foo = value; ! } } --- 39,46 ---- /// Get/set for foo /// </summary> ! public String Foo { ! get { return _foo; } ! set { _foo = value; } } *************** *** 77,90 **** /// Get/set for bar /// </summary> ! public String bar { ! get ! { ! return this._bar; ! } ! set ! { ! this._bar = value; ! } } --- 48,55 ---- /// Get/set for bar /// </summary> ! public String Bar { ! get { return _bar; } ! set { _bar = value; } } *************** *** 96,100 **** public int CompareTo(object obj) { ! return ( (CompositeElement) obj ).foo.CompareTo(foo); } #endregion --- 61,65 ---- public int CompareTo(object obj) { ! return ( (CompositeElement) obj ).Foo.CompareTo(Foo); } #endregion |
From: Michael D. <mik...@us...> - 2004-06-08 11:44:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2936 Modified Files: Simple.cs Simple.hbm.xml Log Message: Made Simple class look like H2.0.3's Simple class. Index: Simple.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Simple.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Simple.hbm.xml 24 May 2004 05:47:00 -0000 1.3 --- Simple.hbm.xml 8 Jun 2004 11:44:47 -0000 1.4 *************** *** 3,7 **** <class name="NHibernate.DomainModel.Simple, NHibernate.DomainModel"> ! <id name="Key" type="Int64" column="id_"> <generator class="assigned"/> </id> --- 3,7 ---- <class name="NHibernate.DomainModel.Simple, NHibernate.DomainModel"> ! <id type="Int64" column="id_"> <generator class="assigned"/> </id> Index: Simple.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Simple.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Simple.cs 24 May 2004 05:47:00 -0000 1.2 --- Simple.cs 8 Jun 2004 11:44:47 -0000 1.3 *************** *** 5,9 **** public class Simple { - private long key; private string name; private string address; --- 5,8 ---- *************** *** 26,35 **** } - public long Key - { - get {return key;} - set {key = value;} - } - public string Name { --- 25,28 ---- |
From: Michael D. <mik...@us...> - 2004-06-07 20:42:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9702 Modified Files: Container.cs Container.hbm.xml Log Message: Continued to add Domain Classes and mappings for test fixtures. Index: Container.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Container.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Container.hbm.xml 3 Jun 2004 18:55:57 -0000 1.4 --- Container.hbm.xml 7 Jun 2004 20:41:30 -0000 1.5 *************** *** 50,54 **** <index column="list_index" /> <composite-element ! class="NHibernate.DomainModel.Container$ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> --- 50,54 ---- <index column="list_index" /> <composite-element ! class="NHibernate.DomainModel.Container+ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> *************** *** 68,72 **** <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container$ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> --- 68,72 ---- <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container+ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> *************** *** 83,87 **** <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container$ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> --- 83,87 ---- <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container+ContainerInnerClass, NHibernate.DomainModel" > <property name="Name" /> *************** *** 137,141 **** /> <composite-element ! class="NHibernate.DomainModel.Container$Ternary, NHibernate.DomainModel" > <property name="Name" /> --- 137,141 ---- /> <composite-element ! class="NHibernate.DomainModel.Container+Ternary, NHibernate.DomainModel" > <property name="Name" /> *************** *** 147,151 **** <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container$Ternary, NHibernate.DomainModel" > <property name="Name" /> --- 147,151 ---- <key column="container_id" /> <composite-element ! class="NHibernate.DomainModel.Container+Ternary, NHibernate.DomainModel" > <property name="Name" /> Index: Container.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Container.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Container.cs 2 Jun 2004 04:53:24 -0000 1.1 --- Container.cs 7 Jun 2004 20:41:30 -0000 1.2 *************** *** 1,18 **** using System; namespace NHibernate.DomainModel { - //TODO: write all of this... - /// <summary> - /// Summary description for Container. - /// </summary> public class Container { ! public Container() { ! // ! // TODO: Add constructor logic here ! // } } } --- 1,160 ---- using System; + using System.Collections; namespace NHibernate.DomainModel { public class Container { ! public sealed class ContainerInnerClass { ! private Simple _simple; ! private string _name; ! private One _one; ! private Many _many; ! private int _count; ! ! public Simple Simple ! { ! get { return _simple; } ! set { _simple = value; } ! } ! ! public string Name ! { ! get { return _name; } ! set { _name = value; } ! } ! ! public One One ! { ! get { return _one; } ! set { _one = value; } ! } ! ! public Many Many ! { ! get { return _many; } ! set { _many = value; } ! } ! ! public int Count ! { ! get { return _count; } ! set { _count = value; } ! } ! ! #region System.Object Members ! ! public override string ToString() ! { ! return _name + " = " + _simple.Count ! + "/" + ( _one==null ? "nil" : _one.Key.ToString() ) ! + "/" + ( _many==null ? "nii" : _many.Key.ToString() ); ! } ! ! #endregion ! } ! ! public sealed class Ternary ! { ! private string _name; ! private Foo _foo; ! private Glarch _glarch; ! ! public string Name ! { ! get { return _name; } ! set { _name = value; } ! } ! ! public Foo Foo ! { ! get { return _foo; } ! set { _foo = value; } ! } ! ! public Glarch Glarch ! { ! get { return _glarch; } ! set { _glarch = value; } ! } ! ! } ! ! ! private IList _oneToMany; ! private IList _components; ! private IList _manyToMany; ! // <set> mapping ! private IDictionary _composites; ! private IList _cascades; ! private long _id; ! private IList _bag; ! private IList _lazyBag = new ArrayList(); ! private IDictionary _ternaryMap; ! //<set> mapping ! private IDictionary _ternarySet; ! ! ! public IList OneToMany ! { ! get { return _oneToMany; } ! set { _oneToMany = value; } ! } ! ! public IList ManyToMany ! { ! get { return _manyToMany; } ! set { _manyToMany = value; } } + + public IList Components + { + get { return _components; } + set { _components = value; } + } + + public IDictionary Composites + { + get { return _composites; } + set { _composites = value; } + } + + public IList Cascades + { + get { return _cascades; } + set { _cascades = value; } + } + + public long Id + { + get { return _id; } + set { _id = value; } + } + + public IList Bag + { + get { return _bag; } + set { _bag = value; } + } + + public IList LazyBag + { + get { return _lazyBag; } + set { _lazyBag = value; } + } + + public IDictionary TernaryMap + { + get { return _ternaryMap; } + set { _ternaryMap = value; } + } + + public IDictionary TernarySet + { + get { return _ternarySet; } + set { _ternarySet = value; } + } + } } |
From: Michael D. <mik...@us...> - 2004-06-07 20:41:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9557 Modified Files: Multi.hbm.xml Log Message: Figured out that the "+" is used in Reflection to get to a Nested Class Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Multi.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Multi.hbm.xml 3 Jun 2004 18:01:24 -0000 1.1 --- Multi.hbm.xml 7 Jun 2004 20:41:06 -0000 1.2 *************** *** 115,123 **** <component name="comp" ! class="NHibernate.DomainModel.Multi$Component, NHibernate.DomainModel" > ! <!-- TODO: figure out how to reflect on a nested type --> ! <property name="cal"/> ! <property name="floaty"/> </component> --- 115,122 ---- <component name="comp" ! class="NHibernate.DomainModel.Multi+Component, NHibernate.DomainModel" > ! <property name="Cal"/> ! <property name="Floaty"/> </component> |
From: Michael D. <mik...@us...> - 2004-06-07 20:37:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8031 Modified Files: ABCProxyTest.cs ABCTest.cs FooBarTest.cs FumTest.cs TestCase.cs Log Message: Moved the TearDown method into the base class TestCase Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** FooBarTest.cs 4 Jun 2004 12:02:44 -0000 1.23 --- FooBarTest.cs 7 Jun 2004 20:35:44 -0000 1.24 *************** *** 30,44 **** "Location.hbm.xml", "Stuff.hbm.xml", ! //"Container.hbm.xml", "XY.hbm.xml" }, true); } - [TearDown] - public void TearDown() - { - DropSchema(); - } - [Test] [Ignore("Fails because Proxies are not working.")] --- 30,38 ---- "Location.hbm.xml", "Stuff.hbm.xml", ! "Container.hbm.xml", "XY.hbm.xml" }, true); } [Test] [Ignore("Fails because Proxies are not working.")] Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ABCProxyTest.cs 3 Jun 2004 18:00:31 -0000 1.5 --- ABCProxyTest.cs 7 Jun 2004 20:35:42 -0000 1.6 *************** *** 16,25 **** } - [TearDown] - public void TearDown() - { - DropSchema(); - } - [Test] [Ignore("Test will fail because of proxy initalization problems")] --- 16,19 ---- Index: TestCase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TestCase.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TestCase.cs 16 Apr 2004 14:07:19 -0000 1.11 --- TestCase.cs 7 Jun 2004 20:35:44 -0000 1.12 *************** *** 9,12 **** --- 9,14 ---- using NHibernate.Tool.hbm2ddl; + using NUnit.Framework; + namespace NHibernate.Test { *************** *** 18,21 **** --- 20,38 ---- protected ISessionFactory sessions; + /// <summary> + /// Removes the tables used in this TestCase. + /// </summary> + /// <remarks> + /// If the tables are not cleaned up sometimes SchemaExport runs into + /// Sql errors because it can't drop tables because of the FKs. This + /// will occur if the TestCase does not have the same hbm.xml files + /// included as a previous one. + /// </remarks> + [TearDown] + public virtual void TearDown() + { + DropSchema(); + } + public void ExportSchema(string[] files) { Index: ABCTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ABCTest.cs 3 Jun 2004 18:00:31 -0000 1.5 --- ABCTest.cs 7 Jun 2004 20:35:43 -0000 1.6 *************** *** 19,28 **** } - [TearDown] - public void TearDown() - { - DropSchema(); - } - [Test] public void Subclassing() --- 19,22 ---- Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FumTest.cs 3 Jun 2004 19:03:40 -0000 1.2 --- FumTest.cs 7 Jun 2004 20:35:44 -0000 1.3 *************** *** 42,52 **** } - - [TearDown] - public void TearDown() - { - DropSchema(); - } - static FumCompositeID FumKey(String str) { --- 42,45 ---- |
From: Michael D. <mik...@us...> - 2004-06-04 19:59:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15717/Cfg Modified Files: Binder.cs Log Message: <idbag> is now converted to an IdentiferBag collection correctly. Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Binder.cs 11 May 2004 19:26:59 -0000 1.24 --- Binder.cs 4 Jun 2004 19:59:29 -0000 1.25 *************** *** 497,500 **** --- 497,504 ---- mappings.AddSecondPass( new SetSecondPass(node, mappings, (Set) model) ); } + else if (model is IdentifierCollection) + { + mappings.AddSecondPass( new IdentifierCollectionSecondPass(node, mappings, (IdentifierCollection) model) ); + } else { *************** *** 987,990 **** --- 991,1007 ---- } + public static void BindIdentifierCollectionSecondPass(XmlNode node, IdentifierCollection model, IDictionary persitentClasses, Mappings mappings) + { + BindCollectionSecondPass(node, model, persitentClasses, mappings); + + XmlNode subnode = node.SelectSingleNode(nsPrefix + ":collection-id", nsmgr); + Value id = new Value(model.Table); + BindValue(subnode, id, false, IdentifierCollection.DefaultIdentifierColumnName); + model.Identifier = id; + MakeIdentifier(subnode, id, mappings); + if ( !model.IsOneToMany ) model.CreatePrimaryKey(); + + } + //map binding *************** *** 1215,1221 **** } private class MapSecondPass : SecondPass { ! public MapSecondPass(XmlNode node, Mappings mappings, Mapping.Collection collection) : base(node, mappings, collection) { --- 1232,1251 ---- } + private class IdentifierCollectionSecondPass : SecondPass + { + public IdentifierCollectionSecondPass(XmlNode node, Mappings mappings, Mapping.IdentifierCollection collection) + : base(node, mappings, collection) + { + } + + public override void secondPass(IDictionary persistentClasses) + { + Binder.BindIdentifierCollectionSecondPass( node, (Mapping.IdentifierCollection) collection, persistentClasses, mappings); + } + } + private class MapSecondPass : SecondPass { ! public MapSecondPass(XmlNode node, Mappings mappings, Mapping.Map collection) : base(node, mappings, collection) { *************** *** 1229,1233 **** private class SetSecondPass : SecondPass { ! public SetSecondPass(XmlNode node, Mappings mappings, Mapping.Collection collection) : base(node, mappings, collection) { --- 1259,1263 ---- private class SetSecondPass : SecondPass { ! public SetSecondPass(XmlNode node, Mappings mappings, Mapping.Set collection) : base(node, mappings, collection) { *************** *** 1241,1245 **** private class ListSecondPass : SecondPass { ! public ListSecondPass(XmlNode node, Mappings mappings, Mapping.Collection collection) : base(node, mappings, collection) { --- 1271,1275 ---- private class ListSecondPass : SecondPass { ! public ListSecondPass(XmlNode node, Mappings mappings, Mapping.List collection) : base(node, mappings, collection) { *************** *** 1315,1319 **** } ! private static CollectionType IDBAG = new CollectionTypeBag("idbag"); private class CollectionTypeIdBag : CollectionType { --- 1345,1349 ---- } ! private static CollectionType IDBAG = new CollectionTypeIdBag("idbag"); private class CollectionTypeIdBag : CollectionType { |
From: Michael D. <mik...@us...> - 2004-06-04 19:58:29
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15504/Collection Modified Files: IdentifierBag.cs Log Message: Added a Read() in the GetEnumerator method. Index: IdentifierBag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/IdentifierBag.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdentifierBag.cs 3 May 2004 04:56:43 -0000 1.1 --- IdentifierBag.cs 4 Jun 2004 19:58:18 -0000 1.2 *************** *** 175,178 **** --- 175,179 ---- public override IEnumerator GetEnumerator() { + Read(); return values.GetEnumerator(); } |