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-09-02 13:05:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30951/NHibernate/Impl Modified Files: EnumerableImpl.cs Log Message: Fixed NH-93 & NH-87 problems with Max Results Index: EnumerableImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/EnumerableImpl.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EnumerableImpl.cs 27 Aug 2004 04:14:19 -0000 1.4 --- EnumerableImpl.cs 2 Sep 2004 13:04:58 -0000 1.5 *************** *** 1,5 **** using System; - using System.Data; using System.Collections; using NHibernate.Engine; using NHibernate.Type; --- 1,6 ---- using System; using System.Collections; + using System.Data; + using NHibernate.Engine; using NHibernate.Type; *************** *** 17,50 **** private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(EnumerableImpl)); ! private IDataReader rs; ! private ISessionImplementor sess; ! private IType[] types; ! private bool single; ! private object[] currentResults; ! private bool hasNext; ! private string[][] names; ! private IDbCommand cmd; ! public EnumerableImpl(IDataReader rs, IDbCommand cmd, ISessionImplementor sess, IType[] types, string[][] columnNames) { ! this.rs = rs; ! this.cmd = cmd; ! this.sess = sess; ! this.types = types; ! this.names = columnNames; ! single = types.Length==1; } private void PostMoveNext(bool hasNext) { ! this.hasNext = hasNext; ! // there are no more records in the DataReader so clean up ! if (!hasNext) { log.Debug("exhausted results"); ! currentResults = null; ! rs.Close(); //TODO: H2.0.3 code to synch here to close the QueryStatement //sess.Batcher.CloseQueryStatement( cmd, rs ); --- 18,74 ---- private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(EnumerableImpl)); ! private IDataReader _reader; ! private ISessionImplementor _sess; ! private IType[] _types; ! private bool _single; ! private object[] _currentResults; ! private bool _hasNext; ! private string[][] _names; ! private IDbCommand _cmd; ! // when we start enumerating through the DataReader we are positioned ! // before the first record we need ! private int _currentRow = -1; ! ! private RowSelection _selection; ! ! /// <summary> ! /// Create an <see cref="IEnumerable"/> wrapper over an <see cref="IDataReader"/>. ! /// </summary> ! /// <param name="reader">The <see cref="IDataReader"/> to enumerate over.</param> ! /// <param name="cmd">TODO: is this needed?</param> ! /// <param name="sess">The <see cref="ISession"/> to use to load objects.</param> ! /// <param name="types">The <see cref="IType"/>s contained in the <see cref="IDataReader"/>.</param> ! /// <param name="columnNames">The names of the columns in the <see cref="IDataReader"/>.</param> ! /// <param name="selection">The <see cref="RowSelection"/> that should be applied to the <see cref="IDataReader"/>.</param> ! /// <remarks> ! /// The <see cref="IDataReader"/> should already be positioned on the first record in <see cref="RowSelection"/>. ! /// </remarks> ! public EnumerableImpl(IDataReader reader, IDbCommand cmd, ISessionImplementor sess, IType[] types, string[][] columnNames, RowSelection selection) { ! _reader = reader; ! _cmd = cmd; ! _sess = sess; ! _types = types; ! _names = columnNames; ! _selection = selection; ! _single = _types.Length==1; } private void PostMoveNext(bool hasNext) { ! _hasNext = hasNext; ! _currentRow++; ! if( _selection!=null && _selection.MaxRows!=RowSelection.NoValue ) ! { ! _hasNext = _hasNext && ( _currentRow < _selection.MaxRows ); ! } // there are no more records in the DataReader so clean up ! if( !_hasNext ) { log.Debug("exhausted results"); ! _currentResults = null; ! _reader.Close(); //TODO: H2.0.3 code to synch here to close the QueryStatement //sess.Batcher.CloseQueryStatement( cmd, rs ); *************** *** 53,60 **** { log.Debug("retreiving next results"); ! currentResults = new object[types.Length]; ! for (int i=0; i<types.Length; i++) { ! currentResults[i] = types[i].NullSafeGet(rs, names[i], sess, null); } } --- 77,84 ---- { log.Debug("retreiving next results"); ! _currentResults = new object[_types.Length]; ! for (int i=0; i<_types.Length; i++) { ! _currentResults[i] = _types[i].NullSafeGet(_reader, _names[i], _sess, null); } } *************** *** 72,82 **** get { ! if (single) { ! return currentResults[0]; } else { ! return currentResults; } } --- 96,106 ---- get { ! if( _single ) { ! return _currentResults[0]; } else { ! return _currentResults; } } *************** *** 85,91 **** public bool MoveNext() { ! PostMoveNext( rs.Read() ); ! ! return hasNext; } --- 109,115 ---- public bool MoveNext() { ! PostMoveNext( _reader.Read() ); ! ! return _hasNext; } |
From: Michael D. <mik...@us...> - 2004-09-02 13:05:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30951/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Fixed NH-93 & NH-87 problems with Max Results Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** FooBarTest.cs 2 Sep 2004 04:00:42 -0000 1.62 --- FooBarTest.cs 2 Sep 2004 13:04:57 -0000 1.63 *************** *** 434,438 **** [Test] - [Ignore("IQuery.SetMaxResults() - http://jira.nhibernate.org:8080/browse/NH-93")] public void Limit() { --- 434,437 ---- *************** *** 2816,2820 **** [Test] ! public void AuotFlushCollections() { ISession s = sessions.OpenSession(); --- 2815,2819 ---- [Test] ! public void AutoFlushCollections() { ISession s = sessions.OpenSession(); |
From: Michael D. <mik...@us...> - 2004-09-02 13:05:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30951/NHibernate/Hql Modified Files: QueryTranslator.cs Log Message: Fixed NH-93 & NH-87 problems with Max Results Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** QueryTranslator.cs 30 Aug 2004 18:28:11 -0000 1.43 --- QueryTranslator.cs 2 Sep 2004 13:04:58 -0000 1.44 *************** *** 923,927 **** } - //TODO: H2.0.3: iterate and scroll instead of getenumerable public IEnumerable GetEnumerable(object[] values, IType[] types, RowSelection selection, IDictionary namedParams, IDictionary lockModes, ISessionImplementor session) --- 923,926 ---- *************** *** 934,938 **** IDataReader rs = GetResultSet( st, selection, session ); ! return new EnumerableImpl(rs, st, session, ReturnTypes, ScalarColumnNames ); } --- 933,937 ---- IDataReader rs = GetResultSet( st, selection, session ); ! return new EnumerableImpl(rs, st, session, ReturnTypes, ScalarColumnNames, selection ); } |
From: Michael D. <mik...@us...> - 2004-09-02 13:05:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30951/NHibernate/Loader Modified Files: Loader.cs Log Message: Fixed NH-93 & NH-87 problems with Max Results Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Loader.cs 2 Sep 2004 04:00:40 -0000 1.32 --- Loader.cs 2 Sep 2004 13:04:58 -0000 1.33 *************** *** 680,687 **** /// advance to the first result and return an SQL <c>IDataReader</c> /// </summary> ! /// <param name="st"></param> ! /// <param name="selection"></param> ! /// <param name="session"></param> ! /// <returns></returns> protected IDataReader GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) { --- 680,687 ---- /// advance to the first result and return an SQL <c>IDataReader</c> /// </summary> ! /// <param name="st">The <see cref="IDbCommand" /> to execute.</param> ! /// <param name="selection">The <see cref="RowSelection"/> to apply to the <see cref="IDbCommand"/> and <see cref="IDataReader"/>.</param> ! /// <param name="session">The <see cref="ISession" /> to load in.</param> ! /// <returns>An IDataReader advanced to the first record in RowSelection.</returns> protected IDataReader GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) { |
From: Michael D. <mik...@us...> - 2004-09-02 04:00:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11922/NHibernate Modified Files: ICriteria.cs Log Message: Fixed NH-87 problems with Criteria and Max Results Index: ICriteria.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ICriteria.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICriteria.cs 2 Apr 2004 14:34:31 -0000 1.5 --- ICriteria.cs 2 Sep 2004 04:00:42 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; + using NHibernate.Engine; using NHibernate.Expression; *************** *** 51,67 **** /// <summary> ! /// ! /// </summary> ! int MaxResults {get; } ! ! /// <summary> ! /// ! /// </summary> ! int FirstResult {get; } ! ! /// <summary> ! /// /// </summary> ! int Timeout {get; } /// <summary> --- 52,58 ---- /// <summary> ! /// Gets the <see cref="RowSelection"/> for the ICriteria /// </summary> ! RowSelection Selection { get; } /// <summary> |
From: Michael D. <mik...@us...> - 2004-09-02 04:00:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11922/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Fixed NH-87 problems with Criteria and Max Results Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** FooBarTest.cs 1 Sep 2004 00:10:12 -0000 1.61 --- FooBarTest.cs 2 Sep 2004 04:00:42 -0000 1.62 *************** *** 536,540 **** [Test] - [Ignore("SetMaxResults - http://jira.nhibernate.org:8080/browse/NH-87")] public void FindByCriteria() { --- 536,539 ---- |
From: Michael D. <mik...@us...> - 2004-09-02 04:00:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11922/NHibernate/Engine Modified Files: RowSelection.cs Log Message: Fixed NH-87 problems with Criteria and Max Results Index: RowSelection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/RowSelection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RowSelection.cs 20 Feb 2003 15:57:11 -0000 1.1 --- RowSelection.cs 2 Sep 2004 04:00:42 -0000 1.2 *************** *** 1,22 **** using System; ! namespace NHibernate.Engine { ! ! public sealed class RowSelection { ! private int firstRow; ! private int maxRows; ! private int timeout; ! public int FirstRow { get { return firstRow; } set { firstRow = value; } } ! public int MaxRows { get { return maxRows; } set { maxRows = value; } } ! public int Timeout { get { return timeout; } set { timeout = value; } --- 1,50 ---- using System; ! namespace NHibernate.Engine ! { ! /// <summary> ! /// Information to determine how to run an IDbCommand and what ! /// records to return from the IDataReader. ! /// </summary> ! public sealed class RowSelection ! { ! /// <summary> ! /// Indicates that the no value has been set on the Property. ! /// </summary> ! public static int NoValue = -1; ! ! private int firstRow = 0; ! private int maxRows = RowSelection.NoValue; ! private int timeout = RowSelection.NoValue; ! /// <summary> ! /// Gets or Sets the Index of the First Row to Select ! /// </summary> ! /// <value>The Index of the First Rows to Select</value> ! /// <remarks>Defaults to 0 unless specifically set.</remarks> ! public int FirstRow ! { get { return firstRow; } set { firstRow = value; } } ! /// <summary> ! /// Gets or Sets the Maximum Number of Rows to Select ! /// </summary> ! /// <value>The Maximum Number of Rows to Select</value> ! /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int MaxRows ! { get { return maxRows; } set { maxRows = value; } } ! /// <summary> ! /// Gets or Sets the Timeout of the Query ! /// </summary> ! /// <value>The Query Timeout</value> ! /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int Timeout ! { get { return timeout; } set { timeout = value; } |
From: Michael D. <mik...@us...> - 2004-09-02 04:00:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11922/NHibernate/Loader Modified Files: CriteriaLoader.cs Loader.cs Log Message: Fixed NH-87 problems with Criteria and Max Results Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Loader.cs 28 Aug 2004 04:25:57 -0000 1.31 --- Loader.cs 2 Sep 2004 04:00:40 -0000 1.32 *************** *** 129,133 **** { ! int maxRows = (selection==null || selection.MaxRows==0) ? int.MaxValue : selection.MaxRows; --- 129,133 ---- { ! int maxRows = (selection==null || selection.MaxRows==RowSelection.NoValue) ? int.MaxValue : selection.MaxRows; *************** *** 552,558 **** { // it used to be selection.MaxRows != null -> since an Int32 will always ! // be initialized to 0, I will compare it to that instead of null. return dialect.SupportsLimit && ! ( selection!=null && selection.MaxRows!=0 ) && // there is a max rows ( dialect.PreferLimit || GetFirstRow(selection)!=0); } --- 552,559 ---- { // it used to be selection.MaxRows != null -> since an Int32 will always ! // have a value I'll compare it to the static field NoValue used to initialize ! // max rows to nothing return dialect.SupportsLimit && ! ( selection!=null && selection.MaxRows!=RowSelection.NoValue ) && // there is a max rows ( dialect.PreferLimit || GetFirstRow(selection)!=0); } *************** *** 601,605 **** try { ! if (selection!=null && selection.Timeout!=0) command.CommandTimeout = selection.Timeout; int colIndex = 0; --- 602,609 ---- try { ! if (selection!=null && selection.Timeout!=RowSelection.NoValue) ! { ! command.CommandTimeout = selection.Timeout; ! } int colIndex = 0; *************** *** 626,630 **** if(!useLimit) SetMaxRows(command, selection); ! if(selection!=null && selection.Timeout!=0) { command.CommandTimeout = selection.Timeout; --- 630,634 ---- if(!useLimit) SetMaxRows(command, selection); ! if(selection!=null && selection.Timeout!=RowSelection.NoValue) { command.CommandTimeout = selection.Timeout; *************** *** 656,662 **** } protected void SetMaxRows(IDbCommand st, RowSelection selection) { ! if ( selection!=null && selection.MaxRows!=0 ) { //TODO: H2.0.3 - do we need this method?? --- 660,672 ---- } + /// <summary> + /// Limits the number of rows returned by the Sql query if necessary. + /// </summary> + /// <param name="st">The IDbCommand to limit.</param> + /// <param name="selection">The RowSelection that contains the MaxResults info.</param> + /// <remarks>TODO: This does not apply to ADO.NET at all</remarks> protected void SetMaxRows(IDbCommand st, RowSelection selection) { ! if ( selection!=null && selection.MaxRows!=RowSelection.NoValue ) { //TODO: H2.0.3 - do we need this method?? Index: CriteriaLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/CriteriaLoader.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CriteriaLoader.cs 29 Jun 2004 04:27:21 -0000 1.7 --- CriteriaLoader.cs 2 Sep 2004 04:00:39 -0000 1.8 *************** *** 72,81 **** IType[] typeArray = (IType[]) types.ToArray(typeof(IType)); ! RowSelection selection = new RowSelection(); ! selection.FirstRow = criteria.FirstResult; ! selection.MaxRows = criteria.MaxResults; ! selection.Timeout = criteria.Timeout; ! ! return Find(session, valueArray, typeArray, true, selection, null, null); } --- 72,76 ---- IType[] typeArray = (IType[]) types.ToArray(typeof(IType)); ! return Find(session, valueArray, typeArray, true, criteria.Selection, null, null); } |
From: Michael D. <mik...@us...> - 2004-09-02 04:00:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11922/NHibernate/Impl Modified Files: CriteriaImpl.cs Log Message: Fixed NH-87 problems with Criteria and Max Results Index: CriteriaImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/CriteriaImpl.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CriteriaImpl.cs 6 Apr 2004 03:07:48 -0000 1.6 --- CriteriaImpl.cs 2 Sep 2004 04:00:41 -0000 1.7 *************** *** 2,5 **** --- 2,6 ---- using System.Collections; + using NHibernate.Engine; using NExpression = NHibernate.Expression; *************** *** 15,21 **** private IDictionary fetchModes = new Hashtable(); ! private int maxResults; ! private int firstResult; ! private int timeout; private System.Type persistentClass; private SessionImpl session; --- 16,20 ---- private IDictionary fetchModes = new Hashtable(); ! private RowSelection selection = new RowSelection(); private System.Type persistentClass; private SessionImpl session; *************** *** 26,30 **** public ICriteria SetMaxResults(int maxResults) { ! this.maxResults = maxResults; return this; } --- 25,29 ---- public ICriteria SetMaxResults(int maxResults) { ! selection.MaxRows = maxResults; return this; } *************** *** 32,36 **** public ICriteria SetFirstResult(int firstResult) { ! this.firstResult = firstResult; return this; } --- 31,35 ---- public ICriteria SetFirstResult(int firstResult) { ! selection.FirstRow = firstResult; return this; } *************** *** 38,42 **** public ICriteria SetTimeout(int timeout) { ! this.timeout = timeout; return this; } --- 37,41 ---- public ICriteria SetTimeout(int timeout) { ! selection.Timeout = timeout; return this; } *************** *** 54,69 **** get {return conjunction;} } ! ! public int MaxResults ! { ! get { return maxResults; } ! } ! public int FirstResult ! { ! get { return firstResult; } ! } ! public int Timeout { ! get { return timeout; } } --- 53,60 ---- get {return conjunction;} } ! ! public RowSelection Selection { ! get { return selection; } } |
From: Michael D. <mik...@us...> - 2004-09-01 03:28:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14322/Connection Modified Files: ConnectionProvider.cs DriverConnectionProvider.cs Log Message: Removed ConnectionPool from ConnectionProvider and settings for PreparedStatementCache. Index: DriverConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DriverConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.2 --- DriverConnectionProvider.cs 1 Sep 2004 03:28:28 -0000 1.3 *************** *** 10,24 **** /// 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() { --- 10,17 ---- *************** *** 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 --- 21,24 ---- *************** *** 69,104 **** { 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); } --- 43,53 ---- { log.Info("cleaning up connection pool"); } public override void CloseConnection(IDbConnection conn) { base.CloseConnection(conn); + //TODO: make sure I want to do this - pretty sure I do because of Oracle problems. + conn.Dispose(); } Index: ConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/ConnectionProvider.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ConnectionProvider.cs 28 Aug 2004 04:14:01 -0000 1.6 --- ConnectionProvider.cs 1 Sep 2004 03:28:28 -0000 1.7 *************** *** 15,19 **** private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConnectionProvider)); private string connString = null; - private int poolSize; protected IDriver driver = null; --- 15,18 ---- *************** *** 40,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.GetInt32( Cfg.Environment.PoolSize, settings, 0 ); - log.Info( "NHibernate connection pool size: " + poolSize ); - connString = settings[ Cfg.Environment.ConnectionString ] as string; if (connString==null) --- 39,42 ---- *************** *** 87,95 **** } - protected virtual int PoolSize - { - get { return poolSize; } - } - public IDriver Driver { --- 79,82 ---- |
From: Michael D. <mik...@us...> - 2004-09-01 03:28:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14322/Cfg Modified Files: Environment.cs Log Message: Removed ConnectionPool from ConnectionProvider and settings for PreparedStatementCache. Index: Environment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Environment.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Environment.cs 31 Aug 2004 13:14:24 -0000 1.17 --- Environment.cs 1 Sep 2004 03:28:28 -0000 1.18 *************** *** 52,59 **** --- 52,65 ---- // equivalents - we can probably remove these and remove the SessionFactoryImpl code that // uses them. + [Obsolete("Removing ConnectionPool from NH")] public const string PoolSize = "hibernate.connection.pool_size"; public const string StatementBatchSize = "hibernate.jdbc.batch_size"; public const string StatementFetchSize = "hibernate.jdbc.fetch_size"; public const string UseScrollableResultSet = "hibernate.jdbc.use_scrollable_resultset"; + + // going to remove this - the DataProvider should implement their own IDbCommand + // caching, not NHibernate + [Obsolete("Removing StatementCache from NH")] + public const string StatementCacheSize = "hibernate.statement_cache.size"; static Environment() |
From: Michael D. <mik...@us...> - 2004-09-01 00:19:28
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19375/NHibernate.Test Modified Files: App.config Log Message: Added section for OracleClient Index: App.config =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/App.config,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** App.config 9 Aug 2004 18:31:51 -0000 1.7 --- App.config 1 Sep 2004 00:19:18 -0000 1.8 *************** *** 17,20 **** --- 17,30 ---- value="NHibernate.Connection.DriverConnectionProvider" /> + <!-- + The valid strings for Isolation can be found in the documentation for the System.Data.IsolationLevel + Enumeration documentation. Use the member names - not the values. + --> + <!-- --> + <add + key="hibernate.connection.isolation" + value="ReadCommitted" + /> + <add key="hibernate.dialect" *************** *** 30,33 **** --- 40,61 ---- /> + <!-- This is the System.Data.OracleClient.dll provider for Oracle from MS --> + <!-- + <add + key="hibernate.dialect" + value="NHibernate.Dialect.OracleDialect" + /> + <add + key="hibernate.connection.driver_class" + value="NHibernate.Driver.OracleClientDriver" + /> + + <add + key="hibernate.connection.connection_string" + value="Data Source=ora9i;User ID=scott;Password=tiger;" + /> + + --> + <!-- <add *************** *** 98,108 **** </root> ! <!-- ! <logger name="NHibernate.Impl.PreparerImpl"> ! <level value="INFO" /> </logger> ! --> ! ! </log4net> --- 126,133 ---- </root> ! <logger name="NHibernate.SqlCommand"> ! <level value="DEBUG" /> </logger> ! </log4net> |
From: Michael D. <mik...@us...> - 2004-09-01 00:17:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19155/NHibernate/Dialect Modified Files: Oracle9Dialect.cs Log Message: Some notes for OracleDialect. Index: Oracle9Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Oracle9Dialect.cs 19 Aug 2004 17:45:25 -0000 1.12 --- Oracle9Dialect.cs 1 Sep 2004 00:17:08 -0000 1.13 *************** *** 43,47 **** Register( DbType.Decimal, "NUMBER(19,5)" ); Register( DbType.Decimal, 19, "NUMBER(19, $1)"); ! Register( DbType.Double, "DOUBLE PRECISION" ); //Oracle does not have a guid datatype //Register( DbType.Guid, "UNIQUEIDENTIFIER" ); --- 43,49 ---- Register( DbType.Decimal, "NUMBER(19,5)" ); Register( DbType.Decimal, 19, "NUMBER(19, $1)"); ! // having problems with both ODP and OracleClient from MS not being able ! // to read values out of a field that is DOUBLE PRECISION ! Register( DbType.Double, "DOUBLE PRECISION" ); //"FLOAT(53)" ); //Oracle does not have a guid datatype //Register( DbType.Guid, "UNIQUEIDENTIFIER" ); *************** *** 49,53 **** Register( DbType.Int32, "NUMBER(10,0)" ); Register( DbType.Int64, "NUMBER(20,0)" ); ! Register( DbType.Single, "FLOAT" ); Register( DbType.StringFixedLength, "NCHAR(255)"); Register( DbType.StringFixedLength, 2000, "NCHAR($1)"); --- 51,55 ---- Register( DbType.Int32, "NUMBER(10,0)" ); Register( DbType.Int64, "NUMBER(20,0)" ); ! Register( DbType.Single, "FLOAT(24)" ); Register( DbType.StringFixedLength, "NCHAR(255)"); Register( DbType.StringFixedLength, 2000, "NCHAR($1)"); |
From: Michael D. <mik...@us...> - 2004-09-01 00:16:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18981/NHibernate/Type Modified Files: PersistentEnumType.cs Log Message: Fixed problem that Oracle was causing with Enums. Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PersistentEnumType.cs 28 Apr 2004 14:16:18 -0000 1.6 --- PersistentEnumType.cs 1 Sep 2004 00:16:00 -0000 1.7 *************** *** 6,23 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ImmutableType, ILiteralType { ! private readonly System.Type enumClass; ! public PersistentEnumType(System.Type enumClass) : base(GetUnderlyingSqlType(enumClass)) { ! if(enumClass.IsEnum) this.enumClass = enumClass; ! else throw new MappingException(enumClass.Name + " did not inherit from System.Enum" ); } --- 6,28 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ImmutableType, ILiteralType ! { private readonly System.Type enumClass; ! public PersistentEnumType(System.Type enumClass) : base(GetUnderlyingSqlType(enumClass)) ! { ! if(enumClass.IsEnum) ! { this.enumClass = enumClass; ! } ! else ! { throw new MappingException(enumClass.Name + " did not inherit from System.Enum" ); + } } *************** *** 28,33 **** /// <param name="enumClass">The Enumeration class to get the values from.</param> /// <returns>The SqlType for this EnumClass</returns> ! public static SqlType GetUnderlyingSqlType (System.Type enumClass) { ! switch( Enum.GetUnderlyingType(enumClass).FullName ) { case "System.Byte": return SqlTypeFactory.GetByte();// DbType.Byte; --- 33,40 ---- /// <param name="enumClass">The Enumeration class to get the values from.</param> /// <returns>The SqlType for this EnumClass</returns> ! public static SqlType GetUnderlyingSqlType (System.Type enumClass) ! { ! switch( Enum.GetUnderlyingType(enumClass).FullName ) ! { case "System.Byte": return SqlTypeFactory.GetByte();// DbType.Byte; *************** *** 52,85 **** } ! public virtual object GetInstance(object code) { ! try { ! return Enum.ToObject(enumClass, code); } ! catch (ArgumentException ae) { throw new HibernateException( "ArgumentException occurred inside Enum.ToObject()", ae ); } } ! public virtual object GetValue(object code) { ! //code is an enum instance. ! //An explicit cast is needed to convert from enum type to an integral type. ! switch( Enum.GetUnderlyingType(enumClass).FullName ) { case "System.Byte": ! return (byte)code; case "System.Int16": ! return (short)code; case "System.Int32": ! return (int)code; case "System.Int64": ! return (long)code; case "System.SByte": ! return (sbyte)code; case "System.UInt16": ! return (ushort)code; case "System.UInt32": ! return (uint)code; case "System.UInt64": ! return (ulong)code; default: throw new HibernateException( "Unknown UnderlyingType for Enum"); //Impossible exception --- 59,116 ---- } ! /// <summary> ! /// Gets an instance of the Enum ! /// </summary> ! /// <param name="code">The underlying value of an item in the Enum.</param> ! /// <returns> ! /// An instance of the Enum set to the <c>code</c> value. ! /// </returns> ! public virtual object GetInstance(object code) ! { ! try ! { ! return Enum.ToObject( enumClass, GetValue(code) ); } ! catch (ArgumentException ae) ! { throw new HibernateException( "ArgumentException occurred inside Enum.ToObject()", ae ); } } ! /// <summary> ! /// Gets the correct value for the Enum. ! /// </summary> ! /// <param name="code">The value to convert.</param> ! /// <returns>A boxed version of the code converted to the correct type.</returns> ! /// <remarks> ! /// This handles situations where the DataProvider returns the value of the Enum ! /// from the db in the wrong underlying type. It uses <see cref="Convert"/> to ! /// convert it to the correct type. ! /// </remarks> ! public virtual object GetValue(object code) ! { ! // code is an enum instance. ! // TODO: ORACLE - An convert is needed because right now everything that Oracle is ! // sending to NHibernate is a decimal - not the correct underlying ! // type and I don't know why ! switch( Enum.GetUnderlyingType(enumClass).FullName ) ! { case "System.Byte": ! return Convert.ToByte( code ); case "System.Int16": ! return Convert.ToInt16( code ); case "System.Int32": ! return Convert.ToInt32( code ); case "System.Int64": ! return Convert.ToInt64( code ); case "System.SByte": ! return Convert.ToSByte( code ); case "System.UInt16": ! return Convert.ToUInt16( code ); case "System.UInt32": ! return Convert.ToUInt32( code ); case "System.UInt64": ! return Convert.ToUInt64( code ); default: throw new HibernateException( "Unknown UnderlyingType for Enum"); //Impossible exception *************** *** 87,145 **** } ! public override bool Equals(object x, object y) { ! //return (x==y) || ( x!=null && y!=null && x.GetType()==y.GetType() && x.ToString()==y.ToString() ); return (x==y) || ( x!=null && y!=null && x.Equals(y) ) ; } ! public override System.Type ReturnedClass { get { return enumClass.GetType(); } } ! public override void Set(IDbCommand cmd, object value, int index) { IDataParameter par = (IDataParameter) cmd.Parameters[index]; ! if (value==null) { par.Value = DBNull.Value; } ! else { par.Value = value; } } ! public override object Get(IDataReader rs, int index) { object code = rs[index]; ! if ( code==DBNull.Value || code==null) { return null; } ! else { return GetInstance(code); } } ! public override object Get(IDataReader rs, string name) { return Get(rs, rs.GetOrdinal(name)); } ! public override string Name { get { return enumClass.Name; } } ! public override string ToXML(object value) { return (value==null) ? null : GetValue(value).ToString(); } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { ! if (cached==null) { return null; } ! else { return GetInstance(cached);; } } ! public override object Disassemble(object value, ISessionImplementor session) { return (value==null) ? null : GetValue(value); } ! public string ObjectToSQLString(object value) { return GetValue(value).ToString(); } --- 118,191 ---- } ! public override bool Equals(object x, object y) ! { return (x==y) || ( x!=null && y!=null && x.Equals(y) ) ; } ! public override System.Type ReturnedClass ! { get { return enumClass.GetType(); } } ! public override void Set(IDbCommand cmd, object value, int index) ! { IDataParameter par = (IDataParameter) cmd.Parameters[index]; ! if (value==null) ! { par.Value = DBNull.Value; } ! else ! { par.Value = value; } } ! public override object Get(IDataReader rs, int index) ! { object code = rs[index]; ! if ( code==DBNull.Value || code==null) ! { return null; } ! else ! { return GetInstance(code); } } ! public override object Get(IDataReader rs, string name) ! { return Get(rs, rs.GetOrdinal(name)); } ! public override string Name ! { get { return enumClass.Name; } } ! public override string ToXML(object value) ! { return (value==null) ? null : GetValue(value).ToString(); } ! public override object Assemble(object cached, ISessionImplementor session, object owner) ! { ! if (cached==null) ! { return null; } ! else ! { return GetInstance(cached);; } } ! public override object Disassemble(object value, ISessionImplementor session) ! { return (value==null) ? null : GetValue(value); } ! public string ObjectToSQLString(object value) ! { return GetValue(value).ToString(); } |
From: Michael D. <mik...@us...> - 2004-09-01 00:10:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/NHibernate.DomainModel/NHSpecific Modified Files: BasicClass.cs BasicClass.hbm.xml Added Files: BasicDouble.cs BasicDouble.hbm.xml Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: BasicClass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicClass.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicClass.hbm.xml 31 Aug 2004 20:24:24 -0000 1.4 --- BasicClass.hbm.xml 1 Sep 2004 00:10:12 -0000 1.5 *************** *** 18,22 **** <property name="DateTimeProperty" type="DateTime" column="dtm_p"/> <property name="DecimalProperty" type="Decimal(19,5)" column="decm_p"/> - <property name="DoubleProperty" type="Double" column="dbl_p"/> <property name="Int16Property" type="Int16" column="shrt_p" /> <property name="Int32Property" type="Int32" column="int_p"/> --- 18,21 ---- --- NEW FILE: BasicDouble.cs --- using System; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for BasicDouble. /// </summary> public class BasicDouble { int _id; Double _doubleValue; public BasicDouble() { } public int Id { get { return _id; } set { _id = value; } } public double DoubleValue { get {return _doubleValue;} set {_doubleValue = value;} } } } --- NEW FILE: BasicDouble.hbm.xml --- (This appears to be a binary file; contents omitted.) Index: BasicClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicClass.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicClass.cs 31 Aug 2004 20:24:24 -0000 1.3 --- BasicClass.cs 1 Sep 2004 00:10:12 -0000 1.4 *************** *** 4,9 **** namespace NHibernate.DomainModel.NHSpecific { - - /// <summary> /// Summary description for BasicClass. --- 4,7 ---- *************** *** 22,26 **** private DateTime _dateTimeProperty; private decimal _decimalProperty; - private double _doubleProperty; private short _int16Property; private int _int32Property; --- 20,23 ---- *************** *** 93,102 **** } - public double DoubleProperty - { - get {return _doubleProperty;} - set {_doubleProperty = value;} - } - public short Int16Property { --- 90,93 ---- |
From: Michael D. <mik...@us...> - 2004-09-01 00:10:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/NHibernate.DomainModel Modified Files: Foo.cs FooBar.hbm.xml FooProxy.cs NHibernate.DomainModel-1.1.csproj Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** FooBar.hbm.xml 31 Aug 2004 21:22:58 -0000 1.16 --- FooBar.hbm.xml 1 Sep 2004 00:10:11 -0000 1.17 *************** *** 46,50 **** </property> <property name="X"/> ! <property name="Double" column="double_" type="double"/> <primitive-array name="Bytes" table="foobytes"> --- 46,50 ---- </property> <property name="X"/> ! <!--<property name="Double" column="double_" type="double"/>--> <primitive-array name="Bytes" table="foobytes"> Index: FooProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooProxy.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FooProxy.cs 31 Aug 2004 21:22:58 -0000 1.7 --- FooProxy.cs 1 Sep 2004 00:10:11 -0000 1.8 *************** *** 80,88 **** } ! double Double ! { ! get; ! set; ! } float Float --- 80,88 ---- } ! // double Double ! // { ! // get; ! // set; ! // } float Float Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NHibernate.DomainModel-1.1.csproj 31 Aug 2004 20:24:23 -0000 1.23 --- NHibernate.DomainModel-1.1.csproj 1 Sep 2004 00:10:11 -0000 1.24 *************** *** 631,634 **** --- 631,643 ---- /> <File + RelPath = "NHSpecific\BasicDouble.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecific\BasicDouble.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "NHSpecific\BasicObject.cs" SubType = "Code" Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Foo.cs 31 Aug 2004 21:22:58 -0000 1.13 --- Foo.cs 1 Sep 2004 00:10:11 -0000 1.14 *************** *** 33,37 **** private float _float; private int _x; ! private double _double; private DateTime _date; private DateTime _timestamp; --- 33,37 ---- private float _float; private int _x; ! // private double _double; private DateTime _date; private DateTime _timestamp; *************** *** 113,124 **** } ! /// <summary> ! /// Get/set for double ! /// </summary> ! public double Double ! { ! get { return _double; } ! set { _double = value; } ! } /// <summary> --- 113,124 ---- } ! // /// <summary> ! // /// Get/set for double ! // /// </summary> ! // public double Double ! // { ! // get { return _double; } ! // set { _double = value; } ! // } /// <summary> *************** *** 337,341 **** _float = 6666.66f; //_double = new Double( 1.33e-69 ); // this double is too big for the sap db jdbc driver ! _double = 1.12e-36; _boolean = true; _byte = 127; --- 337,341 ---- _float = 6666.66f; //_double = new Double( 1.33e-69 ); // this double is too big for the sap db jdbc driver ! // _double = 1.12e-36; _boolean = true; _byte = 127; *************** *** 381,390 **** } } ! return ( _bool == other.Bool ) && ( ( _boolean == other.Boolean ) || ( _boolean.Equals(other.Boolean) ) ) && ( ( _byte == other.Byte ) || ( _byte.Equals(other.Byte) ) ) //&& ( ( this._date == other._date ) || ( this._date.getDate() == other._date.getDate() && this._date.getMonth() == other._date.getMonth() && this._date.getYear() == other._date.getYear() ) ) ! && ( ( _double == other.Double ) || ( _double.Equals(other.Double) ) ) && ( ( _float == other.Float ) || ( _float.Equals(other.Float) ) ) && ( _int == other.Int ) --- 381,391 ---- } } ! ! return ( _bool == other.Bool ) && ( ( _boolean == other.Boolean ) || ( _boolean.Equals(other.Boolean) ) ) && ( ( _byte == other.Byte ) || ( _byte.Equals(other.Byte) ) ) //&& ( ( this._date == other._date ) || ( this._date.getDate() == other._date.getDate() && this._date.getMonth() == other._date.getMonth() && this._date.getYear() == other._date.getYear() ) ) ! // && ( ( _double == other.Double ) || ( _double.Equals(other.Double) ) ) && ( ( _float == other.Float ) || ( _float.Equals(other.Float) ) ) && ( _int == other.Int ) |
From: Michael D. <mik...@us...> - 2004-09-01 00:10:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/NHibernate.Examples Modified Files: NHibernate.Examples-1.1.csproj Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: NHibernate.Examples-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/NHibernate.Examples-1.1.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NHibernate.Examples-1.1.csproj 17 Aug 2004 17:40:43 -0000 1.3 --- NHibernate.Examples-1.1.csproj 1 Sep 2004 00:10:12 -0000 1.4 *************** *** 232,235 **** --- 232,258 ---- /> <File + RelPath = "ForumQuestions\T1128288\AgentManager.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ForumQuestions\T1128288\AgentManager.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "ForumQuestions\T1128288\CustomerRep.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ForumQuestions\T1128288\CustomerRep.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "ForumQuestions\T1128288\DDLFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "QuickStart\User.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-09-01 00:10:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/NHibernate.Test/NHSpecificTest Modified Files: BasicClassFixture.cs Added Files: BasicDoubleFixture.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. --- NEW FILE: BasicDoubleFixture.cs --- using System; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Tests for mapping a Double Property to a database field. /// </summary> [TestFixture] public class BasicDoubleFixture : TestCase { double[] _values = new double[2]; [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BasicDouble.hbm.xml"}, true ); if( dialect is Dialect.OracleDialect ) { _values[0] = 1.5e20; _values[1] = 1.2e-20; } else { _values[0] = 1.5e35; _values[1] = 1.2e-35; } } [Test] public void Insert() { BasicDouble basic = Create(1); ISession s = sessions.OpenSession(); s.Save(basic); s.Flush(); s.Close(); s = sessions.OpenSession(); BasicDouble basicLoaded = (BasicDouble)s.Load(typeof(BasicDouble), 1); Assert.IsNotNull(basicLoaded); Assert.IsFalse(basic==basicLoaded); Assert.AreEqual( basic.DoubleValue, basicLoaded.DoubleValue ); s.Delete(basicLoaded); s.Flush(); s.Close(); } [Test] public void Update() { BasicDouble basic = Create(1); ISession s = sessions.OpenSession(); s.Save(basic); s.Flush(); s.Close(); s = sessions.OpenSession(); basic = (BasicDouble)s.Load(typeof(BasicDouble), 1); basic.DoubleValue = _values[1]; s.Flush(); s.Close(); s = sessions.OpenSession(); // make sure the update went through BasicDouble basicLoaded = (BasicDouble)s.Load(typeof(BasicDouble), 1); Assert.AreEqual( basic.DoubleValue, basicLoaded.DoubleValue ); s.Delete(basicLoaded); s.Flush(); s.Close(); } private BasicDouble Create(int id) { BasicDouble basic = new BasicDouble(); basic.Id = id; basic.DoubleValue = _values[0]; return basic; } } } Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicClassFixture.cs 31 Aug 2004 20:37:29 -0000 1.4 --- BasicClassFixture.cs 1 Sep 2004 00:10:28 -0000 1.5 *************** *** 171,189 **** AssertPropertiesEqual(bc[index-1], bc[index]); - bc[index].DoubleProperty = 6458946; - s[index].Update(bc[index]); - - t[index].Commit(); - s[index].Close(); - - index++; - - // make sure the previous updates went through - s[index] = sessions.OpenSession(); - t[index] = s[index].BeginTransaction(); - - bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); - AssertPropertiesEqual(bc[index-1], bc[index]); - bc[index].Int16Property = Int16.MinValue; s[index].Update(bc[index]); --- 171,174 ---- *************** *** 835,839 **** Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); Assertion.Assert("DecimalProperty", expected.DecimalProperty.Equals(actual.DecimalProperty)); ! Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); Assert.AreEqual(expected.Int32Property, actual.Int32Property, "Int32Property"); --- 820,824 ---- Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); Assertion.Assert("DecimalProperty", expected.DecimalProperty.Equals(actual.DecimalProperty)); ! // Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); Assert.AreEqual(expected.Int32Property, actual.Int32Property, "Int32Property"); *************** *** 869,873 **** basicClass.DateTimeProperty = DateTime.Parse("2003-12-01 10:45:21 AM"); basicClass.DecimalProperty = 5.64351M; - basicClass.DoubleProperty = 456343; basicClass.Int16Property = Int16.MaxValue; basicClass.Int32Property = Int32.MaxValue; --- 854,857 ---- |
From: Michael D. <mik...@us...> - 2004-09-01 00:10:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/NHibernate.Test Modified Files: FooBarTest.cs NHibernate.Test-1.1.csproj PerformanceTest.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: PerformanceTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/PerformanceTest.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PerformanceTest.cs 16 Aug 2004 05:15:10 -0000 1.8 --- PerformanceTest.cs 1 Sep 2004 00:10:28 -0000 1.9 *************** *** 244,253 **** { //SELECT s.id_, s.name, s.address, s.count_, s.date_, s.other ! keys[j] = (long)reader[0]; simplesFromReader[j] = new Simple(); simplesFromReader[j].Name = (string)reader[1]; simplesFromReader[j].Address = (string)reader[2]; ! simplesFromReader[j].Count = (int)reader[3]; ! simplesFromReader[j].Date = (DateTime)reader[4]; if(reader.IsDBNull(5)==false) --- 244,253 ---- { //SELECT s.id_, s.name, s.address, s.count_, s.date_, s.other ! keys[j] = Convert.ToInt64( reader[0] ); simplesFromReader[j] = new Simple(); simplesFromReader[j].Name = (string)reader[1]; simplesFromReader[j].Address = (string)reader[2]; ! simplesFromReader[j].Count = Convert.ToInt32( reader[3] ); ! simplesFromReader[j].Date = Convert.ToDateTime( reader[4] ); if(reader.IsDBNull(5)==false) Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** FooBarTest.cs 31 Aug 2004 21:24:37 -0000 1.60 --- FooBarTest.cs 1 Sep 2004 00:10:12 -0000 1.61 *************** *** 890,894 **** { ISession s = sessions.OpenSession(); ! ITransaction t = s.BeginTransaction(); Foo[] foos = new Foo[] { null, new Foo() }; s.Save(foos[1]); --- 890,894 ---- { ISession s = sessions.OpenSession(); ! // ITransaction t = s.BeginTransaction(); Foo[] foos = new Foo[] { null, new Foo() }; s.Save(foos[1]); *************** *** 949,953 **** s.Find("select count(*) from Bar as bar where 1 in (from bar.Component.Glarch.ProxyArray g where g.Name='foo')"); s.Find("select count(*) from Bar as bar where 1 in (from g in bar.Component.Glarch.ProxyArray.elements where g.Name='foo')"); ! s.Find("select count(*) from Bar as bar left outer join bar.Component.Glarch.ProxyArray as pg where 1 in (from g in bar.Component.Glarch.ProxyArray)"); } --- 949,958 ---- s.Find("select count(*) from Bar as bar where 1 in (from bar.Component.Glarch.ProxyArray g where g.Name='foo')"); s.Find("select count(*) from Bar as bar where 1 in (from g in bar.Component.Glarch.ProxyArray.elements where g.Name='foo')"); ! ! // TODO: figure out why this is throwing an ORA-1722 error ! if( !( dialect is Dialect.Oracle9Dialect) && !( dialect is Dialect.OracleDialect) ) ! { ! s.Find("select count(*) from Bar as bar left outer join bar.Component.Glarch.ProxyArray as pg where 1 in (from g in bar.Component.Glarch.ProxyArray)"); ! } } *************** *** 988,992 **** s.Delete(baz2); s.Delete(foos[1]); ! t.Commit(); s.Close(); --- 993,997 ---- s.Delete(baz2); s.Delete(foos[1]); ! // t.Commit(); s.Close(); Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** NHibernate.Test-1.1.csproj 31 Aug 2004 20:37:28 -0000 1.39 --- NHibernate.Test-1.1.csproj 1 Sep 2004 00:10:28 -0000 1.40 *************** *** 317,320 **** --- 317,325 ---- /> <File + RelPath = "NHSpecificTest\BasicDoubleFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\BasicObjectFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-08-31 21:24:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19224/src/NHibernate.Test/NHSpecificTest Modified Files: BasicBinaryFixture.cs BasicObjectFixture.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: BasicObjectFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicObjectFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicObjectFixture.cs 31 Aug 2004 20:37:29 -0000 1.1 --- BasicObjectFixture.cs 31 Aug 2004 21:24:38 -0000 1.2 *************** *** 28,32 **** /// <summary> ! /// This is the replacement for ParentChildTest.ObjectType() /// </summary> [Test] --- 28,32 ---- /// <summary> ! /// This is the replacement for ParentChildTest.ObjectType() and FooBarTest.ObjectType() /// </summary> [Test] *************** *** 38,46 **** --- 38,51 ---- any.Name = "the any"; + IBasicObjectProxy anyProxy = new BasicObjectProxy(); + anyProxy.Name = "proxied object"; + BasicObject bo = new BasicObject(); bo.Name = "the object"; bo.Any = any; + bo.AnyWithProxy = anyProxy; s.Save(any); + s.Save(anyProxy); s.Save(bo); s.Flush(); *************** *** 49,59 **** s = sessions.OpenSession(); bo = (BasicObject)s.Load( typeof(BasicObject), bo.Id ); Assert.IsNotNull( bo.Any , "any should not be null" ); Assert.IsTrue( bo.Any is BasicObjectRef, "any should have been a BasicObjectRef instance" ); any = (BasicObjectRef)s.Load( typeof(BasicObjectRef), any.Id ); Assert.AreSame( any, bo.Any, "any loaded and ref by BasicObject should be the same" ); ! s.Delete(any); s.Delete(bo); s.Flush(); --- 54,72 ---- s = sessions.OpenSession(); bo = (BasicObject)s.Load( typeof(BasicObject), bo.Id ); + + + Assert.IsNotNull( bo.AnyWithProxy , "AnyWithProxy should not be null" ); + Assert.IsTrue( bo.AnyWithProxy is IBasicObjectProxy, "AnyWithProxy should have been a IBasicObjectProxy instance" ); + Assert.AreEqual( anyProxy.Id, ((IBasicObjectProxy)bo.AnyWithProxy).Id ); + Assert.IsNotNull( bo.Any , "any should not be null" ); Assert.IsTrue( bo.Any is BasicObjectRef, "any should have been a BasicObjectRef instance" ); + Assert.AreEqual( any.Id, ((BasicObjectRef)bo.Any).Id ); any = (BasicObjectRef)s.Load( typeof(BasicObjectRef), any.Id ); Assert.AreSame( any, bo.Any, "any loaded and ref by BasicObject should be the same" ); ! s.Delete(bo.Any); ! s.Delete(bo.AnyWithProxy); s.Delete(bo); s.Flush(); Index: BasicBinaryFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicBinaryFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicBinaryFixture.cs 1 Jul 2004 12:53:14 -0000 1.3 --- BasicBinaryFixture.cs 31 Aug 2004 21:24:38 -0000 1.4 *************** *** 23,26 **** --- 23,27 ---- } + [Test] public void InsertNull() *************** *** 106,109 **** --- 107,111 ---- ISession s = sessions.OpenSession(); + bcBinary.DefaultSize = System.Text.Encoding.UTF8.GetBytes("ghij1`23%$"); s.Save(bcBinary); s.Flush(); *************** *** 113,117 **** bcBinary = (BasicBinary)s.Load(typeof(BasicBinary), 1); ! bcBinary.DefaultSize = GetByteArray(15); s.Flush(); --- 115,119 ---- bcBinary = (BasicBinary)s.Load(typeof(BasicBinary), 1); ! bcBinary.DefaultSize[1] = (byte)126; s.Flush(); *************** *** 123,127 **** // was DefaultSize updated ! ObjectAssertion.AssertEquals( bcBinary.DefaultSize, GetByteArray(15) ); // WithSize should not have been updated ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); --- 125,130 ---- // was DefaultSize updated ! Assert.AreEqual( 10, bcBinary.DefaultSize.Length ); ! Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); // WithSize should not have been updated ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); *************** *** 136,140 **** // was DefaultSize not updated ! ObjectAssertion.AssertEquals( bcBinary.DefaultSize, GetByteArray(15) ); ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); --- 139,145 ---- // was DefaultSize not updated ! Assert.AreEqual( 10, bcBinary.DefaultSize.Length ); ! Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); ! ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); |
From: Michael D. <mik...@us...> - 2004-08-31 21:24:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19224/src/NHibernate.Test Modified Files: FooBarTest.cs FumTest.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** FooBarTest.cs 19 Aug 2004 18:38:00 -0000 1.59 --- FooBarTest.cs 31 Aug 2004 21:24:37 -0000 1.60 *************** *** 3012,3039 **** [Test] - public void ObjectType() - { - ISession s = sessions.OpenSession(); - GlarchProxy g = new Glarch(); - Foo foo = new Foo(); - g.Any = foo; - object gid = s.Save(g); - object fid = s.Save(foo); - s.Flush(); - s.Close(); - - s = sessions.OpenSession(); - g = (GlarchProxy)s.Load( typeof(Glarch), gid ); - Assert.IsNotNull( g.Any ); - Assert.IsTrue( g.Any is FooProxy ); - Assert.AreEqual( fid, ((FooProxy)g.Any).Key ); - s.Delete(g.Any); - s.Delete(g); - s.Flush(); - s.Close(); - - } - - [Test] public void Any() { --- 3012,3015 ---- Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FumTest.cs 31 Aug 2004 20:37:28 -0000 1.14 --- FumTest.cs 31 Aug 2004 21:24:37 -0000 1.15 *************** *** 368,372 **** ISession s = sessions.OpenSession(); Fo fo = Fo.NewFo(); - fo.Buf = System.Text.Encoding.ASCII.GetBytes("abcdefghij1`23%$*^*$*\n\t"); s.Save( fo, FumTest.FumKey("an instance of fo") ); s.Flush(); --- 368,371 ---- *************** *** 375,379 **** s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); ! fo.Buf[1] = (byte)126; s.Flush(); s.Close(); --- 374,378 ---- s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); ! fo.X = 5; s.Flush(); s.Close(); *************** *** 381,385 **** s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); ! Assert.AreEqual( 126, fo.Buf[1] ); IEnumerator enumer = s.Enumerable("from fo in class NHibernate.DomainModel.Fo where fo.id.String like 'an instance of fo'").GetEnumerator(); Assert.IsTrue( enumer.MoveNext() ); --- 380,384 ---- s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); ! Assert.AreEqual( 5, fo.X ); IEnumerator enumer = s.Enumerable("from fo in class NHibernate.DomainModel.Fo where fo.id.String like 'an instance of fo'").GetEnumerator(); Assert.IsTrue( enumer.MoveNext() ); |
From: Michael D. <mik...@us...> - 2004-08-31 21:23:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18669/src/NHibernate.DomainModel Modified Files: Fo.cs Fo.hbm.xml Foo.cs FooBar.hbm.xml FooProxy.cs Glarch.cs Glarch.hbm.xml GlarchProxy.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FooBar.hbm.xml 31 Aug 2004 20:24:23 -0000 1.15 --- FooBar.hbm.xml 31 Aug 2004 21:22:58 -0000 1.16 *************** *** 71,75 **** <property name="Status" column="`status_@###`" type="NHibernate.DomainModel.FooStatus, NHibernate.DomainModel"/> - <property name="Binary" column="bin_"/> <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> --- 71,74 ---- Index: Glarch.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Glarch.cs 13 Aug 2004 18:54:29 -0000 1.7 --- Glarch.cs 31 Aug 2004 21:22:58 -0000 1.8 *************** *** 18,22 **** private string _immutable; private int _derivedVersion; ! private object _any; private int _x; private Multiplicity _multiple; --- 18,22 ---- private string _immutable; private int _derivedVersion; ! // private object _any; private int _x; private Multiplicity _multiple; *************** *** 150,164 **** /// <summary> - /// Gets or sets the _any - /// </summary> - public object Any - { - get { return _any; } - set { _any = value; } - } - - - - /// <summary> /// Gets or sets the _multiple /// </summary> --- 150,153 ---- Index: Fo.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fo.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Fo.hbm.xml 31 Aug 2004 20:24:23 -0000 1.8 --- Fo.hbm.xml 31 Aug 2004 21:22:45 -0000 1.9 *************** *** 30,34 **** /> ! <property name="Buf" length="500"/> <property name="X" /> </class> --- 30,34 ---- /> ! <property name="X" /> </class> Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Foo.cs 31 Aug 2004 20:24:23 -0000 1.12 --- Foo.cs 31 Aug 2004 21:22:58 -0000 1.13 *************** *** 23,43 **** public class Foo : FooProxy, ILifecycle { - // [Serializable] - // public class Struct - // { - // public string name; - // public int count; - // - // public override bool Equals(object obj) - // { - // Struct s = (Struct) obj; - // return ( s.name==name || s.name.Equals(name) ) && s.count==count; - // } - // - // public override int GetHashCode() - // { - // return count; - // } - // } #region Fields --- 23,26 ---- *************** *** 64,68 **** private bool _yesno; private FooStatus _status; - private byte[] _binary; private byte[] _bytes; private System.Globalization.CultureInfo _locale; --- 47,50 ---- *************** *** 256,268 **** set { _status = value; } } - - /// <summary> - /// Get/set for binary - /// </summary> - public byte[] Binary - { - get { return _binary; } - set { _binary = value; } - } public byte[] Bytes --- 238,241 ---- *************** *** 371,375 **** _bytes = System.Text.Encoding.ASCII.GetBytes(_string); _status=FooStatus.ON; - _binary = System.Text.Encoding.ASCII.GetBytes( _string + "yada yada yada" ); custom = new string[] { --- 344,347 ---- *************** *** 409,422 **** } } - - if(_binary!=other.Binary) - { - if (_binary==null || other.Binary==null) return false; - if (_binary.Length!=other.Binary.Length) return false; - for(int i=0; i< _binary.Length; i++) - { - if( _binary[i]!=other.Binary[i] ) return false; - } - } return ( _bool == other.Bool ) --- 381,384 ---- Index: GlarchProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/GlarchProxy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GlarchProxy.cs 13 Aug 2004 18:54:29 -0000 1.3 --- GlarchProxy.cs 31 Aug 2004 21:22:58 -0000 1.4 *************** *** 64,73 **** get; set; ! } ! object Any ! { ! get; ! set; ! } } } \ No newline at end of file --- 64,68 ---- get; set; ! } } } \ No newline at end of file Index: FooProxy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooProxy.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FooProxy.cs 31 Aug 2004 20:24:23 -0000 1.6 --- FooProxy.cs 31 Aug 2004 21:22:58 -0000 1.7 *************** *** 4,8 **** { - //TODO: fix up these property names for .net standards public interface FooProxy { --- 4,7 ---- *************** *** 23,32 **** } - byte[] Binary - { - get; - set; - } - FooStatus Status { --- 22,25 ---- Index: Fo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fo.cs 31 Aug 2004 20:24:17 -0000 1.2 --- Fo.cs 31 Aug 2004 21:22:45 -0000 1.3 *************** *** 12,25 **** private Fo() {} - private byte[] _buf; private long _version; private int _x; - public byte[] Buf - { - get { return _buf; } - set { _buf = value; } - } - public long Version { --- 12,18 ---- Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Glarch.hbm.xml 13 Aug 2004 18:54:29 -0000 1.8 --- Glarch.hbm.xml 31 Aug 2004 21:22:58 -0000 1.9 *************** *** 111,120 **** column="version" /> ! ! <property name="Any" type="Object"> ! <column name="`any_id of object`" /> ! <column name="`any_class of object`" /> ! </property> ! <property name="Multiple" --- 111,115 ---- column="version" /> ! <property name="Multiple" |
From: Michael D. <mik...@us...> - 2004-08-31 21:23:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18669/src/NHibernate.DomainModel/NHSpecific Modified Files: BasicBinary.hbm.xml BasicObject.cs BasicObject.hbm.xml Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: BasicBinary.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicBinary.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicBinary.hbm.xml 29 Jun 2004 04:28:08 -0000 1.1 --- BasicBinary.hbm.xml 31 Aug 2004 21:22:58 -0000 1.2 *************** *** 11,15 **** </id> ! <property name="DefaultSize" type="Byte[]" column="bin_def"/> <property name="WithSize" type="Byte[](2048880)" column="bin_size" /> </class> --- 11,15 ---- </id> ! <property name="DefaultSize" column="bin_def"/> <property name="WithSize" type="Byte[](2048880)" column="bin_size" /> </class> Index: BasicObject.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicObject.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicObject.cs 31 Aug 2004 20:24:24 -0000 1.1 --- BasicObject.cs 31 Aug 2004 21:22:58 -0000 1.2 *************** *** 14,19 **** { private int _id; - private object _any; private string _name; public int Id --- 14,20 ---- { private int _id; private string _name; + private object _any; + private object _anyProxy; public int Id *************** *** 35,38 **** --- 36,45 ---- } + public object AnyWithProxy + { + get { return _anyProxy; } + set { _anyProxy = value; } + } + } *************** *** 59,61 **** --- 66,99 ---- } + + public interface IBasicObjectProxy + { + int Id { get; set; } + string Name { get; set; } + } + + [Serializable] + public class BasicObjectProxy : IBasicObjectProxy + { + private int _id; + private string _name; + + #region IBasicObjectProxy Members + + public int Id + { + get { return _id; } + set { _id = value; } + } + + public string Name + { + get { return _name; } + set { _name = value; } + } + + #endregion + + } + } Index: BasicObject.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/BasicObject.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicObject.hbm.xml 31 Aug 2004 20:24:24 -0000 1.1 --- BasicObject.hbm.xml 31 Aug 2004 21:22:58 -0000 1.2 *************** *** 14,17 **** --- 14,23 ---- <column name="id_ser" /> </property> + + <property name="AnyWithProxy" type="Object" > + <column name="the_ptype" /> + <column name="id_pser" /> + </property> + </class> *************** *** 27,30 **** --- 33,52 ---- </class> + <class + name="NHibernate.DomainModel.NHSpecific.BasicObjectProxy, NHibernate.DomainModel" + table="bc_ref_p" + + > + <!-- + uncomment once proxies are working + proxy="NHibernate.DomainModel.NHSpecific.IBasicObjectProxy, NHibernate.DomainModel" + --> + <id name="Id"> + <generator class="native" /> + </id> + + <property name="Name" /> + + </class> </hibernate-mapping> \ No newline at end of file |
From: Michael D. <mik...@us...> - 2004-08-31 20:37:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9207/src/NHibernate.Test/NHSpecificTest Modified Files: BasicClassFixture.cs Added Files: BasicObjectFixture.cs BasicSerializableFixture.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicClassFixture.cs 16 Aug 2004 05:15:10 -0000 1.3 --- BasicClassFixture.cs 31 Aug 2004 20:37:29 -0000 1.4 *************** *** 231,251 **** AssertPropertiesEqual(bc[index-1], bc[index]); - bc[index].SerializableProperty = new SerializableClass(); - bc[index].SerializableProperty._classId = 1; - bc[index].SerializableProperty._classString = "one string"; - s[index].Update(bc[index]); - - t[index].Commit(); - s[index].Close(); - - index++; - - // make sure the previous updates went through - s[index] = sessions.OpenSession(); - t[index] = s[index].BeginTransaction(); - - bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); - AssertPropertiesEqual(bc[index-1], bc[index]); - bc[index].SingleProperty = bc[index].SingleProperty * -1; s[index].Update(bc[index]); --- 231,234 ---- *************** *** 856,860 **** Assert.AreEqual(expected.Int32Property, actual.Int32Property, "Int32Property"); Assert.AreEqual(expected.Int64Property, actual.Int64Property, "Int64Property"); - Assert.AreEqual(expected.SerializableProperty, actual.SerializableProperty, "SerializableProperty"); Assert.AreEqual(expected.SingleProperty, actual.SingleProperty, 0, "SingleProperty"); Assert.AreEqual(expected.StringProperty, actual.StringProperty, "StringProperty"); --- 839,842 ---- *************** *** 892,899 **** basicClass.Int64Property = Int64.MaxValue; - basicClass.SerializableProperty = new SerializableClass(); - basicClass.SerializableProperty._classId = 2; - basicClass.SerializableProperty._classString = "string"; - // more MySql problems - it returns 3.40282E38 // instead of 3.402823E+38 which is Single.MaxValue --- 874,877 ---- --- NEW FILE: BasicSerializableFixture.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// TestFixture for <c>type="Serializable"</c> in use by classes. It test a Property /// that is mapped specifically by <c>type="Serializable"</c> and another Property /// whose type is a class that is serializable. /// </summary> [TestFixture] public class BasicSerializableFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BasicSerializable.hbm.xml"}, true ); } /// <summary> /// This contains portions of FumTest.CompositeIDs that deal with <c>type="Serializable"</c> /// and replacements Foo.NullBlob, and Foo.Blob. /// </summary> [Test] public void TestCRUD() { ISession s = sessions.OpenSession(); BasicSerializable ser = new BasicSerializable(); SerializableClass serClass = ser.SerializableProperty; s.Save(ser); s.Flush(); s.Close(); s = sessions.OpenSession(); ser = (BasicSerializable)s.Load( typeof(BasicSerializable), ser.Id ); Assert.IsNull( ser.Serial , "should have saved as null" ); ser.Serial = ser.SerializableProperty; s.Flush(); s.Close(); s = sessions.OpenSession(); ser = (BasicSerializable)s.Load( typeof(BasicSerializable), ser.Id ); Assert.IsTrue( ser.Serial is SerializableClass, "should have been a SerializableClass" ); Assert.AreEqual( ser.SerializableProperty, ser.Serial, "SerializablePorperty and Serial should both be 5 and 'serialize me'" ); IDictionary props = new Hashtable(); props["foo"] = "bar"; props["bar"] = "foo"; ser.Serial = props; s.Flush(); props["x"] = "y"; s.Flush(); s.Close(); s = sessions.OpenSession(); ser = (BasicSerializable)s.Load( typeof(BasicSerializable), ser.Id ); props = (IDictionary)ser.Serial; Assert.AreEqual( "bar", props["foo"] ); Assert.AreEqual( "y", props["x"] ); Assert.AreEqual( serClass, ser.SerializableProperty ); ser.SerializableProperty._classString = "modify me"; s.Flush(); s.Close(); s = sessions.OpenSession(); ser = (BasicSerializable)s.Load( typeof(BasicSerializable), ser.Id ); Assert.AreEqual( "modify me", ser.SerializableProperty._classString ); Assert.AreEqual( "bar", props["foo"] ); Assert.AreEqual( "y", props["x"] ); s.Delete(ser); s.Flush(); s.Close(); } } } --- NEW FILE: BasicObjectFixture.cs --- using System; using NHibernate; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { /// <summary> /// Test mappings of <c>type="Object"</c> /// </summary> /// <remarks> /// Moved that mapping out of ParentChildTest because MySql has a bug with writing /// binary types to the database. So any TestFixture that used <see cref="NHibernate.DomainModel.Parent"/> /// would fail. /// </remarks> [TestFixture] public class BasicObjectFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.BasicObject.hbm.xml"}, true ); } /// <summary> /// This is the replacement for ParentChildTest.ObjectType() /// </summary> [Test] public void TestCRUD() { ISession s = sessions.OpenSession(); BasicObjectRef any = new BasicObjectRef(); any.Name = "the any"; BasicObject bo = new BasicObject(); bo.Name = "the object"; bo.Any = any; s.Save(any); s.Save(bo); s.Flush(); s.Close(); s = sessions.OpenSession(); bo = (BasicObject)s.Load( typeof(BasicObject), bo.Id ); Assert.IsNotNull( bo.Any , "any should not be null" ); Assert.IsTrue( bo.Any is BasicObjectRef, "any should have been a BasicObjectRef instance" ); any = (BasicObjectRef)s.Load( typeof(BasicObjectRef), any.Id ); Assert.AreSame( any, bo.Any, "any loaded and ref by BasicObject should be the same" ); s.Delete(any); s.Delete(bo); s.Flush(); s.Close(); } } } |
From: Michael D. <mik...@us...> - 2004-08-31 20:37:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9207/src/NHibernate.Test Modified Files: FumTest.cs NHibernate.Test-1.1.csproj ParentChildTest.cs Log Message: Beginning to isolate the Types so I can figure out what is ADO.NET driver problems and which are NHibernate problems. NH works great with Ms Sql 2000, but not so great with MySql & Oracle. Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ParentChildTest.cs 13 Aug 2004 13:26:35 -0000 1.7 --- ParentChildTest.cs 31 Aug 2004 20:37:28 -0000 1.8 *************** *** 653,677 **** } ! [Test] ! public void ObjectType() ! { ! ISession s = sessions.OpenSession(); ! Parent g = new Parent(); ! Foo foo = new Foo(); ! g.Any = foo; ! s.Save(g); ! s.Save(foo); ! s.Flush(); ! s.Close(); ! ! s = sessions.OpenSession(); ! g = (Parent)s.Load( typeof(Parent), g.Id ); ! Assert.IsNotNull( g.Any ); ! Assert.IsTrue( g.Any is FooProxy ); ! s.Delete( g.Any ); ! s.Delete(g); ! s.Flush(); ! s.Close(); ! } --- 653,677 ---- } ! // [Test] ! // public void ObjectType() ! // { ! // ISession s = sessions.OpenSession(); ! // Parent g = new Parent(); ! // Foo foo = new Foo(); ! // g.Any = foo; ! // s.Save(g); ! // s.Save(foo); ! // s.Flush(); ! // s.Close(); ! // ! // s = sessions.OpenSession(); ! // g = (Parent)s.Load( typeof(Parent), g.Id ); ! // Assert.IsNotNull( g.Any ); ! // Assert.IsTrue( g.Any is FooProxy ); ! // s.Delete( g.Any ); ! // s.Delete(g); ! // s.Flush(); ! // s.Close(); ! // } Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FumTest.cs 20 Aug 2004 15:34:05 -0000 1.13 --- FumTest.cs 31 Aug 2004 20:37:28 -0000 1.14 *************** *** 368,388 **** ISession s = sessions.OpenSession(); Fo fo = Fo.NewFo(); - IDictionary props = new Hashtable(); - props["foo"] = "bar"; - props["bar"] = "foo"; - fo.Serial = props; fo.Buf = System.Text.Encoding.ASCII.GetBytes("abcdefghij1`23%$*^*$*\n\t"); s.Save( fo, FumTest.FumKey("an instance of fo") ); s.Flush(); - props["x"] = "y"; - s.Flush(); s.Close(); s = sessions.OpenSession(); fo = (Fo)s.Load( typeof(Fo), FumTest.FumKey("an instance of fo") ); - props = (IDictionary)fo.Serial; - Assert.AreEqual( "bar", props["foo"] ); - Assert.AreEqual( "y", props["x"] ); - Assert.AreEqual( 'a', fo.Buf[0] ); fo.Buf[1] = (byte)126; s.Flush(); --- 368,378 ---- Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** NHibernate.Test-1.1.csproj 26 Aug 2004 14:28:43 -0000 1.38 --- NHibernate.Test-1.1.csproj 31 Aug 2004 20:37:28 -0000 1.39 *************** *** 317,320 **** --- 317,330 ---- /> <File + RelPath = "NHSpecificTest\BasicObjectFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecificTest\BasicSerializableFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\BlobberInMemoryFixture.cs" SubType = "Code" |