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-08-25 04:16:47
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9779 Modified Files: releasenotes.txt Log Message: starting to update release notes for build 0.2.0.0 Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** releasenotes.txt 11 Aug 2004 11:49:17 -0000 1.8 --- releasenotes.txt 25 Aug 2004 04:16:38 -0000 1.9 *************** *** 1,2 **** --- 1,19 ---- + PreAlpha Build 0.2.0.0 + ======================== + - Removed support for <dynabean> mapping since it doesn't exist in .net + - Fixed bug in nhibernate.build file when not signing NHibernate.dll + - Fixed bug with Hql and SetParameter() where there were 2 parameters with same name. + - Fixed bug with Hql and "IN (:namedParam)" + - Fixed bug with Hql and multi column IType + - Fixed bug with NullReferenceException and TypeType class. + - Simple Filters are now working. + - Compiled Queries and Filters are now cached. + - Refactored Hql to use a SqlString instead of string containing sql. + - Dialect has had public API changed because of Sql to SqlCommand refactoring. + - IPreparer has had methods removed from public API + - type="System.Object" no longer matches to SerializableType - instead it matches to ObjectType. Use type="Serializable" instead. + - Added "access" attribute for NHibernate to get to fields and properties with no setters. See NHibernate.Property.PropertyAccessorFactory for all valid value types and how to plug in your own implementation of IPropertyAccessor. + - Added Types to read BLOB/CLOB columns to a byte[]/string Property. + PreAlpha Build 0.1.0.0 ======================== |
From: Michael D. <mik...@us...> - 2004-08-25 04:07:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8267/NHSpecificTest Added Files: BlobberInMemoryFixture.cs Log Message: Added test for blobs/clobs in memory --- NEW FILE: BlobberInMemoryFixture.cs --- using System; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Summary description for BlobberInMemoryFixture. /// </summary> [TestFixture] public class BlobberInMemoryFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BlobberInMemory.hbm.xml" } ); } [Test] public void BlobClobInMemory() { ISession s = sessions.OpenSession(); BlobberInMemory b = new BlobberInMemory(); b.BinaryBlob = System.Text.UnicodeEncoding.UTF8.GetBytes("foo/bar/baz"); b.StringClob = "foo/bar/baz"; s.Save(b); s.Flush(); s.Refresh(b); b.BinaryBlob[0] = System.Text.UTF8Encoding.UTF8.GetBytes("a")[0]; b.StringClob.Substring(2,3); b.StringClob = "a" + b.StringClob.Substring(1); s.Flush(); s.Close(); s = sessions.OpenSession(); b = (BlobberInMemory)s.Load( typeof(BlobberInMemory), b.Id ); BlobberInMemory b2 = new BlobberInMemory(); s.Save(b2); b2.BinaryBlob = b.BinaryBlob; b.BinaryBlob = null; Assert.AreEqual( "aoo", b.StringClob.Substring(0, 3) ); b.StringClob.Substring(1, 6); s.Flush(); s.Close(); s = sessions.OpenSession(); b = (BlobberInMemory)s.Load( typeof(BlobberInMemory), b.Id ); b.StringClob = "xcvfxvc xcvbx cvbx cvbx cvbxcvbxcvbxcvb"; s.Flush(); s.Close(); s = sessions.OpenSession(); b = (BlobberInMemory)s.Load( typeof(BlobberInMemory), b.Id ); Assert.AreEqual( "xcvfxvc", b.StringClob.Substring(0, 7) ); s.Flush(); s.Close(); } } } |
From: Michael D. <mik...@us...> - 2004-08-25 04:07:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8267 Modified Files: NHibernate.Test-1.1.csproj SQLFunctionsTest.cs Log Message: Added test for blobs/clobs in memory Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** NHibernate.Test-1.1.csproj 23 Aug 2004 13:13:24 -0000 1.36 --- NHibernate.Test-1.1.csproj 25 Aug 2004 04:06:59 -0000 1.37 *************** *** 312,315 **** --- 312,320 ---- /> <File + RelPath = "NHSpecificTest\BlobberInMemoryFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\ClassWithCompositeIdFixture.cs" SubType = "Code" Index: SQLFunctionsTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLFunctionsTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SQLFunctionsTest.cs 13 Aug 2004 18:56:33 -0000 1.4 --- SQLFunctionsTest.cs 25 Aug 2004 04:06:59 -0000 1.5 *************** *** 17,22 **** public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml"//, ! //"Blobber.hbm.xml" } ); } --- 17,22 ---- public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml", ! "Blobber.hbm.xml" } ); } *************** *** 65,69 **** [Test] ! [Ignore("HQL 'IN' keyword problems - http://jira.nhibernate.org:8080/browse/NH-84, IScrollableResults - http://jira.nhibernate.org:8080/browse/NH-37")] public void SQLFunctions() { --- 65,69 ---- [Test] ! [Ignore("IScrollableResults - http://jira.nhibernate.org:8080/browse/NH-37")] public void SQLFunctions() { *************** *** 196,201 **** Assert.AreEqual( 1, q.List().Count ); - /* - * http://jira.nhibernate.org:8080/browse/NH-84 q = s.CreateQuery("from s in class Simple where s.Name in (:name_list) and s.Count > :count"); IList list = new ArrayList(2); --- 196,199 ---- *************** *** 205,209 **** q.SetParameter( "count", (int)-1 ); Assert.AreEqual( 1, q.List().Count ); ! */ /* --- 203,207 ---- q.SetParameter( "count", (int)-1 ); Assert.AreEqual( 1, q.List().Count ); ! /* *************** *** 226,235 **** [Test] ! [Ignore("No BLOB/CLOB support yet - http://jira.nhibernate.org:8080/browse/NH-19")] public void BlobClob() { } ! } } --- 224,233 ---- [Test] ! [Ignore("BLOB/CLOB not implmented like h2.0.3 - http://jira.nhibernate.org:8080/browse/NH-19")] public void BlobClob() { } ! } } |
From: Michael D. <mik...@us...> - 2004-08-25 04:06:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8185/NHSpecific Added Files: BlobberInMemory.cs BlobberInMemory.hbm.xml Log Message: Added test for blobs/clobs in memory --- NEW FILE: BlobberInMemory.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for BlobberInMemory. /// </summary> public class BlobberInMemory { private int _id; private byte[] _blob; private string _clob; public int Id { get { return _id; } set { _id = value; } } public byte[] BinaryBlob { get { return _blob; } set { _blob = value; } } public string StringClob { get { return _clob; } set { _clob = value; } } } } --- NEW FILE: BlobberInMemory.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.DomainModel.NHSpecific.BlobberInMemory, NHibernate.DomainModel" table="bim" dynamic-update="true" > <id name="Id" type="Int32" > <generator class="hilo" /> </id> <!-- setting it to 100000 to get past the length that most dialects can hold in just a plain var binary column --> <property name="BinaryBlob" column="blob_" type="BinaryBlob" length="100000"/> <property name="StringClob" column="clob_" type="StringClob" length="100000"/> </class> </hibernate-mapping> |
From: Michael D. <mik...@us...> - 2004-08-25 04:06:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8185 Modified Files: Blobber.cs NHibernate.DomainModel-1.1.csproj Added Files: Blobber.hbm.xml Log Message: Added test for blobs/clobs in memory Index: Blobber.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Blobber.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Blobber.cs 2 Jun 2004 04:53:24 -0000 1.1 --- Blobber.cs 25 Aug 2004 04:06:20 -0000 1.2 *************** *** 8,17 **** public class Blobber { ! public Blobber() { ! // ! // TODO: Add constructor logic here ! // } } } --- 8,34 ---- public class Blobber { ! private int _id; ! private byte[] _blob; ! private string _clob; ! ! public int Id { ! get { return _id; } ! set { _id = value; } } + + public byte[] Blob + { + get { return _blob; } + set { _blob = value; } + } + + public string Clob + { + get { return _clob; } + set { _clob = value; } + } + + } } --- NEW FILE: Blobber.hbm.xml --- (This appears to be a binary file; contents omitted.) Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NHibernate.DomainModel-1.1.csproj 14 Aug 2004 14:52:01 -0000 1.21 --- NHibernate.DomainModel-1.1.csproj 25 Aug 2004 04:06:20 -0000 1.22 *************** *** 157,160 **** --- 157,164 ---- /> <File + RelPath = "Blobber.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "C1.cs" SubType = "Code" *************** *** 627,630 **** --- 631,643 ---- /> <File + RelPath = "NHSpecific\BlobberInMemory.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecific\BlobberInMemory.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "NHSpecific\Child.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-08-25 03:59:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6956/NHibernate Modified Files: NHibernate.cs Log Message: Had a typo in the field to get CultureInfoType's xml docs. Index: NHibernate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NHibernate.cs 25 Aug 2004 03:58:08 -0000 1.21 --- NHibernate.cs 25 Aug 2004 03:59:07 -0000 1.22 *************** *** 47,51 **** /// <summary> ! /// NHibernate clob type /// </summary> public static readonly NullableType CultureInfo = new CultureInfoType(); --- 47,51 ---- /// <summary> ! /// NHibernate Culture Info type /// </summary> public static readonly NullableType CultureInfo = new CultureInfoType(); |
From: Michael D. <mik...@us...> - 2004-08-25 03:58:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6732/NHibernate Modified Files: NHibernate-1.1.csproj NHibernate.cs Log Message: Added types to help MsSql with image & ntext fields in the database. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** NHibernate-1.1.csproj 23 Aug 2004 13:15:36 -0000 1.41 --- NHibernate-1.1.csproj 25 Aug 2004 03:58:08 -0000 1.42 *************** *** 1559,1562 **** --- 1559,1567 ---- /> <File + RelPath = "SqlTypes\BinaryBlobSqlType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SqlTypes\BinarySqlType.cs" SubType = "Code" *************** *** 1634,1637 **** --- 1639,1647 ---- /> <File + RelPath = "SqlTypes\StringClobSqlType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SqlTypes\StringFixedLengthSqlType.cs" SubType = "Code" *************** *** 1699,1702 **** --- 1709,1717 ---- /> <File + RelPath = "Type\BinaryBlobType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Type\BinaryType.cs" SubType = "Code" *************** *** 1928,1931 **** --- 1943,1951 ---- /> <File + RelPath = "Type\StringClobType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Type\StringType.cs" SubType = "Code" Index: NHibernate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NHibernate.cs 21 Aug 2004 16:37:32 -0000 1.20 --- NHibernate.cs 25 Aug 2004 03:58:08 -0000 1.21 *************** *** 27,30 **** --- 27,35 ---- /// <summary> + /// NHibernate binary blob type + /// </summary> + public static readonly NullableType BinaryBlob = new BinaryBlobType(); + + /// <summary> /// NHibernate boolean type /// </summary> *************** *** 42,46 **** /// <summary> ! /// NHibernate CultureInfo type /// </summary> public static readonly NullableType CultureInfo = new CultureInfoType(); --- 47,51 ---- /// <summary> ! /// NHibernate clob type /// </summary> public static readonly NullableType CultureInfo = new CultureInfoType(); *************** *** 97,100 **** --- 102,110 ---- /// <summary> + /// NHibernate string clob type + /// </summary> + public static readonly NullableType StringClob = new StringClobType(); + + /// <summary> /// NHibernate Time type /// </summary> |
From: Michael D. <mik...@us...> - 2004-08-25 03:56:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6290/NHibernate/Driver Modified Files: SqlClientDriver.cs Log Message: Can now prepare commands that contain image & ntext. Index: SqlClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SqlClientDriver.cs 16 Aug 2004 05:21:12 -0000 1.5 --- SqlClientDriver.cs 25 Aug 2004 03:56:30 -0000 1.6 *************** *** 65,69 **** } - /// <summary> /// Generates an IDbDataParameter that has values for the Size or Precision/Scale Properties set. --- 65,68 ---- *************** *** 92,95 **** --- 91,95 ---- switch( parameter.SqlType.DbType ) { + case DbType.AnsiString: case DbType.AnsiStringFixedLength: *************** *** 100,104 **** case DbType.Binary: pl = parameter as ParameterLength; ! dbParam.Size = dialect.MaxBinarySize; break; --- 100,111 ---- case DbType.Binary: pl = parameter as ParameterLength; ! if( parameter.SqlType is SqlTypes.BinaryBlobSqlType) ! { ! dbParam.Size = dialect.MaxBinaryBlobSize; ! } ! else ! { ! dbParam.Size = dialect.MaxBinarySize; ! } break; *************** *** 106,110 **** case DbType.StringFixedLength: pl = parameter as ParameterLength; ! dbParam.Size = dialect.MaxStringSize; break; case DbType.Decimal: --- 113,124 ---- case DbType.StringFixedLength: pl = parameter as ParameterLength; ! if( parameter.SqlType is SqlTypes.StringClobSqlType) ! { ! dbParam.Size = dialect.MaxStringClobSize; ! } ! else ! { ! dbParam.Size = dialect.MaxStringSize; ! } break; case DbType.Decimal: |
From: Michael D. <mik...@us...> - 2004-08-25 03:56:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6186/NHibernate/Dialect Modified Files: Dialect.cs MsSql2000Dialect.cs Log Message: Added code to deal with MaxBinaryBlobSize and MaxStringClobSize. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Dialect.cs 19 Aug 2004 17:45:24 -0000 1.37 --- Dialect.cs 25 Aug 2004 03:55:56 -0000 1.38 *************** *** 508,515 **** /// <remarks> /// <para> - /// Setting the value to 0 indicates that there is no Maximum Size or that it - /// does not need to be set to Prepare the IDbCommand. - /// </para> - /// <para> /// Currently the only Driver that needs to worry about setting the Param size /// is MsSql --- 508,511 ---- *************** *** 518,533 **** public virtual int MaxAnsiStringSize { ! get { throw new NotImplementedException("should be implemented by subclass - this will be converted to abstract"); } } /// <summary> /// The largest value that can be set in IDbDataParameter.Size for a parameter ! /// that contains a Binary. /// </summary> /// <remarks> /// <para> ! /// Setting the value to 0 indicates that there is no Maximum Size or that it ! /// does not need to be set to Prepare the IDbCommand. /// </para> /// <para> /// Currently the only Driver that needs to worry about setting the Param size --- 514,540 ---- public virtual int MaxAnsiStringSize { ! get { throw new NotImplementedException("should be implemented by subclass if needed."); } } /// <summary> /// The largest value that can be set in IDbDataParameter.Size for a parameter ! /// that contains a DbType.Binary value. /// </summary> /// <remarks> /// <para> ! /// Currently the only Driver that needs to worry about setting the Param size ! /// is MsSql /// </para> + /// </remarks> + public virtual int MaxBinarySize + { + get { throw new NotImplementedException("should be implemented by subclass if needed."); } + } + + /// <summary> + /// The largest value that can be set in IDbDataParameter.Size for a parameter + /// that contains a DbType.Binary value that is written to a BLOB column. + /// </summary> + /// <remarks> /// <para> /// Currently the only Driver that needs to worry about setting the Param size *************** *** 535,546 **** /// </para> /// </remarks> ! public virtual int MaxBinarySize { ! get { throw new NotImplementedException("should be implemented by subclass - this will be converted to abstract"); } } /// <summary> /// The largest value that can be set in IDbDataParameter.Size for a parameter ! /// that contains an Unicode String. /// </summary> /// <remarks> --- 542,568 ---- /// </para> /// </remarks> ! public virtual int MaxBinaryBlobSize { ! get { throw new NotImplementedException("should be implemented by subclass if needed."); } } /// <summary> /// The largest value that can be set in IDbDataParameter.Size for a parameter ! /// that contains a Unicode String value that is written to a CLOB column. ! /// </summary> ! /// <remarks> ! /// <para> ! /// Currently the only Driver that needs to worry about setting the Param size ! /// is MsSql. ! /// </para> ! /// </remarks> ! public virtual int MaxStringClobSize ! { ! get { throw new NotImplementedException("should be implemented by subclass if needed."); } ! } ! ! /// <summary> ! /// The largest value that can be set in IDbDataParameter.Size for a parameter ! /// that contains an Unicode String value. /// </summary> /// <remarks> Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MsSql2000Dialect.cs 19 Aug 2004 17:45:25 -0000 1.16 --- MsSql2000Dialect.cs 25 Aug 2004 03:55:56 -0000 1.17 *************** *** 120,126 **** --- 120,136 ---- } + public override int MaxBinaryBlobSize + { + get { return 2147483647; } + } + public override int MaxBinarySize { get { return 8000; } + } + + public override int MaxStringClobSize + { + get { return 1073741823; } } |
From: Michael D. <mik...@us...> - 2004-08-25 03:54:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6005/NHibernate/Impl Modified Files: PreparerImpl.cs Log Message: Removed BuildCommand from the public api. Index: PreparerImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/PreparerImpl.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PreparerImpl.cs 19 Jul 2004 03:21:32 -0000 1.7 --- PreparerImpl.cs 25 Aug 2004 03:54:49 -0000 1.8 *************** *** 24,30 **** // key = SqlString or a sql string // value = ADO.NET Command - // A Built command is just an sql string/SQL Statement that has been converted - // into an ADO.NET Command - private Hashtable builtCommands = new Hashtable(); // A prepared command is ADO.NET command that is attached to an IDbConnection --- 24,27 ---- *************** *** 62,66 **** // a connection. preparedCommands = new Hashtable(); - builtCommands = new Hashtable(); currentConnection = value; --- 59,62 ---- *************** *** 73,89 **** } ! public IDbCommand BuildCommand(string sql) { ! IDbCommand cmd = builtCommands[sql] as IDbCommand; ! if( cmd==null ) { ! cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sql); ! if(log.IsDebugEnabled) ! { ! log.Debug( "Building an IDbCommand object for the sql: " + sql ); ! } } - - builtCommands[sql] = cmd; return cmd; --- 69,79 ---- } ! private IDbCommand BuildCommand(string sql) { ! IDbCommand cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sql); ! if(log.IsDebugEnabled) { ! log.Debug( "Building an IDbCommand object for the sql: " + sql ); } return cmd; *************** *** 91,108 **** ! public IDbCommand BuildCommand(SqlString sqlString) { ! IDbCommand cmd = builtCommands[sqlString] as IDbCommand; ! ! if( cmd==null ) { ! cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sqlString); ! if(log.IsDebugEnabled) ! { ! log.Debug( "Building an IDbCommand object for the SqlString: " + sqlString.ToString() ); ! } } - - builtCommands[sqlString] = cmd; return cmd; --- 81,91 ---- ! private IDbCommand BuildCommand(SqlString sqlString) { ! IDbCommand cmd = factory.ConnectionProvider.Driver.GenerateCommand(factory.Dialect, sqlString); ! if(log.IsDebugEnabled) { ! log.Debug( "Building an IDbCommand object for the SqlString: " + sqlString.ToString() ); } return cmd; *************** *** 159,163 **** public IDbCommand PrepareCommand(IDbCommand dbCommand) { - try { --- 142,145 ---- *************** *** 189,193 **** } - public IDbCommand PrepareCommand(string sql) { --- 171,174 ---- |
From: Michael D. <mik...@us...> - 2004-08-25 03:54:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6005/NHibernate/Engine Modified Files: IPreparer.cs Log Message: Removed BuildCommand from the public api. Index: IPreparer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IPreparer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IPreparer.cs 10 Feb 2004 18:32:25 -0000 1.1 --- IPreparer.cs 25 Aug 2004 03:54:48 -0000 1.2 *************** *** 19,37 **** public interface IPreparer { - - /// <summary> - /// Builds an IDbCommand from a SQL String. The SQL String can have - /// no parameters. - /// </summary> - /// <remarks>The String to build into a IDbCommand.</remarks> - IDbCommand BuildCommand(string sql); - - /// <summary> - /// Builds an IDbCommand from a SqlString - /// </summary> - /// <param name="sqlString">The SqlString to build into an IDbCommand.</param> - /// <returns></returns> - IDbCommand BuildCommand(SqlString sqlString); - /// <summary> /// Prepares the IDbCommand for the IDbConnection --- 19,22 ---- |
From: Michael D. <mik...@us...> - 2004-08-25 03:52:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5673/NHibernate/Type Modified Files: TypeFactory.cs Added Files: BinaryBlobType.cs StringClobType.cs Log Message: Added Types so that MsSql could make a image and ntext parameter. Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** TypeFactory.cs 21 Aug 2004 16:37:33 -0000 1.37 --- TypeFactory.cs 25 Aug 2004 03:52:21 -0000 1.38 *************** *** 77,80 **** --- 77,82 ---- // get a Timezone by name... //basicTypes.Add(NHibernate.Timezone.Name, NHibernate.Timezone); + + // set up the mappings of .NET Classes/Structs to their NHibernate types. typeByTypeOfName[ typeof(System.Byte[]).Name ] = NHibernate.Binary ; typeByTypeOfName[ typeof(System.Byte[]).AssemblyQualifiedName ] = NHibernate.Binary ; *************** *** 108,116 **** --- 110,121 ---- typeByTypeOfName[ typeof(System.TimeSpan).AssemblyQualifiedName ] = NHibernate.TimeSpan; + // add the mappings of the NHibernate specific names that are used in type="" typeByTypeOfName[ NHibernate.AnsiString.Name ] = NHibernate.AnsiString ; typeByTypeOfName[ NHibernate.Binary.Name ] = NHibernate.Binary ; + typeByTypeOfName[ NHibernate.BinaryBlob.Name ] = NHibernate.BinaryBlob; typeByTypeOfName[ NHibernate.Boolean.Name ] = NHibernate.Boolean; typeByTypeOfName[ NHibernate.Byte.Name ] = NHibernate.Byte; typeByTypeOfName[ NHibernate.Character.Name ] = NHibernate.Character; + typeByTypeOfName[ NHibernate.StringClob.Name ] = NHibernate.StringClob; typeByTypeOfName[ NHibernate.CultureInfo.Name ] = NHibernate.CultureInfo; typeByTypeOfName[ NHibernate.DateTime.Name ] = NHibernate.DateTime; *************** *** 141,144 **** --- 146,151 ---- typeByTypeOfName[ NHibernate.Serializable.Name ] = NHibernate.Serializable; + // object needs to have both class and serializable setup before it can + // be created. typeByTypeOfName[ typeof(System.Object).FullName ] = NHibernate.Object; typeByTypeOfName[ typeof(System.Object).AssemblyQualifiedName ] = NHibernate.Object; *************** *** 147,151 **** // These are in here for Hibernate mapping compatibility typeByTypeOfName[ "binary" ] = NHibernate.Binary ; - // TODO: add clob and blob when implemented typeByTypeOfName[ "boolean" ] = NHibernate.Boolean; typeByTypeOfName[ "byte" ] = NHibernate.Byte; --- 154,157 ---- --- NEW FILE: StringClobType.cs --- using System; using NHibernate.SqlTypes; namespace NHibernate.Type { /// <summary> /// Maps a System.String Property to an column that can store a CLOB. /// </summary> /// <remarks> /// This is only needed by DataProviders (SqlClient) that need to specify a Size for the /// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a StringType /// would work just fine. /// </remarks> public class StringClobType : StringType { internal StringClobType() : base( new StringClobSqlType() ) { } internal StringClobType(StringSqlType sqlType) : base(sqlType) { } public override string Name { get {return "StringClob"; } } } } --- NEW FILE: BinaryBlobType.cs --- using System; using System.Data; using NHibernate.SqlTypes; namespace NHibernate.Type { /// <summary> /// Maps a System.Byte[] Property to an column that can store a BLOB. /// </summary> /// <remarks> /// This is only needed by DataProviders (SqlClient) that need to specify a Size for the /// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a BinaryType /// would work just fine. /// </remarks> public class BinaryBlobType : BinaryType { internal BinaryBlobType() : base( new BinaryBlobSqlType() ) { } internal BinaryBlobType(BinarySqlType sqlType) : base(sqlType) { } public override string Name { get {return "BinaryBlob"; } } } } |
From: Michael D. <mik...@us...> - 2004-08-25 03:51:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlTypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5531/NHibernate/SqlTypes Added Files: BinaryBlobSqlType.cs StringClobSqlType.cs Log Message: Added SqlTypes so that MsSql could make a image and ntext parameter. --- NEW FILE: StringClobSqlType.cs --- using System; using System.Data; namespace NHibernate.SqlTypes { /// <summary> /// A SqlType that uses a <see cref="DbType.String "/> to generate a Parameter /// for the IDriver to write a CLOB value to the database. /// </summary> /// <remarks> /// This is only needed by DataProviders (SqlClient) that need to specify a Size for the /// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a /// StringSqlType would work just fine. /// </remarks> [Serializable] public class StringClobSqlType : StringSqlType { public StringClobSqlType() : base() { } public StringClobSqlType(int length) : base(length) { } } } --- NEW FILE: BinaryBlobSqlType.cs --- using System; using System.Data; namespace NHibernate.SqlTypes { /// <summary> /// A SqlType that uses a <see cref="DbType.Binary"/> to generate a Parameter /// for the IDriver to write a BLOB value to the database. /// </summary> /// <remarks> /// This is only needed by DataProviders (SqlClient) that need to specify a Size for the /// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a /// BinarySqlType would work just fine. /// </remarks> [Serializable] public class BinaryBlobSqlType : BinarySqlType { public BinaryBlobSqlType() : base() { } public BinaryBlobSqlType(int length) : base(length) { } } } |
From: Michael D. <mik...@us...> - 2004-08-23 13:15:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17456 Modified Files: NHibernate-1.1.csproj Log Message: Added access strategy for Properties with only a get exposed. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** NHibernate-1.1.csproj 23 Aug 2004 02:10:05 -0000 1.40 --- NHibernate-1.1.csproj 23 Aug 2004 13:15:36 -0000 1.41 *************** *** 1384,1387 **** --- 1384,1392 ---- /> <File + RelPath = "Property\NoSetterAccessor.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Property\PascalCaseMUnderscoreStrategy.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-08-23 13:15:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17456/Property Added Files: NoSetterAccessor.cs Log Message: Added access strategy for Properties with only a get exposed. --- NEW FILE: NoSetterAccessor.cs --- using System; using System.Reflection; namespace NHibernate.Property { /// <summary> /// Access the Property through the <c>get</c> to get the value /// and go directly to the Field to set the value. /// </summary> /// <remarks> /// This is most useful because Classes can provider a get for the Property /// that is the <id> but tell NHibernate there is no setter for the Property /// so the value should be written directly to the field. /// </remarks> public class NoSetterAccessor : IPropertyAccessor { IFieldNamingStrategy namingStrategy; public NoSetterAccessor(IFieldNamingStrategy namingStrategy) { this.namingStrategy = namingStrategy; } #region IPropertyAccessor Members public IGetter GetGetter(System.Type theClass, string propertyName) { BasicGetter result = BasicPropertyAccessor.GetGetterOrNull(theClass, propertyName); if (result == null) throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + theClass.FullName ); return result; } public ISetter GetSetter(System.Type theClass, string propertyName) { string fieldName = namingStrategy.GetFieldName(propertyName); return new FieldSetter( FieldAccessor.GetField( theClass, fieldName ), theClass, fieldName ); } #endregion } } |
From: Michael D. <mik...@us...> - 2004-08-23 13:13:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16606/NHibernate.Test/PropertyTest Modified Files: CamelCaseFixture.cs CamelCaseUnderscoreFixture.cs FieldAccessorFixture.cs FieldClass.cs PascalCaseMUnderscoreFixture.cs Added Files: NoSetterAccessorFixture.cs NoSetterCamelCaseFixture.cs NoSetterCamelCaseUnderscoreFixture.cs NoSetterPascalCaseMUnderscoreFixture.cs Log Message: Added test for access="nosetter" --- NEW FILE: NoSetterCamelCaseFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for NoSetterCamelCaseFixture. /// </summary> [TestFixture] public class NoSetterCamelCaseFixture : NoSetterAccessorFixture { [SetUp] public override void SetUp() { _expectedCamelBazGetterCalled = true; _accessor = PropertyAccessorFactory.GetPropertyAccessor("nosetter.camelcase"); _getter = _accessor.GetGetter( typeof(FieldClass), "CamelBaz" ); _setter = _accessor.GetSetter( typeof(FieldClass), "CamelBaz" ); _instance = new FieldClass( 6, -1, 2, 0 ); } } } --- NEW FILE: NoSetterCamelCaseUnderscoreFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for NoSetterCamelCaseUnderscoreFixture. /// </summary> [TestFixture] public class NoSetterCamelCaseUnderscoreFixture : NoSetterAccessorFixture { [SetUp] public override void SetUp() { _expectedCamelUnderscoreFooGetterCalled = true; _accessor = PropertyAccessorFactory.GetPropertyAccessor("nosetter.camelcase-underscore"); _getter = _accessor.GetGetter( typeof(FieldClass), "CamelUnderscoreFoo" ); _setter = _accessor.GetSetter( typeof(FieldClass), "CamelUnderscoreFoo" ); _instance = new FieldClass( 6, 0, -1, 2 ); } } } --- NEW FILE: NoSetterPascalCaseMUnderscoreFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for NoSetterCamelCaseUnderscoreFixture. /// </summary> [TestFixture] public class NoSetterPascalCaseMUnderscoreFixture : NoSetterAccessorFixture { [SetUp] public override void SetUp() { _expectedBlahGetterCalled = true; _accessor = PropertyAccessorFactory.GetPropertyAccessor("nosetter.pascalcase-m-underscore"); _getter = _accessor.GetGetter( typeof(FieldClass), "Blah" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Blah" ); _instance = new FieldClass( 6, -1, 0, 2 ); } } } Index: CamelCaseFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/CamelCaseFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CamelCaseFixture.cs 23 Aug 2004 02:10:31 -0000 1.1 --- CamelCaseFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 *************** *** 17,22 **** { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass(2, -4, 3, 0 ); } --- 17,22 ---- { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "CamelBaz" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "CamelBaz" ); _instance = new FieldClass(2, -4, 3, 0 ); } Index: FieldClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/FieldClass.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FieldClass.cs 23 Aug 2004 02:10:31 -0000 1.2 --- FieldClass.cs 23 Aug 2004 13:13:25 -0000 1.3 *************** *** 9,22 **** { private int Id; ! private int _id; ! private int m_Id; ! private int id; ! public FieldClass(int Id, int underscoreId, int mUnderscoreId, int camelId ) { this.Id = Id; ! _id = underscoreId; ! m_Id = mUnderscoreId; ! id = camelId; } --- 9,26 ---- { private int Id; ! private int _camelUnderscoreFoo; ! private int m_Blah; ! private int camelBaz; ! public bool CamelUnderscoreFooGetterCalled = false; ! public bool BlahGetterCalled = false; ! public bool CamelBazGetterCalled = false; ! ! public FieldClass(int Id, int _camelUnderscoreFoo, int m_Blah, int camelBaz ) { this.Id = Id; ! this._camelUnderscoreFoo = _camelUnderscoreFoo; ! this.m_Blah = m_Blah; ! this.camelBaz = camelBaz; } *************** *** 24,30 **** { Id++; ! _id++; ! m_Id++; ! id++; } } --- 28,61 ---- { Id++; ! _camelUnderscoreFoo++; ! m_Blah++; ! camelBaz++; ! } ! ! public int CamelUnderscoreFoo ! { ! get ! { ! CamelUnderscoreFooGetterCalled = true; ! return _camelUnderscoreFoo; ! } ! } ! ! public int Blah ! { ! get ! { ! BlahGetterCalled = true; ! return m_Blah; ! } ! } ! ! public int CamelBaz ! { ! get ! { ! CamelBazGetterCalled = true; ! return camelBaz; ! } } } --- NEW FILE: NoSetterAccessorFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Base test fixture for the NoSetter Accessors. /// </summary> [TestFixture] public abstract class NoSetterAccessorFixture { protected IPropertyAccessor _accessor; protected IGetter _getter; protected ISetter _setter; protected FieldClass _instance; protected bool _expectedBlahGetterCalled = false; protected bool _expectedCamelBazGetterCalled = false; protected bool _expectedCamelUnderscoreFooGetterCalled = false; /// <summary> /// SetUp the local fields for the test cases. /// </summary> /// <remarks> /// Any classes testing out their field access should override this /// and setup their FieldClass instance so that whichever field is /// going to be reflected upon is initialized to 0. /// </remarks> [SetUp] public abstract void SetUp(); [Test] public void GetValue() { Assert.AreEqual( 0, _getter.Get(_instance) ); _instance.Increment(); Assert.AreEqual( 1, _getter.Get(_instance) ); Assert.AreEqual( _expectedBlahGetterCalled, _instance.BlahGetterCalled ); Assert.AreEqual( _expectedCamelBazGetterCalled, _instance.CamelBazGetterCalled ); Assert.AreEqual( _expectedCamelUnderscoreFooGetterCalled, _instance.CamelUnderscoreFooGetterCalled ); } [Test] public void SetValue() { Assert.AreEqual( 0, _getter.Get(_instance) ); _setter.Set( _instance, 5 ); Assert.AreEqual( 5, _getter.Get(_instance) ); } } } Index: FieldAccessorFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/FieldAccessorFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FieldAccessorFixture.cs 23 Aug 2004 02:10:31 -0000 1.2 --- FieldAccessorFixture.cs 23 Aug 2004 13:13:25 -0000 1.3 *************** *** 32,36 **** _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); ! _instance = new FieldClass( 0, 6, -1, 2); } --- 32,36 ---- _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); ! _instance = new FieldClass( 0, 6, -1, 2 ); } *************** *** 42,45 **** --- 42,49 ---- _instance.Increment(); Assert.AreEqual( 1, _getter.Get(_instance) ); + + Assert.IsFalse( _instance.BlahGetterCalled ); + Assert.IsFalse( _instance.CamelBazGetterCalled ); + Assert.IsFalse( _instance.CamelUnderscoreFooGetterCalled ); } *************** *** 48,58 **** { Assert.AreEqual( 0, _getter.Get(_instance) ); - _setter.Set( _instance, 5 ); Assert.AreEqual( 5, _getter.Get(_instance) ); } - } - - } --- 52,58 ---- Index: CamelCaseUnderscoreFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/CamelCaseUnderscoreFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CamelCaseUnderscoreFixture.cs 23 Aug 2004 02:10:31 -0000 1.1 --- CamelCaseUnderscoreFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 *************** *** 17,22 **** { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase-underscore"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass(2, 0 , -4, 3 ); } --- 17,22 ---- { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase-underscore"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "CamelUnderscoreFoo" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "CamelUnderscoreFoo" ); _instance = new FieldClass(2, 0 , -4, 3 ); } Index: PascalCaseMUnderscoreFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/PascalCaseMUnderscoreFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PascalCaseMUnderscoreFixture.cs 23 Aug 2004 02:10:31 -0000 1.1 --- PascalCaseMUnderscoreFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 *************** *** 17,22 **** { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.pascalcase-m-underscore"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass( 6, -12 , 0, 13); } --- 17,22 ---- { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.pascalcase-m-underscore"); ! _getter = _accessor.GetGetter( typeof(FieldClass), "Blah" ); ! _setter = _accessor.GetSetter( typeof(FieldClass), "Blah" ); _instance = new FieldClass( 6, -12 , 0, 13); } |
From: Michael D. <mik...@us...> - 2004-08-23 13:13:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16606/NHibernate.Test/NHSpecificTest Modified Files: SubclassFixture.cs Log Message: Added test for access="nosetter" Index: SubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/SubclassFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubclassFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- SubclassFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 *************** *** 25,31 **** ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); JoinedSubclassOne one1 = new JoinedSubclassOne(); ! one1.Id = 2; one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; --- 25,33 ---- ISession s1 = sessions.OpenSession(); ITransaction t1 = s1.BeginTransaction(); + int oneId; + int baseId; JoinedSubclassOne one1 = new JoinedSubclassOne(); ! one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; *************** *** 33,45 **** one1.OneTestLong = 1; ! s1.Save(one1); JoinedSubclassBase base1 = new JoinedSubclassBase(); - base1.Id = 1; base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; base1.TestLong = 5; ! s1.Save(base1); t1.Commit(); --- 35,46 ---- one1.OneTestLong = 1; ! oneId = (int)s1.Save(one1); JoinedSubclassBase base1 = new JoinedSubclassBase(); base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; base1.TestLong = 5; ! baseId = (int)s1.Save(base1); t1.Commit(); *************** *** 51,56 **** // perform a load based on the base class ! JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 1); ! JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 2); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. --- 52,57 ---- // perform a load based on the base class ! JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), baseId); ! JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), oneId); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. |
From: Michael D. <mik...@us...> - 2004-08-23 13:13:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16606/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: Added test for access="nosetter" Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** NHibernate.Test-1.1.csproj 23 Aug 2004 02:10:31 -0000 1.35 --- NHibernate.Test-1.1.csproj 23 Aug 2004 13:13:24 -0000 1.36 *************** *** 377,380 **** --- 377,400 ---- /> <File + RelPath = "PropertyTest\NoSetterAccessorFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "PropertyTest\NoSetterCamelCaseFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "PropertyTest\NoSetterCamelCaseUnderscoreFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "PropertyTest\NoSetterPascalCaseMUnderscoreFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "PropertyTest\PascalCaseMUnderscoreFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-08-23 13:11:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16001/NHibernate.DomainModel/NHSpecific Modified Files: JoinedSubclass.hbm.xml JoinedSubclassBase.cs SexType.cs SexType.hbm.xml SimpleComponent.cs SimpleComponent.hbm.xml Subclass.hbm.xml Log Message: Modified mapping to test access="nosetter" Index: SimpleComponent.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/SimpleComponent.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleComponent.cs 9 Jun 2004 01:04:35 -0000 1.1 --- SimpleComponent.cs 23 Aug 2004 13:11:45 -0000 1.2 *************** *** 8,12 **** public class SimpleComponent { ! private int _key; private string _name; private string _address; --- 8,12 ---- public class SimpleComponent { ! private int m_Key = 0; private string _name; private string _address; *************** *** 23,28 **** public int Key { ! get {return _key;} ! set {_key = value;} } --- 23,27 ---- public int Key { ! get {return m_Key;} } Index: Subclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/Subclass.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Subclass.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- Subclass.hbm.xml 23 Aug 2004 13:11:45 -0000 1.2 *************** *** 7,12 **** > ! <id name="Id" type="Int32" column="class_id" > ! <generator class="assigned" /> </id> --- 7,12 ---- > ! <id name="Id" type="Int32" column="class_id" access="nosetter.camelcase-underscore"> ! <generator class="native" /> </id> Index: SexType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/SexType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SexType.cs 9 Jun 2004 01:04:35 -0000 1.1 --- SexType.cs 23 Aug 2004 13:11:45 -0000 1.2 *************** *** 8,12 **** public class SexType { ! private int _id; private string _typeName; private string _nonpublicString; --- 8,12 ---- public class SexType { ! private int id = 0; private string _typeName; private string _nonpublicString; *************** *** 18,23 **** public int Id { ! get {return _id;} ! set {_id = value;} } --- 18,22 ---- public int Id { ! get {return id;} } Index: JoinedSubclassBase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/JoinedSubclassBase.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclassBase.cs 9 Jun 2004 01:04:35 -0000 1.1 --- JoinedSubclassBase.cs 23 Aug 2004 13:11:45 -0000 1.2 *************** *** 8,12 **** public class JoinedSubclassBase { ! private int _id; private long _testLong; private string _testString; --- 8,12 ---- public class JoinedSubclassBase { ! private int _id = 0; private long _testLong; private string _testString; *************** *** 17,38 **** } ! public int Id { ! get {return _id;} ! set {_id = value;} } ! public long TestLong { ! get {return _testLong;} ! set {_testLong = value;} } ! public string TestString { ! get {return _testString;} ! set {_testString = value;} } ! public System.DateTime TestDateTime { ! get {return _testDate;} ! set {_testDate = value;} } } --- 17,41 ---- } ! public int Id ! { ! get { return _id; } } ! public long TestLong ! { ! get { return _testLong; } ! set { _testLong = value; } } ! public string TestString ! { ! get { return _testString; } ! set { _testString = value; } } ! public System.DateTime TestDateTime ! { ! get { return _testDate; } ! set { _testDate = value; } } } Index: JoinedSubclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/JoinedSubclass.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JoinedSubclass.hbm.xml 12 Jul 2004 20:40:33 -0000 1.2 --- JoinedSubclass.hbm.xml 23 Aug 2004 13:11:45 -0000 1.3 *************** *** 5,9 **** table="j_sc" > ! <id name="Id" type="Int32" unsaved-value="0" column="joined_subclass_id" > <generator class="native" /> </id> --- 5,15 ---- table="j_sc" > ! <id ! name="Id" ! type="Int32" ! unsaved-value="0" ! column="joined_subclass_id" ! access="nosetter.camelcase-underscore" ! > <generator class="native" /> </id> Index: SexType.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/SexType.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SexType.hbm.xml 22 Jun 2004 03:11:02 -0000 1.2 --- SexType.hbm.xml 23 Aug 2004 13:11:45 -0000 1.3 *************** *** 6,10 **** table="s_type" > ! <id name="Id" column="id"> <generator class="native" /> </id> --- 6,10 ---- table="s_type" > ! <id name="Id" column="id" access="nosetter.camelcase"> <generator class="native" /> </id> Index: SimpleComponent.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/SimpleComponent.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleComponent.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- SimpleComponent.hbm.xml 23 Aug 2004 13:11:45 -0000 1.2 *************** *** 5,9 **** table="simp_com" > ! <id name="Key" type="Int64" column="`i[d]_`" > <generator class="assigned" /> </id> --- 5,9 ---- table="simp_com" > ! <id name="Key" type="Int64" column="`i[d]_`" access="nosetter.pascalcase-m-underscore" > <generator class="assigned" /> </id> |
From: Michael D. <mik...@us...> - 2004-08-23 13:11:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15811/NHibernate/Property Modified Files: BasicPropertyAccessor.cs FieldAccessor.cs PascalCaseMUnderscoreStrategy.cs PropertyAccessorFactory.cs Log Message: Added comments to GetPropertyAccessor and changed access modifiers of some helper functions. Index: BasicPropertyAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicPropertyAccessor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicPropertyAccessor.cs 22 Aug 2004 06:18:54 -0000 1.1 --- BasicPropertyAccessor.cs 23 Aug 2004 13:11:08 -0000 1.2 *************** *** 30,34 **** #endregion ! private static BasicSetter GetSetterOrNull(System.Type type, string propertyName) { if (type == typeof(object) || type == null) return null; --- 30,34 ---- #endregion ! internal static BasicSetter GetSetterOrNull(System.Type type, string propertyName) { if (type == typeof(object) || type == null) return null; *************** *** 56,60 **** } ! private static BasicGetter GetGetterOrNull(System.Type type, string propertyName) { if (type==typeof(object) || type==null) return null; --- 56,60 ---- } ! internal static BasicGetter GetGetterOrNull(System.Type type, string propertyName) { if (type==typeof(object) || type==null) return null; Index: PropertyAccessorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/PropertyAccessorFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PropertyAccessorFactory.cs 23 Aug 2004 02:10:06 -0000 1.2 --- PropertyAccessorFactory.cs 23 Aug 2004 13:11:08 -0000 1.3 *************** *** 16,20 **** private static readonly IPropertyAccessor fieldCamelCaseUnderscoreAccessor = new FieldAccessor( new CamelCaseUnderscoreStrategy() ); private static readonly IPropertyAccessor fieldPascalCaseMUnderscoreAccessor = new FieldAccessor( new PascalCaseMUnderscoreStrategy() ); ! private PropertyAccessorFactory() --- 16,22 ---- private static readonly IPropertyAccessor fieldCamelCaseUnderscoreAccessor = new FieldAccessor( new CamelCaseUnderscoreStrategy() ); private static readonly IPropertyAccessor fieldPascalCaseMUnderscoreAccessor = new FieldAccessor( new PascalCaseMUnderscoreStrategy() ); ! private static readonly IPropertyAccessor noSetterCamelCaseAccessor = new NoSetterAccessor( new CamelCaseStrategy() ); ! private static readonly IPropertyAccessor noSetterCamelCaseUnderscoreAccessor = new NoSetterAccessor( new CamelCaseUnderscoreStrategy() ); ! private static readonly IPropertyAccessor noSetterPascalCaseMUnderscoreAccessor = new NoSetterAccessor( new PascalCaseMUnderscoreStrategy() ); private PropertyAccessorFactory() *************** *** 23,26 **** --- 25,116 ---- } + /// <summary> + /// Gets or creates the IPropertyAccessor specified by the type. + /// </summary> + /// <param name="type"></param> + /// <returns></returns> + /// <remarks> + /// <p> + /// The built in ways of accessing the values of Properties in your domain class are: + /// </p> + /// <list type="table"> + /// <listheader> + /// <term>access method</term> + /// <description>How NHibernate accesses the Mapped Class.</description> + /// </listheader> + /// <item> + /// <term>property</term> + /// <description> + /// The <c>name</c> attribute is the name of the Property. This is the + /// default implementation. + /// </description> + /// </item> + /// <item> + /// <term>field</term> + /// <description> + /// The <c>name</c> attribute is the name of the field. If you have any Properties + /// in the Mapped Class those will be bypassed and NHibernate will go straight to the + /// field. This is a good option if your setters have business rules attached to them + /// or if you don't want to expose a field through a Getter & Setter. + /// </description> + /// </item> + /// <item> + /// <term>nosetter</term> + /// <description> + /// The <c>name</c> attribute is the name of the Property. NHibernate will use the + /// Property's get method to retreive the value and will use the field + /// to set the value. This is a good option for <id> Properties because this access method + /// allow's users of the Class to get the value of the Id but not set the value. + /// </description> + /// </item> + /// <item> + /// <term>Assembly Qualified Name</term> + /// <description> + /// If NHibernate's built in <see cref="IPropertyAccessor"/>s are not what is needed for your + /// situation then you are free to build your own. Provide an Assembly Qualified Name so that + /// NHibernate can call <c>Activator.CreateInstance(AssemblyQualifiedName)</c> to create it. + /// </description> + /// </item> + /// </list> + /// <p> + /// In order for the <c>nosetter</c> to know the name of the field to access NHibernate needs to know + /// what the naming strategy is. The following naming strategies are built into NHibernate: + /// </p> + /// <list type="table"> + /// <item> + /// <term>camelcase</term> + /// <description> + /// The <c>name</c> attribute should be changed to CamelCase to find the field. + /// <c><property name="Foo" ... ></c> finds a field <c>foo</c>. + /// </description> + /// </item> + /// <item> + /// <term>camelcase-underscore</term> + /// <description> + /// The <c>name</c> attribute should be changed to CamelCase and prefixed with + /// an underscore to find the field. + /// <c><property name="Foo" ... ></c> finds a field <c>_foo</c>. + /// </description> + /// </item> + /// <item> + /// <term>pascalcase-m-underscore</term> + /// <description> + /// The <c>name</c> attribute should be changed to CamelCase to find the field. + /// <c><property name="Foo" ... ></c> finds a field <c>m_Foo</c>. + /// </description> + /// </item> + /// </list> + /// <para> + /// The naming strategy can also be appended at the end of the <c>field</c> access method. Where + /// this could be useful is a scenario where you do expose a get and set method in the Domain Class + /// but NHibernate should only use the fields. + /// </para> + /// <para> + /// With a naming strategy and a get/set for the Property available the user of the Domain Class + /// could write an Hql statement <c>from Foo as foo where foo.SomeProperty = 'a'</c>. If no naming + /// strategy was specified the Hql statement whould have to be <c>from Foo as foo where foo._someProperty</c> + /// (assuming CamelCase with an underscore field naming strategy is used). + /// </para> + /// </remarks> public static IPropertyAccessor GetPropertyAccessor(string type) { *************** *** 31,40 **** --- 121,143 ---- case "field" : return fieldAccessor; + case "field.camelcase" : return fieldCamelCaseAccessor; + case "field.camelcase-underscore" : return fieldCamelCaseUnderscoreAccessor; + case "field.pascalcase-m-underscore" : return fieldPascalCaseMUnderscoreAccessor; + + case "nosetter.camelcase" : + return noSetterCamelCaseAccessor; + + case "nosetter.camelcase-underscore" : + return noSetterCamelCaseUnderscoreAccessor; + + case "nosetter.pascalcase-m-underscore" : + return noSetterPascalCaseMUnderscoreAccessor; + } Index: PascalCaseMUnderscoreStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/PascalCaseMUnderscoreStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PascalCaseMUnderscoreStrategy.cs 23 Aug 2004 02:10:06 -0000 1.1 --- PascalCaseMUnderscoreStrategy.cs 23 Aug 2004 13:11:08 -0000 1.2 *************** *** 5,9 **** /// <summary> /// Implementation of FieldNamingStrategy for fields that are prefixed with ! /// an "m_" and the PropertyName. /// </summary> public class PascalCaseMUnderscoreStrategy : IFieldNamingStrategy --- 5,9 ---- /// <summary> /// Implementation of FieldNamingStrategy for fields that are prefixed with ! /// an "m_" and the first character in PropertyName capitalized. /// </summary> public class PascalCaseMUnderscoreStrategy : IFieldNamingStrategy *************** *** 14,18 **** public string GetFieldName(string propertyName) { ! return "m_" + propertyName; } --- 14,18 ---- public string GetFieldName(string propertyName) { ! return "m_" + propertyName.Substring(0, 1).ToUpper() + propertyName.Substring(1); } Index: FieldAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldAccessor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FieldAccessor.cs 23 Aug 2004 02:10:06 -0000 1.2 --- FieldAccessor.cs 23 Aug 2004 13:11:08 -0000 1.3 *************** *** 8,14 **** /// </summary> /// <remarks> ! /// This accesses fields with the following naming convention: /// Property Name = "Id" ! /// Field Name = "id" /// </remarks> public class FieldAccessor : IPropertyAccessor --- 8,15 ---- /// </summary> /// <remarks> ! /// This accesses fields with the following naming convention unless a ! /// <see cref="IFieldNamingStrategy"/> is supplied. /// Property Name = "Id" ! /// Field Name = "Id" /// </remarks> public class FieldAccessor : IPropertyAccessor *************** *** 41,45 **** #endregion ! private static FieldInfo GetField(System.Type clazz, string fieldName) { if( clazz==null || clazz==typeof(object) ) --- 42,46 ---- #endregion ! internal static FieldInfo GetField(System.Type clazz, string fieldName) { if( clazz==null || clazz==typeof(object) ) |
From: Michael D. <mik...@us...> - 2004-08-23 02:12:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24731 Modified Files: Foo.cs FooBar.hbm.xml Fum.cs Fum.hbm.xml Master.cs MasterDetail.hbm.xml Simple.hbm.xml Log Message: Modified classes and mappings to test the access="field" and the various field naming strategies. Index: Simple.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Simple.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Simple.hbm.xml 19 Jul 2004 03:02:33 -0000 1.6 --- Simple.hbm.xml 23 Aug 2004 02:11:53 -0000 1.7 *************** *** 10,14 **** <property name="Count" column="count_" not-null="true" unique="true"/> <property name="Date" column="date_"/> ! <many-to-one name="Other"/> </class> --- 10,14 ---- <property name="Count" column="count_" not-null="true" unique="true"/> <property name="Date" column="date_"/> ! <many-to-one name="Other" access="field.camelcase"/> </class> Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FooBar.hbm.xml 21 Aug 2004 16:40:42 -0000 1.13 --- FooBar.hbm.xml 23 Aug 2004 02:11:53 -0000 1.14 *************** *** 73,81 **** <property name="Status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> <property name="Binary" column="bin_"/> ! <property name="Locale" column="`localeayzabc123!@#$`" type="locale"/> <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"/> --- 73,81 ---- <property name="Status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> <property name="Binary" column="bin_"/> ! <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> <property name="Formula" formula="1/2 * int_"/> ! <property name="Custom" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel" access="field.camelcase"> <column name="first_name" length="66"/> <column name="surname" length="66"/> *************** *** 135,138 **** --- 135,139 ---- class="NHibernate.DomainModel.Fee, NHibernate.DomainModel" outer-join="false" + access="field.camelcase-underscore" /> </component> Index: MasterDetail.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/MasterDetail.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MasterDetail.hbm.xml 28 Jul 2004 03:53:19 -0000 1.3 --- MasterDetail.hbm.xml 23 Aug 2004 02:11:53 -0000 1.4 *************** *** 16,22 **** <!--TODO: make sure this type has an equiv .net type--> <version ! name="Stamp" type="Timestamp" column="ts_" /> --- 16,23 ---- <!--TODO: make sure this type has an equiv .net type--> <version ! name="stamp" type="Timestamp" column="ts_" + access="field" /> Index: Fum.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Fum.cs 18 Jun 2004 13:48:11 -0000 1.5 --- Fum.cs 23 Aug 2004 02:11:53 -0000 1.6 *************** *** 11,15 **** private Qux[] _quxArray; private IDictionary _friends; // <set> mapping ! private DateTime _lastUpdated; public Fum() --- 11,15 ---- private Qux[] _quxArray; private IDictionary _friends; // <set> mapping ! private DateTime m_LastUpdated; public Fum() *************** *** 24,28 **** // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! _lastUpdated = DateTime.Now; FumCompositeID fid = new FumCompositeID(); --- 24,28 ---- // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! m_LastUpdated = DateTime.Now; FumCompositeID fid = new FumCompositeID(); *************** *** 152,160 **** get { ! return _lastUpdated; } set { ! _lastUpdated = value; } } --- 152,160 ---- get { ! return m_LastUpdated; } set { ! m_LastUpdated = value; } } Index: Master.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Master.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Master.cs 29 Jul 2004 13:05:28 -0000 1.3 --- Master.cs 23 Aug 2004 02:11:53 -0000 1.4 *************** *** 21,25 **** // to set it right now because it checks to see if value==null -> since this // is a struct it is not null... ! private DateTime _stamp = DateTime.Now; // private BigDecimal bigDecimal = new BigDecimal("1234.123"); TODO: how to do in .net private int _x; --- 21,25 ---- // to set it right now because it checks to see if value==null -> since this // is a struct it is not null... ! private DateTime stamp = DateTime.Now; // private BigDecimal bigDecimal = new BigDecimal("1234.123"); TODO: how to do in .net private int _x; *************** *** 91,100 **** } - public DateTime Stamp - { - get { return _stamp; } - set { _stamp = value; } - } - public int X { --- 91,94 ---- Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Foo.cs 6 Jul 2004 04:27:36 -0000 1.10 --- Foo.cs 23 Aug 2004 02:11:53 -0000 1.11 *************** *** 70,74 **** private System.Globalization.CultureInfo _locale; private String _formula; ! private string[] _custom; private int _version; private FooProxy _foo; --- 70,74 ---- private System.Globalization.CultureInfo _locale; private String _formula; ! private string[] custom; private int _version; private FooProxy _foo; *************** *** 315,320 **** public string[] Custom { ! get { return _custom; } ! set { _custom = value; } } --- 315,320 ---- public string[] Custom { ! get { return custom; } ! set { custom = value; } } *************** *** 396,400 **** _status=FooStatus.ON; _binary = System.Text.Encoding.ASCII.GetBytes( _string + "yada yada yada" ); ! _custom = new string[] { "foo", "bar" --- 396,400 ---- _status=FooStatus.ON; _binary = System.Text.Encoding.ASCII.GetBytes( _string + "yada yada yada" ); ! custom = new string[] { "foo", "bar" *************** *** 466,470 **** && ( _key.Equals(other.Key) ) && ( _locale.Equals(other.Locale) ) ! && ( ( _custom == other.Custom ) || ( _custom[0].Equals(other.Custom[0]) && _custom[1].Equals(other.Custom[1]) ) ) ; } --- 466,470 ---- && ( _key.Equals(other.Key) ) && ( _locale.Equals(other.Locale) ) ! && ( ( custom == other.Custom ) || ( custom[0].Equals(other.Custom[0]) && custom[1].Equals(other.Custom[1]) ) ) ; } Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Fum.hbm.xml 18 Jun 2004 13:48:11 -0000 1.5 --- Fum.hbm.xml 23 Aug 2004 02:11:53 -0000 1.6 *************** *** 27,31 **** <version name="LastUpdated" ! type="DateTime" /> --- 27,32 ---- <version name="LastUpdated" ! type="DateTime" ! access="field.pascalcase-m-underscore" /> |
From: Michael D. <mik...@us...> - 2004-08-23 02:10:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24450/PropertyTest Modified Files: FieldAccessorFixture.cs FieldClass.cs Added Files: CamelCaseFixture.cs CamelCaseUnderscoreFixture.cs PascalCaseMUnderscoreFixture.cs Removed Files: FieldMUnderscorePrefixAccessorFixture.cs FieldUnderscorePrefixAccessorFixture.cs Log Message: Refactored how naming strategies for fields are implemented. --- FieldUnderscorePrefixAccessorFixture.cs DELETED --- --- NEW FILE: CamelCaseFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for CamelCaseFixture. /// </summary> [TestFixture] public class CamelCaseFixture : FieldAccessorFixture { [SetUp] public override void SetUp() { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase"); _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass(2, -4, 3, 0 ); } } } Index: FieldClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/FieldClass.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldClass.cs 22 Aug 2004 06:19:46 -0000 1.1 --- FieldClass.cs 23 Aug 2004 02:10:31 -0000 1.2 *************** *** 8,26 **** public class FieldClass { private int _id; ! private int m_id; private int id; ! public FieldClass( int underscoreId, int mUnderscoreId, int Id ) { _id = underscoreId; ! m_id = mUnderscoreId; ! id = Id; } public void Increment() { _id++; ! m_id++; id++; } --- 8,29 ---- public class FieldClass { + private int Id; private int _id; ! private int m_Id; private int id; ! public FieldClass(int Id, int underscoreId, int mUnderscoreId, int camelId ) { + this.Id = Id; _id = underscoreId; ! m_Id = mUnderscoreId; ! id = camelId; } public void Increment() { + Id++; _id++; ! m_Id++; id++; } --- NEW FILE: CamelCaseUnderscoreFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for CamelCaseUnderscoreFixture. /// </summary> [TestFixture] public class CamelCaseUnderscoreFixture : FieldAccessorFixture { [SetUp] public override void SetUp() { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.camelcase-underscore"); _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass(2, 0 , -4, 3 ); } } } Index: FieldAccessorFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PropertyTest/FieldAccessorFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldAccessorFixture.cs 22 Aug 2004 06:19:46 -0000 1.1 --- FieldAccessorFixture.cs 23 Aug 2004 02:10:31 -0000 1.2 *************** *** 29,36 **** public virtual void SetUp() { ! _accessor = new FieldAccessor(); _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); ! _instance = new FieldClass(6, -1, 0); } --- 29,36 ---- public virtual void SetUp() { ! _accessor = PropertyAccessorFactory.GetPropertyAccessor("field"); _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); ! _instance = new FieldClass( 0, 6, -1, 2); } --- FieldMUnderscorePrefixAccessorFixture.cs DELETED --- --- NEW FILE: PascalCaseMUnderscoreFixture.cs --- using System; using NHibernate.Property; using NUnit.Framework; namespace NHibernate.Test.PropertyTest { /// <summary> /// Summary description for PascalCaseMUnderscoreFixture. /// </summary> [TestFixture] public class PascalCaseMUnderscoreFixture : FieldAccessorFixture { [SetUp] public override void SetUp() { _accessor = PropertyAccessorFactory.GetPropertyAccessor("field.pascalcase-m-underscore"); _getter = _accessor.GetGetter( typeof(FieldClass), "Id" ); _setter = _accessor.GetSetter( typeof(FieldClass), "Id" ); _instance = new FieldClass( 6, -12 , 0, 13); } } } |
From: Michael D. <mik...@us...> - 2004-08-23 02:10:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24450 Modified Files: NHibernate.Test-1.1.csproj Log Message: Refactored how naming strategies for fields are implemented. Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** NHibernate.Test-1.1.csproj 22 Aug 2004 06:19:45 -0000 1.34 --- NHibernate.Test-1.1.csproj 23 Aug 2004 02:10:31 -0000 1.35 *************** *** 357,376 **** /> <File ! RelPath = "PropertyTest\FieldAccessorFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\FieldClass.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\FieldMUnderscorePrefixAccessorFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\FieldUnderscorePrefixAccessorFixture.cs" SubType = "Code" BuildAction = "Compile" --- 357,381 ---- /> <File ! RelPath = "PropertyTest\CamelCaseFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\CamelCaseUnderscoreFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\FieldAccessorFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "PropertyTest\FieldClass.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "PropertyTest\PascalCaseMUnderscoreFixture.cs" SubType = "Code" BuildAction = "Compile" |
From: Michael D. <mik...@us...> - 2004-08-23 02:10:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24251/Property Modified Files: FieldAccessor.cs PropertyAccessorFactory.cs Added Files: CamelCaseStrategy.cs CamelCaseUnderscoreStrategy.cs IFieldNamingStrategy.cs PascalCaseMUnderscoreStrategy.cs Removed Files: FieldMUnderscorePrefixAccessor.cs FieldUnderscorePrefixAccessor.cs Log Message: Refactored how naming strategies for fields are implemented. Index: PropertyAccessorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/PropertyAccessorFactory.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyAccessorFactory.cs 22 Aug 2004 06:18:54 -0000 1.1 --- PropertyAccessorFactory.cs 23 Aug 2004 02:10:06 -0000 1.2 *************** *** 13,18 **** private static readonly IPropertyAccessor basicPropertyAccessor = new BasicPropertyAccessor(); private static readonly IPropertyAccessor fieldAccessor = new FieldAccessor(); ! private static readonly IPropertyAccessor fieldUnderscoreAccessor = new FieldUnderscorePrefixAccessor(); ! private static readonly IPropertyAccessor fieldMUnderscoreAccessor = new FieldMUnderscorePrefixAccessor(); --- 13,19 ---- private static readonly IPropertyAccessor basicPropertyAccessor = new BasicPropertyAccessor(); private static readonly IPropertyAccessor fieldAccessor = new FieldAccessor(); ! private static readonly IPropertyAccessor fieldCamelCaseAccessor = new FieldAccessor( new CamelCaseStrategy() ); ! private static readonly IPropertyAccessor fieldCamelCaseUnderscoreAccessor = new FieldAccessor( new CamelCaseUnderscoreStrategy() ); ! private static readonly IPropertyAccessor fieldPascalCaseMUnderscoreAccessor = new FieldAccessor( new PascalCaseMUnderscoreStrategy() ); *************** *** 30,37 **** case "field" : return fieldAccessor; ! case "field.underscore" : ! return fieldUnderscoreAccessor; ! case "field.munderscore" : ! return fieldMUnderscoreAccessor; } --- 31,40 ---- case "field" : return fieldAccessor; ! case "field.camelcase" : ! return fieldCamelCaseAccessor; ! case "field.camelcase-underscore" : ! return fieldCamelCaseUnderscoreAccessor; ! case "field.pascalcase-m-underscore" : ! return fieldPascalCaseMUnderscoreAccessor; } --- NEW FILE: CamelCaseStrategy.cs --- using System; namespace NHibernate.Property { /// <summary> /// Implementation of FieldNamingStrategy for fields that are the /// Camel Case version of the PropertyName /// </summary> public class CamelCaseStrategy : IFieldNamingStrategy { #region IFieldNamingStrategy Members public string GetFieldName(string propertyName) { return propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1); } #endregion } } --- NEW FILE: PascalCaseMUnderscoreStrategy.cs --- using System; namespace NHibernate.Property { /// <summary> /// Implementation of FieldNamingStrategy for fields that are prefixed with /// an "m_" and the PropertyName. /// </summary> public class PascalCaseMUnderscoreStrategy : IFieldNamingStrategy { #region IFieldNamingStrategy Members public string GetFieldName(string propertyName) { return "m_" + propertyName; } #endregion } } Index: FieldAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldAccessor.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldAccessor.cs 22 Aug 2004 06:18:54 -0000 1.1 --- FieldAccessor.cs 23 Aug 2004 02:10:06 -0000 1.2 *************** *** 14,18 **** public class FieldAccessor : IPropertyAccessor { ! #region IPropertyAccessor Members --- 14,28 ---- public class FieldAccessor : IPropertyAccessor { ! protected IFieldNamingStrategy namingStragety; ! ! public FieldAccessor() ! { ! } ! ! public FieldAccessor(IFieldNamingStrategy namingStragety) ! { ! this.namingStragety = namingStragety; ! } ! #region IPropertyAccessor Members *************** *** 58,64 **** /// This uses the convention that a Property named <c>Id</c> will have a field </c>id</c> /// </remarks> ! protected virtual string GetFieldName(string propertyName) { ! return propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1); } } --- 68,81 ---- /// This uses the convention that a Property named <c>Id</c> will have a field </c>id</c> /// </remarks> ! private string GetFieldName(string propertyName) { ! if(namingStragety==null) ! { ! return propertyName; ! } ! else ! { ! return namingStragety.GetFieldName(propertyName); ! } } } --- NEW FILE: CamelCaseUnderscoreStrategy.cs --- using System; namespace NHibernate.Property { /// <summary> /// Implementation of FieldNamingStrategy for fields that are prefixed with /// an underscore and the PropertyName is changed to camelCase. /// </summary> public class CamelCaseUnderscoreStrategy : IFieldNamingStrategy { #region IFieldNamingStrategy Members public string GetFieldName(string propertyName) { return "_" + propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1); } #endregion } } --- FieldUnderscorePrefixAccessor.cs DELETED --- --- FieldMUnderscorePrefixAccessor.cs DELETED --- --- NEW FILE: IFieldNamingStrategy.cs --- using System; namespace NHibernate.Property { /// <summary> /// Summary description for IFieldNamingStrategy. /// </summary> public interface IFieldNamingStrategy { /// <summary> /// Converts the Property's name into a Field name /// </summary> /// <param name="propertyName">The name of the Property.</param> /// <returns>The name of the Field.</returns> string GetFieldName(string propertyName); } } |
From: Michael D. <mik...@us...> - 2004-08-23 02:10:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24251 Modified Files: NHibernate-1.1.csproj Log Message: Refactored how naming strategies for fields are implemented. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** NHibernate-1.1.csproj 22 Aug 2004 06:39:22 -0000 1.39 --- NHibernate-1.1.csproj 23 Aug 2004 02:10:05 -0000 1.40 *************** *** 1339,1353 **** /> <File ! RelPath = "Property\FieldAccessor.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Property\FieldGetter.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Property\FieldMUnderscorePrefixAccessor.cs" SubType = "Code" BuildAction = "Compile" --- 1339,1358 ---- /> <File ! RelPath = "Property\CamelCaseStrategy.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Property\CamelCaseUnderscoreStrategy.cs" SubType = "Code" BuildAction = "Compile" /> <File ! RelPath = "Property\FieldAccessor.cs" ! SubType = "Code" ! BuildAction = "Compile" ! /> ! <File ! RelPath = "Property\FieldGetter.cs" SubType = "Code" BuildAction = "Compile" *************** *** 1359,1363 **** /> <File ! RelPath = "Property\FieldUnderscorePrefixAccessor.cs" SubType = "Code" BuildAction = "Compile" --- 1364,1368 ---- /> <File ! RelPath = "Property\IFieldNamingStrategy.cs" SubType = "Code" BuildAction = "Compile" *************** *** 1379,1382 **** --- 1384,1392 ---- /> <File + RelPath = "Property\PascalCaseMUnderscoreStrategy.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Property\PropertyAccessorFactory.cs" SubType = "Code" |