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-25 20:38:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22086/NHibernate/Id Modified Files: TableGenerator.cs Log Message: TableGenerator now works with Drivers that don't support "?" as the parameter. It uses a SqlString instead of string holding sql. Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TableGenerator.cs 10 Apr 2004 05:34:15 -0000 1.7 --- TableGenerator.cs 25 Jun 2004 20:38:46 -0000 1.8 *************** *** 6,9 **** --- 6,10 ---- using NHibernate.Dialect; using NHibernate.Engine; + using NHibernate.SqlCommand; using NHibernate.SqlTypes; using NHibernate.Type; *************** *** 11,15 **** ! namespace NHibernate.Id { /// <summary> /// An <c>IIdentifierGenerator</c> that uses a database table to store the last --- 12,17 ---- ! namespace NHibernate.Id ! { /// <summary> /// An <c>IIdentifierGenerator</c> that uses a database table to store the last *************** *** 42,46 **** private string columnName; private string query; ! private string update; public virtual void Configure(IType type, IDictionary parms, Dialect.Dialect dialect) --- 44,49 ---- private string columnName; private string query; ! ! private SqlString updateSql; public virtual void Configure(IType type, IDictionary parms, Dialect.Dialect dialect) *************** *** 54,58 **** query = "select " + columnName + " from " + tableName; if ( dialect.SupportsForUpdate ) query += " for update"; ! update = "update " + tableName + " set " + columnName + " = " + StringHelper.SqlParameter + " where " + columnName + " = " + StringHelper.SqlParameter; } --- 57,82 ---- query = "select " + columnName + " from " + tableName; if ( dialect.SupportsForUpdate ) query += " for update"; ! ! // build the sql string for the Update since it uses parameters ! Parameter setParam = new Parameter(); ! setParam.Name = columnName; ! setParam.DbType = DbType.Int32; ! ! Parameter whereParam = new Parameter(); ! whereParam.Name = columnName; ! whereParam.DbType = DbType.Int32; ! ! SqlStringBuilder builder = new SqlStringBuilder(); ! builder.Add("update " + tableName + " set ") ! .Add(columnName) ! .Add(" = ") ! .Add(setParam) ! .Add(" where ") ! .Add(columnName) ! .Add(" = ") ! .Add(whereParam); ! ! updateSql = builder.ToSqlString(); ! } *************** *** 100,118 **** } ! IDbCommand ups = conn.CreateCommand(); ! ups.CommandText = update; ! ups.CommandType = CommandType.Text; ups.Transaction = trans; try { ! IDbDataParameter parm1 = ups.CreateParameter(); ! parm1.DbType = DbType.Int32; ! parm1.Value = result + 1; ! ups.Parameters.Add(parm1); ! IDbDataParameter parm2 = ups.CreateParameter(); ! parm2.DbType = DbType.Int32; ! parm2.Value = result; ! ups.Parameters.Add(parm2); rows = ups.ExecuteNonQuery(); } --- 124,137 ---- } ! ! IDbCommand ups = updateSql.BuildCommand(session.Factory.ConnectionProvider.Driver); ! ups.Connection = conn; ups.Transaction = trans; try { ! ((IDbDataParameter)ups.Parameters[0]).Value = result + 1; ! ((IDbDataParameter)ups.Parameters[1]).Value = result; ! rows = ups.ExecuteNonQuery(); } |
From: Michael D. <mik...@us...> - 2004-06-25 20:37:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21764/NHibernate/Collection Modified Files: CollectionPersister.cs Log Message: Fixed problem with WriteRowSelect writing a value to a nonexistant param index. Index: CollectionPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CollectionPersister.cs 30 Apr 2004 14:14:39 -0000 1.22 --- CollectionPersister.cs 25 Jun 2004 20:37:26 -0000 1.23 *************** *** 470,474 **** private void WriteRowSelect(IDbCommand st, object idx, ISessionImplementor session) { ! rowSelectType.NullSafeSet(st, idx, keyColumnNames.Length, session); } --- 470,474 ---- private void WriteRowSelect(IDbCommand st, object idx, ISessionImplementor session) { ! rowSelectType.NullSafeSet(st, idx, (HasIdentifier ? 0 : keyColumnNames.Length), session); } |
From: Michael D. <mik...@us...> - 2004-06-25 20:35:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21338/NHibernate/Dialect Modified Files: Dialect.cs Log Message: Changed default value of SupportsForUpdateOf to be false - that is what h2.0.3 had it as and I don't know why we would be different. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Dialect.cs 19 May 2004 04:14:18 -0000 1.31 --- Dialect.cs 25 Jun 2004 20:35:02 -0000 1.32 *************** *** 87,95 **** /// <summary> ! /// Does this dialect support the <c>FOR UDPATE</c> syntax? /// </summary> public virtual bool SupportsForUpdateOf { ! get { return true; } } --- 87,95 ---- /// <summary> ! /// Does this dialect support the <c>FOR UDPATE OF</c> syntax? /// </summary> public virtual bool SupportsForUpdateOf { ! get { return false; } } |
From: Michael D. <mik...@us...> - 2004-06-25 20:33:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20937/NHibernate/Loader Modified Files: AbstractEntityLoader.cs CollectionLoader.cs Loader.cs OneToManyLoader.cs OuterJoinLoader.cs Log Message: Renamed CreateLockModeArray to follow .net standards. Trying to hunt down what is causing problem in QueryLockMode test. Added ApplyLocks to PrepareQueryStatement Index: CollectionLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/CollectionLoader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CollectionLoader.cs 2 Apr 2004 15:55:48 -0000 1.6 --- CollectionLoader.cs 25 Jun 2004 20:33:02 -0000 1.7 *************** *** 77,80 **** --- 77,81 ---- classPersisters = new ILoadable[joins]; + lockModeArray = CreateLockModeArray(joins, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = (ILoadable) ((OuterJoinableAssociation) associations[i]).Subpersister; this.collectionPersister = persister; Index: AbstractEntityLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/AbstractEntityLoader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractEntityLoader.cs 19 May 2004 04:01:06 -0000 1.6 --- AbstractEntityLoader.cs 25 Jun 2004 20:33:02 -0000 1.7 *************** *** 61,65 **** classPersisters = new ILoadable[joins+1]; ! lockModeArray = createLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation)associations[i]).Subpersister; classPersisters[joins] = persister; --- 61,65 ---- classPersisters = new ILoadable[joins+1]; ! lockModeArray = CreateLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation)associations[i]).Subpersister; classPersisters[joins] = persister; *************** *** 108,112 **** classPersisters = new ILoadable[joins+1]; ! lockModeArray = createLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation)associations[i]).Subpersister; classPersisters[joins] = persister; --- 108,112 ---- classPersisters = new ILoadable[joins+1]; ! lockModeArray = CreateLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation)associations[i]).Subpersister; classPersisters[joins] = persister; Index: OuterJoinLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/OuterJoinLoader.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** OuterJoinLoader.cs 30 Apr 2004 14:06:47 -0000 1.11 --- OuterJoinLoader.cs 25 Jun 2004 20:33:02 -0000 1.12 *************** *** 477,481 **** } ! protected LockMode[] createLockModeArray(int length, LockMode lockMode) { LockMode[] lmArray = new LockMode[length]; --- 477,481 ---- } ! protected LockMode[] CreateLockModeArray(int length, LockMode lockMode) { LockMode[] lmArray = new LockMode[length]; Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Loader.cs 23 Jun 2004 21:15:56 -0000 1.23 --- Loader.cs 25 Jun 2004 20:33:02 -0000 1.24 *************** *** 185,189 **** else { ! st = PrepareQueryStatement( SQLString, values, types, namedParams, selection, false, session ); } IDataReader rs = GetResultSet(st, selection, session); --- 185,195 ---- else { ! // it is okay to convert to and from a string to SqlString and back to a string ! // because there are no parameters in the SqlString - even though there are parameters ! // in the string that contains sql. SqlString will not parse out parameters - it assumes ! // a string passed to it is a string. ! st = PrepareQueryStatement( ! ApplyLocks(new SqlString(SQLString), lockModes, session.Factory.Dialect).ToString() ! , values, types, namedParams, selection, false, session ); } IDataReader rs = GetResultSet(st, selection, session); Index: OneToManyLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/OneToManyLoader.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OneToManyLoader.cs 2 Apr 2004 15:55:48 -0000 1.6 --- OneToManyLoader.cs 25 Jun 2004 20:33:02 -0000 1.7 *************** *** 83,87 **** classPersisters = new ILoadable[joins+1]; ! lockModeArray = createLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation) associations[i]).Subpersister; classPersisters[joins] = persister; --- 83,87 ---- classPersisters = new ILoadable[joins+1]; ! lockModeArray = CreateLockModeArray(joins+1, LockMode.None); for (int i=0; i<joins; i++) classPersisters[i] = ((OuterJoinableAssociation) associations[i]).Subpersister; classPersisters[joins] = persister; |
From: Michael D. <mik...@us...> - 2004-06-25 20:31:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20613/NHibernate/SqlCommand Modified Files: Parameter.cs ParameterLength.cs ParameterPrecisionScale.cs SqlString.cs Log Message: The IDbCommand is now built by the SqlString and not the IPreparer. SqlString and Parameter* depends on IDriver not IConnectionProvider now. Index: Parameter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/Parameter.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Parameter.cs 27 May 2004 13:55:39 -0000 1.6 --- Parameter.cs 25 Jun 2004 20:31:32 -0000 1.7 *************** *** 2,6 **** using System.Data; ! using NHibernate.Connection; using NHibernate.Engine; using NHibernate.SqlTypes; --- 2,6 ---- using System.Data; ! using NHibernate.Driver; using NHibernate.Engine; using NHibernate.SqlTypes; *************** *** 36,45 **** set {this.tableAlias = value;} } - - [Obsolete("This does not handle quoted identifiers - going to use a number based name.")] - public string GetSqlName(IConnectionProvider provider){ - - return provider.Driver.FormatNameForSql(tableAlias, name); - } /// <summary> --- 36,39 ---- *************** *** 47,61 **** /// format for the SQL in the CommandText. /// </summary> ! /// <param name="provider">The ConnectionProvider that contains the Dialect.</param> /// <param name="name">The name to format for SQL.</param> /// <returns>A valid SQL string for this Parameter.</returns> ! public string GetSqlName(IConnectionProvider provider, string name) { ! return provider.Driver.FormatNameForSql(name); ! } ! ! [Obsolete("This does not handle quoted identifiers - going to use a number based name.")] ! public string GetParameterName(IConnectionProvider provider){ ! return provider.Driver.FormatNameForParameter(tableAlias, name); } --- 41,50 ---- /// format for the SQL in the CommandText. /// </summary> ! /// <param name="driver">The Driver that knows how to format the name.</param> /// <param name="name">The name to format for SQL.</param> /// <returns>A valid SQL string for this Parameter.</returns> ! public string GetSqlName(IDriver driver, string name) { ! return driver.FormatNameForSql(name); } *************** *** 64,90 **** /// format for the IDbDataParameter.Name /// </summary> ! /// <param name="provider">The ConnectionProvider that contains the Dialect.</param> /// <param name="name">The name to format for the IDbDataParameter.</param> /// <returns>A valid IDbDataParameter Name for this Parameter.</returns> ! public string GetParameterName(IConnectionProvider provider, string name) { ! return provider.Driver.FormatNameForParameter(name); } ! [Obsolete("This does not handle quoted identifiers - going to use a number based name.")] ! public virtual IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider) ! { ! IDbDataParameter param = command.CreateParameter(); ! param.DbType = dbType; ! param.ParameterName = GetParameterName(provider); ! ! return param; ! } ! ! public virtual IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider, string name) { IDbDataParameter param = command.CreateParameter(); param.DbType = dbType; ! param.ParameterName = GetParameterName(provider, name); return param; --- 53,69 ---- /// format for the IDbDataParameter.Name /// </summary> ! /// <param name="driver">The Driver that knows how to format the name.</param> /// <param name="name">The name to format for the IDbDataParameter.</param> /// <returns>A valid IDbDataParameter Name for this Parameter.</returns> ! public string GetParameterName(IDriver driver, string name) { ! return driver.FormatNameForParameter(name); } ! public virtual IDbDataParameter GetIDbDataParameter(IDbCommand command, IDriver driver, string name) { IDbDataParameter param = command.CreateParameter(); param.DbType = dbType; ! param.ParameterName = GetParameterName(driver, name); return param; Index: SqlString.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlString.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SqlString.cs 25 May 2004 17:14:27 -0000 1.6 --- SqlString.cs 25 Jun 2004 20:31:32 -0000 1.7 *************** *** 1,5 **** --- 1,8 ---- using System; + using System.Data; using System.Text; + using NHibernate.Driver; + namespace NHibernate.SqlCommand { *************** *** 49,53 **** } ! #region object Members --- 52,93 ---- } ! /// <summary> ! /// Builds an IDbCommand using the Driver to help format the Sql and Parameters ! /// </summary> ! /// <param name="driver">The Driver to use to create the Sql and Parameters.</param> ! /// <returns>An IDbCommand with its CommandText and ParametersCollection populated.</returns> ! public IDbCommand BuildCommand(IDriver driver) ! { ! int paramIndex = 0; ! IDbCommand cmd = driver.CreateCommand(); ! ! StringBuilder builder = new StringBuilder(sqlParts.Length * 15); ! for(int i = 0; i < sqlParts.Length; i++) ! { ! object part = sqlParts[i]; ! Parameter parameter = part as Parameter; ! ! if(parameter!=null) ! { ! string paramName = "p" + paramIndex; ! builder.Append( parameter.GetSqlName(driver, paramName) ); ! IDbDataParameter dbParam = parameter.GetIDbDataParameter(cmd, driver, paramName); ! cmd.Parameters.Add(dbParam); ! ! paramIndex++; ! } ! else ! { ! builder.Append((string)part); ! } ! } ! ! cmd.CommandText = builder.ToString(); ! ! return cmd; ! } ! ! ! #region System.Object Members Index: ParameterLength.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/ParameterLength.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ParameterLength.cs 25 May 2004 17:14:27 -0000 1.4 --- ParameterLength.cs 25 Jun 2004 20:31:32 -0000 1.5 *************** *** 2,35 **** using System.Data; ! using NHibernate.Connection; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.SqlCommand { ! /// <summary> /// Extension to the Parameter class that supports Parameters with /// a Length /// </summary> ! public class ParameterLength : Parameter { private int length; ! public int Length { get {return length;} set {length = value;} } ! [Obsolete("This does not handle quoted identifiers - going to use a number based name.")] ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider) ! { ! IDbDataParameter param = base.GetIDbDataParameter (command, provider); ! param.Size = length; ! ! return param; ! } ! ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider, string name) { ! IDbDataParameter param = base.GetIDbDataParameter (command, provider, name); param.Size = length; --- 2,28 ---- using System.Data; ! using NHibernate.Driver; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.SqlCommand ! { /// <summary> /// Extension to the Parameter class that supports Parameters with /// a Length /// </summary> ! public class ParameterLength : Parameter ! { private int length; ! public int Length ! { get {return length;} set {length = value;} } ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IDriver driver, string name) { ! IDbDataParameter param = base.GetIDbDataParameter (command, driver, name); param.Size = length; *************** *** 37,45 **** } ! #region object Members public override bool Equals(object obj) { ! if(base.Equals(obj)) { ParameterLength rhs; --- 30,39 ---- } ! #region System.Object Members public override bool Equals(object obj) { ! if(base.Equals(obj)) ! { ParameterLength rhs; *************** *** 51,55 **** return this.Length.Equals(rhs.Length); } ! else { return false; } --- 45,50 ---- return this.Length.Equals(rhs.Length); } ! else ! { return false; } Index: ParameterPrecisionScale.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/ParameterPrecisionScale.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ParameterPrecisionScale.cs 25 May 2004 17:14:27 -0000 1.4 --- ParameterPrecisionScale.cs 25 Jun 2004 20:31:32 -0000 1.5 *************** *** 2,42 **** using System.Data; ! using NHibernate.Connection; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.SqlCommand { ! /// <summary> /// Extension to the Parameter class that supports Parameters with /// a Precision and a Scale /// </summary> ! public class ParameterPrecisionScale : Parameter { private byte precision; private byte scale; ! public byte Precision { get {return precision;} set {precision = value;} } ! public byte Scale { get {return scale;} set {scale = value;} } ! [Obsolete("This does not handle quoted identifiers - going to use a number based name.")] ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider) ! { ! IDbDataParameter param = base.GetIDbDataParameter (command, provider); ! param.Precision = precision; ! param.Scale = scale; ! ! return param; ! } ! ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IConnectionProvider provider, string name) { ! IDbDataParameter param = base.GetIDbDataParameter (command, provider, name); param.Precision = precision; param.Scale = scale; --- 2,35 ---- using System.Data; ! using NHibernate.Driver; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.SqlCommand ! { /// <summary> /// Extension to the Parameter class that supports Parameters with /// a Precision and a Scale /// </summary> ! public class ParameterPrecisionScale : Parameter ! { private byte precision; private byte scale; ! public byte Precision ! { get {return precision;} set {precision = value;} } ! public byte Scale ! { get {return scale;} set {scale = value;} } ! public override IDbDataParameter GetIDbDataParameter(IDbCommand command, IDriver driver, string name) { ! IDbDataParameter param = base.GetIDbDataParameter (command, driver, name); param.Precision = precision; param.Scale = scale; *************** *** 45,53 **** } ! #region object Members public override bool Equals(object obj) { ! if(base.Equals(obj)) { ParameterPrecisionScale rhs; --- 38,47 ---- } ! #region System.Object Members public override bool Equals(object obj) { ! if(base.Equals(obj)) ! { ParameterPrecisionScale rhs; *************** *** 60,64 **** && this.Scale==rhs.Scale; } ! else { return false; } --- 54,59 ---- && this.Scale==rhs.Scale; } ! else ! { return false; } |
From: Michael D. <mik...@us...> - 2004-06-25 20:29:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20048/NHibernate.DomainModel Modified Files: Abstract.cs AbstractProxy.cs Log Message: Fixed a mapping of a <set> to an IList to an IDictionary. Index: Abstract.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Abstract.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Abstract.cs 2 Jun 2004 04:53:24 -0000 1.2 --- Abstract.cs 25 Jun 2004 20:29:15 -0000 1.3 *************** *** 6,14 **** public abstract class Abstract : Foo, AbstractProxy { - - /// <summary> - /// Holds the _time - /// </summary> private DateTime _time; /// <summary> --- 6,11 ---- public abstract class Abstract : Foo, AbstractProxy { private DateTime _time; + private IDictionary _abstracts; /// <summary> *************** *** 17,47 **** public DateTime Time { ! get ! { ! return _time; ! } ! set ! { ! _time = value; ! } } ! /// <summary> ! /// Holds the _abstract ! /// </summary> ! private IList _abstracts; ! /// <summary> /// Gets or sets the _abstract /// </summary> ! public IList Abstracts { ! get ! { ! return _abstracts; ! } ! set ! { ! _abstracts = value; ! } } } --- 14,28 ---- public DateTime Time { ! get { return _time; } ! set { _time = value; } } ! /// <summary> /// Gets or sets the _abstract /// </summary> ! public IDictionary Abstracts { ! get { return _abstracts; } ! set { _abstracts = value; } } } Index: AbstractProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/AbstractProxy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractProxy.cs 2 Jun 2004 04:53:24 -0000 1.2 --- AbstractProxy.cs 25 Jun 2004 20:29:15 -0000 1.3 *************** *** 6,10 **** public interface AbstractProxy : FooProxy { ! IList Abstracts { get; --- 6,10 ---- public interface AbstractProxy : FooProxy { ! IDictionary Abstracts { get; |
From: Michael D. <mik...@us...> - 2004-06-24 15:29:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6323/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: The Session has been modified to not fail when loading an object with a proxy specified. Now it just ignores the proxy and loads the object anyway. Did this so we could start working on more of the test until I get the proxy going. This is _not_ a working proxy - it is the same as not having a proxy specified. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** SessionImpl.cs 23 Jun 2004 21:11:41 -0000 1.28 --- SessionImpl.cs 24 Jun 2004 15:29:25 -0000 1.29 *************** *** 1983,2004 **** } ! /** ! * Load the data for the object with the specified id into a newly created ! * object. A new key will be assigned to the object. If the class supports ! * lazy initialization, return a proxy instead, leaving the real work for ! * later. This should return an existing proxy where appropriate. ! */ ! private object DoLoadByClass(System.Type clazz, object id, bool checkDeleted, bool allowProxyCreation) { ! if ( log.IsDebugEnabled ) log.Debug( "loading " + MessageHelper.InfoString(clazz, id) ); IClassPersister persister = GetPersister(clazz); ! if ( !persister.HasProxy ) { // this class has no proxies (so do a shortcut) return DoLoad(clazz, id, null, LockMode.None, checkDeleted); ! } else { Key key = new Key(id, persister); object proxy = null; ! if ( GetEntity(key)!=null ) { // return existing object or initialized proxy (unless deleted) return ProxyFor( --- 1983,2014 ---- } ! /// <summary> ! /// Load the data for the object with the specified id into a newly created ! /// object. A new key will be assigned to the object. If the class supports ! /// lazy initialization, return a proxy instead, leaving the real work for ! /// later. This should return an existing proxy where appropriate. ! /// </summary> ! /// <param name="clazz"></param> ! /// <param name="id"></param> ! /// <param name="checkDeleted"></param> ! /// <param name="allowProxyCreation"></param> ! /// <returns></returns> ! private object DoLoadByClass(System.Type clazz, object id, bool checkDeleted, bool allowProxyCreation) ! { if ( log.IsDebugEnabled ) log.Debug( "loading " + MessageHelper.InfoString(clazz, id) ); IClassPersister persister = GetPersister(clazz); ! if ( !persister.HasProxy ) ! { // this class has no proxies (so do a shortcut) return DoLoad(clazz, id, null, LockMode.None, checkDeleted); ! } ! else ! { Key key = new Key(id, persister); object proxy = null; ! ! if ( GetEntity(key)!=null ) ! { // return existing object or initialized proxy (unless deleted) return ProxyFor( *************** *** 2007,2026 **** DoLoad(clazz, id, null, LockMode.None, checkDeleted) ); ! } else if ( ( proxy = proxiesByKey[key] ) != null ) { // return existing uninitizlied proxy return NarrowProxy(proxy, persister, key, null); ! } else if ( allowProxyCreation ) { ! // retunr new uninitailzed proxy ! if ( persister.HasProxy ) { ! proxy = null; //TODO: Create the proxy ! // this is the spot that is causing the problems with FooBarTest.FetchInitializedCollection ! // when the following code "Assert.IsTrue( baz.fooBag.Count==2 );" is being executed. This ! // is causing a null value to be returned when a "Proxied" version of the class is expected. ! // So the method ThrowObjectNotFound is throwing an exception because it is given a null object ! // - hence the error looks like it can't find a row in the DB. ! } ! proxiesByKey[key] = proxy; ! return proxy; ! } else { // return a newly loaded object return DoLoad(clazz, id, null, LockMode.None, checkDeleted); --- 2017,2048 ---- DoLoad(clazz, id, null, LockMode.None, checkDeleted) ); ! } ! else if ( ( proxy = proxiesByKey[key] ) != null ) ! { // return existing uninitizlied proxy return NarrowProxy(proxy, persister, key, null); ! } ! else if ( allowProxyCreation ) ! { ! ! return DoLoad(clazz, id, null, LockMode.None, checkDeleted); ! ! // return new uninitailzed proxy ! //TODO: commented this out so we could get all of the test running - this basically makes ! // the proxy of a class be ignored - which is fine until we have it working. ! // if ( persister.HasProxy ) ! // { ! // proxy = null; //TODO: Create the proxy ! // // this is the spot that is causing the problems with FooBarTest.FetchInitializedCollection ! // // when the following code "Assert.IsTrue( baz.fooBag.Count==2 );" is being executed. This ! // // is causing a null value to be returned when a "Proxied" version of the class is expected. ! // // So the method ThrowObjectNotFound is throwing an exception because it is given a null object ! // // - hence the error looks like it can't find a row in the DB. ! // } ! // proxiesByKey[key] = proxy; ! // return proxy; ! } ! else ! { // return a newly loaded object return DoLoad(clazz, id, null, LockMode.None, checkDeleted); |
From: Michael D. <mik...@us...> - 2004-06-24 15:28:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6045/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Removed an [Ignore] because instead of failing to Load an object with a proxy specified it just ignores the proxy and loads the object anyway. Did this so we could start working on more of the test until I get the proxy going. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** FooBarTest.cs 23 Jun 2004 21:12:58 -0000 1.26 --- FooBarTest.cs 24 Jun 2004 15:27:51 -0000 1.27 *************** *** 35,40 **** } [Test] - [Ignore("Fails because Proxies are not working.")] public void FetchInitializedCollection() { --- 35,46 ---- } + /// <summary> + /// + /// </summary> + /// <remarks> + /// This test is still not completely working because it depends on Proxies which + /// has not been implemented yet. + /// </remarks> [Test] public void FetchInitializedCollection() { |
From: Michael D. <mik...@us...> - 2004-06-24 15:26:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5621/NHibernate/Collection Modified Files: ArrayHolder.cs Log Message: ToArray was not working when a null element was added to the array. I was getting a cast exception - this was appearing with null elements going into a DateTime array. Index: ArrayHolder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/ArrayHolder.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ArrayHolder.cs 28 Mar 2004 06:01:29 -0000 1.8 --- ArrayHolder.cs 24 Jun 2004 15:26:12 -0000 1.9 *************** *** 146,157 **** public override void EndRead(CollectionPersister persister, object owner) { ! for(int i = 0 ;i < tempListIdentifier.Count; i++) { object element = persister.ElementType.ResolveIdentifier(tempListIdentifier[i], session, owner); tempList[i] = element; } - array = ((ArrayList)tempList).ToArray(elementClass); //tempList = null; //tempListIdentifier = null; --- 146,158 ---- public override void EndRead(CollectionPersister persister, object owner) { ! array = System.Array.CreateInstance(elementClass, tempListIdentifier.Count); ! for(int i = 0 ;i < tempListIdentifier.Count; i++) { object element = persister.ElementType.ResolveIdentifier(tempListIdentifier[i], session, owner); + ( (System.Array)array ).SetValue(element, i); tempList[i] = element; } //tempList = null; //tempListIdentifier = null; |
From: Michael D. <mik...@us...> - 2004-06-24 15:24:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5178/NHibernate/Driver Modified Files: NDataReader.cs Log Message: Fixed problem where a read-only property and a read-write property that referred to the same column causes the sql select to have the same column in there twice. NDataReader was throwing up on that because it used Add and the column already existed in the dictionary. Index: NDataReader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NDataReader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NDataReader.cs 6 May 2004 13:15:13 -0000 1.1 --- NDataReader.cs 24 Jun 2004 15:23:52 -0000 1.2 *************** *** 357,361 **** { string fieldName = reader.GetName(i); ! fieldNameToIndex.Add( fieldName, i); fieldIndexToName.Add(fieldName); fieldTypes.Add( reader.GetFieldType(i) ); --- 357,361 ---- { string fieldName = reader.GetName(i); ! fieldNameToIndex[fieldName] = i; fieldIndexToName.Add(fieldName); fieldTypes.Add( reader.GetFieldType(i) ); |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4847/NHibernate.DomainModel Modified Files: Baz.hbm.xml Fee.hbm.xml Foo.cs FooBar.hbm.xml FooComponent.cs FooProxy.cs Glarch.cs Glarch.hbm.xml GlarchProxy.cs Log Message: Modified properties and mappings to follow .net standard Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FooBar.hbm.xml 2 Jun 2004 04:53:24 -0000 1.6 --- FooBar.hbm.xml 24 Jun 2004 15:22:07 -0000 1.7 *************** *** 2,140 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <import class="NHibernate.DomainModel.Result, NHibernate.DomainModel"/> ! <import class="NHibernate.DomainModel.Named, NHibernate.DomainModel"/> ! <class ! name="NHibernate.DomainModel.Foo, NHibernate.DomainModel" ! table="`foos`" ! proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" ! discriminator-value="F" ! dynamic-update="true" ! dynamic-insert="true"> ! <jcs-cache usage="nonstrict-read-write"/> ! <id name="key" type="String"> ! <column name="`foo_id`" length="36"/> ! <generator class="uuid.hex"> ! <param name="seperator">:</param> ! </generator> ! </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"/> ! <element column="byte_" type="Byte"/> ! </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="null" 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" column="count_" type="Int32" not-null="true"/> ! <property name="name"> ! <column name="name_" length="32" not-null="true"/> ! </property> ! <many-to-one name="glarch" column="g__" cascade="all" class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" outer-join="true"/> ! <property name="null" column="cmpnt_null_"/> ! <component name="subcomponent"> ! <property name="count" column="subcount"/> ! <property name="name" column="subname"/> ! <array name="importantDates" table="foo_times"> ! <key column="foo_id"/> ! <index column="i"/> ! <element column="date_" type="Time"/> ! </array> ! <many-to-one name="fee" column="fee_sub" cascade="all" class="NHibernate.DomainModel.Fee, NHibernate.DomainModel" outer-join="false"/> ! </component> ! <array name="importantDates" table="foo_dates"> ! <key column="foo_id"/> ! <index column="i"/> ! <element column="date_" type="DateTime"/> ! </array> ! </component> ! <component name="nullComponent"> ! <property name="name" column="null_cmpnt_"/> ! </component> ! <subclass ! name="NHibernate.DomainModel.Trivial, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" ! discriminator-value="T"/> ! <subclass ! name="NHibernate.DomainModel.Abstract, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.AbstractProxy, NHibernate.DomainModel" ! discriminator-value="null"> ! <set name="Abstracts"> ! <key column="abstract_id"/> ! <one-to-many class="NHibernate.DomainModel.Abstract, NHibernate.DomainModel"/> ! </set> ! <property name="Time" column="the_time"/> ! <subclass ! name="NHibernate.DomainModel.Bar, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.BarProxy, NHibernate.DomainModel" ! discriminator-value="B"> ! <many-to-one name="Baz"/> ! <property name="BarString"> ! <column name="bar_String" length="24"/> ! </property> ! <property name="Name" column="name_name"/> ! <component name="BarComponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <parent name="parent"/> ! <property name="count" column="bar_count"/> ! <property name="name" length="64"/> ! <array name ="importantDates"> ! <key column="id" /> ! <index column="i"/> ! <element column="date_" type="DateTime"/> ! </array> ! </component> ! <any name="Object" id-type="Int64" cascade="all"> ! <column name="clazz" length="100"/> ! <column name="gen_id"/> ! </any> ! </subclass> ! </subclass> </class> --- 2,188 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <import class="NHibernate.DomainModel.Result, NHibernate.DomainModel"/> ! <import class="NHibernate.DomainModel.Named, NHibernate.DomainModel"/> ! <class ! name="NHibernate.DomainModel.Foo, NHibernate.DomainModel" ! table="`foos`" ! proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" ! discriminator-value="F" ! dynamic-update="true" ! dynamic-insert="true" ! > ! <jcs-cache usage="nonstrict-read-write"/> ! <id name="key" type="String"> ! <column name="`foo_id`" length="36"/> ! <generator class="uuid.hex"> ! <param name="seperator">:</param> ! </generator> ! </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"/> ! <element column="byte_" type="Byte"/> ! </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" ! column="count_" ! type="Int32" ! not-null="true" ! /> ! <property ! name="Name" ! > ! <column ! name="name_" ! length="32" ! not-null="true" ! /> ! </property> ! <many-to-one ! name="Glarch" ! column="g__" ! cascade="all" ! class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" ! outer-join="true" ! /> ! ! <property ! name="NullString" ! column="cmpnt_null_" ! /> ! ! <component ! name="Subcomponent" ! > ! <property ! name="Count" ! column="subcount" ! /> ! <property ! name="Name" ! column="subname" ! /> ! <array name="ImportantDates" table="foo_times"> ! <key column="foo_id"/> ! <index column="i"/> ! <element column="date_" type="Time"/> ! </array> ! ! <many-to-one ! name="Fee" ! column="fee_sub" ! cascade="all" ! class="NHibernate.DomainModel.Fee, NHibernate.DomainModel" ! outer-join="false" ! /> ! </component> ! ! <array ! name="ImportantDates" ! table="foo_dates" ! > ! <key column="foo_id"/> ! <index column="i"/> ! <element column="date_" type="DateTime"/> ! </array> ! ! </component> ! ! <component name="nullComponent"> ! <property name="Name" column="null_cmpnt_"/> ! </component> ! ! <subclass ! name="NHibernate.DomainModel.Trivial, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.FooProxy, NHibernate.DomainModel" ! discriminator-value="T" ! /> ! <subclass ! name="NHibernate.DomainModel.Abstract, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.AbstractProxy, NHibernate.DomainModel" ! discriminator-value="null" ! > ! <set name="Abstracts"> ! <key column="abstract_id"/> ! <one-to-many class="NHibernate.DomainModel.Abstract, NHibernate.DomainModel"/> ! </set> ! <property name="Time" column="the_time"/> ! <subclass ! name="NHibernate.DomainModel.Bar, NHibernate.DomainModel" ! proxy="NHibernate.DomainModel.BarProxy, NHibernate.DomainModel" ! discriminator-value="B"> ! <many-to-one name="Baz"/> ! <property name="BarString"> ! <column name="bar_String" length="24"/> ! </property> ! <property name="Name" column="name_name"/> ! <component name="BarComponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <parent name="Parent"/> ! <property name="Count" column="bar_count"/> ! <property name="Name" length="64"/> ! <array name="ImportantDates"> ! <key column="id" /> ! <index column="i"/> ! <element column="date_" type="DateTime"/> ! </array> ! </component> ! <any name="Object" id-type="Int64" cascade="all"> ! <column name="clazz" length="100"/> ! <column name="gen_id"/> ! </any> ! </subclass> ! </subclass> </class> Index: Glarch.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Glarch.cs 3 Jun 2004 14:54:39 -0000 1.4 --- Glarch.cs 24 Jun 2004 15:22:07 -0000 1.5 *************** *** 15,19 **** private IList _fooComponents; private GlarchProxy[] _proxyArray; ! private IList _proxySet; private object _dynaBean; private string _immutable; --- 15,19 ---- private IList _fooComponents; private GlarchProxy[] _proxyArray; ! private IDictionary _proxySet; private object _dynaBean; private string _immutable; *************** *** 23,33 **** private Multiplicity _multiple; ! public int x { get { return _x; } ! set { this._x = value; } } ! public int version { get { return _version; } --- 23,33 ---- private Multiplicity _multiple; ! public int X { get { return _x; } ! set { _x = value; } } ! public int Version { get { return _version; } *************** *** 40,44 **** /// Gets or sets the _next /// </summary> ! public GlarchProxy next { get { return _next; } --- 40,44 ---- /// Gets or sets the _next /// </summary> ! public GlarchProxy Next { get { return _next; } *************** *** 50,54 **** /// Gets or sets the _order /// </summary> ! public short order { get { return _order; } --- 50,54 ---- /// Gets or sets the _order /// </summary> ! public short Order { get { return _order; } *************** *** 60,64 **** /// Gets or sets the _strings /// </summary> ! public IList strings { get { return _strings; } --- 60,64 ---- /// Gets or sets the _strings /// </summary> ! public IList Strings { get { return _strings; } *************** *** 70,74 **** /// Gets or sets the _stringSets /// </summary> ! public IDictionary stringSets { get { return _stringSets; } --- 70,75 ---- /// Gets or sets the _stringSets /// </summary> ! //TODO: figure out why this is not in the mapping??? ! public IDictionary StringSets { get { return _stringSets; } *************** *** 80,84 **** /// Gets or sets the _fooComponents /// </summary> ! public IList fooComponents { get { return _fooComponents; } --- 81,85 ---- /// Gets or sets the _fooComponents /// </summary> ! public IList FooComponents { get { return _fooComponents; } *************** *** 90,94 **** /// Gets or sets the _proxyArray /// </summary> ! public GlarchProxy[] proxyArray { get { return _proxyArray; } --- 91,95 ---- /// Gets or sets the _proxyArray /// </summary> ! public GlarchProxy[] ProxyArray { get { return _proxyArray; } *************** *** 100,104 **** /// Gets or sets the _proxySet /// </summary> ! public IList proxySet { get { return _proxySet; } --- 101,105 ---- /// Gets or sets the _proxySet /// </summary> ! public IDictionary ProxySet { get { return _proxySet; } *************** *** 161,165 **** /// Gets or sets the _immutable /// </summary> ! public string immutable { get { return _immutable; } --- 162,166 ---- /// Gets or sets the _immutable /// </summary> ! public string Immutable { get { return _immutable; } *************** *** 170,174 **** /// Gets or sets the _derivedVersion /// </summary> ! public int derivedVersion { get { return _derivedVersion; } --- 171,175 ---- /// Gets or sets the _derivedVersion /// </summary> ! public int DerivedVersion { get { return _derivedVersion; } *************** *** 179,183 **** /// Gets or sets the _any /// </summary> ! public object any { get { return _any; } --- 180,184 ---- /// Gets or sets the _any /// </summary> ! public object Any { get { return _any; } *************** *** 190,194 **** /// Gets or sets the _multiple /// </summary> ! public Multiplicity multiple { get { return _multiple; } --- 191,195 ---- /// Gets or sets the _multiple /// </summary> ! public Multiplicity Multiple { get { return _multiple; } *************** *** 196,203 **** } ! public new string name { get { return base._name; } ! set { this._name = value; } } --- 197,204 ---- } ! public new string Name { get { return base._name; } ! set { _name = value; } } Index: FooComponent.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooComponent.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FooComponent.cs 8 Apr 2004 16:37:39 -0000 1.2 --- FooComponent.cs 24 Jun 2004 15:22:07 -0000 1.3 *************** *** 1,12 **** - //------------------------------------------------------------------------------ - // <autogenerated> - // This code was generated by a tool. - // Runtime Version: v1.1.4322 - // - // Changes to this file may cause incorrect behavior and will be lost if - // the code is regenerated. - // </autogenerated> - //------------------------------------------------------------------------------ - using System; --- 1,2 ---- *************** *** 60,81 **** public FooComponent(String name, Int32 count) { ! this._name = name; ! this._count = count; } public FooComponent(String name, int count, DateTime[] dates, FooComponent subcomponent) { ! this.name = name; ! this.count = count; ! this.importantDates = dates; ! this.subcomponent = subcomponent; } public FooComponent(String name, int count, DateTime[] dates, FooComponent subcomponent, Fee fee) { ! this.name = name; ! this.count = count; ! this.importantDates = dates; ! this.subcomponent = subcomponent; ! this.fee = fee; } --- 50,71 ---- public FooComponent(String name, Int32 count) { ! _name = name; ! _count = count; } public FooComponent(String name, int count, DateTime[] dates, FooComponent subcomponent) { ! _name = name; ! _count = count; ! _importantDates = dates; ! _subcomponent = subcomponent; } public FooComponent(String name, int count, DateTime[] dates, FooComponent subcomponent, Fee fee) { ! _name = name; ! _count = count; ! _importantDates = dates; ! _subcomponent = subcomponent; ! _fee = fee; } *************** *** 83,99 **** #region Properties /// <summary> /// Get/set for name /// </summary> ! public String name { ! get ! { ! return this._name; ! } ! set ! { ! this._name = value; ! } } --- 73,84 ---- #region Properties + /// <summary> /// Get/set for name /// </summary> ! public String Name { ! get { return _name; } ! set { _name = value; } } *************** *** 101,144 **** /// Get/set for count /// </summary> ! public Int32 count { ! get ! { ! return this._count; ! } ! set ! { ! this._count = value; ! } } ! public DateTime[] importantDates { ! get ! { ! return _importantDates; ! } ! set ! { ! this._importantDates = value; ! } } ! public FooComponent subcomponent { ! get ! { ! return _subcomponent; ! } ! set ! { ! this._subcomponent = value; ! } } ! private String @null { ! get ! { ! return null; ! } ! set { if (value!=null) --- 86,111 ---- /// Get/set for count /// </summary> ! public Int32 Count { ! get { return _count; } ! set { _count = value; } } ! ! public DateTime[] ImportantDates { ! get { return _importantDates; } ! set { _importantDates = value; } } ! ! public FooComponent Subcomponent { ! get { return _subcomponent; } ! set { _subcomponent = value; } } ! ! private String NullString { ! get { return null; } ! set { if (value!=null) *************** *** 146,215 **** } } ! public Fee fee { ! get ! { ! return _fee; ! } ! set ! { ! this._fee = value; ! } } ! public GlarchProxy glarch { ! get ! { ! return _glarch; ! } ! set ! { ! this._glarch = value; ! } } ! public FooProxy parent { ! get ! { ! return _parent; ! } set { if (value==null) throw new ArgumentNullException("null parent set"); ! this._parent = value; } } ! public Baz baz { ! get ! { ! return _baz; ! } ! set ! { ! this._baz = value; ! } } #endregion public override bool Equals(object obj) { FooComponent fc = (FooComponent) obj; ! return count==fc.count; } public override int GetHashCode() { ! return count; } public override string ToString() { ! String result = "FooComponent: " + name + "=" + count; result+="; dates=["; if ( _importantDates!=null) --- 113,164 ---- } } ! ! public Fee Fee { ! get { return _fee; } ! set { this._fee = value; } } ! public GlarchProxy Glarch { ! get { return _glarch; } ! set { _glarch = value; } } ! public FooProxy Parent { ! get { return _parent; } set { if (value==null) throw new ArgumentNullException("null parent set"); ! _parent = value; } } ! public Baz Baz { ! get { return _baz; } ! set { _baz = value; } } #endregion + #region System.Object Members + public override bool Equals(object obj) { FooComponent fc = (FooComponent) obj; ! return Count==fc.Count; } public override int GetHashCode() { ! return Count; } public override string ToString() { ! String result = "FooComponent: " + Name + "=" + Count; result+="; dates=["; if ( _importantDates!=null) *************** *** 221,230 **** } result+="]"; ! if ( subcomponent!=null ) { ! result+= " (" + subcomponent + ")"; } return result; } } } \ No newline at end of file --- 170,181 ---- } result+="]"; ! if ( Subcomponent!=null ) { ! result+= " (" + Subcomponent + ")"; } return result; } + #endregion + } } \ No newline at end of file Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Foo.cs 26 Apr 2004 03:47:32 -0000 1.7 --- Foo.cs 24 Jun 2004 15:22:07 -0000 1.8 *************** *** 368,372 **** /// Get/set for null /// </summary> ! public int @null { get --- 368,372 ---- /// Get/set for null /// </summary> ! public int NullInt32 { get *************** *** 686,690 **** }; component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, DateTime.MinValue, new DateTime() }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3), DateTime.MinValue }, null ) ); ! component.glarch = new Glarch(); dependent = new Fee(); dependent.fi = "belongs to foo # " + key; --- 686,690 ---- }; component = new FooComponent("foo", 12, new DateTime[] { _date, _timestamp, DateTime.MinValue, new DateTime() }, new FooComponent("bar", 666, new DateTime[] { new DateTime(1999,12,3), DateTime.MinValue }, null ) ); ! component.Glarch = new Glarch(); dependent = new Fee(); dependent.fi = "belongs to foo # " + key; Index: GlarchProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/GlarchProxy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GlarchProxy.cs 8 Apr 2004 14:59:32 -0000 1.1 --- GlarchProxy.cs 24 Jun 2004 15:22:07 -0000 1.2 *************** *** 6,20 **** public interface GlarchProxy { ! int version { get; set; } ! int derivedVersion { get; } ! string name { get; --- 6,20 ---- public interface GlarchProxy { ! int Version { get; set; } ! int DerivedVersion { get; } ! string Name { get; *************** *** 22,26 **** } ! GlarchProxy next { get; --- 22,26 ---- } ! GlarchProxy Next { get; *************** *** 28,32 **** } ! short order { get; --- 28,32 ---- } ! short Order { get; *************** *** 34,38 **** } ! IList strings { get; --- 34,38 ---- } ! IList Strings { get; *************** *** 44,73 **** set; } ! IDictionary stringSets { get; set; } ! IList fooComponents { get; set; } ! GlarchProxy[] proxyArray { get; set; } ! IList proxySet { get; set; } ! Multiplicity multiple { get; set; } ! object any { get; --- 44,73 ---- set; } ! IDictionary StringSets { get; set; } ! IList FooComponents { get; set; } ! GlarchProxy[] ProxyArray { get; set; } ! IDictionary ProxySet { get; set; } ! Multiplicity Multiple { get; set; } ! object Any { get; Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Baz.hbm.xml 8 Jun 2004 11:46:06 -0000 1.11 --- Baz.hbm.xml 24 Jun 2004 15:22:06 -0000 1.12 *************** *** 91,96 **** class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" > ! <parent name="baz"/> ! <property name="name"> <column name="name" --- 91,96 ---- class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" > ! <parent name="Baz"/> ! <property name="Name"> <column name="name" *************** *** 99,112 **** </property> <property ! name="count" column="count_" type="Int32" /> <nested-composite-element ! name="subcomponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" > ! <property name="name" column="x_"/> ! <property name="count" column="y_" type="Int32"/> </nested-composite-element> </composite-element> --- 99,112 ---- </property> <property ! name="Count" column="count_" type="Int32" /> <nested-composite-element ! name="Subcomponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" > ! <property name="Name" column="x_"/> ! <property name="Count" column="y_" type="Int32"/> </nested-composite-element> </composite-element> *************** *** 169,177 **** > <key-property ! name="name" length="32" /> <key-property ! name="count" column="count_" type="Int32" --- 169,177 ---- > <key-property ! name="Name" length="32" /> <key-property ! name="Count" column="count_" type="Int32" *************** *** 260,265 **** <index column="i"/> <composite-element class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <property name="name"/> ! <property name="count" column="count_" type="Int32"/> </composite-element> </list> --- 260,265 ---- <index column="i"/> <composite-element class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <property name="Name"/> ! <property name="Count" column="count_" type="Int32"/> </composite-element> </list> Index: FooProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooProxy.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FooProxy.cs 3 Jun 2004 03:23:33 -0000 1.2 --- FooProxy.cs 24 Jun 2004 15:22:07 -0000 1.3 *************** *** 61,65 **** } ! int @null { get; --- 61,65 ---- } ! int NullInt32 { get; Index: Fee.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fee.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Fee.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 --- Fee.hbm.xml 24 Jun 2004 15:22:07 -0000 1.4 *************** *** 15,20 **** </set> <component name="compon" update="false"> ! <property name="name" /> ! <property name="null" column="null_prop" /> </component> </class> --- 15,20 ---- </set> <component name="compon" update="false"> ! <property name="Name" /> ! <property name="NullString" column="null_prop" /> </component> </class> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Glarch.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 --- Glarch.hbm.xml 24 Jun 2004 15:22:07 -0000 1.4 *************** *** 1,54 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" table="`glarchez`" ! proxy="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" dynamic-update="true"> <!--<jcs-cache usage="read-write"/>--> ! <id type="String" column="tha_key" length="32"> <generator class="uuid.hex" /> </id> ! <version name="version" /> ! <property name="name" column="namecvbnmasdf" /> <!-- <property name="currency"/> --> ! <many-to-one name="next" column="next_" class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> ! <property name="order" column="order_" /> <dynabean name="dynaBean" dynaclass="foo"> <property name="foo" type="String" /> <property name="bar" type="Int32" /> </dynabean> ! <property name="x" /> ! <list name="strings"> <key column="glarch_key" /> <index column="`!@# i`" /> <element type="String" column="`tha_stryng`" /> </list> ! <list name="fooComponents" lazy="true" cascade="all"> <key column="glarch_key" /> <index column="tha_indecks" /> ! <composite-element class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <property name="name" column="name_" /> ! <property name="count" column="count_" /> ! <nested-composite-element name="subcomponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> ! <property name="name" column="x_" /> ! <property name="count" column="y_" /> </nested-composite-element> ! <many-to-one name="fee" cascade="all" outer-join="true" /> </composite-element> </list> ! <array name="proxyArray" element-class="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel"> <key column="array_key" /> <index column="array_indecks" /> <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </array> ! <set name="proxySet"> <key column="set_key" /> <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </set> ! <property name="immutable" update="false" /> ! <property name="derivedVersion" insert="false" update="false" column="version" /> ! <any name="any" id-type="System.Object"> <column name="`any_id of object`" /> <column name="`any_class of object`" /> </any> ! <property name="multiple" type="NHibernate.DomainModel.MultiplicityType, NHibernate.DomainModel"> <column name="count_" /> <column name="glarch_" /> --- 1,125 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" ! table="`glarchez`" ! proxy="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" ! dynamic-update="true" ! > ! <!--<jcs-cache usage="read-write"/>--> ! <id ! type="String" ! column="tha_key" ! length="32" ! > <generator class="uuid.hex" /> </id> ! ! <version ! name="Version" ! column="version" ! /> ! <!-- ! MikeD added column="version" because it was defaulting to "Version" and was ! creating a "Version" and "version" column - sql server is not case insensitive ! so it was making duplicate columns ! --> ! ! <property ! name="Name" ! column="namecvbnmasdf" ! /> ! <!-- <property name="currency"/> --> ! <many-to-one ! name="Next" ! column="next_" ! class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" ! /> ! ! <property ! name="Order" ! column="order_" ! /> ! <dynabean name="dynaBean" dynaclass="foo"> <property name="foo" type="String" /> <property name="bar" type="Int32" /> </dynabean> ! ! <property name="X" /> ! ! <list name="Strings"> <key column="glarch_key" /> <index column="`!@# i`" /> <element type="String" column="`tha_stryng`" /> </list> ! ! <list ! name="FooComponents" ! lazy="true" ! cascade="all" ! > <key column="glarch_key" /> <index column="tha_indecks" /> ! <composite-element ! class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" ! > ! <property ! name="Name" ! column="name_" ! /> ! <property name="Count" column="count_" /> ! <nested-composite-element ! name="Subcomponent" ! class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel" ! > ! <property ! name="Name" ! column="x_" ! /> ! <property ! name="Count" ! column="y_" ! /> </nested-composite-element> ! <many-to-one name="Fee" cascade="all" outer-join="true" /> </composite-element> </list> ! <array ! name="ProxyArray" ! element-class="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" ! > <key column="array_key" /> <index column="array_indecks" /> <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </array> ! <set name="ProxySet"> <key column="set_key" /> <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </set> ! ! <property ! name="Immutable" ! update="false" ! /> ! ! <property ! name="DerivedVersion" ! insert="false" ! update="false" ! column="version" ! /> ! ! <any name="Any" id-type="System.Object"> <column name="`any_id of object`" /> <column name="`any_class of object`" /> </any> ! ! <property ! name="Multiple" ! type="NHibernate.DomainModel.MultiplicityType, NHibernate.DomainModel" ! > <column name="count_" /> <column name="glarch_" /> |
From: Michael D. <mik...@us...> - 2004-06-23 21:16:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2928/NHibernate/Loader Modified Files: Loader.cs Log Message: Modified some code formatting for easier debugging and added some details to comments. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Loader.cs 20 May 2004 21:05:30 -0000 1.22 --- Loader.cs 23 Jun 2004 21:15:56 -0000 1.23 *************** *** 221,225 **** PersistentCollection rowCollection = session.GetLoadingCollection(collectionPersister, ownerKey.Identifier, row[collectionOwner]); object collectionRowKey = collectionPersister.ReadKey(rs, session); ! if(collectionRowKey!=null) rowCollection.ReadFrom(rs, CollectionPersister, row[collectionOwner]); } } --- 221,228 ---- PersistentCollection rowCollection = session.GetLoadingCollection(collectionPersister, ownerKey.Identifier, row[collectionOwner]); object collectionRowKey = collectionPersister.ReadKey(rs, session); ! if(collectionRowKey!=null) ! { ! rowCollection.ReadFrom(rs, CollectionPersister, row[collectionOwner]); ! } } } *************** *** 687,691 **** log.Info(st.CommandText); //TODO: H2.0.3 - uses session.Batcher.GetResultSet(st) instead ! // of directly executing the reader IDataReader rs = st.ExecuteReader(); --- 690,695 ---- log.Info(st.CommandText); //TODO: H2.0.3 - uses session.Batcher.GetResultSet(st) instead ! // of directly executing the reader - the Batcher can be smarter ! // about when to wrap the IDataReader in an NDataReader IDataReader rs = st.ExecuteReader(); |
From: Michael D. <mik...@us...> - 2004-06-23 21:13:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2319/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Modified hql used in test to look just like h2.0.3 since the bug in LoadingCollectionEntry fixed the problem. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** FooBarTest.cs 9 Jun 2004 01:05:46 -0000 1.25 --- FooBarTest.cs 23 Jun 2004 21:12:58 -0000 1.26 *************** *** 47,51 **** s.Save(baz); fooBag = baz.FooBag; ! s.Find("from Baz baz left join fetch fooBag"); Assert.IsTrue( NHibernate.IsInitialized(fooBag) ); Assert.IsTrue( fooBag==baz.FooBag ); --- 47,51 ---- s.Save(baz); fooBag = baz.FooBag; ! s.Find("from Baz baz left join fetch baz.FooBag"); Assert.IsTrue( NHibernate.IsInitialized(fooBag) ); Assert.IsTrue( fooBag==baz.FooBag ); *************** *** 107,111 **** s = sessions.OpenSession(); t = s.BeginTransaction(); ! result = s.CreateQuery("from Baz baz left join fetch sortablez order by baz.Name asc") .List(); b = (Baz) result[0]; --- 107,111 ---- s = sessions.OpenSession(); t = s.BeginTransaction(); ! result = s.CreateQuery("from Baz baz left join fetch baz.Sortablez order by baz.Name asc") .List(); b = (Baz) result[0]; *************** *** 157,161 **** } baz.Fees = list; ! list = s.Find("from Foo foo, Baz baz left join fetch fees"); Assert.IsTrue( NHibernate.IsInitialized( ( (Baz) ( (object[]) list[0] )[1] ).Fees ) ); s.Delete(foo); --- 157,161 ---- } baz.Fees = list; ! list = s.Find("from Foo foo, Baz baz left join fetch baz.Fees"); Assert.IsTrue( NHibernate.IsInitialized( ( (Baz) ( (object[]) list[0] )[1] ).Fees ) ); s.Delete(foo); |
From: Michael D. <mik...@us...> - 2004-06-23 21:11:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2051/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Fixed a major bug that was causing problems with fetching collections in hql. I had mistyped the parameter "collectin" to the ctor of LoadingCollectionEntry - since I was using this.collection = collection there was no problem and collection was staying null. The private vars are now prefixed with "_" and exposed via properties. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** SessionImpl.cs 24 May 2004 20:52:47 -0000 1.27 --- SessionImpl.cs 23 Jun 2004 21:11:41 -0000 1.28 *************** *** 3027,3045 **** private string loadingRole; ! private sealed class LoadingCollectionEntry { ! public PersistentCollection collection; ! public bool initialize; ! public object id; ! public object owner; ! internal LoadingCollectionEntry(PersistentCollection collection, object id) { ! this.collection = collection; ! this.id = id; } ! internal LoadingCollectionEntry(PersistentCollection collectin, object id, object owner) { ! this.collection = collection; ! this.id = id; ! this.owner = owner; } } --- 3027,3073 ---- private string loadingRole; ! private sealed class LoadingCollectionEntry ! { ! private PersistentCollection _collection; ! private bool _initialize; ! private object _id; ! private object _owner; ! internal LoadingCollectionEntry(PersistentCollection collection, object id) ! { ! _collection = collection; ! _id = id; } ! internal LoadingCollectionEntry(PersistentCollection collection, object id, object owner) ! { ! _collection = collection; ! _id = id; ! _owner = owner; ! } ! ! public PersistentCollection Collection ! { ! get { return _collection;} ! set { _collection = value; } ! } ! ! public object Id ! { ! get { return _id; } ! set { _id = value; } ! } ! ! ! public object Owner ! { ! get { return _owner; } ! set { _owner = value; } ! } ! ! public bool Initialize ! { ! get { return _initialize; } ! set { _initialize = value; } } } *************** *** 3060,3064 **** } else { ! return lce.collection; } } --- 3088,3092 ---- } else { ! return lce.Collection; } } *************** *** 3078,3082 **** } else { ! return lce.collection; } } --- 3106,3110 ---- } else { ! return lce.Collection; } } *************** *** 3087,3093 **** foreach (LoadingCollectionEntry lce in loadingCollections.Values) { //lce.collection.EndRead(); ! lce.collection.EndRead(persister, lce.owner); ! AddInitializedCollection(lce.collection, persister, lce.id); ! persister.Cache(lce.id, lce.collection, this); } --- 3115,3121 ---- foreach (LoadingCollectionEntry lce in loadingCollections.Values) { //lce.collection.EndRead(); ! lce.Collection.EndRead(persister, lce.Owner); ! AddInitializedCollection(lce.Collection, persister, lce.Id); ! persister.Cache(lce.Id, lce.Collection, this); } *************** *** 3105,3110 **** } else { ! lce.initialize = true; ! return lce.collection; } } --- 3133,3138 ---- } else { ! lce.Initialize = true; ! return lce.Collection; } } |
From: Michael D. <mik...@us...> - 2004-06-23 21:09:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1216/NHibernate/SqlCommand Modified Files: SelectFragment.cs Log Message: Add methods to add a forumla to a select fragment. Index: SelectFragment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SelectFragment.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SelectFragment.cs 15 Apr 2004 11:36:36 -0000 1.3 --- SelectFragment.cs 23 Jun 2004 21:08:58 -0000 1.4 *************** *** 15,19 **** private string suffix; private IList columns = new ArrayList(); ! private IList aliases = new ArrayList(); private IList columnAliases = new ArrayList(); private Dialect.Dialect dialect; --- 15,19 ---- private string suffix; private IList columns = new ArrayList(); ! //private IList aliases = new ArrayList(); private IList columnAliases = new ArrayList(); private Dialect.Dialect dialect; *************** *** 49,54 **** public SelectFragment AddColumn(string tableAlias, string columnName, string columnAlias) { ! columns.Add(columnName); ! aliases.Add(tableAlias); columnAliases.Add(columnAlias); return this; --- 49,61 ---- public SelectFragment AddColumn(string tableAlias, string columnName, string columnAlias) { ! if(tableAlias==null || tableAlias==String.Empty) ! { ! columns.Add(columnName); ! } ! else ! { ! columns.Add(tableAlias + StringHelper.Dot + columnName); ! } ! columnAliases.Add(columnAlias); return this; *************** *** 68,71 **** --- 75,100 ---- } + public SelectFragment AddFormulas(string tableAlias, string[] formulas, string[] formulaAliases) + { + for(int i=0; i < formulas.Length; i++) + { + AddFormula(tableAlias, formulas[i], formulaAliases[i]); + } + + return this; + } + + public SelectFragment AddFormula(string tableAlias, string formula, string formulaAlias) + { + + AddColumn( + null, + StringHelper.Replace(formula, Template.PlaceHolder, tableAlias), + formulaAlias); + + return this; + } + + public SqlString ToSqlStringFragment() { *************** *** 83,88 **** if(i > 0 || includeLeadingComma) buf.Append(StringHelper.CommaSpace); ! string alias = aliases[i] as string; ! if (alias!=null) buf.Append(alias).Append(StringHelper.Dot); string columnAlias = columnAliases[i] as string; --- 112,117 ---- if(i > 0 || includeLeadingComma) buf.Append(StringHelper.CommaSpace); ! // string alias = aliases[i] as string; ! // if (alias!=null) buf.Append(alias).Append(StringHelper.Dot); string columnAlias = columnAliases[i] as string; |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1056/NHibernate/Persister Modified Files: AbstractEntityPersister.cs EntityPersister.cs IClassPersister.cs ILoadable.cs IQueryable.cs NormalizedEntityPersister.cs Log Message: Synch with h2.0.3 Added support for "formula" mapping to a property. Added support for dynamic insert via the "insert" attribute Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NormalizedEntityPersister.cs 28 Apr 2004 03:46:51 -0000 1.17 --- NormalizedEntityPersister.cs 23 Jun 2004 21:08:20 -0000 1.18 *************** *** 15,30 **** ! namespace NHibernate.Persister { /// <summary> /// A <c>IClassPersister</c> implementing the normalized "table-per-subclass" mapping strategy /// </summary> ! public class NormalizedEntityPersister : AbstractEntityPersister { private readonly ISessionFactoryImplementor factory; [...2061 lines suppressed...] } ! ! public override string WhereJoinFragment(string alias, bool innerJoin, bool includeSubclasses) ! { return Outerjoin(alias, innerJoin, includeSubclasses).ToWhereFragmentString; } ! public override string QueryWhereFragment(string alias, bool innerJoin, bool includeSubclasses) ! { return WhereJoinFragment(alias, innerJoin, includeSubclasses); } ! ! public override string[] IdentifierColumnNames ! { ! get { return tableKeyColumns[0]; } ! } ! } } Index: IClassPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/IClassPersister.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IClassPersister.cs 24 Mar 2004 19:54:01 -0000 1.5 --- IClassPersister.cs 23 Jun 2004 21:08:20 -0000 1.6 *************** *** 7,12 **** using NHibernate.Metadata; ! namespace NHibernate.Persister { ! /// <summary> /// Concrete <c>IClassPersister</c>s implement mapping and persistence logic for a particular class. --- 7,12 ---- using NHibernate.Metadata; ! namespace NHibernate.Persister ! { /// <summary> /// Concrete <c>IClassPersister</c>s implement mapping and persistence logic for a particular class. *************** *** 16,20 **** /// (PersistentClass, SessionFactoryImplementor) /// </remarks> ! public interface IClassPersister { /// <summary> --- 16,21 ---- /// (PersistentClass, SessionFactoryImplementor) /// </remarks> ! public interface IClassPersister ! { /// <summary> *************** *** 50,58 **** /// <summary> - /// Does it have a composite key? - /// </summary> - bool HasCompositeKey { get; } - - /// <summary> /// Does the class implement the <c>ILifecycle</c> inteface? /// </summary> --- 51,54 ---- *************** *** 70,76 **** /// <summary> ! /// Get an array of interfaces that the proxy object implements /// </summary> ! System.Type[] ProxyInterfaces { get; } //TODO: .NET proxy only can implement one??? /// <summary> --- 66,73 ---- /// <summary> ! /// Get an array of interfaces that the proxy object implements - must include ! /// proxy interfaces for all subclasses /// </summary> ! System.Type[] ProxyInterfaces { get; } /// <summary> Index: ILoadable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/ILoadable.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ILoadable.cs 18 Mar 2004 18:38:53 -0000 1.5 --- ILoadable.cs 23 Jun 2004 21:08:20 -0000 1.6 *************** *** 3,23 **** using NHibernate.Type; ! namespace NHibernate.Persister { ! /// <summary> ! /// Implemented by <c>ClassPersister</c> that uses <c>Loader</c>. THere are several optional /// operations used only by loaders that inherit <c>OuterJoinLoader</c> /// </summary> ! public interface ILoadable : IClassPersister { ! /// <summary> ! /// The names of columns used to persist the identifier /// </summary> ! string[] IdentifierColumnNames { get; } /// <summary> ! /// Does the persistent class have subclasses? /// </summary> ! bool HasSubclasses { get; } /// <summary> --- 3,28 ---- using NHibernate.Type; ! namespace NHibernate.Persister ! { /// <summary> ! /// Implemented by <c>ClassPersister</c> that uses <c>Loader</c>. There are several optional /// operations used only by loaders that inherit <c>OuterJoinLoader</c> /// </summary> ! public interface ILoadable : IClassPersister ! { /// <summary> ! /// Does the persistent class have subclasses? /// </summary> ! bool HasSubclasses { get; } /// <summary> ! /// The fully-qualified tablename used to persist this class /// </summary> ! string TableName { get; } ! ! /// <summary> ! /// The names of columns used to persist the identifier ! /// </summary> ! string[] IdentifierColumnNames { get; } /// <summary> *************** *** 45,53 **** string[] GetPropertyColumnNames(int i); ! /// <summary> ! /// The fully-qualified tablename used to persist this class ! /// </summary> ! string TableName { get; } ! //USED BY OuterJoinLoader + subclasses --- 50,54 ---- string[] GetPropertyColumnNames(int i); ! //USED BY OuterJoinLoader + subclasses Index: IQueryable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/IQueryable.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IQueryable.cs 23 Apr 2003 11:50:18 -0000 1.6 --- IQueryable.cs 23 Jun 2004 21:08:20 -0000 1.7 *************** *** 2,12 **** using NHibernate.Type; ! namespace NHibernate.Persister { /// <summary> /// Extends the generic <c>IClassPersister</c> contract to add operations required /// by the query language /// </summary> ! public interface IQueryable : ILoadable { ! /// <summary> /// Is this class mapped as a subclass of another class? --- 2,13 ---- using NHibernate.Type; ! namespace NHibernate.Persister ! { /// <summary> /// Extends the generic <c>IClassPersister</c> contract to add operations required /// by the query language /// </summary> ! public interface IQueryable : ILoadable ! { /// <summary> /// Is this class mapped as a subclass of another class? Index: EntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/EntityPersister.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** EntityPersister.cs 28 Apr 2004 03:46:51 -0000 1.17 --- EntityPersister.cs 23 Jun 2004 21:08:19 -0000 1.18 *************** *** 14,24 **** using NHibernate.Id; ! ! namespace NHibernate.Persister { /// <summary> /// Default implementation of the <c>ClassPersister</c> interface. Implements the ! /// "table-per-class hierarchy" mapping strategy for an entity class /// </summary> ! public class EntityPersister : AbstractEntityPersister, IQueryable { private readonly ISessionFactoryImplementor factory; [...1555 lines suppressed...] ! public override string WhereJoinFragment(string alias, bool innerJoin, bool includeSublasses) { return String.Empty; } --- 1157,1171 ---- // this works now because there are no parameters in the select string return frag.AddColumns(name, subclassColumnClosure, subclassColumnAliasClosure) + .AddFormulas(name, subclassFormulaTemplateClosure, subclassFormulaAliasClosure) .ToSqlStringFragment().ToString(); } ! public override string FromJoinFragment(string alias, bool innerJoin, bool includeSubclasses) ! { return String.Empty; } ! public override string WhereJoinFragment(string alias, bool innerJoin, bool includeSublasses) ! { return String.Empty; } Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AbstractEntityPersister.cs 15 Apr 2004 11:36:36 -0000 1.17 --- AbstractEntityPersister.cs 23 Jun 2004 21:08:19 -0000 1.18 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; using System.Reflection; + using NHibernate.Cache; using NHibernate.Cfg; *************** *** 16,20 **** using NHibernate.Loader; [...1055 lines suppressed...] } + // IDictionary was a Set in h2.0.3 + protected void CheckColumnDuplication(IDictionary distinctColumns, ICollection columns) + { + foreach(Column col in columns) + { + if( distinctColumns.Contains(col.Name) ) + { + throw new MappingException( + "Repated column in mapping for class " + + className + + " should be mapped with insert=\"false\" update=\"false\": " + + col.Name); + } + } + } + public abstract string QueryWhereFragment(string alias, bool innerJoin, bool includeSublcasses); public abstract string DiscriminatorSQLString { get; } |
From: Michael D. <mik...@us...> - 2004-06-23 21:03:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32220/NHibernate/Mapping Modified Files: Formula.cs Log Message: Minor code formatting changes to follow the .net standard Index: Formula.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Formula.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Formula.cs 13 Apr 2004 13:03:54 -0000 1.2 --- Formula.cs 23 Jun 2004 21:03:34 -0000 1.3 *************** *** 13,20 **** public Formula() { uniqueInteger = formulaUniqueInteger++; } ! public String getTemplate(Dialect.Dialect dialect) { return Template.RenderWhereStringTemplate(formula, dialect); } ! public String getAlias() ! { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } public string FormulaString { --- 13,21 ---- public Formula() { uniqueInteger = formulaUniqueInteger++; } ! public String GetTemplate(Dialect.Dialect dialect) { return Template.RenderWhereStringTemplate(formula, dialect); } ! public String Alias ! { get ! { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } } public string FormulaString { |
From: Michael D. <mik...@us...> - 2004-06-23 21:02:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31802/NHibernate/Mapping Modified Files: Property.cs Log Message: Fixed problem with a Formula property trying to be set in an update sql. Index: Property.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Property.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Property.cs 13 Apr 2004 02:06:54 -0000 1.6 --- Property.cs 23 Jun 2004 21:02:17 -0000 1.7 *************** *** 42,46 **** public bool IsUpdateable { ! get { return updateable; } set { updateable = value; } } --- 42,46 ---- public bool IsUpdateable { ! get { return updateable && !IsFormula ; } set { updateable = value; } } |
From: Michael D. <mik...@us...> - 2004-06-23 21:00:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31262/NHibernate/Util Modified Files: StringHelper.cs Log Message: Fixed problem with NullPointerException for template parameter Index: StringHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringHelper.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** StringHelper.cs 20 May 2004 20:55:54 -0000 1.12 --- StringHelper.cs 23 Jun 2004 21:00:24 -0000 1.13 *************** *** 28,31 **** --- 28,34 ---- public static string Replace(string template, string placeholder, string replacement) { + // sometimes a null value will get passed in here -> SqlWhereStrings are a good example + if(template==null) return null; + int loc = template.IndexOf(placeholder); if (loc<0) { |
From: Michael D. <mik...@us...> - 2004-06-22 03:11:14
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11777/NHSpecific Modified Files: SexType.hbm.xml Team.hbm.xml UnsavedType.hbm.xml Log Message: Changed from sql server specific "identity" to less specific "native" for id generator. Index: UnsavedType.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/UnsavedType.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UnsavedType.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- UnsavedType.hbm.xml 22 Jun 2004 03:11:02 -0000 1.2 *************** *** 10,14 **** unsaved-value="0" > ! <generator class="identity" /> </id> <property --- 10,14 ---- unsaved-value="0" > ! <generator class="native" /> </id> <property Index: SexType.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/SexType.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SexType.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- SexType.hbm.xml 22 Jun 2004 03:11:02 -0000 1.2 *************** *** 7,11 **** > <id name="Id" column="id"> ! <generator class="identity" /> </id> <property name="TypeName" type="String" column="type_name" /> --- 7,11 ---- > <id name="Id" column="id"> ! <generator class="native" /> </id> <property name="TypeName" type="String" column="type_name" /> Index: Team.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/Team.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Team.hbm.xml 9 Jun 2004 01:04:35 -0000 1.1 --- Team.hbm.xml 22 Jun 2004 03:11:02 -0000 1.2 *************** *** 1,3 **** ! <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> --- 1,3 ---- ! <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> *************** *** 10,14 **** column="team_id" > ! <generator class="identity" /> </id> <property --- 10,14 ---- column="team_id" > ! <generator class="native" /> </id> <property |
From: Michael D. <mik...@us...> - 2004-06-18 14:14:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9916/NHibernate.Test Modified Files: PerformanceTest.cs Log Message: Minor mods because of changes in ConnectionProvider. Index: PerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PerformanceTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PerformanceTest.cs 8 Jun 2004 11:47:37 -0000 1.4 --- PerformanceTest.cs 18 Jun 2004 14:14:27 -0000 1.5 *************** *** 27,31 **** /// </para> /// <para> ! /// Currently (2004-05-26) NHibernate adds about 20% overhead versus a straight DataReader when /// the exact same sql is issued. NHibernate's DriverConnectionProvider has not implemented a /// Connection Cache or Prepared IDbCommand cache yet. No cache was configured for the class Simple for --- 27,32 ---- /// </para> /// <para> ! /// Currently (2004-05-26) NHibernate adds about 20% overhead with everything on the same machine/6% overhead ! /// with Sql Server on a different machine compared to a straight DataReader when /// the exact same sql is issued. NHibernate's DriverConnectionProvider has not implemented a /// Connection Cache or Prepared IDbCommand cache yet. No cache was configured for the class Simple for *************** *** 113,117 **** s = sessions.OpenSession(); Hibernate(s, simples, ids, n, "h" + runIndex.ToString()); - s.Connection.Close(); s.Close(); } --- 114,117 ---- *************** *** 132,136 **** System.Console.Out.Write("NHibernate: " + hiber + "ms / Direct ADO.NET: " + adonet + "ms = Ratio: " + (((float)hiber/adonet)).ToString() ); ! //cp.Close(); System.GC.Collect(); } --- 132,136 ---- System.Console.Out.Write("NHibernate: " + hiber + "ms / Direct ADO.NET: " + adonet + "ms = Ratio: " + (((float)hiber/adonet)).ToString() ); ! cp.Close(); System.GC.Collect(); } |
From: Michael D. <mik...@us...> - 2004-06-18 14:14:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9916/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: Minor mods because of changes in ConnectionProvider. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SessionFactoryImpl.cs 28 May 2004 11:49:04 -0000 1.19 --- SessionFactoryImpl.cs 18 Jun 2004 14:14:29 -0000 1.20 *************** *** 654,667 **** } ! // TODO: H2.0.3 ! // if (statementCache!=null) statementCache.CloseAll(); ! // try ! // { ! // connections.close(); ! // } ! // finally ! // { ! // SessionFactoryObjectFactory.removeInstance(uuid, name, properties); ! // } } --- 654,668 ---- } ! //TODO: H2.0.3 ! //if (statementCache!=null) statementCache.CloseAll(); ! try ! { ! connectionProvider.Close(); ! } ! finally ! { ! //TODO: H2.0.3 ! //SessionFactoryObjectFactory.removeInstance(uuid, name, properties); ! } } |
From: Michael D. <mik...@us...> - 2004-06-18 14:00:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2ddl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32472/NHibernate/Tool/hbm2ddl Modified Files: SchemaExport.cs Log Message: Synch with H2.0.3 - added line to tell the ConnectionProvider to close all of the connections it has in the pool. Index: SchemaExport.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2ddl/SchemaExport.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SchemaExport.cs 3 May 2004 14:33:19 -0000 1.8 --- SchemaExport.cs 18 Jun 2004 14:00:20 -0000 1.9 *************** *** 193,196 **** --- 193,197 ---- { connectionProvider.CloseConnection(connection); + connectionProvider.Close(); } } |
From: Michael D. <mik...@us...> - 2004-06-18 13:59:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31538/NHibernate/Connection Modified Files: ConnectionProvider.cs DriverConnectionProvider.cs IConnectionProvider.cs UserSuppliedConnectionProvider.cs Log Message: Synch with H2.0.3 - main thing is the addition of a basic connection pool to DriverManager so you can get back the same IDbConnection (same by reference - not just an already established connection by the data providers built in connection pool). This defaults to not being on. Index: IConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/IConnectionProvider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IConnectionProvider.cs 10 Mar 2004 15:36:45 -0000 1.4 --- IConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.5 *************** *** 51,54 **** --- 51,59 ---- bool IsStatementCache { get; } + /// <summary> + /// Release all resources held by this ConnectionProvider. + /// </summary> + void Close(); + } } Index: DriverConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DriverConnectionProvider.cs 10 Mar 2004 15:36:45 -0000 1.1 --- DriverConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Collections; using System.Data; *************** *** 7,15 **** { /// <summary> ! /// Summary description for DriverConnectionProvider. /// </summary> public class DriverConnectionProvider : ConnectionProvider { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(DriverConnectionProvider)); public DriverConnectionProvider() --- 8,23 ---- { /// <summary> ! /// A ConnectionProvider that uses an IDriver to create connections. /// </summary> + /// <remarks> + /// This IConnectionProvider implements a rudimentary connection pool. + /// </remarks> public class DriverConnectionProvider : ConnectionProvider { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(DriverConnectionProvider)); + private static object poolLock = new object(); + private readonly ArrayList pool = new ArrayList(); + + private int checkedOut = 0; public DriverConnectionProvider() *************** *** 20,23 **** --- 28,50 ---- public override IDbConnection GetConnection() { + if(log.IsDebugEnabled) log.Debug("total checked-out connections: " + checkedOut); + + lock(poolLock) + { + if( pool.Count > 0 ) + { + int last = pool.Count - 1; + if(log.IsDebugEnabled) + { + log.Debug("using pooled connection, pool size: " + last); + checkedOut++; + } + + IDbConnection conn = (IDbConnection)pool[last]; + pool.RemoveAt(last); + return conn; + } + } + log.Debug("Obtaining IDbConnection from Driver"); try *************** *** 39,42 **** --- 66,108 ---- } + public override void Close() + { + log.Info("cleaning up connection pool"); + + for(int i = 0; i < pool.Count; i++) + { + try + { + ((IDbConnection)pool[i]).Close(); + } + catch(Exception e) + { + log.Warn("problem closing pooled connection", e); + } + } + + pool.Clear(); + } + + public override void CloseConnection(IDbConnection conn) + { + if(log.IsDebugEnabled) checkedOut--; + + lock(poolLock) + { + int currentSize = pool.Count; + if( currentSize < PoolSize ) + { + if(log.IsDebugEnabled) log.Debug("returning connection to pool, pool size: " + (currentSize + 1) ); + pool.Add(conn); + return; + } + } + + base.CloseConnection(conn); + } + + + } } Index: ConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/ConnectionProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionProvider.cs 10 Mar 2004 15:36:45 -0000 1.2 --- ConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.3 *************** *** 11,18 **** /// The base class for the ConnectionProvider. /// </summary> ! public abstract class ConnectionProvider : IConnectionProvider { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConnectionProvider)); private string connString = null; protected IDriver driver = null; --- 11,19 ---- /// The base class for the ConnectionProvider. /// </summary> ! public abstract class ConnectionProvider : IConnectionProvider, IDisposable { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConnectionProvider)); private string connString = null; + private int poolSize; protected IDriver driver = null; *************** *** 38,41 **** --- 39,50 ---- { log.Info("Configuring ConnectionProvider"); + + // default the poolSize to 0 if no setting was made because most of the .net DataProvider + // do their own connection pooling. This would be useful to change to some higher number + // if the .net DataProvider did not provide their own connection pooling. I don't know of + // any instances of this yet. + poolSize = PropertiesHelper.GetInt(Cfg.Environment.PoolSize, Cfg.Environment.Properties, 0); + log.Info("NHibernate connection pool size: " + poolSize); + connString = Cfg.Environment.Properties[ Cfg.Environment.ConnectionString ] as string; if (connString==null) throw new HibernateException("Could not find connection string setting"); *************** *** 75,78 **** --- 84,92 ---- } + protected virtual int PoolSize + { + get { return poolSize; } + } + public IDriver Driver { *************** *** 88,91 **** --- 102,116 ---- public abstract bool IsStatementCache {get;} + public abstract void Close(); + + #region IDisposable Members + + // equiv to java's object.finalize() + public void Dispose() + { + Close(); + } + + #endregion } } Index: UserSuppliedConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/UserSuppliedConnectionProvider.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UserSuppliedConnectionProvider.cs 10 Mar 2004 15:36:45 -0000 1.4 --- UserSuppliedConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.5 *************** *** 48,51 **** --- 48,58 ---- } + public override void Close() + { + // do nothing - don't need to throw an error because this is something + // that NHibernate will call. + } + + } } |
From: Michael D. <mik...@us...> - 2004-06-18 13:48:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22528/NHibernate.DomainModel Modified Files: Fum.cs Fum.hbm.xml Fumm.cs Log Message: Modified some properties to follow .net naming standards and wrote more test for composite ids. Index: Fumm.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fumm.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fumm.cs 29 Apr 2004 15:16:00 -0000 1.1 --- Fumm.cs 18 Jun 2004 13:48:11 -0000 1.2 *************** *** 18,22 **** public FumCompositeID Id { ! get { return fum.id; } set { } } --- 18,22 ---- public FumCompositeID Id { ! get { return fum.Id; } set { } } Index: Fum.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fum.cs 3 Jun 2004 18:55:57 -0000 1.4 --- Fum.cs 18 Jun 2004 13:48:11 -0000 1.5 *************** *** 13,21 **** private DateTime _lastUpdated; ! public Fum() {} public Fum(FumCompositeID id) { ! this.id = id; ! friends = new Hashtable(); //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so --- 13,24 ---- private DateTime _lastUpdated; ! public Fum() ! { ! } ! public Fum(FumCompositeID id) { ! _id = id; ! _friends = new Hashtable(); //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so *************** *** 29,42 **** Fum f = new Fum(); ! f.id = fid; ! f.fum="FRIEND"; //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! f.lastUpdated = DateTime.Now; ! friends.Add(f, new object()); } ! public string fum { get --- 32,46 ---- Fum f = new Fum(); ! f.Id = fid; ! f.FumString="FRIEND"; //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! f.LastUpdated = DateTime.Now; ! _friends.Add(f, new object()); } ! ! public string FumString { get *************** *** 50,54 **** } ! public FumCompositeID id { get --- 54,58 ---- } ! public FumCompositeID Id { get *************** *** 61,65 **** } } ! public Fum fo { get --- 65,69 ---- } } ! public Fum Fo { get *************** *** 73,77 **** } ! public Qux[] quxArray { get --- 77,81 ---- } ! public Qux[] QuxArray { get *************** *** 85,89 **** } ! public IDictionary friends { get --- 89,93 ---- } ! public IDictionary Friends { get *************** *** 100,107 **** public LifecycleVeto OnDelete(ISession s) { ! if (friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in friends) { s.Delete(de.Key); --- 104,111 ---- public LifecycleVeto OnDelete(ISession s) { ! if (_friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in _friends) { s.Delete(de.Key); *************** *** 123,130 **** public LifecycleVeto OnSave(ISession s) { ! if (friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in friends) { s.Save(de.Key); --- 127,134 ---- public LifecycleVeto OnSave(ISession s) { ! if (_friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in _friends) { s.Save(de.Key); *************** *** 144,148 **** } ! public DateTime lastUpdated { get --- 148,152 ---- } ! public DateTime LastUpdated { get Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fum.hbm.xml 3 Jun 2004 18:55:57 -0000 1.4 --- Fum.hbm.xml 18 Jun 2004 13:48:11 -0000 1.5 *************** *** 1,20 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Fum, NHibernate.DomainModel"> ! <composite-id name="id" unsaved-value="any"> <key-property name="String"> ! <column name="string_" length="10" /> </key-property> ! <key-property name="Short" column="short_" /> ! <key-property name="Date" column="date_" type="DateTime" /> </composite-id> ! <version name="lastUpdated" type="DateTime" /> ! <property name="fum" not-null="true" /> ! <many-to-one name="fo"> <column name="fo_string" length="10" /> <column name="fo_short" /> <column name="fo_date" /> </many-to-one> ! <set name="friends"> <key> <column name="fr_string" length="10" /> --- 1,45 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Fum, NHibernate.DomainModel" ! > ! <composite-id ! name="Id" ! unsaved-value="any" ! > <key-property name="String"> ! <column ! name="string_" ! length="10" ! /> </key-property> ! <key-property ! name="Short" ! column="short_" ! /> ! <key-property ! name="Date" ! column="date_" ! type="DateTime" ! /> </composite-id> ! ! <version ! name="LastUpdated" ! type="DateTime" ! /> ! ! <property ! name="FumString" ! not-null="true" ! /> ! ! <many-to-one name="Fo"> <column name="fo_string" length="10" /> <column name="fo_short" /> <column name="fo_date" /> </many-to-one> ! ! <set name="Friends"> <key> <column name="fr_string" length="10" /> *************** *** 24,28 **** <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> ! <array name="quxArray"> <key> <column name="fum_str_" length="10" /> --- 49,54 ---- <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> ! ! <array name="QuxArray"> <key> <column name="fum_str_" length="10" /> |