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-30 18:23:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21740/NHibernate.DomainModel Modified Files: Stuff.cs Log Message: Added TODO comments about TimeZone property. Index: Stuff.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Stuff.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Stuff.cs 29 Jun 2004 14:26:27 -0000 1.2 --- Stuff.cs 30 Jun 2004 18:23:50 -0000 1.3 *************** *** 13,16 **** --- 13,19 ---- private MoreStuff _moreStuff; //private TimeZone property; TODO - does this exists in .net??? + // yes, but it does not have a ctor (or static method) to get anything but the current TimeZone + // so I'm not sure how if we persist something diff than the current TimeZone we could retreive + // it... public long Id |
From: Michael D. <mik...@us...> - 2004-06-30 18:23:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21615/NHibernate.DomainModel Modified Files: Baz.hbm.xml Container.hbm.xml Glarch.hbm.xml Log Message: Added comments that certain jcs-cache elements were also commented out in h2.0.3 Index: Container.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Container.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Container.hbm.xml 7 Jun 2004 20:41:30 -0000 1.5 --- Container.hbm.xml 30 Jun 2004 18:23:09 -0000 1.6 *************** *** 122,126 **** cascade="save-update" > ! <!--jcs-cache usage="read-write"--> <key column="container_id" /> <many-to-many --- 122,126 ---- cascade="save-update" > ! <jcs-cache usage="read-write" /> <key column="container_id" /> <many-to-many Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Baz.hbm.xml 24 Jun 2004 15:22:06 -0000 1.12 --- Baz.hbm.xml 30 Jun 2004 18:23:09 -0000 1.13 *************** *** 194,197 **** --- 194,198 ---- <set name="StringSet" lazy="true" sort="NHibernate.DomainModel.StringComparator, NHibernate.DomainModel"> <!--<jcs-cache usage="read-write"/>--> + <!-- commented out in h2.0.3 also --> <key column="id_"/> <element column="element" type="String" not-null="true" length="32"/> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Glarch.hbm.xml 24 Jun 2004 15:22:07 -0000 1.4 --- Glarch.hbm.xml 30 Jun 2004 18:23:09 -0000 1.5 *************** *** 8,12 **** > ! <!--<jcs-cache usage="read-write"/>--> <id type="String" --- 8,13 ---- > ! <!-- <jcs-cache usage="read-write" /> --> ! <!-- commented out in h2.0.3 also --> <id type="String" |
From: Michael D. <mik...@us...> - 2004-06-30 18:22:20
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21374/NHibernate.DomainModel Modified Files: Assignable.cs MoreStuff.cs Log Message: Changed properties that were mapped to a <bag> to an IList Index: Assignable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Assignable.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Assignable.cs 2 Jun 2004 04:53:24 -0000 1.1 --- Assignable.cs 30 Jun 2004 18:22:09 -0000 1.2 *************** *** 10,14 **** { private string _id; ! private ICollection _categories; public string Id --- 10,14 ---- { private string _id; ! private IList _categories; public string Id *************** *** 18,22 **** } ! public ICollection Categories { get { return _categories; } --- 18,22 ---- } ! public IList Categories { get { return _categories; } Index: MoreStuff.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/MoreStuff.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MoreStuff.cs 3 Jun 2004 13:31:52 -0000 1.1 --- MoreStuff.cs 30 Jun 2004 18:22:09 -0000 1.2 *************** *** 13,17 **** private int _intId; // <bag> mapping ! private ICollection _stuffs; private string _name; --- 13,17 ---- private int _intId; // <bag> mapping ! private IList _stuffs; private string _name; *************** *** 29,33 **** } ! public ICollection Stuffs { get { return _stuffs; } --- 29,33 ---- } ! public IList Stuffs { get { return _stuffs; } |
From: Michael D. <mik...@us...> - 2004-06-30 13:38:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/Util Removed Files: SequencedHashMapTest.cs Log Message: Removed SequenceHashMapTest because it is now in NHibernate.Test instead of NHibernate csproj. --- SequencedHashMapTest.cs DELETED --- |
From: Michael D. <mik...@us...> - 2004-06-30 13:38:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163 Modified Files: NHibernate-1.1.csproj Log Message: Removed SequenceHashMapTest because it is now in NHibernate.Test instead of NHibernate csproj. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** NHibernate-1.1.csproj 19 May 2004 04:14:48 -0000 1.28 --- NHibernate-1.1.csproj 30 Jun 2004 13:38:04 -0000 1.29 *************** *** 1906,1914 **** /> <File - RelPath = "Util\SequencedHashMapTest.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File RelPath = "Util\StringHelper.cs" SubType = "Code" --- 1906,1909 ---- |
From: Michael D. <mik...@us...> - 2004-06-30 13:29:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24329 Modified Files: BasicBinaryFixture.cs Log Message: Added some messesages to Asserts to make sure what is being tested (and failing) is reported in an easy to read way. Index: BasicBinaryFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicBinaryFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicBinaryFixture.cs 29 Jun 2004 04:30:16 -0000 1.1 --- BasicBinaryFixture.cs 30 Jun 2004 13:29:49 -0000 1.2 *************** *** 11,15 **** { /// <summary> ! /// Summary description for BasicBinaryFixture. /// </summary> [TestFixture] --- 11,15 ---- { /// <summary> ! /// Tests for mapping a byte[] Property to a BinaryType. /// </summary> [TestFixture] *************** *** 41,46 **** Assert.IsNotNull(bcBinaryLoaded); ! Assert.AreEqual(null, bcBinary.DefaultSize); ! Assert.AreEqual(null, bcBinary.WithSize); s.Delete(bcBinaryLoaded); --- 41,46 ---- Assert.IsNotNull(bcBinaryLoaded); ! Assert.AreEqual(null, bcBinary.DefaultSize, "A property mapped as type=\"Byte[]\" with a null byte[] value was not saved & loaded as null"); ! Assert.AreEqual(null, bcBinary.WithSize, "A property mapped as type=\"Byte[](length)\" with null byte[] value was not saved & loaded as null"); s.Delete(bcBinaryLoaded); *************** *** 67,72 **** Assert.IsNotNull(bcBinaryLoaded); ! Assert.AreEqual(0, bcBinary.DefaultSize.Length); ! Assert.AreEqual(0, bcBinary.WithSize.Length); s.Delete(bcBinaryLoaded); --- 67,72 ---- Assert.IsNotNull(bcBinaryLoaded); ! Assert.AreEqual(0, bcBinary.DefaultSize.Length, "A property mapped as type=\"Byte[]\" with a byte[0] value was not saved & loaded as byte[0]"); ! Assert.AreEqual(0, bcBinary.WithSize.Length, "A property mapped as type=\"Byte[](length)\" with a byte[0] value was not saved & loaded as byte[0]"); s.Delete(bcBinaryLoaded); *************** *** 78,86 **** public void Insert() { ! BasicBinary bcBinary = new BasicBinary(); ! bcBinary.Id = 1; ! ! bcBinary.DefaultSize = GetByteArray(5); ! bcBinary.WithSize = GetByteArray(10); ISession s = sessions.OpenSession(); --- 78,82 ---- public void Insert() { ! BasicBinary bcBinary = Create(1); ISession s = sessions.OpenSession(); *************** *** 104,107 **** --- 100,158 ---- } + [Test] + public void Update() + { + BasicBinary bcBinary = Create(1); + + ISession s = sessions.OpenSession(); + s.Save(bcBinary); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + bcBinary = (BasicBinary)s.Load(typeof(BasicBinary), 1); + + bcBinary.DefaultSize = GetByteArray(15); + + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + // make sure the update went through + bcBinary = (BasicBinary)s.Load(typeof(BasicBinary), 1); + + // was DefaultSize updated + ObjectAssertion.AssertEquals( bcBinary.DefaultSize, GetByteArray(15) ); + // WithSize should not have been updated + ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); + + // lets modify WithSize + bcBinary.WithSize = GetByteArray(20); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + bcBinary = (BasicBinary)s.Load(typeof(BasicBinary), 1); + + // was DefaultSize not updated + ObjectAssertion.AssertEquals( bcBinary.DefaultSize, GetByteArray(15) ); + ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); + + s.Delete(bcBinary); + s.Flush(); + s.Close(); + } + + private BasicBinary Create(int id) + { + BasicBinary bcBinary = new BasicBinary(); + bcBinary.Id = id; + + bcBinary.DefaultSize = GetByteArray(5); + bcBinary.WithSize = GetByteArray(10); + + return bcBinary; + } + private byte[] GetByteArray(int value) { |
From: Michael D. <mik...@us...> - 2004-06-29 14:28:14
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30583 Modified Files: FooBarTest.cs Log Message: Implmented more test and made changes because of DomainModel property name changes. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** FooBarTest.cs 29 Jun 2004 04:30:15 -0000 1.31 --- FooBarTest.cs 29 Jun 2004 14:28:04 -0000 1.32 *************** *** 1,7 **** using System; ! using NUnit.Framework; using NHibernate; using NHibernate.DomainModel; ! using System.Collections; namespace NHibernate.Test --- 1,10 ---- using System; ! using System.Collections; ! using System.Data; ! using NHibernate; using NHibernate.DomainModel; ! ! using NUnit.Framework; namespace NHibernate.Test *************** *** 206,210 **** s.Flush(); ! bar.@string = "changed"; Baz baz = new Baz(); baz.Foo = bar; --- 209,213 ---- s.Flush(); ! bar.String = "changed"; Baz baz = new Baz(); baz.Foo = bar; *************** *** 500,508 **** //TODO: need to add PropertyExpressions to Expression namespace. IList list = s.CreateCriteria(typeof(Foo)) ! .Add( Expression.Expression.Eq( "integer", f.integer ) ) //.Add( Expression.Expression.EqProperty("integer", "integer") ) ! .Add( Expression.Expression.Like( "string", f.@string) ) ! .Add( Expression.Expression.In("boolean", new bool[] {f.boolean, f.boolean} ) ) ! .SetFetchMode("foo", FetchMode.Eager) .SetFetchMode("baz", FetchMode.Lazy) .List(); --- 503,511 ---- //TODO: need to add PropertyExpressions to Expression namespace. IList list = s.CreateCriteria(typeof(Foo)) ! .Add( Expression.Expression.Eq( "Integer", f.Integer ) ) //.Add( Expression.Expression.EqProperty("integer", "integer") ) ! .Add( Expression.Expression.Like( "String", f.String) ) ! .Add( Expression.Expression.In("Boolean", new bool[] {f.Boolean, f.Boolean} ) ) ! .SetFetchMode("TheFoo", FetchMode.Eager) .SetFetchMode("baz", FetchMode.Lazy) .List(); *************** *** 512,520 **** list = s.CreateCriteria( typeof(Foo) ).Add( Expression.Expression.Disjunction() ! .Add( Expression.Expression.Eq( "integer", f.integer ) ) ! .Add( Expression.Expression.Like( "string", f.@string ) ) ! .Add( Expression.Expression.Eq( "boolean", f.boolean ) ) ) ! .Add( Expression.Expression.IsNotNull("boolean") ) .List(); --- 515,523 ---- list = s.CreateCriteria( typeof(Foo) ).Add( Expression.Expression.Disjunction() ! .Add( Expression.Expression.Eq( "Integer", f.Integer ) ) ! .Add( Expression.Expression.Like( "String", f.String ) ) ! .Add( Expression.Expression.Eq( "Boolean", f.Boolean ) ) ) ! .Add( Expression.Expression.IsNotNull("Boolean") ) .List(); *************** *** 524,529 **** Expression.Expression orExpression; ! andExpression = Expression.Expression.And( Expression.Expression.Eq( "integer", f.integer ), Expression.Expression.Like( "string", f.@string ) ); ! orExpression = Expression.Expression.Or( andExpression, Expression.Expression.Eq( "boolean", f.boolean ) ); list = s.CreateCriteria(typeof(Foo)) --- 527,532 ---- Expression.Expression orExpression; ! andExpression = Expression.Expression.And( Expression.Expression.Eq( "Integer", f.Integer ), Expression.Expression.Like( "String", f.String ) ); ! orExpression = Expression.Expression.Or( andExpression, Expression.Expression.Eq( "Boolean", f.Boolean ) ); list = s.CreateCriteria(typeof(Foo)) *************** *** 536,540 **** list = s.CreateCriteria(typeof(Foo)) .SetMaxResults(5) ! .AddOrder(Expression.Order.Asc("date")) .List(); --- 539,543 ---- list = s.CreateCriteria(typeof(Foo)) .SetMaxResults(5) ! .AddOrder(Expression.Order.Asc("Date")) .List(); *************** *** 547,584 **** list = s.CreateCriteria(typeof(Foo)) .SetFirstResult(1) ! .AddOrder( Expression.Order.Asc("date") ) ! .AddOrder( Expression.Order.Desc("string") ) .List(); Assert.AreEqual(0, list.Count); ! f.foo = new Foo(); ! s.Save(f.foo); s.Flush(); s.Close(); //TODO: some HSQLDialect specific code here - // s = sessions.OpenSession(); - // list = s.CreateCriteria(Foo) - // .Add( Expression.Expression.Eq( "integer", f.integer ) ) - // .Add( Expression.Expression.Like( "string", f.@string ) ) - // .Add( Expression.Expression.In( "boolean", new bool[] { f.boolean, f.boolean } ) ) - // .Add( Expression.Expression.IsNotNull("foo") ); - - } [Test] - [Ignore("Test not written yet.")] public void AfterDelete() { } [Test] ! [Ignore("Test not written yet.")] public void CollectionWhere() { } --- 550,645 ---- list = s.CreateCriteria(typeof(Foo)) .SetFirstResult(1) ! .AddOrder( Expression.Order.Asc("Date") ) ! .AddOrder( Expression.Order.Desc("String") ) .List(); Assert.AreEqual(0, list.Count); ! f.TheFoo = new Foo(); ! s.Save(f.TheFoo); s.Flush(); s.Close(); //TODO: some HSQLDialect specific code here + s = sessions.OpenSession(); + list = s.CreateCriteria(typeof(Foo)) + .Add( Expression.Expression.Eq( "Integer", f.Integer ) ) + .Add( Expression.Expression.Like( "String", f.String ) ) + .Add( Expression.Expression.In( "Boolean", new bool[] { f.Boolean, f.Boolean } ) ) + .Add( Expression.Expression.IsNotNull("TheFoo") ) + .SetFetchMode("TheFoo", FetchMode.Eager) + .SetFetchMode("Baz", FetchMode.Lazy) + .SetFetchMode("Component.Glarch", FetchMode.Lazy) + .SetFetchMode("TheFoo.Baz", FetchMode.Lazy) + .SetFetchMode("TheFoo.Component.Glarch", FetchMode.Lazy) + .List(); + + f = (Foo) list[0]; + Assert.IsTrue(NHibernate.IsInitialized(f.TheFoo)); + + //TODO: this is initialized because Proxies are not implemented yet. + //Assert.IsFalse( NHibernate.IsInitialized(f.component.Glarch) ); + s.Delete(f.TheFoo); + s.Delete(f); + s.Flush(); + s.Close(); + } [Test] public void AfterDelete() { + ISession s = sessions.OpenSession(); + Foo foo = new Foo(); + s.Save(foo); + s.Flush(); + s.Delete(foo); + s.Save(foo); + s.Delete(foo); + s.Flush(); + s.Close(); } [Test] ! //[Ignore("Test not written yet.")] public void CollectionWhere() { + Foo foo1 = new Foo(); + Foo foo2 = new Foo(); + Baz baz = new Baz(); + Foo[] arr = new Foo[10]; + arr[0] = foo1; + arr[9] = foo2; + + ISession s = sessions.OpenSession(); + s.Save(foo1); + s.Save(foo2); + baz.FooArray = arr; + s.Save(baz); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + baz = (Baz)s.Load(typeof(Baz), baz.Code); + Assert.AreEqual( 1, baz.FooArray.Length ); + Assert.AreEqual( 1, s.Find("from Baz baz, baz.FooArray foo").Count ); + Assert.AreEqual( 2, s.Find("from Foo foo").Count ); + // TODO: filter is not working because QueryKeyCacheFactor is null + //Assert.AreEqual( 1, s.Filter(baz.FooArray, "").Count ); + + s.Delete("from Foo foo"); + s.Delete(baz); + + IDbCommand deleteCmd = s.Connection.CreateCommand(); + deleteCmd.CommandText = "delete from fooArray where id_='" + baz.Code + "' and i>=8"; + deleteCmd.CommandType = CommandType.Text; + int rows = deleteCmd.ExecuteNonQuery(); + Assert.AreEqual(1, rows); + + s.Flush(); + s.Close(); + } *************** *** 840,844 **** s = sessions.OpenSession(); ! s.Delete( s.Load( typeof(Foo), f.key ) ); s.Flush(); s.Close(); --- 901,905 ---- s = sessions.OpenSession(); ! s.Delete( s.Load( typeof(Foo), f.Key ) ); s.Flush(); s.Close(); |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30227 Modified Files: Bar.cs Baz.cs Fee.cs Fee.hbm.xml Foo.cs FooBar.hbm.xml FooProxy.cs Qux.cs Qux.hbm.xml Stuff.cs Log Message: Modified Properties to use .net naming conventions. Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FooBar.hbm.xml 24 Jun 2004 15:22:07 -0000 1.7 --- FooBar.hbm.xml 29 Jun 2004 14:26:27 -0000 1.8 *************** *** 16,20 **** <jcs-cache usage="nonstrict-read-write"/> ! <id name="key" type="String"> <column name="`foo_id`" length="36"/> <generator class="uuid.hex"> --- 16,20 ---- <jcs-cache usage="nonstrict-read-write"/> ! <id name="Key" type="String"> <column name="`foo_id`" length="36"/> <generator class="uuid.hex"> *************** *** 23,45 **** </id> <discriminator column="`$foo_subclass^`" type="Char"/> ! <version name="version"/> <!--<version name="versionCalendar" type="calendar"/>--> <!--<timestamp name="versionTimestamp"/>--> ! <many-to-one name="foo" class="NHibernate.DomainModel.Foo, NHibernate.DomainModel"> <column name="foo" length="36" index="fbmtoidx"/> </many-to-one> ! <property name="long"> <column name="long_" index="fbmtoidx" unique-key="abc" not-null="true"/> </property> ! <property name="integer"> <column name="`@@##integer_ *`" unique-key="abc" not-null="true"/> </property> ! <property name="float"> <column name="float_" unique-key="abc" not-null="true"/> </property> ! <property name="x"/> ! <property name="double" column="double_"/> ! <primitive-array name="bytes" table="foobytes"> <key column="id"/> <index column="i"/> --- 23,45 ---- </id> <discriminator column="`$foo_subclass^`" type="Char"/> ! <version name="Version"/> <!--<version name="versionCalendar" type="calendar"/>--> <!--<timestamp name="versionTimestamp"/>--> ! <many-to-one name="TheFoo" class="NHibernate.DomainModel.Foo, NHibernate.DomainModel"> <column name="foo" length="36" index="fbmtoidx"/> </many-to-one> ! <property name="Long"> <column name="long_" index="fbmtoidx" unique-key="abc" not-null="true"/> </property> ! <property name="Integer"> <column name="`@@##integer_ *`" unique-key="abc" not-null="true"/> </property> ! <property name="Float"> <column name="float_" unique-key="abc" not-null="true"/> </property> ! <property name="X"/> ! <property name="Double" column="double_"/> ! <primitive-array name="Bytes" table="foobytes"> <key column="id"/> <index column="i"/> *************** *** 47,79 **** </primitive-array> ! <property name="date" type="DateTime" column="date_"/> ! <property name="timestamp" type="Timestamp" column="timestamp_"/> ! <property name="boolean" column="boolean_"/> ! <property name="bool" column="bool_"/> <property name="NullInt32" column="null_"/> ! <property name="short" column="short_"/> ! <property name="char" column="char_"/> ! <property name="zero" column="zero_"/> ! <property name="int" column="int_"/> ! <property name="string"> <column name="string_" length="48" index="fbstridx"/> </property> ! <property name="byte" column="byte_"/> ! <property name="yesno" /> ! <property name="blob" type="NHibernate.DomainModel.Foo+Struct, NHibernate.DomainModel" column="blobb_"/> ! <property name="nullBlob" type="System.Object"/> ! <property name="status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> ! <property name="binary" column="bin_"/> ! <property name="locale" column="`localeayzabc123!@#$`"/> ! <property name="formula" formula="1/2 * int_"/> ! <property name="custom" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel"> <column name="first_name" length="66"/> <column name="surname" length="66"/> </property> ! <many-to-one name="dependent" class="NHibernate.DomainModel.Fee, NHibernate.DomainModel" cascade="all" not-null="true"/> ! <component name="component"> <property name="Count" --- 47,79 ---- </primitive-array> ! <property name="Date" type="DateTime" column="date_"/> ! <property name="Timestamp" type="Timestamp" column="timestamp_"/> ! <property name="Boolean" column="boolean_"/> ! <property name="Bool" column="bool_"/> <property name="NullInt32" column="null_"/> ! <property name="Short" column="short_"/> ! <property name="Char" column="char_"/> ! <property name="Zero" column="zero_"/> ! <property name="Int" column="int_"/> ! <property name="String"> <column name="string_" length="48" index="fbstridx"/> </property> ! <property name="Byte" column="byte_"/> ! <property name="YesNo" /> ! <property name="Blob" type="NHibernate.DomainModel.Foo+Struct, NHibernate.DomainModel" column="blobb_"/> ! <property name="NullBlob" type="System.Object"/> ! <property name="Status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> ! <property name="Binary" column="bin_"/> ! <property name="Locale" column="`localeayzabc123!@#$`"/> ! <property name="Formula" formula="1/2 * int_"/> ! <property name="Custom" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel"> <column name="first_name" length="66"/> <column name="surname" length="66"/> </property> ! <many-to-one name="Dependent" class="NHibernate.DomainModel.Fee, NHibernate.DomainModel" cascade="all" not-null="true"/> ! <component name="Component"> <property name="Count" *************** *** 141,145 **** </component> ! <component name="nullComponent"> <property name="Name" column="null_cmpnt_"/> </component> --- 141,145 ---- </component> ! <component name="NullComponent"> <property name="Name" column="null_cmpnt_"/> </component> Index: Bar.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Bar.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bar.cs 3 Jun 2004 18:01:24 -0000 1.3 --- Bar.cs 29 Jun 2004 14:26:27 -0000 1.4 *************** *** 17,21 **** /// Gets or sets the X /// </summary> ! public int X { get { return _x; } --- 17,21 ---- /// Gets or sets the X /// </summary> ! public override int X { get { return _x; } Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Baz.cs 8 Jun 2004 11:46:06 -0000 1.8 --- Baz.cs 29 Jun 2004 14:26:27 -0000 1.9 *************** *** 162,173 **** public System.Collections.IList Fees { ! get ! { ! return this._fees; ! } ! set ! { ! this._fees = value; ! } } --- 162,167 ---- public System.Collections.IList Fees { ! get { return _fees; } ! set { _fees = value; } } Index: Fee.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fee.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fee.cs 9 Apr 2004 13:14:53 -0000 1.2 --- Fee.cs 29 Jun 2004 14:26:27 -0000 1.3 *************** *** 20,116 **** } ! public Fee fee { ! get ! { ! return _fee; ! } ! set ! { ! this._fee = value; ! } ! } ! public string fi { ! get ! ! { ! return _fi; ! } ! set ! { ! this._fi = value; ! } } ! public string key { ! get ! { ! return _key; ! } ! set ! { ! this._key = value; ! } } ! public System.Collections.IDictionary fees { ! get ! { ! return _fees; ! } ! set ! { ! this._fees = value; ! } } ! public Fee anotherFee { ! get ! { ! return _anotherFee; ! } ! set ! { ! this._anotherFee = value; ! } } ! public Qux qux { ! get ! { ! return _qux; ! } ! set ! { ! this._qux = value; ! } } ! public FooComponent compon { ! get ! { ! return _compon; ! } ! set ! { ! this._compon = value; ! } } ! public int count { ! get ! { ! return _count; ! } ! set ! { ! _count = value; ! } } } --- 20,68 ---- } ! public Fee TheFee { ! get { return _fee; } ! set { _fee = value; } ! } ! public string Fi { ! get { return _fi; } ! set { _fi = value; } } ! ! public string Key { ! get { return _key; } ! set { this._key = value; } } ! public System.Collections.IDictionary Fees { ! get { return _fees; } ! set { _fees = value; } } ! public Fee AnotherFee { ! get { return _anotherFee; } ! set { _anotherFee = value; } } ! public Qux Qux { ! get { return _qux; } ! set { _qux = value; } } ! public FooComponent Compon { ! get { return _compon; } ! set { _compon = value; } } ! public int Count { ! get { return _count; } ! set { _count = value; } } } Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Foo.cs 24 Jun 2004 15:22:07 -0000 1.8 --- Foo.cs 29 Jun 2004 14:26:27 -0000 1.9 *************** *** 24,28 **** { [Serializable] ! public class Struct { public string name; --- 24,28 ---- { [Serializable] ! public class Struct { [...1044 lines suppressed...] //&& ( ( this._timestamp==other._timestamp) || ( this._timestamp.getDate() == other._timestamp.getDate() && this._timestamp.getYear() == other._timestamp.getYear() && this._timestamp.getMonth() == other._timestamp.getMonth() ) ) ! && ( _zero == other._zero ) ! && ( ( _foo == other._foo ) || ( _foo.Key.Equals( other._foo.Key ) ) ) ! && ( ( _blob == other.Blob ) || ( _blob.Equals(other.Blob) ) ) ! && ( _yesno == other.YesNo ) ! && ( _status == other.Status ) ! && ( ( _binary == other.Binary ) || _binary.Equals(other.Binary)) ! && ( _key.Equals(other.Key) ) ! && ( _locale.Equals(other.Locale) ) ! && ( ( _custom == other.Custom ) || ( _custom[0].Equals(other.Custom[0]) && _custom[1].Equals(other.Custom[1]) ) ); } + // public override int GetHashCode() // { // return key.GetHashCode() - _string.GetHashCode(); // } ! ! private static int count=0; Index: Fee.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fee.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fee.hbm.xml 24 Jun 2004 15:22:07 -0000 1.4 --- Fee.hbm.xml 29 Jun 2004 14:26:27 -0000 1.5 *************** *** 2,18 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.Fee, NHibernate.DomainModel" table="`the fees`"> ! <id type="String" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex" /> </id> ! <property name="fi" /> ! <many-to-one name="fee" /> ! <many-to-one name="anotherFee" /> ! <many-to-one name="qux" cascade="all" /> ! <property name="count" column="count_" /> ! <set name="fees"> <key column="fee_id" /> <element column="str_" type="String" /> </set> ! <component name="compon" update="false"> <property name="Name" /> <property name="NullString" column="null_prop" /> --- 2,18 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.Fee, NHibernate.DomainModel" table="`the fees`"> ! <id type="String" name="Key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex" /> </id> ! <property name="Fi" /> ! <many-to-one name="TheFee" /> ! <many-to-one name="AnotherFee" /> ! <many-to-one name="Qux" cascade="all" /> ! <property name="Count" column="count_" /> ! <set name="Fees"> <key column="fee_id" /> <element column="str_" type="String" /> </set> ! <component name="Compon" update="false"> <property name="Name" /> <property name="NullString" column="null_prop" /> Index: Qux.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Qux.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Qux.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 --- Qux.hbm.xml 29 Jun 2004 14:26:27 -0000 1.4 *************** *** 2,9 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.Qux, NHibernate.DomainModel" table="quux" proxy="NHibernate.DomainModel.Qux, NHibernate.DomainModel"> ! <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> </id> ! <many-to-one name="foo" class="NHibernate.DomainModel.Foo, NHibernate.DomainModel"> <column name="foo" length="36" /> </many-to-one> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.Qux, NHibernate.DomainModel" table="quux" proxy="NHibernate.DomainModel.Qux, NHibernate.DomainModel"> ! <id name="Key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> </id> ! <many-to-one name="Foo" class="NHibernate.DomainModel.Foo, NHibernate.DomainModel"> <column name="foo" length="36" /> </many-to-one> Index: FooProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooProxy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FooProxy.cs 24 Jun 2004 15:22:07 -0000 1.3 --- FooProxy.cs 29 Jun 2004 14:26:27 -0000 1.4 *************** *** 7,21 **** public interface FooProxy { ! FooComponent nullComponent { get; set; } ! FooComponent component { get; set; } ! string[] custom { get; --- 7,21 ---- public interface FooProxy { ! FooComponent NullComponent { get; set; } ! FooComponent Component { get; set; } ! string[] Custom { get; *************** *** 23,27 **** } ! byte[] binary { get; --- 23,27 ---- } ! byte[] Binary { get; *************** *** 29,33 **** } ! FooStatus status { get; --- 29,33 ---- } ! FooStatus Status { get; *************** *** 35,39 **** } ! object nullBlob { get; --- 35,39 ---- } ! object NullBlob { get; *************** *** 41,45 **** } ! Foo.Struct blob { get; --- 41,45 ---- } ! Foo.Struct Blob { get; *************** *** 47,51 **** } ! bool yesno { get; --- 47,51 ---- } ! bool YesNo { get; *************** *** 53,59 **** } ! void disconnect(); ! Byte @byte { get; --- 53,59 ---- } ! void Disconnect(); ! byte Byte { get; *************** *** 67,71 **** } ! int @int { get; --- 67,71 ---- } ! int Int { get; *************** *** 73,77 **** } ! bool @bool { get; --- 73,77 ---- } ! bool Bool { get; *************** *** 79,83 **** } ! float zero { get; --- 79,83 ---- } ! float Zero { get; *************** *** 85,89 **** } ! byte[] bytes { get; --- 85,89 ---- } ! byte[] Bytes { get; *************** *** 91,95 **** } ! bool boolean { get; --- 91,95 ---- } ! bool Boolean { get; *************** *** 97,101 **** } ! double @double { get; --- 97,101 ---- } ! double Double { get; *************** *** 103,107 **** } ! float @float { get; --- 103,107 ---- } ! float Float { get; *************** *** 109,113 **** } ! short @short { get; --- 109,113 ---- } ! short Short { get; *************** *** 115,119 **** } ! char @char { get; --- 115,119 ---- } ! char Char { get; *************** *** 121,125 **** } ! long @long { get; --- 121,125 ---- } ! long Long { get; *************** *** 127,131 **** } ! int @integer { get; --- 127,131 ---- } ! int Integer { get; *************** *** 133,137 **** } ! DateTime timestamp { get; --- 133,137 ---- } ! DateTime Timestamp { get; *************** *** 139,143 **** } ! DateTime date { get; --- 139,143 ---- } ! DateTime Date { get; *************** *** 145,149 **** } ! String @string { get; --- 145,149 ---- } ! string String { get; *************** *** 151,155 **** } ! FooProxy foo { get; --- 151,155 ---- } ! FooProxy TheFoo { get; *************** *** 157,161 **** } ! String key { get; --- 157,161 ---- } ! String Key { get; Index: Qux.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Qux.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Qux.cs 3 Jun 2004 13:31:52 -0000 1.2 --- Qux.cs 29 Jun 2004 14:26:27 -0000 1.3 *************** *** 24,29 **** try { ! foo = new Foo(); ! session.Save(foo); } catch (Exception e) --- 24,29 ---- try { ! Foo = new Foo(); ! session.Save(Foo); } catch (Exception e) *************** *** 31,35 **** throw new CallbackException(e); } ! foo.@string = "child of a qux"; return LifecycleVeto.NoVeto; } --- 31,35 ---- throw new CallbackException(e); } ! Foo.String = "child of a qux"; return LifecycleVeto.NoVeto; } *************** *** 40,44 **** try { ! session.Delete(foo); } catch (Exception e) --- 40,44 ---- try { ! session.Delete(Foo); } catch (Exception e) *************** *** 75,88 **** /// Gets or sets the _foo /// </summary> ! public FooProxy foo { ! get ! { ! return _foo; ! } ! set ! { ! _foo = value; ! } } --- 75,82 ---- /// Gets or sets the _foo /// </summary> ! public FooProxy Foo { ! get { return _foo; } ! set { _foo = value; } } *************** *** 173,186 **** /// Gets or sets the _key /// </summary> ! public long key { ! get ! { ! return _key; ! } ! set ! { ! _key = value; ! } } --- 167,174 ---- /// Gets or sets the _key /// </summary> ! public long Key { ! get { return _key; } ! set { _key = value; } } *************** *** 190,194 **** set { ! this.key = value; } } --- 178,182 ---- set { ! _key = value; } } *************** *** 260,264 **** { stored=true; ! this.childKey = child==null ? 0 : child.key; if (childKey!=0 && child==null) child = (Qux) session.Load(typeof(Qux), childKey); return _child; --- 248,252 ---- { stored=true; ! this.childKey = child==null ? 0 : child.Key; if (childKey!=0 && child==null) child = (Qux) session.Load(typeof(Qux), childKey); return _child; Index: Stuff.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Stuff.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Stuff.cs 3 Jun 2004 13:31:52 -0000 1.1 --- Stuff.cs 29 Jun 2004 14:26:27 -0000 1.2 *************** *** 41,45 **** if(rhs==null) return false; ! return rhs.Id.Equals(this.Id) && rhs.Foo.key.Equals(_foo.key) && rhs.MoreStuff.Equals(_moreStuff) ; } --- 41,45 ---- if(rhs==null) return false; ! return rhs.Id.Equals(this.Id) && rhs.Foo.Key.Equals(_foo.Key) && rhs.MoreStuff.Equals(_moreStuff) ; } |
From: Michael D. <mik...@us...> - 2004-06-29 08:54:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18283/NHibernate.Test Modified Files: FooBarTest.cs NHibernate.Test-1.1.csproj Log Message: Moved BinaryProperties to their own class for smaller test fixtures. Continued to work on FindByCriteria Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FooBarTest.cs 28 Jun 2004 19:15:44 -0000 1.30 --- FooBarTest.cs 29 Jun 2004 04:30:15 -0000 1.31 *************** *** 536,559 **** list = s.CreateCriteria(typeof(Foo)) .SetMaxResults(5) ! .AddOrder(Expression.Order.Asc("Date")) .List(); Assert.IsTrue(list.Count==1 && list[0]==f); ! list = s.CreateCriteria(typeof(Foo)).SetMaxResults(0).List(); ! Assert.AreEqual(0, list.Count); ! //TODO: resume here ! // list = s.CreateCriteria(typeof(Foo)) ! // .SetFirstResult(1) ! // .AddOrder( Expression.Order.Asc("Date") ) ! // .AddOrder( Expression.Order.Desc("String") ) ! // .List(); ! // // Assert.AreEqual(0, list.Count); ! // ! // f.foo = new Foo(); ! // s.Save(f.foo); ! // s.Flush(); ! // s.Close(); //TODO: some HSQLDialect specific code here --- 536,560 ---- list = s.CreateCriteria(typeof(Foo)) .SetMaxResults(5) ! .AddOrder(Expression.Order.Asc("date")) .List(); Assert.IsTrue(list.Count==1 && list[0]==f); ! //TODO: the SetMaxResults doesn't seem to have any impact ! // list = s.CreateCriteria(typeof(Foo)).SetMaxResults(0).List(); // Assert.AreEqual(0, list.Count); ! ! list = s.CreateCriteria(typeof(Foo)) ! .SetFirstResult(1) ! .AddOrder( Expression.Order.Asc("date") ) ! .AddOrder( Expression.Order.Desc("string") ) ! .List(); ! ! Assert.AreEqual(0, list.Count); ! ! f.foo = new Foo(); ! s.Save(f.foo); ! s.Flush(); ! s.Close(); //TODO: some HSQLDialect specific code here Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** NHibernate.Test-1.1.csproj 28 Jun 2004 03:44:36 -0000 1.26 --- NHibernate.Test-1.1.csproj 29 Jun 2004 04:30:16 -0000 1.27 *************** *** 288,291 **** --- 288,296 ---- /> <File + RelPath = "NHSpecificTest\BasicBinaryFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\BasicClassFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-06-29 08:54:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18283/NHibernate.Test/NHSpecificTest Modified Files: BasicClassFixture.cs Added Files: BasicBinaryFixture.cs Log Message: Moved BinaryProperties to their own class for smaller test fixtures. Continued to work on FindByCriteria Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicClassFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- BasicClassFixture.cs 29 Jun 2004 04:30:16 -0000 1.2 *************** *** 71,93 **** 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(); --- 71,75 ---- index++; ! // make sure the previous updates went through s[index] = sessions.OpenSession(); *************** *** 861,865 **** { 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"); --- 843,846 ---- *************** *** 897,905 **** 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; --- 878,882 ---- basicClass.Id = id; ! basicClass.BooleanProperty = true; basicClass.ByteProperty = Byte.MaxValue; --- NEW FILE: BasicBinaryFixture.cs --- using System; using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for BasicBinaryFixture. /// </summary> [TestFixture] public class BasicBinaryFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BasicBinary.hbm.xml"}, true ); } [Test] public void InsertNull() { BasicBinary bcBinary = new BasicBinary(); bcBinary.Id = 1; bcBinary.DefaultSize = null; bcBinary.WithSize = null; ISession s = sessions.OpenSession(); s.Save(bcBinary); s.Flush(); s.Close(); s = sessions.OpenSession(); BasicBinary bcBinaryLoaded = (BasicBinary)s.Load(typeof(BasicBinary), 1); Assert.IsNotNull(bcBinaryLoaded); Assert.AreEqual(null, bcBinary.DefaultSize); Assert.AreEqual(null, bcBinary.WithSize); s.Delete(bcBinaryLoaded); s.Flush(); s.Close(); } [Test] public void InsertZeroLength() { BasicBinary bcBinary = new BasicBinary(); bcBinary.Id = 1; bcBinary.DefaultSize = new byte[0]; bcBinary.WithSize = new byte[0]; ISession s = sessions.OpenSession(); s.Save(bcBinary); s.Flush(); s.Close(); s = sessions.OpenSession(); BasicBinary bcBinaryLoaded = (BasicBinary)s.Load(typeof(BasicBinary), 1); Assert.IsNotNull(bcBinaryLoaded); Assert.AreEqual(0, bcBinary.DefaultSize.Length); Assert.AreEqual(0, bcBinary.WithSize.Length); s.Delete(bcBinaryLoaded); s.Flush(); s.Close(); } [Test] public void Insert() { BasicBinary bcBinary = new BasicBinary(); bcBinary.Id = 1; bcBinary.DefaultSize = GetByteArray(5); bcBinary.WithSize = GetByteArray(10); ISession s = sessions.OpenSession(); s.Save(bcBinary); s.Flush(); s.Close(); s = sessions.OpenSession(); BasicBinary bcBinaryLoaded = (BasicBinary)s.Load(typeof(BasicBinary), 1); Assert.IsNotNull(bcBinaryLoaded); Assert.IsFalse(bcBinary==bcBinaryLoaded); ObjectAssertion.AssertEquals(bcBinary.DefaultSize, bcBinaryLoaded.DefaultSize); ObjectAssertion.AssertEquals(bcBinary.WithSize, bcBinaryLoaded.WithSize); s.Delete(bcBinaryLoaded); s.Flush(); s.Close(); } private byte[] GetByteArray(int value) { BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); bf.Serialize(stream, value); return stream.ToArray(); } } } |
From: Michael D. <mik...@us...> - 2004-06-29 04:28:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18034/NHibernate.DomainModel/NHSpecific Modified Files: BasicClass.cs BasicClass.hbm.xml Added Files: BasicBinary.cs BasicBinary.hbm.xml Log Message: Moved BinaryProperties to their own class for smaller test fixtures. Index: BasicClass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicClass.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicClass.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- BasicClass.hbm.xml 29 Jun 2004 04:28:08 -0000 1.2 *************** *** 11,15 **** </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"/> --- 11,14 ---- --- NEW FILE: BasicBinary.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.BasicBinary, NHibernate.DomainModel" table="bc_bin"> <id name="Id" column="id"> <generator class="assigned" /> </id> <property name="DefaultSize" type="Byte[]" column="bin_def"/> <property name="WithSize" type="Byte[](2048880)" column="bin_size" /> </class> </hibernate-mapping> --- NEW FILE: BasicBinary.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for BasicBinary. /// </summary> public class BasicBinary { int _id; byte[] _defaultSize; byte[] _withSize; public BasicBinary() { } public int Id { get { return _id; } set { _id = value; } } public byte[] DefaultSize { get {return _defaultSize;} set {_defaultSize = value;} } public byte[] WithSize { get {return _withSize;} set {_withSize = value;} } } } Index: BasicClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicClass.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicClass.cs 9 Jun 2004 01:04:35 -0000 1.1 --- BasicClass.cs 29 Jun 2004 04:28:08 -0000 1.2 *************** *** 81,90 **** } - public byte[] BinaryProperty - { - get {return _binaryProperty;} - set {_binaryProperty = value;} - } - public bool BooleanProperty { --- 81,84 ---- |
From: Michael D. <mik...@us...> - 2004-06-29 04:28:23
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18034/NHibernate.DomainModel Modified Files: NHibernate.DomainModel-1.1.csproj Log Message: Moved BinaryProperties to their own class for smaller test fixtures. Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NHibernate.DomainModel-1.1.csproj 11 Jun 2004 20:08:47 -0000 1.19 --- NHibernate.DomainModel-1.1.csproj 29 Jun 2004 04:28:08 -0000 1.20 *************** *** 605,608 **** --- 605,617 ---- /> <File + RelPath = "NHSpecific\BasicBinary.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecific\BasicBinary.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "NHSpecific\BasicClass.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-06-29 04:27:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17927/NHibernate/Loader Modified Files: CriteriaLoader.cs Log Message: Fixed problem with order by being generated with multi-columns. Index: CriteriaLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/CriteriaLoader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CriteriaLoader.cs 19 May 2004 04:01:06 -0000 1.6 --- CriteriaLoader.cs 29 Jun 2004 04:27:21 -0000 1.7 *************** *** 34,40 **** StringBuilder orderByBuilder = new StringBuilder(60); - // TODO: H2.0.3 has code here to iterateExpressions() - our code is in the Expression.ToSqlString() - // code I believe - verify this. - bool orderByNeeded = true; bool commaNeeded = false; iter = criteria.IterateOrderings(); --- 34,37 ---- *************** *** 42,55 **** while ( iter.MoveNext() ) { - //TODO: H2.0.3 - this is not in H2.0.3 - where did it move to? - //if(orderByNeeded) orderByBuilder.Append(" ORDER BY "); - orderByNeeded = false; - Order ord = (Order) iter.Current; - orderByBuilder.Append(ord.ToStringForSql(factory, criteria.PersistentClass, alias)); if(commaNeeded) orderByBuilder.Append(StringHelper.CommaSpace); commaNeeded = true; ! } --- 39,48 ---- while ( iter.MoveNext() ) { Order ord = (Order) iter.Current; if(commaNeeded) orderByBuilder.Append(StringHelper.CommaSpace); commaNeeded = true; ! ! orderByBuilder.Append(ord.ToStringForSql(factory, criteria.PersistentClass, alias)); } |
From: Michael D. <mik...@us...> - 2004-06-28 19:15:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15235/NHibernate.Test Modified Files: FooBarTest.cs Log Message: didn't comment out enough of one test. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** FooBarTest.cs 28 Jun 2004 19:13:56 -0000 1.29 --- FooBarTest.cs 28 Jun 2004 19:15:44 -0000 1.30 *************** *** 543,562 **** list = s.CreateCriteria(typeof(Foo)).SetMaxResults(0).List(); Assert.AreEqual(0, list.Count); ! ! list = s.CreateCriteria(typeof(Foo)) ! .SetFirstResult(1) ! .AddOrder( Expression.Order.Asc("Date") ) ! .AddOrder( Expression.Order.Desc("String") ) ! .List(); ! ! Assert.AreEqual(0, list.Count); ! ! f.foo = new Foo(); ! s.Save(f.foo); ! s.Flush(); ! s.Close(); //TODO: some HSQLDialect specific code here - //TODO: resume here // s = sessions.OpenSession(); // list = s.CreateCriteria(Foo) --- 543,561 ---- list = s.CreateCriteria(typeof(Foo)).SetMaxResults(0).List(); Assert.AreEqual(0, list.Count); ! //TODO: resume here ! // list = s.CreateCriteria(typeof(Foo)) ! // .SetFirstResult(1) ! // .AddOrder( Expression.Order.Asc("Date") ) ! // .AddOrder( Expression.Order.Desc("String") ) ! // .List(); ! // ! // Assert.AreEqual(0, list.Count); ! // ! // f.foo = new Foo(); ! // s.Save(f.foo); ! // s.Flush(); ! // s.Close(); //TODO: some HSQLDialect specific code here // s = sessions.OpenSession(); // list = s.CreateCriteria(Foo) |
From: Michael D. <mik...@us...> - 2004-06-28 19:14:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14782/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Implemented more test. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** FooBarTest.cs 25 Jun 2004 20:46:28 -0000 1.28 --- FooBarTest.cs 28 Jun 2004 19:13:56 -0000 1.29 *************** *** 302,306 **** System.Text.Encoding encoding = new System.Text.UnicodeEncoding(); - // TODO: not sure about this here... byte[] bytes = encoding.GetBytes("ffo"); l2.Add(bytes); --- 302,305 ---- *************** *** 351,354 **** --- 350,354 ---- public void ForceOuterJoin() { + } *************** *** 376,382 **** [Test] - [Ignore("Test not written yet.")] public void OneToOneGenerator() { } --- 376,430 ---- [Test] public void OneToOneGenerator() { + ISession s = sessions.OpenSession(); + X x = new X(); + Y y = new Y(); + x.Y = y; + y.TheX = x; + + object yId = s.Save(y); + object xId = s.Save(x); + + Assert.AreEqual( yId, xId); + s.Flush(); + + Assert.IsTrue( s.Contains(y) && s.Contains(x) ); + s.Close(); + + Assert.AreEqual( x.Id, y.Id); + + + s = sessions.OpenSession(); + x = new X(); + y = new Y(); + + x.Y = y; + y.TheX = x; + + s.Save(y); + s.Flush(); + + Assert.IsTrue( s.Contains(y) && s.Contains(x) ); + s.Close(); + + Assert.AreEqual( x.Id, y.Id); + + + s = sessions.OpenSession(); + x = new X(); + y = new Y(); + x.Y = y; + y.TheX = x; + xId = s.Save(x); + + Assert.AreEqual(xId, y.Id); + Assert.AreEqual(xId, x.Id); + s.Flush(); + + Assert.IsTrue( s.Contains(y) && s.Contains(x) ); + s.Delete("from X x"); + s.Flush(); + s.Close(); } *************** *** 394,406 **** [Test] - [Ignore("Test not written yet.")] public void SaveAddDelete() { } [Test] ! [Ignore("Test not written yet.")] public void NamedParams() { } --- 442,484 ---- [Test] public void SaveAddDelete() { + ISession s = sessions.OpenSession(); + Baz baz = new Baz(); + IDictionary bars = new Hashtable(); + baz.CascadingBars = bars; + s.Save(baz); + s.Flush(); + + baz.CascadingBars.Add( new Bar(), new object() ); + s.Delete(baz); + s.Flush(); + s.Close(); + } [Test] ! [Ignore("Fails because Proxies not written yet.")] public void NamedParams() { + Bar bar = new Bar(); + Bar bar2 = new Bar(); + bar.Name = "Bar"; + bar2.Name = "Bar Two"; + Baz baz = new Baz(); + baz.CascadingBars = new Hashtable(); + baz.CascadingBars.Add( bar, new object() ); + bar.Baz = baz; + + ISession s = sessions.OpenSession(); + s.Save(baz); + s.Save(bar2); + + // TODO: at this point it fails because of SessionImpl.ProxyFor + IList list = s.Find("from Bar bar left join bar.Baz baz left join baz.CascadingBars b where bar.Name like 'Bar %'"); + object row = list[0]; + Assert.IsTrue( row is object[] && ( (object[])row).Length==3 ); + + } *************** *** 412,418 **** [Test] ! [Ignore("Test not written yet.")] public void FindByCriteria() { } --- 490,572 ---- [Test] ! //[Ignore("Test not written yet.")] public void FindByCriteria() { + ISession s = sessions.OpenSession(); + Foo f = new Foo(); + s.Save(f); + s.Flush(); + + //TODO: need to add PropertyExpressions to Expression namespace. + IList list = s.CreateCriteria(typeof(Foo)) + .Add( Expression.Expression.Eq( "integer", f.integer ) ) + //.Add( Expression.Expression.EqProperty("integer", "integer") ) + .Add( Expression.Expression.Like( "string", f.@string) ) + .Add( Expression.Expression.In("boolean", new bool[] {f.boolean, f.boolean} ) ) + .SetFetchMode("foo", FetchMode.Eager) + .SetFetchMode("baz", FetchMode.Lazy) + .List(); + + Assert.IsTrue( list.Count==1 && list[0]==f ); + + list = s.CreateCriteria( typeof(Foo) ).Add( + Expression.Expression.Disjunction() + .Add( Expression.Expression.Eq( "integer", f.integer ) ) + .Add( Expression.Expression.Like( "string", f.@string ) ) + .Add( Expression.Expression.Eq( "boolean", f.boolean ) ) + ) + .Add( Expression.Expression.IsNotNull("boolean") ) + .List(); + + Assert.IsTrue( list.Count==1 && list[0]==f ); + + Expression.Expression andExpression; + Expression.Expression orExpression; + + andExpression = Expression.Expression.And( Expression.Expression.Eq( "integer", f.integer ), Expression.Expression.Like( "string", f.@string ) ); + orExpression = Expression.Expression.Or( andExpression, Expression.Expression.Eq( "boolean", f.boolean ) ); + + list = s.CreateCriteria(typeof(Foo)) + .Add( orExpression ) + .List(); + + Assert.IsTrue( list.Count==1 && list[0]==f ); + + + list = s.CreateCriteria(typeof(Foo)) + .SetMaxResults(5) + .AddOrder(Expression.Order.Asc("Date")) + .List(); + + Assert.IsTrue(list.Count==1 && list[0]==f); + + list = s.CreateCriteria(typeof(Foo)).SetMaxResults(0).List(); + Assert.AreEqual(0, list.Count); + + list = s.CreateCriteria(typeof(Foo)) + .SetFirstResult(1) + .AddOrder( Expression.Order.Asc("Date") ) + .AddOrder( Expression.Order.Desc("String") ) + .List(); + + Assert.AreEqual(0, list.Count); + + f.foo = new Foo(); + s.Save(f.foo); + s.Flush(); + s.Close(); + + //TODO: some HSQLDialect specific code here + //TODO: resume here + // s = sessions.OpenSession(); + // list = s.CreateCriteria(Foo) + // .Add( Expression.Expression.Eq( "integer", f.integer ) ) + // .Add( Expression.Expression.Like( "string", f.@string ) ) + // .Add( Expression.Expression.In( "boolean", new bool[] { f.boolean, f.boolean } ) ) + // .Add( Expression.Expression.IsNotNull("foo") ); + + + + } |
From: Michael D. <mik...@us...> - 2004-06-28 18:59:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11729/NHibernate.Test/ExpressionTest Modified Files: BaseExpressionFixture.cs JunctionFixture.cs Log Message: Added test for GetTypedValue Made SetUp() in BaseExpressionFixture virtual. Index: BaseExpressionFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/BaseExpressionFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BaseExpressionFixture.cs 16 Apr 2004 14:04:58 -0000 1.2 --- BaseExpressionFixture.cs 28 Jun 2004 18:59:06 -0000 1.3 *************** *** 20,24 **** [SetUp] ! public void SetUp() { Configuration cfg = new Configuration(); --- 20,24 ---- [SetUp] ! public virtual void SetUp() { Configuration cfg = new Configuration(); Index: JunctionFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ExpressionTest/JunctionFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JunctionFixture.cs 20 Mar 2004 23:08:55 -0000 1.1 --- JunctionFixture.cs 28 Jun 2004 18:59:06 -0000 1.2 *************** *** 23,44 **** public class JunctionFixture : BaseExpressionFixture { ! [Test] ! public void JunctionSqlStringTest() { ! ! ISession session = factory.OpenSession(); ! ! NExpression.Conjunction conjunction = NExpression.Expression.Conjunction(); ! conjunction.Add(NExpression.Expression.IsNull("Address")) .Add(NExpression.Expression.Between("Count", 5, 10)); ! SqlString sqlString = conjunction.ToSqlString(factoryImpl, typeof(Simple), "simple_alias"); ! string expectedSql = "(simple_alias.address IS NULL and simple_alias.count_ between :simple_alias.count__lo and :simple_alias.count__hi)"; CompareSqlStrings(sqlString, expectedSql, 2); ! session.Close(); } --- 23,64 ---- public class JunctionFixture : BaseExpressionFixture { + NExpression.Conjunction _conjunction; ! [SetUp] ! public override void SetUp() { ! base.SetUp(); ! _conjunction = NExpression.Expression.Conjunction(); ! _conjunction.Add(NExpression.Expression.IsNull("Address")) .Add(NExpression.Expression.Between("Count", 5, 10)); + } ! [Test] ! public void SqlString() ! { ! SqlString sqlString = _conjunction.ToSqlString(factoryImpl, typeof(Simple), "simple_alias"); ! string expectedSql = "(simple_alias.address IS NULL and simple_alias.count_ between :simple_alias.count__lo and :simple_alias.count__hi)"; CompareSqlStrings(sqlString, expectedSql, 2); ! } ! ! [Test] ! public void GetTypedValues() ! { ! TypedValue[] typedValues = _conjunction.GetTypedValues( factoryImpl, typeof(Simple) ); ! ! TypedValue[] expectedTV = new TypedValue[2]; ! expectedTV[0] = new TypedValue(Type.TypeFactory.GetInt32Type(), 5); ! expectedTV[1] = new TypedValue(Type.TypeFactory.GetInt32Type(), 10); ! ! Assert.AreEqual(2, typedValues.Length); ! ! for(int i=0; i<typedValues.Length; i++) ! { ! Assert.AreEqual(expectedTV[i].Type, typedValues[i].Type); ! Assert.AreEqual(expectedTV[i].Value, typedValues[i].Value); ! } } |
From: Michael D. <mik...@us...> - 2004-06-28 18:36:23
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6935/NHibernate/Expression Modified Files: Junction.cs Log Message: Fixed bug with nothing being returned by GetTypedValues() Index: Junction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Junction.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Junction.cs 6 Apr 2004 04:11:33 -0000 1.4 --- Junction.cs 28 Jun 2004 18:35:57 -0000 1.5 *************** *** 31,37 **** ArrayList typedValues = new ArrayList(); ! foreach ( IEnumerator iter in typedValues ) { ! TypedValue[] subvalues = ( (Expression) iter ).GetTypedValues(sessionFactory, persistentClass); for ( int i=0; i<subvalues.Length; i++ ) { --- 31,37 ---- ArrayList typedValues = new ArrayList(); ! foreach ( Expression expression in expressions ) { ! TypedValue[] subvalues = expression.GetTypedValues(sessionFactory, persistentClass); for ( int i=0; i<subvalues.Length; i++ ) { |
From: Michael D. <mik...@us...> - 2004-06-28 03:44:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7743 Modified Files: NHibernate.Test-1.1.csproj Log Message: Added test fixture for SequencedHashMap Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NHibernate.Test-1.1.csproj 11 Jun 2004 20:09:30 -0000 1.25 --- NHibernate.Test-1.1.csproj 28 Jun 2004 03:44:36 -0000 1.26 *************** *** 413,416 **** --- 413,421 ---- /> <File + RelPath = "UtilityTest\SequencedHashMapFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "UtilityTest\StringHelperFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-06-28 03:41:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7362 Modified Files: IdentityMap.cs SequencedHashMap.cs Log Message: Modified IdentityMap to use SequencedHashMap instead of ListDictionary because of o(n) perf problems with ListDictionary. Finished coding SequencedHashMap. Index: IdentityMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/IdentityMap.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IdentityMap.cs 25 Mar 2004 17:10:58 -0000 1.8 --- IdentityMap.cs 28 Jun 2004 03:41:34 -0000 1.9 *************** *** 54,58 **** public static IDictionary InstantiateSequenced() { ! return new IdentityMap(new ListDictionary()); } --- 54,58 ---- public static IDictionary InstantiateSequenced() { ! return new IdentityMap(new SequencedHashMap()); } Index: SequencedHashMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/SequencedHashMap.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SequencedHashMap.cs 19 Mar 2003 07:14:45 -0000 1.2 --- SequencedHashMap.cs 28 Jun 2004 03:41:34 -0000 1.3 *************** *** 61,65 **** using System.Collections; ! namespace NHibernate.Util { /// <summary> /// A map of objects whose mapping entries are sequenced based on the order in which they were --- 61,66 ---- using System.Collections; ! namespace NHibernate.Util ! { [...976 lines suppressed...] ! ! public DictionaryEntry Entry ! { ! get { return new DictionaryEntry(_pos.Key, _pos.Value); } ! } ! ! public object Key ! { ! get { return _pos.Key; } ! } ! ! public object Value ! { ! get { return _pos.Value; } ! } ! ! #endregion ! } } } |
From: Michael D. <mik...@us...> - 2004-06-28 03:40:43
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/UtilityTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7263 Modified Files: IdentityMapFixture.cs Added Files: SequencedHashMapFixture.cs Log Message: Added test for SequencedHashMap. Modified test for IdentityMap to use sequenced version. Index: IdentityMapFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/UtilityTest/IdentityMapFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdentityMapFixture.cs 26 Mar 2004 16:54:44 -0000 1.4 --- IdentityMapFixture.cs 28 Jun 2004 03:40:34 -0000 1.5 *************** *** 50,54 **** public void AddNoHashCode() { ! IDictionary map = IdentityMap.Instantiate(); map.Add(noHashCode1, value1); --- 50,55 ---- public void AddNoHashCode() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(noHashCode1, value1); *************** *** 63,67 **** public void ConcurrentEntries() { ! IDictionary map = IdentityMap.Instantiate(); map.Add(noHashCode1, value1); --- 64,69 ---- public void ConcurrentEntries() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(noHashCode1, value1); *************** *** 97,101 **** object value4 = new object(); ! IDictionary map = IdentityMap.Instantiate(); map.Add(noHashCode1, value1); map.Add(noHashCode2, value2); --- 99,104 ---- object value4 = new object(); ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(noHashCode1, value1); map.Add(noHashCode2, value2); *************** *** 125,129 **** public void AddValueTypeException() { ! IDictionary map = IdentityMap.Instantiate(); int intKey = 3; object objectValue = new object(); --- 128,133 ---- public void AddValueTypeException() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); int intKey = 3; object objectValue = new object(); *************** *** 135,139 **** public void Count() { ! IDictionary map = IdentityMap.Instantiate(); map.Add(new object(), new object()); map.Add(new object(), new object()); --- 139,144 ---- public void Count() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(new object(), new object()); map.Add(new object(), new object()); *************** *** 150,154 **** public void ContainsSameObjectByRef() { ! IDictionary map = IdentityMap.Instantiate(); MutableHashCode item1Copy = item1; --- 155,160 ---- public void ContainsSameObjectByRef() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); MutableHashCode item1Copy = item1; *************** *** 168,172 **** public void ContainsSameObjectWithDiffEquals() { ! IDictionary map = IdentityMap.Instantiate(); map.Add(item1, new object()); --- 174,179 ---- public void ContainsSameObjectWithDiffEquals() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(item1, new object()); *************** *** 185,189 **** public void ContainsDiffObjectWithEquals() { ! IDictionary map = IdentityMap.Instantiate(); item1.HashCodeField = 4; item2.HashCodeField = 4; --- 192,197 ---- public void ContainsDiffObjectWithEquals() { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); item1.HashCodeField = 4; item2.HashCodeField = 4; *************** *** 204,209 **** public void SetItemChangedHashCodeTwice() { ! IDictionary actualMap = IdentityMap.Instantiate(); ! actualMap[item1] = value1; --- 212,218 ---- public void SetItemChangedHashCodeTwice() { ! //IDictionary actualMap = IdentityMap.Instantiate(); ! IDictionary actualMap = IdentityMap.InstantiateSequenced(); ! actualMap[item1] = value1; *************** *** 221,225 **** public void SetItemsEqualHashCodeDiffIdentity() { ! IDictionary actualMap = IdentityMap.Instantiate(); IDictionary normalMap = new Hashtable(); --- 230,235 ---- public void SetItemsEqualHashCodeDiffIdentity() { ! //IDictionary actualMap = IdentityMap.Instantiate(); ! IDictionary actualMap = IdentityMap.InstantiateSequenced(); IDictionary normalMap = new Hashtable(); *************** *** 250,254 **** { ! IDictionary map = IdentityMap.Instantiate(); map.Add(item1, value1); map.Add(item2, value2); --- 260,265 ---- { ! //IDictionary map = IdentityMap.Instantiate(); ! IDictionary map = IdentityMap.InstantiateSequenced(); map.Add(item1, value1); map.Add(item2, value2); *************** *** 269,275 **** /// Framework. /// </summary> ! [Test] ! [Ignore("I just wanted to verify that an Exception would occur without the NHibernate related code. " + ! "The Exception only occurs the 2nd Time the Test is run in the same NUnit session.")] public void MethodMissingException() { --- 280,288 ---- /// Framework. /// </summary> ! /// <remarks> ! /// This is actually a problem with NUnit settings. To resolve this go to Tools-Options and make ! /// sure that Reload before each test run is NOT checked. ! /// </remarks> ! //[Test] public void MethodMissingException() { --- NEW FILE: SequencedHashMapFixture.cs --- using System; using System.Collections; using NHibernate.Util; using NUnit.Framework; namespace NHibernate.Test.UtilityTest { /// <summary> /// Summary description for SequencedHashMapFixture. /// </summary> [TestFixture] public class SequencedHashMapFixture { private SequencedHashMap _shm; private SequencedHashMap _emptyShm; private IList _expectedKeys; private IList _expectedValues; [SetUp] public void SetUp() { _shm = new SequencedHashMap(); _emptyShm = new SequencedHashMap(); _expectedKeys = new ArrayList(); _expectedKeys.Add("test1"); _expectedKeys.Add("test2"); _expectedKeys.Add("test3"); _expectedValues = new ArrayList(); _expectedValues.Add(1); _expectedValues.Add("2"); _expectedValues.Add(true); for (int i=0; i<_expectedKeys.Count; i++) { _shm[_expectedKeys[i]] = _expectedValues[i]; } } [Test] public void Add() { object newKey = "test4"; object newValue = "test4's value"; _expectedKeys.Add(newKey); _expectedValues.Add(newValue); _shm.Add(newKey, newValue); int i = 0; foreach(DictionaryEntry de in _shm) { Assert.AreEqual(_expectedKeys[i], de.Key); Assert.AreEqual(_expectedValues[i], de.Value); i++; } Assert.AreEqual(4, i, "Did not loop through 4 items"); Assert.AreEqual(4, _shm.Count); } [Test] public void Clear() { _shm.Clear(); Assert.AreEqual(0, _shm.Count); foreach(DictionaryEntry de in _shm) { Assert.Fail( "Should not be any entries but found Key = " + de.Key.ToString() + " and Value = " + de.Value.ToString() ); } } [Test] public void Contains() { Assert.IsTrue( _shm.Contains("test1") ); Assert.IsFalse( _shm.Contains("test10") ); } [Test] public void GetEnumerator() { int i = 0; foreach(DictionaryEntry de in _shm) { Assert.AreEqual(_expectedKeys[i], de.Key); Assert.AreEqual(_expectedValues[i], de.Value); i++; } Assert.AreEqual(3, i); } [Test] [ExpectedException(typeof(InvalidOperationException))] public void GetEnumeratorModifyExceptionFromAdd() { foreach(DictionaryEntry de in _shm) { _shm["newkey"] = de.Value; } } [Test] [ExpectedException(typeof(InvalidOperationException))] public void GetEnumeratorModifyExceptionFromRemove() { foreach(DictionaryEntry de in _shm) { _shm.Remove(de.Key); } } [Test] [ExpectedException(typeof(InvalidOperationException))] public void GetEnumeratorModifyExceptionFromUpdate() { foreach(DictionaryEntry de in _shm) { _shm[de.Key] = new object(); } } [Test] public void Remove() { // remove an item that exists _shm.Remove("test1"); Assert.AreEqual(2, _shm.Count); // try to remove an item that does not exist _shm.Remove("test10"); Assert.AreEqual(2, _shm.Count); } [Test] public void Item() { Assert.AreEqual(1, _shm["test1"]); Assert.AreEqual("2", _shm["test2"]); Assert.AreEqual(true, _shm["test3"]); } [Test] public void Count() { Assert.AreEqual(3, _shm.Count); _shm.Add("new key", "new value"); Assert.AreEqual(4, _shm.Count); } [Test] public void ContainsKey() { Assert.IsTrue( _shm.ContainsKey("test1") ); Assert.IsFalse( _shm.ContainsKey("test10") ); } [Test] public void ContainsValue() { Assert.IsTrue( _shm.ContainsValue("2") ); Assert.IsTrue( _shm.ContainsValue(true) ); Assert.IsFalse( _shm.ContainsValue("not in there") ); } [Test] public void CopyTo() { DictionaryEntry[] destArray = new DictionaryEntry[3]; _shm.CopyTo(destArray, 0); Assert.AreEqual(3, destArray.Length); for(int i = 0; i < destArray.Length; i++) { Assert.AreEqual( _expectedKeys[i], destArray[i].Key ); Assert.AreEqual( _expectedValues[i], destArray[i].Value ); } } [Test] public void Keys() { int i=0; foreach(object obj in _shm.Keys) { i++; Assert.IsTrue( _expectedKeys.Contains(obj) ); } Assert.AreEqual(3, i); SequencedHashMap empty = new SequencedHashMap(); foreach(object obj in empty.Keys) { Assert.Fail("should not be a key: " + obj); } } [Test] public void Values() { int i=0; foreach(object obj in _shm.Values) { i++; Assert.IsTrue( _expectedValues.Contains(obj) ); } Assert.AreEqual(3, i); SequencedHashMap empty = new SequencedHashMap(); foreach(object obj in empty.Values) { Assert.Fail("should not be a value:" + obj); } } [Test] public void FirstKey() { Assert.IsNotNull(_shm.FirstKey); Assert.AreEqual("test1", _shm.FirstKey); Assert.IsNull(_emptyShm.FirstKey); } [Test] public void FirstValue() { Assert.IsNotNull(_shm.FirstValue); Assert.AreEqual(1, _shm.FirstValue); Assert.IsNull(_emptyShm.FirstValue); } [Test] public void LastKey() { Assert.IsNotNull(_shm.LastKey); Assert.AreEqual("test3", _shm.LastKey); Assert.IsNull(_emptyShm.LastKey); } [Test] public void LastValue() { Assert.IsNotNull(_shm.LastValue); Assert.AreEqual(true, _shm.LastValue); Assert.IsNull(_emptyShm.LastValue); } //[Test] // User should uncomment if they want to see the Performance Comparison public void Performance() { // set the hashtable and SequencedHashMap to be the IDictionary hashtable; IDictionary sequenced; IDictionary list; int numOfRuns = 1; int numOfEntries = Int16.MaxValue; long hashStart; long[] hashPopulateTicks = new long[numOfRuns]; long[] hashItemTicks = new long[numOfRuns]; long seqStart; long[] seqPopulateTicks = new long[numOfRuns]; long[] seqItemTicks = new long[numOfRuns]; long listStart; long[] listPopulateTicks = new long[numOfRuns]; long[] listItemTicks = new long[numOfRuns]; for (int runIndex = 0; runIndex < numOfRuns; runIndex++) { object key; object value; hashtable = new Hashtable(); sequenced = new SequencedHashMap(); list = new System.Collections.Specialized.ListDictionary(); hashStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { hashtable.Add("test" + i, new object()); } hashPopulateTicks[runIndex] = DateTime.Now.Ticks - hashStart; hashStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { key = "test" + i; value = hashtable[key]; } hashItemTicks[runIndex] = DateTime.Now.Ticks - hashStart; hashtable.Clear(); seqStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { sequenced.Add("test" + i, new object()); } seqPopulateTicks[runIndex] = DateTime.Now.Ticks - seqStart; seqStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { key = "test" + i; value = sequenced[key]; } seqItemTicks[runIndex] = DateTime.Now.Ticks - seqStart; sequenced.Clear(); listStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { list.Add("test" + i, new object()); } listPopulateTicks[runIndex] = DateTime.Now.Ticks - listStart; listStart = DateTime.Now.Ticks; for(int i = 0; i < numOfEntries; i++) { key = "test" + i; value = list[key]; } listItemTicks[runIndex] = DateTime.Now.Ticks - listStart; list.Clear(); } for (int runIndex = 0; runIndex < numOfRuns; runIndex++) { decimal seqPopulateOverhead = ( (decimal)seqPopulateTicks[runIndex] /(decimal)hashPopulateTicks[runIndex] ); decimal seqItemOverhead = ( (decimal)seqItemTicks[runIndex] / (decimal)hashItemTicks[runIndex] ); string errMessage = "SequenceHashMap vs Hashtable:"; errMessage += "\n POPULATE:"; errMessage += "\n\t seqPopulateTicks[" + runIndex + "] took " + seqPopulateTicks[runIndex] + " ticks."; errMessage += "\n\t hashPopulateTicks[" + runIndex + "] took " + hashPopulateTicks[runIndex] + " ticks."; errMessage += "\n\t for an overhead of " + seqPopulateOverhead .ToString() ; errMessage += "\n ITEM:"; errMessage += "\n\t seqItemTicks[" + runIndex + "] took " + seqItemTicks[runIndex] + " ticks."; errMessage += "\n\t hashItemTicks[" + runIndex + "] took " + hashItemTicks[runIndex] + " ticks."; errMessage += "\n\t for an overhead of " + seqItemOverhead .ToString() ; System.Console.Out.WriteLine(errMessage); decimal listPopulateOverhead = ( (decimal)listPopulateTicks[runIndex] / (decimal)seqPopulateTicks[runIndex] ); decimal listItemOverhead = ( (decimal)listItemTicks[runIndex] / (decimal)seqItemTicks[runIndex] ); errMessage = "ListDictionary vs SequenceHashMap:"; errMessage += "\n POPULATE:"; errMessage += "\n\t listPopulateTicks[" + runIndex + "] took " + listPopulateTicks[runIndex] + " ticks."; errMessage += "\n\t seqPopulateTicks[" + runIndex + "] took " + seqPopulateTicks[runIndex] + " ticks."; errMessage += "\n\t for an overhead of " + listPopulateOverhead.ToString(); errMessage += "\n ITEM:"; errMessage += "\n\t listItemTicks[" + runIndex + "] took " + listItemTicks[runIndex] + " ticks."; errMessage += "\n\t seqItemTicks[" + runIndex + "] took " + seqItemTicks[runIndex] + " ticks."; errMessage += "\n\t for an overhead of " + listItemOverhead .ToString() ; System.Console.Out.WriteLine(errMessage); } } } } |
From: Michael D. <mik...@us...> - 2004-06-25 20:46:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23973/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Implemented some more tests. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** FooBarTest.cs 24 Jun 2004 15:27:51 -0000 1.27 --- FooBarTest.cs 25 Jun 2004 20:46:28 -0000 1.28 *************** *** 198,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() { } --- 198,348 ---- [Test] ! [Ignore("Test is failing and need to debug.")] public void QueryLockMode() { + ISession s = sessions.OpenSession(); + Bar bar = new Bar(); + s.Save(bar); + s.Flush(); + + bar.@string = "changed"; + Baz baz = new Baz(); + baz.Foo = bar; + s.Save(baz); + + IQuery q = s.CreateQuery("from Foo foo, Bar bar"); + q.SetLockMode("bar", LockMode.Upgrade); + object[] result = (object[])q.List()[0]; + + object b = result[0]; + + Assert.IsTrue( s.GetCurrentLockMode(b)==LockMode.Write && s.GetCurrentLockMode(result[1])==LockMode.Write); + s.Flush(); + s.Disconnect(); + + s.Reconnect(); + + Assert.AreEqual( LockMode.None, s.GetCurrentLockMode(b) ); + s.Find("from Foo foo"); + //TODO: test is failing here because CurrentLock Mode is LockMode.Write + Assert.AreEqual( LockMode.None, s.GetCurrentLockMode(b) ); + q = s.CreateQuery("from Foo foo"); + q.SetLockMode("foo", LockMode.Read); + q.List(); + + Assert.AreEqual( LockMode.Read, s.GetCurrentLockMode(b) ); + s.Evict(baz); + + s.Disconnect(); + s.Reconnect(); + + Assert.AreEqual( LockMode.None, s.GetCurrentLockMode(b) ); + s.Delete( s.Load( typeof(Baz), baz.Code ) ); + Assert.AreEqual( LockMode.None, s.GetCurrentLockMode(b) ); + + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + q = s.CreateQuery("from Foo foo, Bar bar, Bar bar2"); + q.SetLockMode("bar", LockMode.Upgrade); + q.SetLockMode("bar2", LockMode.Read); + result = (object[])q.List()[0]; + + Assert.IsTrue( s.GetCurrentLockMode(result[0])==LockMode.Upgrade && s.GetCurrentLockMode(result[1])==LockMode.Upgrade ); + s.Delete(result[0]); + s.Flush(); + s.Close(); + } [Test] public void ManyToManyBag() { + ISession s = sessions.OpenSession(); + Baz baz = new Baz(); + object id = s.Save(baz); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + baz = (Baz)s.Load( typeof(Baz), id ); + baz.FooBag.Add( new Foo() ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + baz = (Baz)s.Load( typeof(Baz), id ); + Assert.IsFalse( NHibernate.IsInitialized( baz.FooBag ) ); + Assert.AreEqual( 1, baz.FooBag.Count ); + + Assert.IsTrue( NHibernate.IsInitialized( baz.FooBag[0] ) ); + s.Delete(baz); + s.Flush(); + s.Close(); + } [Test] public void IdBag() { + ISession s = sessions.OpenSession(); + Baz baz = new Baz(); + s.Save(baz); + + IList l = new ArrayList(); + IList l2 = new ArrayList(); + + baz.IdFooBag = l; + baz.ByteBag = l2; + + l.Add( new Foo() ); + l.Add( new Bar() ); + + System.Text.Encoding encoding = new System.Text.UnicodeEncoding(); + + // TODO: not sure about this here... + byte[] bytes = encoding.GetBytes("ffo"); + l2.Add(bytes); + l2.Add( encoding.GetBytes("foo") ); + s.Flush(); + + l.Add( new Foo() ); + l.Add( new Bar() ); + l2.Add( encoding.GetBytes("bar") ); + s.Flush(); + + object removedObject = l[3]; + l.RemoveAt(3); + s.Delete(removedObject); + + bytes[1] = Convert.ToByte('o'); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + baz = (Baz) s.Load( typeof(Baz), baz.Code ); + Assert.AreEqual( 3, baz.IdFooBag.Count ); + Assert.AreEqual( 3, baz.ByteBag.Count ); + bytes = encoding.GetBytes("foobar"); + + foreach(object obj in baz.IdFooBag) + { + s.Delete(obj); + } + baz.IdFooBag = null; + baz.ByteBag.Add(bytes); + baz.ByteBag.Add(bytes); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + baz = (Baz)s.Load( typeof(Baz), baz.Code ); + Assert.AreEqual( 0, baz.IdFooBag.Count ); + Assert.AreEqual( 5, baz.ByteBag.Count ); + s.Delete(baz); + s.Flush(); + s.Close(); + } |
From: Michael D. <mik...@us...> - 2004-06-25 20:44:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23570/NHibernate Modified Files: LockMode.cs Log Message: Modifed to help find a bug with LockModes in the test QueryLockMode - have not found yet. Index: LockMode.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LockMode.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LockMode.cs 16 Mar 2004 18:23:14 -0000 1.2 --- LockMode.cs 25 Jun 2004 20:44:39 -0000 1.3 *************** *** 28,32 **** /// </summary> public bool GreaterThan(LockMode mode) { - if (mode == null) { return true; } // TODO: should be removed when LockMode is completed return level > mode.level; } --- 28,31 ---- *************** *** 35,39 **** /// </summary> public bool LessThan(LockMode mode) { - if (mode == null) { return false; } // TODO: should be removed when LockMode is completed return level < mode.level; } --- 34,37 ---- *************** *** 72,76 **** /// The semantics of this lock mode, once obtained, are the same as <c>Upgrade</c> /// </remarks> ! public static LockMode UpgradeNoWait = new LockMode(10, "UpdadeNoWait"); /// <summary> --- 70,74 ---- /// The semantics of this lock mode, once obtained, are the same as <c>Upgrade</c> /// </remarks> ! public static LockMode UpgradeNoWait = new LockMode(10, "UpgradeNoWait"); /// <summary> *************** *** 82,85 **** --- 80,85 ---- public static LockMode Write = new LockMode(10, "Write"); + //TODO: need to implement .NET equivalent of readResolve - believe it is + // the IObjectReference interface... } |
From: Michael D. <mik...@us...> - 2004-06-25 20:42:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22976/NHibernate/Impl Modified Files: PreparerImpl.cs Log Message: Moved the conversion of a SqlString to an IDbCommand into a method inside of the SqlString. Index: PreparerImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/PreparerImpl.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PreparerImpl.cs 25 May 2004 17:15:44 -0000 1.4 --- PreparerImpl.cs 25 Jun 2004 20:42:24 -0000 1.5 *************** *** 81,113 **** public IDbCommand BuildCommand(SqlString sqlString) { - int paramIndex = 0; if(builtCommands.ContainsKey(sqlString)) return (IDbCommand) builtCommands[sqlString]; ! IDbCommand cmd = factory.ConnectionProvider.Driver.CreateCommand(); ! ! StringBuilder builder = new StringBuilder(sqlString.SqlParts.Length * 15); ! for(int i = 0; i < sqlString.SqlParts.Length; i++) ! { ! object part = sqlString.SqlParts[i]; ! Parameter parameter = part as Parameter; ! ! if(parameter!=null) ! { ! string paramName = "p" + paramIndex; ! builder.Append( parameter.GetSqlName(factory.ConnectionProvider, paramName) ); ! IDbDataParameter dbParam = parameter.GetIDbDataParameter(cmd, factory.ConnectionProvider, paramName); ! cmd.Parameters.Add(dbParam); ! ! paramIndex++; ! } ! else ! { ! builder.Append((string)part); ! } ! } - cmd.CommandText = builder.ToString(); builtCommands.Add(sqlString, cmd); --- 81,90 ---- public IDbCommand BuildCommand(SqlString sqlString) { if(builtCommands.ContainsKey(sqlString)) return (IDbCommand) builtCommands[sqlString]; ! IDbCommand cmd = sqlString.BuildCommand(factory.ConnectionProvider.Driver); builtCommands.Add(sqlString, cmd); |
From: Michael D. <mik...@us...> - 2004-06-25 20:41:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22730/NHibernate/Hql Modified Files: QueryTranslator.cs Log Message: Change a method's case and added an override. Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** QueryTranslator.cs 18 Jun 2004 13:43:45 -0000 1.31 --- QueryTranslator.cs 25 Jun 2004 20:41:10 -0000 1.32 *************** *** 1156,1160 **** } - //TODO: implement this method - in here for compilation protected override LockMode[] GetLockModes(IDictionary lockModes) { --- 1156,1159 ---- *************** *** 1217,1221 **** } ! protected bool upgradeLocks() { return true; --- 1216,1220 ---- } ! protected override bool UpgradeLocks() { return true; |
From: Michael D. <mik...@us...> - 2004-06-25 20:40:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22440/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Changed EntityEntry to expose Properties instead of public fields so I could debug the gets & sets. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** SessionImpl.cs 24 Jun 2004 15:29:25 -0000 1.29 --- SessionImpl.cs 25 Jun 2004 20:40:12 -0000 1.30 *************** *** 288,314 **** sealed internal class EntityEntry { ! ! internal LockMode lockMode; ! internal Status status; ! internal object id; ! internal object[] loadedState; ! internal object[] deletedState; ! internal bool existsInDatabase; ! internal object version; // for convenience to save some lookups ! [NonSerialized] internal IClassPersister persister; ! internal string className; ! public EntityEntry(Status status, object[] loadedState, object id, object version, LockMode lockMode, bool existsInDatabase, IClassPersister persister) { ! this.status = status; ! this.loadedState = loadedState; ! this.id = id; ! this.existsInDatabase = existsInDatabase; ! this.version = version; ! this.lockMode = lockMode; ! this.persister = persister; ! if (persister!=null) className = persister.ClassName; } } --- 288,369 ---- sealed internal class EntityEntry { ! private LockMode _lockMode; ! private Status _status; ! private object _id; ! private object[] _loadedState; ! private object[] _deletedState; ! private bool _existsInDatabase; ! private object _version; // for convenience to save some lookups ! [NonSerialized] private IClassPersister _persister; ! private string _className; ! public EntityEntry(Status status, object[] loadedState, object id, object version, LockMode lockMode, bool existsInDatabase, IClassPersister persister) { ! _status = status; ! _loadedState = loadedState; ! _id = id; ! _existsInDatabase = existsInDatabase; ! _version = version; ! _lockMode = lockMode; ! _persister = persister; ! if (_persister!=null) _className = _persister.ClassName; ! } ! ! ! public LockMode LockMode ! { ! get { return _lockMode; } ! set { _lockMode = value; } ! } ! ! public Status Status ! { ! get { return _status; } ! set { _status = value; } ! } ! ! public object Id ! { ! get { return _id; } ! set { _id = value; } ! } ! ! public object[] LoadedState ! { ! get { return _loadedState; } ! set { _loadedState = value; } ! } ! ! public object[] DeletedState ! { ! get { return _deletedState; } ! set { _deletedState = value; } ! } ! ! public bool ExistsInDatabase ! { ! get { return _existsInDatabase; } ! set { _existsInDatabase = value; } } + + public object Version + { + get { return _version; } + set { _version = value; } + } + + public IClassPersister Persister + { + get { return _persister; } + set { _persister = value; } + } + + public string ClassName + { + get { return _className; } + set { _className = value; } + } + } *************** *** 548,552 **** foreach(EntityEntry entry in entries.Values) { ! entry.lockMode = LockMode.None; } --- 603,607 ---- foreach(EntityEntry entry in entries.Values) { ! entry.LockMode = LockMode.None; } *************** *** 606,616 **** if (e==null) throw new TransientObjectException("Given object not associated with the session"); ! if (e.status!=Status.Loaded) throw new ObjectDeletedException("The given object was deleted", e.id); ! return e.lockMode; } public LockMode GetLockMode(object entity) { ! return GetEntry(entity).lockMode; } --- 661,671 ---- if (e==null) throw new TransientObjectException("Given object not associated with the session"); ! if (e.Status!=Status.Loaded) throw new ObjectDeletedException("The given object was deleted", e.Id); ! return e.LockMode; } public LockMode GetLockMode(object entity) { ! return GetEntry(entity).LockMode; } *************** *** 634,638 **** public void SetLockMode(object entity, LockMode lockMode) { ! GetEntry(entity).lockMode = lockMode; } --- 689,693 ---- public void SetLockMode(object entity, LockMode lockMode) { ! GetEntry(entity).LockMode = lockMode; } *************** *** 706,710 **** if ( e!=null ) { ! if ( e.status==Status.Deleted) { Flush(); --- 761,765 ---- if ( e!=null ) { ! if ( e.Status==Status.Deleted) { Flush(); *************** *** 713,717 **** { log.Debug( "object already associated with session" ); ! return e.id; } } --- 768,772 ---- { log.Debug( "object already associated with session" ); ! return e.Id; } } *************** *** 747,751 **** if ( e!=null ) { ! if ( e.status==Status.Deleted ) { Flush(); --- 802,806 ---- if ( e!=null ) { ! if ( e.Status==Status.Deleted ) { Flush(); *************** *** 753,760 **** else { ! if ( !id.Equals(e.id) ) throw new PersistentObjectException( "object passed to save() was already persistent: " + ! MessageHelper.InfoString(e.persister, id) ); log.Debug( "object already associated with session" ); --- 808,815 ---- else { ! if ( !id.Equals(e.Id) ) throw new PersistentObjectException( "object passed to save() was already persistent: " + ! MessageHelper.InfoString(e.Persister, id) ); log.Debug( "object already associated with session" ); *************** *** 795,799 **** if (old!=null) { ! if ( GetEntry(old).status==Status.Deleted) { Flush(); --- 850,854 ---- if (old!=null) { ! if ( GetEntry(old).Status==Status.Deleted) { Flush(); *************** *** 1053,1058 **** } ! return e.status==Status.Saving || ( ! earlyInsert ? !e.existsInDatabase : nullifiables.Contains( new Key(e.id, e.persister) ) ); } --- 1108,1113 ---- } ! return e.Status==Status.Saving || ( ! earlyInsert ? !e.ExistsInDatabase : nullifiables.Contains( new Key(e.Id, e.Persister) ) ); } *************** *** 1108,1116 **** log.Debug("deleting a persistent instance"); ! if ( entry.status==Status.Deleted || entry.status==Status.Gone) { log.Debug("object was already deleted"); return; } ! persister = entry.persister; } --- 1163,1171 ---- log.Debug("deleting a persistent instance"); ! if ( entry.Status==Status.Deleted || entry.Status==Status.Gone) { log.Debug("object was already deleted"); return; } ! persister = entry.Persister; } *************** *** 1121,1144 **** ); ! if ( log.IsDebugEnabled ) log.Debug( "deleting " + MessageHelper.InfoString(persister, entry.id) ); IType[] propTypes = persister.PropertyTypes; ! object version = entry.version; ! if (entry.loadedState==null ) { //ie the object came in from Update() ! entry.deletedState = persister.GetPropertyValues(theObj); } else { ! entry.deletedState = new object[entry.loadedState.Length]; ! TypeFactory.DeepCopy(entry.loadedState, propTypes, persister.PropertyUpdateability, entry.deletedState); } ! interceptor.OnDelete(theObj, entry.id, entry.deletedState, persister.PropertyNames, propTypes); ! NullifyTransientReferences(entry.deletedState, propTypes, false, theObj); ArrayList oldNullifiables = null; --- 1176,1199 ---- ); ! if ( log.IsDebugEnabled ) log.Debug( "deleting " + MessageHelper.InfoString(persister, entry.Id) ); IType[] propTypes = persister.PropertyTypes; ! object version = entry.Version; ! if (entry.LoadedState==null ) { //ie the object came in from Update() ! entry.DeletedState = persister.GetPropertyValues(theObj); } else { ! entry.DeletedState = new object[entry.LoadedState.Length]; ! TypeFactory.DeepCopy(entry.LoadedState, propTypes, persister.PropertyUpdateability, entry.DeletedState); } ! interceptor.OnDelete(theObj, entry.Id, entry.DeletedState, persister.PropertyNames, propTypes); ! NullifyTransientReferences(entry.DeletedState, propTypes, false, theObj); ArrayList oldNullifiables = null; *************** *** 1151,1157 **** } ! nullifiables.Add( new Key(entry.id, persister) ); ! entry.status = Status.Deleted; // before any callbacks, etc, so subdeletions see that this deletion happend first ! ScheduledDeletion delete = new ScheduledDeletion(entry.id, version, theObj, persister, this); deletions.Add(delete); // ensures that containing deletions happen before sub-deletions --- 1206,1212 ---- } ! nullifiables.Add( new Key(entry.Id, persister) ); ! entry.Status = Status.Deleted; // before any callbacks, etc, so subdeletions see that this deletion happend first ! ScheduledDeletion delete = new ScheduledDeletion(entry.Id, version, theObj, persister, this); deletions.Add(delete); // ensures that containing deletions happen before sub-deletions *************** *** 1228,1233 **** private void RollbackDeletion(EntityEntry entry, ScheduledDeletion delete) { ! entry.status = Status.Loaded; ! entry.deletedState = null; deletions.Remove(delete); } --- 1283,1288 ---- private void RollbackDeletion(EntityEntry entry, ScheduledDeletion delete) { ! entry.Status = Status.Loaded; ! entry.DeletedState = null; deletions.Remove(delete); } *************** *** 1389,1393 **** EntityEntry e = GetEntry(theObj); ! if (e!=null && e.status!=Status.Deleted) { // do nothing for persistent instances --- 1444,1448 ---- EntityEntry e = GetEntry(theObj); ! if (e!=null && e.Status!=Status.Deleted) { // do nothing for persistent instances *************** *** 1473,1480 **** else { ! if ( !e.id.Equals(id) ) throw new PersistentObjectException( "The instance passed to Update() was already persistent: " + ! MessageHelper.InfoString(e.persister, id) ); } --- 1528,1535 ---- else { ! if ( !e.Id.Equals(id) ) throw new PersistentObjectException( "The instance passed to Update() was already persistent: " + ! MessageHelper.InfoString(e.Persister, id) ); } *************** *** 1705,1721 **** EntityEntry e = GetEntry(obj); if (e==null) throw new TransientObjectException("attempted to lock a transient instance"); ! IClassPersister persister = e.persister; ! if ( lockMode.GreaterThan(e.lockMode) ) { ! if (e.status!=Status.Loaded) throw new TransientObjectException("attempted to lock a deleted instance"); ! if ( log.IsDebugEnabled ) log.Debug( "locking " + MessageHelper.InfoString(persister, e.id) + " in mode: " + lockMode); ! if ( persister.HasCache ) persister.Cache.Lock(e.id); try { ! persister.Lock(e.id, e.version, obj, lockMode, this); ! e.lockMode = lockMode; } catch (Exception exp) --- 1760,1776 ---- EntityEntry e = GetEntry(obj); if (e==null) throw new TransientObjectException("attempted to lock a transient instance"); ! IClassPersister persister = e.Persister; ! if ( lockMode.GreaterThan(e.LockMode) ) { ! if (e.Status!=Status.Loaded) throw new TransientObjectException("attempted to lock a deleted instance"); ! if ( log.IsDebugEnabled ) log.Debug( "locking " + MessageHelper.InfoString(persister, e.Id) + " in mode: " + lockMode); ! if ( persister.HasCache ) persister.Cache.Lock(e.Id); try { ! persister.Lock(e.Id, e.Version, obj, lockMode, this); ! e.LockMode = lockMode; } catch (Exception exp) *************** *** 1727,1731 **** // the database now holds a lock + the object is flushed from the cache, // so release the soft lock ! if ( persister.HasCache ) persister.Cache.Release(e.id); } } --- 1782,1786 ---- // the database now holds a lock + the object is flushed from the cache, // so release the soft lock ! if ( persister.HasCache ) persister.Cache.Release(e.Id); } } *************** *** 1880,1884 **** // (when this method is called) IClassPersister p = GetPersister(impl); ! return ProxyFor( p, new Key(e.id, p), impl); } --- 1935,1939 ---- // (when this method is called) IClassPersister p = GetPersister(impl); ! return ProxyFor( p, new Key(e.Id, p), impl); } *************** *** 1923,1927 **** { if (id==null) throw new NullReferenceException("null is not a valid identifier"); ! DoLoadByObject(obj, id, true); } --- 1978,1982 ---- { if (id==null) throw new NullReferenceException("null is not a valid identifier"); ! DoLoadByObject(obj, id, true, LockMode.None); } *************** *** 1968,1972 **** * as the application is concerned. */ ! private void DoLoadByObject(object obj, object id, bool checkDeleted) { System.Type clazz = obj.GetType(); --- 2023,2027 ---- * as the application is concerned. */ ! private void DoLoadByObject(object obj, object id, bool checkDeleted, LockMode lockMode) { System.Type clazz = obj.GetType(); *************** *** 1975,1979 **** MessageHelper.InfoString(clazz, id) ); ! object result = DoLoad(clazz, id, obj, LockMode.None, checkDeleted); ThrowObjectNotFound(result, id, clazz); if (result!=obj) throw new HibernateException( --- 2030,2034 ---- MessageHelper.InfoString(clazz, id) ); ! object result = DoLoad(clazz, id, obj, lockMode, checkDeleted); ThrowObjectNotFound(result, id, clazz); if (result!=obj) throw new HibernateException( *************** *** 2098,2102 **** object old = GetEntity(key); if (old!=null) { //if this object was already loaded ! Status status = GetEntry(old).status; //if ( checkDeleted && ( status==DELETED || status==GONE ) ) { if ( checkDeleted && ( status==Status.Deleted || status==Status.Gone) ) { --- 2153,2157 ---- object old = GetEntity(key); if (old!=null) { //if this object was already loaded ! Status status = GetEntry(old).Status; //if ( checkDeleted && ( status==DELETED || status==GONE ) ) { if ( checkDeleted && ( status==Status.Deleted || status==Status.Gone) ) { *************** *** 2160,2175 **** EntityEntry e = RemoveEntry(theObj); ! if ( log.IsDebugEnabled ) log.Debug( "refreshing " + MessageHelper.InfoString(e.persister, e.id) ); ! if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); ! Key key = new Key(e.id, e.persister); RemoveEntity( key ); try { ! e.persister.Load( e.id, theObj, lockMode, this); } catch (Exception exp) { throw new ADOException("could not refresh object", exp); } ! GetEntry(theObj).lockMode = e.lockMode; } --- 2215,2230 ---- EntityEntry e = RemoveEntry(theObj); ! if ( log.IsDebugEnabled ) log.Debug( "refreshing " + MessageHelper.InfoString(e.Persister, e.Id) ); ! if ( !e.ExistsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); ! Key key = new Key(e.Id, e.Persister); RemoveEntity( key ); try { ! e.Persister.Load( e.Id, theObj, lockMode, this); } catch (Exception exp) { throw new ADOException("could not refresh object", exp); } ! GetEntry(theObj).LockMode = e.LockMode; } *************** *** 2183,2189 **** EntityEntry e = GetEntry(obj); ! IClassPersister persister = e.persister; ! object id = e.id; ! object[] hydratedState = e.loadedState; IType[] types = persister.PropertyTypes; --- 2238,2244 ---- EntityEntry e = GetEntry(obj); ! IClassPersister persister = e.Persister; ! object id = e.Id; ! object[] hydratedState = e.LoadedState; IType[] types = persister.PropertyTypes; *************** *** 2334,2344 **** public void PostInsert(object obj) { ! GetEntry(obj).existsInDatabase = true; } public void PostDelete(object obj) { EntityEntry e = RemoveEntry(obj); ! e.status = Status.Gone; ! Key key = new Key(e.id, e.persister); RemoveEntity(key); proxiesByKey.Remove(key); --- 2389,2399 ---- public void PostInsert(object obj) { ! GetEntry(obj).ExistsInDatabase = true; } public void PostDelete(object obj) { EntityEntry e = RemoveEntry(obj); ! e.Status = Status.Gone; ! Key key = new Key(e.Id, e.Persister); RemoveEntity(key); proxiesByKey.Remove(key); *************** *** 2348,2357 **** { EntityEntry e = GetEntry(obj); ! e.loadedState = updatedState; ! e.lockMode = LockMode.Write; ! if(e.persister.IsVersioned) { ! e.version = nextVersion; ! e.persister.SetPropertyValue(obj, e.persister.VersionProperty, nextVersion); } } --- 2403,2412 ---- { EntityEntry e = GetEntry(obj); ! e.LoadedState = updatedState; ! e.LockMode = LockMode.Write; ! if(e.Persister.IsVersioned) { ! e.Version = nextVersion; ! e.Persister.SetPropertyValue(obj, e.Persister.VersionProperty, nextVersion); } } *************** *** 2391,2399 **** foreach(DictionaryEntry me in iterSafeCollection) { EntityEntry entry = (EntityEntry) me.Value; ! Status status = entry.status; if (status != Status.Loading && status != Status.Gone) { object obj = me.Key; ! IClassPersister persister = entry.persister; // make sure user didn't mangle the id --- 2446,2454 ---- foreach(DictionaryEntry me in iterSafeCollection) { EntityEntry entry = (EntityEntry) me.Value; ! Status status = entry.Status; if (status != Status.Loading && status != Status.Gone) { object obj = me.Key; ! IClassPersister persister = entry.Persister; // make sure user didn't mangle the id *************** *** 2401,2409 **** object oid = persister.GetIdentifier(obj); ! if ( !entry.id.Equals(oid) ) throw new HibernateException( "identiifier of an instance of " + persister.ClassName + " altered from " + ! entry.id + " to " + oid ); --- 2456,2464 ---- object oid = persister.GetIdentifier(obj); ! if ( !entry.Id.Equals(oid) ) throw new HibernateException( "identiifier of an instance of " + persister.ClassName + " altered from " + ! entry.Id + " to " + oid ); *************** *** 2413,2417 **** if ( status==Status.Deleted) { //grab its state saved at deletion ! values = entry.deletedState; } else { --- 2468,2472 ---- if ( status==Status.Deleted) { //grab its state saved at deletion ! values = entry.DeletedState; } else { *************** *** 2434,2438 **** bool interceptorHandledDirtyCheck; ! int[] dirtyProperties = interceptor.FindDirty(obj, entry.id, values, entry.loadedState, persister.PropertyNames, types); --- 2489,2493 ---- bool interceptorHandledDirtyCheck; ! int[] dirtyProperties = interceptor.FindDirty(obj, entry.Id, values, entry.LoadedState, persister.PropertyNames, types); *************** *** 2440,2446 **** // interceptor returned null, so do the dirtycheck ourself, if possible interceptorHandledDirtyCheck = false; ! cannotDirtyCheck = entry.loadedState==null; // object loaded by update() if ( !cannotDirtyCheck ) { ! dirtyProperties = persister.FindDirty(values, entry.loadedState, obj, this); } } else { --- 2495,2501 ---- // interceptor returned null, so do the dirtycheck ourself, if possible interceptorHandledDirtyCheck = false; ! cannotDirtyCheck = entry.LoadedState==null; // object loaded by update() if ( !cannotDirtyCheck ) { ! dirtyProperties = persister.FindDirty(values, entry.LoadedState, obj, this); } } else { *************** *** 2464,2472 **** if(status == Status.Deleted) { ! log.Debug("Updating deleted entity: " + MessageHelper.InfoString(persister, entry.id) ); } else { ! log.Debug("Updating entity: " + MessageHelper.InfoString(persister, entry.id) ); } } --- 2519,2527 ---- if(status == Status.Deleted) { ! log.Debug("Updating deleted entity: " + MessageHelper.InfoString(persister, entry.Id) ); } else { ! log.Debug("Updating entity: " + MessageHelper.InfoString(persister, entry.Id) ); } } *************** *** 2474,2483 **** // give the Interceptor a chance to modify property values bool intercepted = interceptor.OnFlushDirty( ! obj, entry.id, values, entry.loadedState, persister.PropertyNames, types); //no we might need to recalculate the dirtyProperties array if(intercepted && !cannotDirtyCheck && !interceptorHandledDirtyCheck) { ! dirtyProperties = persister.FindDirty(values, entry.loadedState, obj, this); } // if the properties were modified by the Interceptor, we need to set them back to the object --- 2529,2538 ---- // give the Interceptor a chance to modify property values bool intercepted = interceptor.OnFlushDirty( ! obj, entry.Id, values, entry.LoadedState, persister.PropertyNames, types); //no we might need to recalculate the dirtyProperties array if(intercepted && !cannotDirtyCheck && !interceptorHandledDirtyCheck) { ! dirtyProperties = persister.FindDirty(values, entry.LoadedState, obj, this); } // if the properties were modified by the Interceptor, we need to set them back to the object *************** *** 2491,2498 **** //increment the version number (if necessary) ! object nextVersion = entry.version; if(persister.IsVersioned) { ! if(status!=Status.Deleted) nextVersion = Versioning.Increment(entry.version, persister.VersionType); Versioning.SetVersion(values, nextVersion, persister); } --- 2546,2553 ---- //increment the version number (if necessary) ! object nextVersion = entry.Version; if(persister.IsVersioned) { ! if(status!=Status.Deleted) nextVersion = Versioning.Increment(entry.Version, persister.VersionType); Versioning.SetVersion(values, nextVersion, persister); } *************** *** 2506,2510 **** updates.Add( ! new ScheduledUpdate(entry.id, values, dirtyProperties, entry.version, nextVersion, obj, updatedState, persister, this) ); } --- 2561,2565 ---- updates.Add( ! new ScheduledUpdate(entry.Id, values, dirtyProperties, entry.Version, nextVersion, obj, updatedState, persister, this) ); } *************** *** 2540,2544 **** { EntityEntry entry = (EntityEntry) me.Value; ! Status status = entry.status; if ( status!=Status.Loading && status!=Status.Gone && status!=Status.Deleted) --- 2595,2599 ---- { EntityEntry entry = (EntityEntry) me.Value; ! Status status = entry.Status; if ( status!=Status.Loading && status!=Status.Gone && status!=Status.Deleted) *************** *** 2548,2552 **** try { ! Cascades.Cascade(this, entry.persister, obj, Cascades.CascadingAction.ActionSaveUpdate, CascadePoint.CascadeOnUpdate); } finally --- 2603,2607 ---- try { ! Cascades.Cascade(this, entry.Persister, obj, Cascades.CascadingAction.ActionSaveUpdate, CascadePoint.CascadeOnUpdate); } finally *************** *** 2588,2592 **** EntityEntry entry = GetEntry(obj); if (entry==null) throw new TransientObjectException("the instance was not associated with this session"); ! return entry.id; } } --- 2643,2647 ---- EntityEntry entry = GetEntry(obj); if (entry==null) throw new TransientObjectException("the instance was not associated with this session"); ! return entry.Id; } } *************** *** 2620,2624 **** } else { EntityEntry entry = GetEntry(obj); ! return (entry!=null) ? entry.id : null; } } --- 2675,2679 ---- } else { EntityEntry entry = GetEntry(obj); ! return (entry!=null) ? entry.Id : null; } } *************** *** 2643,2647 **** if(entry!=null) { ! return entry.id; } else --- 2698,2702 ---- if(entry!=null) { ! return entry.Id; } else *************** *** 3544,3549 **** EntityEntry e = (EntityEntry) RemoveEntry(obj); if (e!=null) { ! RemoveEntity( new Key(e.id, e.persister) ); ! DoEvict(e.persister, obj); } } --- 3599,3604 ---- EntityEntry e = (EntityEntry) RemoveEntry(obj); if (e!=null) { ! RemoveEntity( new Key(e.Id, e.Persister) ); ! DoEvict(e.Persister, obj); } } *************** *** 3594,3598 **** public object GetVersion(object entity) { ! return GetEntry(entity).version; } --- 3649,3653 ---- public object GetVersion(object entity) { ! return GetEntry(entity).Version; } |