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: Kevin W. <kev...@us...> - 2004-12-31 18:22:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27817 Modified Files: QueryTranslator.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** QueryTranslator.cs 27 Dec 2004 03:53:52 -0000 1.51 --- QueryTranslator.cs 31 Dec 2004 18:21:59 -0000 1.52 *************** *** 5,16 **** using System.Runtime.CompilerServices; using System.Text; - using Iesi.Collections; ! ! using NHibernate; using NHibernate.Collection; using NHibernate.Engine; using NHibernate.Impl; - using NHibernate.Loader; [...2842 lines suppressed...] ! for( int i = 0; i < paramTypeList.Count; i++ ) { ! IType type = ( IType ) paramTypeList[ i ]; ! string[ ] colNames = new string[type.GetColumnSpan( factory )]; ! for( int j = 0; j < colNames.Length; j++ ) { ! colNames[ j ] = "p" + paramIndex.ToString() + j.ToString(); } ! Parameter[ ] sqlParameters = Parameter.GenerateParameters( factory, colNames, type ); ! foreach( Parameter param in sqlParameters ) { ! sqlPartIndex = paramIndexes[ paramIndex ]; ! sql.SqlParts[ sqlPartIndex ] = param; ! paramIndex++; } |
From: Kevin W. <kev...@us...> - 2004-12-31 17:56:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23216 Modified Files: LogicalExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: LogicalExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LogicalExpression.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LogicalExpression.cs 31 Dec 2004 17:54:36 -0000 1.5 --- LogicalExpression.cs 31 Dec 2004 17:56:25 -0000 1.6 *************** *** 10,14 **** --- 10,16 ---- public abstract class LogicalExpression : Expression { + /// <summary></summary> protected Expression lhs; + /// <summary></summary> protected Expression rhs; |
From: Kevin W. <kev...@us...> - 2004-12-31 17:56:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23023 Modified Files: OrExpression.cs PropertyExpression.cs SimpleExpression.cs SQLExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: OrExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/OrExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OrExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- OrExpression.cs 31 Dec 2004 17:55:48 -0000 1.4 *************** *** 1,14 **** ! using System; ! ! namespace NHibernate.Expression { ! /// <summary> /// An Expression that combines two <see cref="Expression"/>s with an /// <c>"or"</c> between them. /// </summary> ! public class OrExpression : LogicalExpression { ! ! internal OrExpression(Expression lhs, Expression rhs) : base (lhs,rhs) { } --- 1,16 ---- ! namespace NHibernate.Expression ! { /// <summary> /// An Expression that combines two <see cref="Expression"/>s with an /// <c>"or"</c> between them. /// </summary> ! public class OrExpression : LogicalExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="lhs"></param> ! /// <param name="rhs"></param> ! internal OrExpression( Expression lhs, Expression rhs ) : base( lhs, rhs ) { } *************** *** 18,25 **** /// </summary> /// <value>Returns "<c>or</c>"</value> ! protected override string Op { get { return "or"; } } } ! } --- 20,27 ---- /// </summary> /// <value>Returns "<c>or</c>"</value> ! protected override string Op { get { return "or"; } } } ! } \ No newline at end of file Index: SQLExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/SQLExpression.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SQLExpression.cs 26 Aug 2004 14:28:18 -0000 1.7 --- SQLExpression.cs 31 Dec 2004 17:55:48 -0000 1.8 *************** *** 1,10 **** - using System; - using NHibernate.Engine; using NHibernate.SqlCommand; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { /// <summary> --- 1,7 ---- using NHibernate.Engine; using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> *************** *** 17,50 **** public class SQLExpression : Expression { - private readonly SqlString sql; ! private readonly TypedValue[] typedValues; ! internal SQLExpression(SqlString sql, object[] values, IType[] types) { this.sql = sql; typedValues = new TypedValue[values.Length]; ! for ( int i=0; i<typedValues.Length; i++ ) { ! typedValues[i] = new TypedValue( types[i], values[i] ); } } ! ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { return sql.Replace( "$alias", alias ); } ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { return typedValues; } ! public override string ToString() { return sql.ToString(); } } ! } ! --- 14,64 ---- public class SQLExpression : Expression { private readonly SqlString sql; ! private readonly TypedValue[ ] typedValues; ! /// <summary> ! /// ! /// </summary> ! /// <param name="sql"></param> ! /// <param name="values"></param> ! /// <param name="types"></param> ! internal SQLExpression( SqlString sql, object[ ] values, IType[ ] types ) { this.sql = sql; typedValues = new TypedValue[values.Length]; ! for( int i = 0; i < typedValues.Length; i++ ) { ! typedValues[ i ] = new TypedValue( types[ i ], values[ i ] ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { return sql.Replace( "$alias", alias ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { return typedValues; } ! /// <summary></summary> ! public override string ToString() { return sql.ToString(); } } ! } \ No newline at end of file Index: SimpleExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/SimpleExpression.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SimpleExpression.cs 28 Mar 2004 06:05:09 -0000 1.5 --- SimpleExpression.cs 31 Dec 2004 17:55:48 -0000 1.6 *************** *** 1,12 **** - using System; - using System.Text; - using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { /// <summary> --- 1,8 ---- using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> *************** *** 14,20 **** /// to a value. /// </summary> ! public abstract class SimpleExpression : Expression { - private readonly string propertyName; --- 10,15 ---- /// to a value. /// </summary> ! public abstract class SimpleExpression : Expression { private readonly string propertyName; *************** *** 27,31 **** /// <param name="propertyName">The name of the Property in the class.</param> /// <param name="expressionValue">The value for the Property.</param> ! internal SimpleExpression(string propertyName, object expressionValue) { this.propertyName = propertyName; --- 22,26 ---- /// <param name="propertyName">The name of the Property in the class.</param> /// <param name="expressionValue">The value for the Property.</param> ! internal SimpleExpression( string propertyName, object expressionValue ) { this.propertyName = propertyName; *************** *** 37,43 **** /// </summary> /// <value>A string that is the name of the Property.</value> ! public string PropertyName { ! get {return propertyName;} } --- 32,38 ---- /// </summary> /// <value>A string that is the name of the Property.</value> ! public string PropertyName { ! get { return propertyName; } } *************** *** 46,52 **** /// </summary> /// <value>An object that is the value for the Expression.</value> ! public object Value { ! get {return expressionValue;} } --- 41,47 ---- /// </summary> /// <value>An object that is the value for the Expression.</value> ! public object Value { ! get { return expressionValue; } } *************** *** 58,80 **** /// <param name="alias">The alias to use for the table.</param> /// <returns>A SqlString that contains a valid Sql fragment.</returns> ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { - //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! string[] paramColumnNames = GetColumns(factory, persistentClass, propertyName , null); ! Parameter[] parameters = Parameter.GenerateParameters(factory, alias, paramColumnNames, propertyType); ! ! for(int i = 0; i < columnNames.Length; i++) { ! if(i > 0) sqlBuilder.Add(" AND "); ! ! sqlBuilder.Add(columnNames[i]) ! .Add(Op) ! .Add(parameters[i]); } --- 53,77 ---- /// <param name="alias">The alias to use for the table.</param> /// <returns>A SqlString that contains a valid Sql fragment.</returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! string[ ] paramColumnNames = GetColumns( factory, persistentClass, propertyName, null ); ! Parameter[ ] parameters = Parameter.GenerateParameters( factory, alias, paramColumnNames, propertyType ); ! ! for( int i = 0; i < columnNames.Length; i++ ) { ! if( i > 0 ) ! { ! sqlBuilder.Add( " AND " ); ! } ! ! sqlBuilder.Add( columnNames[ i ] ) ! .Add( Op ) ! .Add( parameters[ i ] ); } *************** *** 83,97 **** } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! return new TypedValue[] { GetTypedValue(sessionFactory, persistentClass, propertyName, expressionValue) }; } ! public override string ToString() { return propertyName + Op + expressionValue; } protected abstract string Op { get; } //protected ??? } --- 80,101 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! return new TypedValue[ ] {GetTypedValue( sessionFactory, persistentClass, propertyName, expressionValue )}; } ! /// <summary></summary> ! public override string ToString() { return propertyName + Op + expressionValue; } + /// <summary></summary> protected abstract string Op { get; } //protected ??? } Index: PropertyExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/PropertyExpression.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyExpression.cs 2 Aug 2004 04:30:37 -0000 1.1 --- PropertyExpression.cs 31 Dec 2004 17:55:48 -0000 1.2 *************** *** 1,63 **** - using System; - using NHibernate.Engine; using NHibernate.SqlCommand; - using NHibernate.Util; namespace NHibernate.Expression { ! /// <summary> ! /// Superclass for comparisons between two properties (with SQL binary operators) ! /// </summary> ! public abstract class PropertyExpression : Expression ! { ! private string propertyName; ! private string otherPropertyName; ! private static TypedValue[] NoTypedValues = new TypedValue[0]; ! protected PropertyExpression(string propertyName, string otherPropertyName) ! { ! this.propertyName = propertyName; ! this.otherPropertyName = otherPropertyName; ! } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) ! { ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! string[] otherColumnNames = GetColumns(factory, persistentClass, otherPropertyName, alias); ! bool andNeeded = false; ! for (int i = 0; i < columnNames.Length; i++) ! { ! if (andNeeded) ! sqlBuilder.Add(" AND "); ! andNeeded = true; ! ! sqlBuilder.Add(columnNames[i]).Add(Op).Add(otherColumnNames[i]); ! } ! return sqlBuilder.ToSqlString(); ! //TODO: get SQL rendering out of this package! ! } ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) ! { ! return NoTypedValues; ! } ! public override string ToString() ! { ! return propertyName + Op + otherPropertyName; ! } ! protected abstract string Op ! { ! get; ! } ! } } \ No newline at end of file --- 1,79 ---- using NHibernate.Engine; using NHibernate.SqlCommand; namespace NHibernate.Expression { ! /// <summary> ! /// Superclass for comparisons between two properties (with SQL binary operators) ! /// </summary> ! public abstract class PropertyExpression : Expression ! { ! private string propertyName; ! private string otherPropertyName; ! private static TypedValue[ ] NoTypedValues = new TypedValue[0]; ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="otherPropertyName"></param> ! protected PropertyExpression( string propertyName, string otherPropertyName ) ! { ! this.propertyName = propertyName; ! this.otherPropertyName = otherPropertyName; ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) ! { ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! string[ ] otherColumnNames = GetColumns( factory, persistentClass, otherPropertyName, alias ); ! bool andNeeded = false; ! for( int i = 0; i < columnNames.Length; i++ ) ! { ! if( andNeeded ) ! { ! sqlBuilder.Add( " AND " ); ! } ! andNeeded = true; ! sqlBuilder.Add( columnNames[ i ] ).Add( Op ).Add( otherColumnNames[ i ] ); ! } ! return sqlBuilder.ToSqlString(); ! //TODO: get SQL rendering out of this package! ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) ! { ! return NoTypedValues; ! } ! /// <summary></summary> ! public override string ToString() ! { ! return propertyName + Op + otherPropertyName; ! } ! ! /// <summary></summary> ! protected abstract string Op { get; } ! } } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:55:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22938 Modified Files: NotNullExpression.cs NullExpression.cs Order.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: Order.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Order.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Order.cs 28 Mar 2004 06:05:09 -0000 1.4 --- Order.cs 31 Dec 2004 17:55:35 -0000 1.5 *************** *** 1,15 **** - using System; - using NHibernate.Engine; ! namespace NHibernate.Expression { - /// <summary> /// Represents an order imposed upon a ICriteria result set /// </summary> ! public class Order { - private bool ascending; private string propertyName; --- 1,11 ---- using NHibernate.Engine; ! namespace NHibernate.Expression { /// <summary> /// Represents an order imposed upon a ICriteria result set /// </summary> ! public class Order { private bool ascending; private string propertyName; *************** *** 20,30 **** /// <param name="propertyName"></param> /// <param name="ascending"></param> ! protected Order(string propertyName, bool ascending) { this.propertyName = propertyName; this.ascending = ascending; } ! ! /// <summary> /// Render the SQL fragment --- 16,26 ---- /// <param name="propertyName"></param> /// <param name="ascending"></param> ! protected Order( string propertyName, bool ascending ) { this.propertyName = propertyName; this.ascending = ascending; } ! ! /// <summary> /// Render the SQL fragment *************** *** 34,44 **** /// <param name="alias"></param> /// <returns></returns> ! public string ToStringForSql(ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string alias) { ! string[] columns = Expression.GetColumns(sessionFactory, persistentClass, propertyName, alias); ! if (columns.Length!=1) throw new HibernateException("Cannot order by multi-column property: " + propertyName); ! return columns[0] + ( ascending ? " asc" : " desc" ); } ! /// <summary> /// Ascending order --- 30,43 ---- /// <param name="alias"></param> /// <returns></returns> ! public string ToStringForSql( ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string alias ) { ! string[ ] columns = Expression.GetColumns( sessionFactory, persistentClass, propertyName, alias ); ! if( columns.Length != 1 ) ! { ! throw new HibernateException( "Cannot order by multi-column property: " + propertyName ); ! } ! return columns[ 0 ] + ( ascending ? " asc" : " desc" ); } ! /// <summary> /// Ascending order *************** *** 46,54 **** /// <param name="propertyName"></param> /// <returns></returns> ! public static Order Asc(string propertyName) { ! return new Order(propertyName, true); } ! /// <summary> /// Descending order --- 45,53 ---- /// <param name="propertyName"></param> /// <returns></returns> ! public static Order Asc( string propertyName ) { ! return new Order( propertyName, true ); } ! /// <summary> /// Descending order *************** *** 56,62 **** /// <param name="propertyName"></param> /// <returns></returns> ! public static Order Desc(string propertyName) { ! return new Order(propertyName, false); } } --- 55,61 ---- /// <param name="propertyName"></param> /// <returns></returns> ! public static Order Desc( string propertyName ) { ! return new Order( propertyName, false ); } } Index: NotNullExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/NotNullExpression.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NotNullExpression.cs 28 Mar 2004 06:05:09 -0000 1.5 --- NotNullExpression.cs 31 Dec 2004 17:55:35 -0000 1.6 *************** *** 1,48 **** - using System; - using System.Text; - using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { - /// <summary> /// Constrains a property to be non-null /// </summary> ! public class NotNullExpression : Expression { - private readonly string propertyName; ! ! private static readonly TypedValue[] NoValues = new TypedValue[0]; ! ! internal NotNullExpression(string propertyName) { this.propertyName = propertyName; } ! ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! ! bool andNeeded = false; ! ! for(int i = 0; i < columnNames.Length; i++) { ! if(andNeeded) sqlBuilder.Add(" AND "); andNeeded = true; ! sqlBuilder.Add(columnNames[i]) ! .Add(" IS NOT NULL"); } --- 1,55 ---- using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> /// Constrains a property to be non-null /// </summary> ! public class NotNullExpression : Expression { private readonly string propertyName; ! ! private static readonly TypedValue[ ] NoValues = new TypedValue[0]; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! internal NotNullExpression( string propertyName ) { this.propertyName = propertyName; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! ! bool andNeeded = false; ! ! for( int i = 0; i < columnNames.Length; i++ ) { ! if( andNeeded ) ! { ! sqlBuilder.Add( " AND " ); ! } andNeeded = true; ! sqlBuilder.Add( columnNames[ i ] ) ! .Add( " IS NOT NULL" ); } *************** *** 50,60 **** return sqlBuilder.ToSqlString(); } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { return NoValues; } ! public override string ToString() { return propertyName + " is not null"; --- 57,74 ---- return sqlBuilder.ToSqlString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { return NoValues; } ! /// <summary></summary> ! public override string ToString() { return propertyName + " is not null"; Index: NullExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/NullExpression.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NullExpression.cs 28 Mar 2004 06:05:09 -0000 1.5 --- NullExpression.cs 31 Dec 2004 17:55:35 -0000 1.6 *************** *** 1,43 **** - using System; - using System.Text; - using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { - /// <summary> /// Constrains a property to be null /// </summary> ! public class NullExpression : Expression { - private readonly string propertyName; ! ! private static readonly TypedValue[] NoValues = new TypedValue[0]; ! ! internal NullExpression(string propertyName) { this.propertyName = propertyName; } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! ! for(int i = 0; i < columnNames.Length; i++) { ! if(i > 0) sqlBuilder.Add(" AND "); ! ! sqlBuilder.Add(columnNames[i]) ! .Add(" IS NULL"); } --- 1,51 ---- using NHibernate.Engine; using NHibernate.Persister; using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> /// Constrains a property to be null /// </summary> ! public class NullExpression : Expression { private readonly string propertyName; ! ! private static readonly TypedValue[ ] NoValues = new TypedValue[0]; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! internal NullExpression( string propertyName ) { this.propertyName = propertyName; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! ! for( int i = 0; i < columnNames.Length; i++ ) { ! if( i > 0 ) ! { ! sqlBuilder.Add( " AND " ); ! } ! ! sqlBuilder.Add( columnNames[ i ] ) ! .Add( " IS NULL" ); } *************** *** 45,55 **** return sqlBuilder.ToSqlString(); } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { return NoValues; } ! public override string ToString() { return propertyName + " is null"; --- 53,70 ---- return sqlBuilder.ToSqlString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { return NoValues; } ! /// <summary></summary> ! public override string ToString() { return propertyName + " is null"; |
From: Kevin W. <kev...@us...> - 2004-12-31 17:55:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22865 Modified Files: LtExpression.cs LtPropertyExpression.cs NotExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: LtExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LtExpression.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LtExpression.cs 28 Mar 2004 06:05:09 -0000 1.2 --- LtExpression.cs 31 Dec 2004 17:55:06 -0000 1.3 *************** *** 1,18 **** ! using System; ! ! namespace NHibernate.Expression { ! ! public class LtExpression : SimpleExpression { ! ! internal LtExpression(string propertyName, object value) : base (propertyName, value) { } ! protected override string Op { get { return "<"; } } } ! } --- 1,21 ---- ! namespace NHibernate.Expression { ! /// <summary></summary> ! public class LtExpression : SimpleExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! internal LtExpression( string propertyName, object value ) : base( propertyName, value ) { } ! /// <summary></summary> ! protected override string Op { get { return "<"; } } } ! } \ No newline at end of file Index: NotExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/NotExpression.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NotExpression.cs 28 Mar 2004 06:05:09 -0000 1.4 --- NotExpression.cs 31 Dec 2004 17:55:06 -0000 1.5 *************** *** 1,39 **** - using System; - using NHibernate.Engine; using NHibernate.SqlCommand; - using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { /// <summary> /// Negates another expression. /// </summary> ! public class NotExpression : Expression { private Expression expression; ! internal NotExpression(Expression expression) { this.expression = expression; } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: set default capacity SqlStringBuilder builder = new SqlStringBuilder(); ! builder.Add("not "); ! builder.Add(expression.ToSqlString(factory, persistentClass, alias)); return builder.ToSqlString(); } ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! return expression.GetTypedValues(sessionFactory, persistentClass); } ! public override string ToString() { return "not " + expression.ToString(); } --- 1,54 ---- using NHibernate.Engine; using NHibernate.SqlCommand; ! namespace NHibernate.Expression { /// <summary> /// Negates another expression. /// </summary> ! public class NotExpression : Expression { private Expression expression; ! /// <summary> ! /// ! /// </summary> ! /// <param name="expression"></param> ! internal NotExpression( Expression expression ) { this.expression = expression; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: set default capacity SqlStringBuilder builder = new SqlStringBuilder(); ! builder.Add( "not " ); ! builder.Add( expression.ToSqlString( factory, persistentClass, alias ) ); return builder.ToSqlString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! return expression.GetTypedValues( sessionFactory, persistentClass ); } ! /// <summary></summary> ! public override string ToString() ! { return "not " + expression.ToString(); } Index: LtPropertyExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LtPropertyExpression.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LtPropertyExpression.cs 2 Aug 2004 04:30:37 -0000 1.1 --- LtPropertyExpression.cs 31 Dec 2004 17:55:06 -0000 1.2 *************** *** 1,17 **** - using System; - namespace NHibernate.Expression { ! public class LtPropertyExpression : PropertyExpression ! { ! public LtPropertyExpression(string propertyName, string otherPropertyName) ! : base(propertyName, otherPropertyName) ! { ! } ! protected override string Op ! { ! get { return " < "; } ! } ! } } \ No newline at end of file --- 1,22 ---- namespace NHibernate.Expression { ! /// <summary></summary> ! public class LtPropertyExpression : PropertyExpression ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="otherPropertyName"></param> ! public LtPropertyExpression( string propertyName, string otherPropertyName ) ! : base( propertyName, otherPropertyName ) ! { ! } ! /// <summary></summary> ! protected override string Op ! { ! get { return " < "; } ! } ! } } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:54:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22686 Modified Files: LePropertyExpression.cs LikeExpression.cs LogicalExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: LogicalExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LogicalExpression.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LogicalExpression.cs 22 Nov 2004 03:55:59 -0000 1.4 --- LogicalExpression.cs 31 Dec 2004 17:54:36 -0000 1.5 *************** *** 1,19 **** using System; - using System.Text; - using System.Collections; - using NHibernate.Engine; using NHibernate.SqlCommand; - using NHibernate.Util; ! namespace NHibernate.Expression { - /// <summary> /// Base Class of binary logical expressions. /// </summary> ! public abstract class LogicalExpression : Expression { - protected Expression lhs; protected Expression rhs; --- 1,13 ---- using System; using NHibernate.Engine; using NHibernate.SqlCommand; ! namespace NHibernate.Expression { /// <summary> /// Base Class of binary logical expressions. /// </summary> ! public abstract class LogicalExpression : Expression { protected Expression lhs; protected Expression rhs; *************** *** 25,29 **** /// <param name="lhs">The Expression to use in the Left Hand Side.</param> /// <param name="rhs">The Expression to use in the Right Hand Side.</param> ! internal LogicalExpression(Expression lhs, Expression rhs) { this.lhs = lhs; --- 19,23 ---- /// <param name="lhs">The Expression to use in the Left Hand Side.</param> /// <param name="rhs">The Expression to use in the Right Hand Side.</param> ! internal LogicalExpression( Expression lhs, Expression rhs ) { this.lhs = lhs; *************** *** 34,38 **** /// The Expression that will be on the Left Hand Side of the Op. /// </summary> ! protected Expression LeftHandSide { get { return lhs; } --- 28,32 ---- /// The Expression that will be on the Left Hand Side of the Op. /// </summary> ! protected Expression LeftHandSide { get { return lhs; } *************** *** 42,46 **** /// The Expression that will be on the Right Hand Side of the Op. /// </summary> ! protected Expression RightHandSide { get { return rhs; } --- 36,40 ---- /// The Expression that will be on the Right Hand Side of the Op. /// </summary> ! protected Expression RightHandSide { get { return rhs; } *************** *** 53,64 **** /// <param name="sessionFactory">The ISessionFactory to get the Persistence information from.</param> /// <param name="persistentClass">The Type we are constructing the Expression for.</param> ! /// <returns>An arry of <see cref="TypeValue"/>s.</returns> ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! TypedValue[] lhstv = lhs.GetTypedValues(sessionFactory, persistentClass); ! TypedValue[] rhstv = rhs.GetTypedValues(sessionFactory, persistentClass); ! TypedValue[] result = new TypedValue[ lhstv.Length + rhstv.Length ]; ! Array.Copy(lhstv, 0, result, 0, lhstv.Length); ! Array.Copy(rhstv, 0, result, lhstv.Length, rhstv.Length); return result; } --- 47,58 ---- /// <param name="sessionFactory">The ISessionFactory to get the Persistence information from.</param> /// <param name="persistentClass">The Type we are constructing the Expression for.</param> ! /// <returns>An arry of <see cref="TypedValue"/>s.</returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! TypedValue[ ] lhstv = lhs.GetTypedValues( sessionFactory, persistentClass ); ! TypedValue[ ] rhstv = rhs.GetTypedValues( sessionFactory, persistentClass ); ! TypedValue[ ] result = new TypedValue[lhstv.Length + rhstv.Length]; ! Array.Copy( lhstv, 0, result, 0, lhstv.Length ); ! Array.Copy( rhstv, 0, result, lhstv.Length, rhstv.Length ); return result; } *************** *** 72,89 **** /// <returns>A well formed SqlString for the Where clause.</returns> /// <remarks>The SqlString will be enclosed by <c>(</c> and <c>)</c>.</remarks> ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! SqlString lhSqlString = lhs.ToSqlString(factory, persistentClass, alias); ! SqlString rhSqlString = rhs.ToSqlString(factory, persistentClass, alias); - sqlBuilder.Add(new SqlString[] {lhSqlString, rhSqlString}, - "(", - Op, - ")"); - - return sqlBuilder.ToSqlString(); } --- 66,83 ---- /// <returns>A well formed SqlString for the Where clause.</returns> /// <remarks>The SqlString will be enclosed by <c>(</c> and <c>)</c>.</remarks> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! SqlString lhSqlString = lhs.ToSqlString( factory, persistentClass, alias ); ! SqlString rhSqlString = rhs.ToSqlString( factory, persistentClass, alias ); ! ! sqlBuilder.Add( new SqlString[ ] {lhSqlString, rhSqlString}, ! "(", ! Op, ! ")" ); ! return sqlBuilder.ToSqlString(); } *************** *** 105,109 **** /// are being combined. /// </remarks> ! public override string ToString() { return lhs.ToString() + ' ' + Op + ' ' + rhs.ToString(); --- 99,103 ---- /// are being combined. /// </remarks> ! public override string ToString() { return lhs.ToString() + ' ' + Op + ' ' + rhs.ToString(); Index: LikeExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LikeExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LikeExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- LikeExpression.cs 31 Dec 2004 17:54:36 -0000 1.4 *************** *** 1,4 **** - using System; - namespace NHibernate.Expression { --- 1,2 ---- *************** *** 6,18 **** /// Summary description for LikeExpression. /// </summary> ! public class LikeExpression: SimpleExpression { ! internal LikeExpression(string propertyName, object value) : base (propertyName, value) {} ! ! protected override string Op { get { return " like "; } } } ! } --- 4,23 ---- /// Summary description for LikeExpression. /// </summary> ! public class LikeExpression : SimpleExpression { + /// <summary> + /// + /// </summary> + /// <param name="propertyName"></param> + /// <param name="value"></param> + internal LikeExpression( string propertyName, object value ) : base( propertyName, value ) + { + } ! /// <summary></summary> ! protected override string Op { get { return " like "; } } } ! } \ No newline at end of file Index: LePropertyExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LePropertyExpression.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LePropertyExpression.cs 2 Aug 2004 04:30:37 -0000 1.1 --- LePropertyExpression.cs 31 Dec 2004 17:54:36 -0000 1.2 *************** *** 1,17 **** - using System; - namespace NHibernate.Expression { ! public class LePropertyExpression : PropertyExpression ! { ! public LePropertyExpression(string propertyName, string otherPropertyName) ! : base(propertyName, otherPropertyName) ! { ! } ! protected override string Op ! { ! get { return " <= "; } ! } ! } } \ No newline at end of file --- 1,22 ---- namespace NHibernate.Expression { ! /// <summary></summary> ! public class LePropertyExpression : PropertyExpression ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="otherPropertyName"></param> ! public LePropertyExpression( string propertyName, string otherPropertyName ) ! : base( propertyName, otherPropertyName ) ! { ! } ! /// <summary></summary> ! protected override string Op ! { ! get { return " <= "; } ! } ! } } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:54:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22649 Modified Files: InsensitiveLikeExpression.cs Junction.cs LeExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: InsensitiveLikeExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/InsensitiveLikeExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InsensitiveLikeExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- InsensitiveLikeExpression.cs 31 Dec 2004 17:54:19 -0000 1.4 *************** *** 1,11 **** - using System; - using System.Text; - using NHibernate.Dialect; using NHibernate.Engine; - using NHibernate.SqlCommand; using NHibernate.Persister; using NHibernate.Type; - using NHibernate.Util; namespace NHibernate.Expression --- 1,7 ---- using NHibernate.Dialect; using NHibernate.Engine; using NHibernate.Persister; + using NHibernate.SqlCommand; using NHibernate.Type; namespace NHibernate.Expression *************** *** 16,69 **** /// </summary> //TODO:H2.0.3 renamed this to ILikeExpression ! public class InsensitiveLikeExpression: Expression { - private readonly string propertyName; private readonly object expressionValue; ! internal InsensitiveLikeExpression(string propertyName, object expressionValue) ! { this.propertyName = propertyName; this.expressionValue = expressionValue; } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! string[] paramColumnNames = GetColumns(factory, persistentClass, propertyName , null); ! Parameter[] parameters = Parameter.GenerateParameters(factory, alias, paramColumnNames, propertyType); ! ! if(factory.Dialect is PostgreSQLDialect) { ! sqlBuilder.Add(columnNames[0]); ! sqlBuilder.Add(" ilike "); } ! else { ! sqlBuilder.Add(factory.Dialect.LowercaseFunction) ! .Add("(") ! .Add(columnNames[0]) ! .Add(")") ! .Add(" like "); } ! sqlBuilder.Add(parameters[0]); return sqlBuilder.ToSqlString(); } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! return new TypedValue[] { Expression.GetTypedValue( sessionFactory, persistentClass, propertyName, expressionValue.ToString().ToLower() ) }; } ! ! public override string ToString() { return propertyName + " ilike " + expressionValue; --- 12,81 ---- /// </summary> //TODO:H2.0.3 renamed this to ILikeExpression ! public class InsensitiveLikeExpression : Expression { private readonly string propertyName; private readonly object expressionValue; ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="expressionValue"></param> ! internal InsensitiveLikeExpression( string propertyName, object expressionValue ) ! { this.propertyName = propertyName; this.expressionValue = expressionValue; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! string[ ] paramColumnNames = GetColumns( factory, persistentClass, propertyName, null ); ! Parameter[ ] parameters = Parameter.GenerateParameters( factory, alias, paramColumnNames, propertyType ); ! ! if( factory.Dialect is PostgreSQLDialect ) { ! sqlBuilder.Add( columnNames[ 0 ] ); ! sqlBuilder.Add( " ilike " ); } ! else { ! sqlBuilder.Add( factory.Dialect.LowercaseFunction ) ! .Add( "(" ) ! .Add( columnNames[ 0 ] ) ! .Add( ")" ) ! .Add( " like " ); } ! sqlBuilder.Add( parameters[ 0 ] ); return sqlBuilder.ToSqlString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! return new TypedValue[ ] {Expression.GetTypedValue( sessionFactory, persistentClass, propertyName, expressionValue.ToString().ToLower() )}; } ! /// <summary></summary> ! public override string ToString() { return propertyName + " ilike " + expressionValue; Index: LeExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/LeExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LeExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- LeExpression.cs 31 Dec 2004 17:54:19 -0000 1.4 *************** *** 1,18 **** ! using System; ! ! namespace NHibernate.Expression { ! ! public class LeExpression : SimpleExpression { ! ! internal LeExpression(string propertyName, object value) : base (propertyName, value) { } ! protected override string Op { get { return " <= "; } } } ! } --- 1,21 ---- ! namespace NHibernate.Expression { ! /// <summary></summary> ! public class LeExpression : SimpleExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! internal LeExpression( string propertyName, object value ) : base( propertyName, value ) { } ! /// <summary></summary> ! protected override string Op { get { return " <= "; } } } ! } \ No newline at end of file Index: Junction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Junction.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Junction.cs 28 Jun 2004 18:35:57 -0000 1.5 --- Junction.cs 31 Dec 2004 17:54:19 -0000 1.6 *************** *** 1,11 **** using System; - using System.Text; using System.Collections; - using NHibernate.Engine; using NHibernate.SqlCommand; - using NHibernate.Util; ! namespace NHibernate.Expression { /// <summary> --- 1,8 ---- using System; using System.Collections; using NHibernate.Engine; using NHibernate.SqlCommand; ! namespace NHibernate.Expression { /// <summary> *************** *** 13,80 **** /// logical operator. /// </summary> ! public abstract class Junction : Expression { - private IList expressions = new ArrayList(); ! public Junction Add(Expression expression) { ! expressions.Add(expression); return this; } protected abstract String Op { get; } ! public override TypedValue[] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { - ArrayList typedValues = new ArrayList(); ! foreach ( Expression expression in expressions ) { ! TypedValue[] subvalues = expression.GetTypedValues(sessionFactory, persistentClass); ! for ( int i=0; i<subvalues.Length; i++ ) { ! typedValues.Add( subvalues[i] ); } } ! ! return (TypedValue[]) typedValues.ToArray( typeof (TypedValue) ); } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { - //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! ! if(expressions.Count==0) { ! return new SqlString(new object[] {"1=1"}); } - - sqlBuilder.Add("("); ! for(int i = 0; i < expressions.Count - 1; i++) { sqlBuilder.Add( ! ((Expression)expressions[i]).ToSqlString(factory, persistentClass, alias)); ! sqlBuilder.Add(Op); } sqlBuilder.Add( ! ((Expression)expressions[expressions.Count - 1]).ToSqlString(factory, persistentClass, alias)); ! sqlBuilder.Add(")"); return sqlBuilder.ToSqlString(); } ! public override string ToString() { ! return '(' + String.Join( Op, (string[]) expressions ) + ')'; } } --- 10,94 ---- /// logical operator. /// </summary> ! public abstract class Junction : Expression { private IList expressions = new ArrayList(); ! /// <summary> ! /// ! /// </summary> ! /// <param name="expression"></param> ! /// <returns></returns> ! public Junction Add( Expression expression ) { ! expressions.Add( expression ); return this; } + /// <summary></summary> protected abstract String Op { get; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ArrayList typedValues = new ArrayList(); ! foreach( Expression expression in expressions ) { ! TypedValue[ ] subvalues = expression.GetTypedValues( sessionFactory, persistentClass ); ! for( int i = 0; i < subvalues.Length; i++ ) { ! typedValues.Add( subvalues[ i ] ); } } ! ! return ( TypedValue[ ] ) typedValues.ToArray( typeof( TypedValue ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! ! if( expressions.Count == 0 ) { ! return new SqlString( new object[ ] {"1=1"} ); } ! sqlBuilder.Add( "(" ); ! ! for( int i = 0; i < expressions.Count - 1; i++ ) { sqlBuilder.Add( ! ( ( Expression ) expressions[ i ] ).ToSqlString( factory, persistentClass, alias ) ); ! sqlBuilder.Add( Op ); } sqlBuilder.Add( ! ( ( Expression ) expressions[ expressions.Count - 1 ] ).ToSqlString( factory, persistentClass, alias ) ); ! sqlBuilder.Add( ")" ); return sqlBuilder.ToSqlString(); } ! /// <summary></summary> ! public override string ToString() { ! return '(' + String.Join( Op, ( string[ ] ) expressions ) + ')'; } } |
From: Kevin W. <kev...@us...> - 2004-12-31 17:53:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22387 Modified Files: Expression.cs GeExpression.cs GtExpression.cs InExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: GeExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/GeExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GeExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- GeExpression.cs 31 Dec 2004 17:52:39 -0000 1.4 *************** *** 1,18 **** ! using System; ! ! namespace NHibernate.Expression { ! ! public class GeExpression : SimpleExpression { ! ! internal GeExpression(string propertyName, object value) : base (propertyName, value) { } ! protected override string Op { get { return " >= "; } } } ! } --- 1,21 ---- ! namespace NHibernate.Expression { ! /// <summary></summary> ! public class GeExpression : SimpleExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! internal GeExpression( string propertyName, object value ) : base( propertyName, value ) { } ! /// <summary></summary> ! protected override string Op { get { return " >= "; } } } ! } \ No newline at end of file Index: GtExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/GtExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GtExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- GtExpression.cs 31 Dec 2004 17:52:39 -0000 1.4 *************** *** 1,18 **** ! using System; ! ! namespace NHibernate.Expression { ! ! public class GtExpression : SimpleExpression { ! ! internal GtExpression(string propertyName, object value) : base (propertyName, value) { } ! protected override string Op { get { return " > "; } } } ! } --- 1,21 ---- ! namespace NHibernate.Expression { ! /// <summary></summary> ! public class GtExpression : SimpleExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! internal GtExpression( string propertyName, object value ) : base( propertyName, value ) { } ! /// <summary></summary> ! protected override string Op { get { return " > "; } } } ! } \ No newline at end of file Index: Expression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Expression.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Expression.cs 17 Sep 2004 12:25:53 -0000 1.11 --- Expression.cs 31 Dec 2004 17:52:39 -0000 1.12 *************** *** 1,5 **** using System; using System.Collections; - using NHibernate.Engine; using NHibernate.Persister; --- 1,4 ---- *************** *** 7,13 **** using NHibernate.Type; ! namespace NHibernate.Expression { - /// <summary> /// An object-oriented representation of expressions that may be used as constraints --- 6,11 ---- using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> /// An object-oriented representation of expressions that may be used as constraints *************** *** 20,28 **** /// the static accessors on this class. /// </remarks> ! public abstract class Expression { ! ! private static readonly object[] NoObjects = new object[0]; ! private static readonly IType[] NoTypes = new IType[0]; /// <summary> --- 18,25 ---- /// the static accessors on this class. /// </remarks> ! public abstract class Expression { ! private static readonly object[ ] NoObjects = new object[0]; ! private static readonly IType[ ] NoTypes = new IType[0]; /// <summary> *************** *** 32,38 **** /// <param name="value">The value for the Property.</param> /// <returns>An <see cref="EqExpression" />.</returns> ! public static Expression Eq(string propertyName, object value) { ! return new EqExpression(propertyName, value); } --- 29,35 ---- /// <param name="value">The value for the Property.</param> /// <returns>An <see cref="EqExpression" />.</returns> ! public static Expression Eq( string propertyName, object value ) { ! return new EqExpression( propertyName, value ); } *************** *** 43,49 **** /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LikeExpression" />.</returns> ! public static Expression Like(string propertyName, object value) { ! return new LikeExpression(propertyName, value); } --- 40,46 ---- /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LikeExpression" />.</returns> ! public static Expression Like( string propertyName, object value ) { ! return new LikeExpression( propertyName, value ); } *************** *** 54,60 **** /// <param name="value">The value for the Property.</param> /// <returns>An <see cref="InsensitiveLikeExpression" />.</returns> ! public static Expression InsensitiveLike(string propertyName, object value) { ! return new InsensitiveLikeExpression(propertyName, value); } --- 51,57 ---- /// <param name="value">The value for the Property.</param> /// <returns>An <see cref="InsensitiveLikeExpression" />.</returns> ! public static Expression InsensitiveLike( string propertyName, object value ) { ! return new InsensitiveLikeExpression( propertyName, value ); } *************** *** 65,71 **** /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="GtExpression" />.</returns> ! public static Expression Gt(string propertyName, object value) { ! return new GtExpression(propertyName, value); } --- 62,68 ---- /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="GtExpression" />.</returns> ! public static Expression Gt( string propertyName, object value ) { ! return new GtExpression( propertyName, value ); } *************** *** 76,82 **** /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LtExpression" />.</returns> ! public static Expression Lt(string propertyName, object value) { ! return new LtExpression(propertyName, value); } --- 73,79 ---- /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LtExpression" />.</returns> ! public static Expression Lt( string propertyName, object value ) { ! return new LtExpression( propertyName, value ); } *************** *** 87,93 **** /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LeExpression" />.</returns> ! public static Expression Le(string propertyName, object value) { ! return new LeExpression(propertyName, value); } --- 84,90 ---- /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="LeExpression" />.</returns> ! public static Expression Le( string propertyName, object value ) { ! return new LeExpression( propertyName, value ); } *************** *** 98,104 **** /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="GtExpression" />.</returns> ! public static Expression Ge(string propertyName, object value) { ! return new GeExpression(propertyName, value); } --- 95,101 ---- /// <param name="value">The value for the Property.</param> /// <returns>A <see cref="GtExpression" />.</returns> ! public static Expression Ge( string propertyName, object value ) { ! return new GeExpression( propertyName, value ); } *************** *** 110,118 **** /// <param name="hi">The high value for the Property.</param> /// <returns>A <see cref="BetweenExpression" />.</returns> ! public static Expression Between(string propertyName, object lo, object hi) ! { ! return new BetweenExpression(propertyName, lo, hi); ! } ! /// <summary> /// Apply an "in" constraint to the named property --- 107,115 ---- /// <param name="hi">The high value for the Property.</param> /// <returns>A <see cref="BetweenExpression" />.</returns> ! public static Expression Between( string propertyName, object lo, object hi ) ! { ! return new BetweenExpression( propertyName, lo, hi ); ! } ! /// <summary> /// Apply an "in" constraint to the named property *************** *** 121,129 **** /// <param name="values">An array of values.</param> /// <returns>An <see cref="InExpression" />.</returns> ! public static Expression In(string propertyName, object[] values) ! { ! return new InExpression(propertyName, values); ! } ! /// <summary> /// Apply an "in" constraint to the named property --- 118,126 ---- /// <param name="values">An array of values.</param> /// <returns>An <see cref="InExpression" />.</returns> ! public static Expression In( string propertyName, object[ ] values ) ! { ! return new InExpression( propertyName, values ); ! } ! /// <summary> /// Apply an "in" constraint to the named property *************** *** 132,141 **** /// <param name="values">An ICollection of values.</param> /// <returns>An <see cref="InExpression" />.</returns> ! public static Expression In(string propertyName, ICollection values) ! { ! ArrayList ary = new ArrayList(values); //HACK return new InExpression( propertyName, ary.ToArray() ); ! } ! /// <summary> /// Apply an "is null" constraint to the named property --- 129,138 ---- /// <param name="values">An ICollection of values.</param> /// <returns>An <see cref="InExpression" />.</returns> ! public static Expression In( string propertyName, ICollection values ) ! { ! ArrayList ary = new ArrayList( values ); //HACK return new InExpression( propertyName, ary.ToArray() ); ! } ! /// <summary> /// Apply an "is null" constraint to the named property *************** *** 143,151 **** /// <param name="propertyName">The name of the Property in the class.</param> /// <returns>A <see cref="NullExpression" />.</returns> ! public static Expression IsNull(string propertyName) ! { ! return new NullExpression(propertyName); ! } ! /// <summary> /// Apply an "is not null" constraint to the named property --- 140,148 ---- /// <param name="propertyName">The name of the Property in the class.</param> /// <returns>A <see cref="NullExpression" />.</returns> ! public static Expression IsNull( string propertyName ) ! { ! return new NullExpression( propertyName ); ! } ! /// <summary> /// Apply an "is not null" constraint to the named property *************** *** 153,162 **** /// <param name="propertyName">The name of the Property in the class.</param> /// <returns>A <see cref="NotNullExpression" />.</returns> ! public static Expression IsNotNull(string propertyName) ! { ! return new NotNullExpression(propertyName); } ! /// <summary> /// Apply an "equal" constraint to two properties --- 150,159 ---- /// <param name="propertyName">The name of the Property in the class.</param> /// <returns>A <see cref="NotNullExpression" />.</returns> ! public static Expression IsNotNull( string propertyName ) ! { ! return new NotNullExpression( propertyName ); } ! /// <summary> /// Apply an "equal" constraint to two properties *************** *** 165,173 **** /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="EqPropertyExpression"/> .</returns> ! public static Expression EqProperty(String propertyName, String otherPropertyName) { ! return new EqPropertyExpression(propertyName, otherPropertyName); } ! /// <summary> /// Apply a "less than" constraint to two properties --- 162,170 ---- /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="EqPropertyExpression"/> .</returns> ! public static Expression EqProperty( String propertyName, String otherPropertyName ) { ! return new EqPropertyExpression( propertyName, otherPropertyName ); } ! /// <summary> /// Apply a "less than" constraint to two properties *************** *** 176,184 **** /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="LtPropertyExpression"/> .</returns> ! public static Expression LtProperty(String propertyName, String otherPropertyName) { ! return new LtPropertyExpression(propertyName, otherPropertyName); } ! /// <summary> /// Apply a "less than or equal" constraint to two properties --- 173,181 ---- /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="LtPropertyExpression"/> .</returns> ! public static Expression LtProperty( String propertyName, String otherPropertyName ) { ! return new LtPropertyExpression( propertyName, otherPropertyName ); } ! /// <summary> /// Apply a "less than or equal" constraint to two properties *************** *** 187,194 **** /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="LePropertyExpression"/> .</returns> ! public static Expression LeProperty(String propertyName, String otherPropertyName) { ! return new LePropertyExpression(propertyName, otherPropertyName); } /// <summary> /// Return the conjuction of two expressions --- 184,192 ---- /// <param name="otherPropertyName">The rhs Property Name</param> /// <returns>A <see cref="LePropertyExpression"/> .</returns> ! public static Expression LeProperty( String propertyName, String otherPropertyName ) { ! return new LePropertyExpression( propertyName, otherPropertyName ); } + /// <summary> /// Return the conjuction of two expressions *************** *** 197,203 **** /// <param name="rhs">The Expression to use as the Right Hand Side.</param> /// <returns>An <see cref="AndExpression" />.</returns> ! public static Expression And(Expression lhs, Expression rhs) { ! return new AndExpression(lhs, rhs); } --- 195,201 ---- /// <param name="rhs">The Expression to use as the Right Hand Side.</param> /// <returns>An <see cref="AndExpression" />.</returns> ! public static Expression And( Expression lhs, Expression rhs ) { ! return new AndExpression( lhs, rhs ); } *************** *** 208,214 **** /// <param name="rhs">The Expression to use as the Right Hand Side.</param> /// <returns>An <see cref="OrExpression" />.</returns> ! public static Expression Or(Expression lhs, Expression rhs) { ! return new OrExpression(lhs, rhs); } --- 206,212 ---- /// <param name="rhs">The Expression to use as the Right Hand Side.</param> /// <returns>An <see cref="OrExpression" />.</returns> ! public static Expression Or( Expression lhs, Expression rhs ) { ! return new OrExpression( lhs, rhs ); } *************** *** 218,224 **** /// <param name="expression">The Expression to negate.</param> /// <returns>A <see cref="NotExpression" />.</returns> ! public static Expression Not(Expression expression) { ! return new NotExpression(expression); } --- 216,222 ---- /// <param name="expression">The Expression to negate.</param> /// <returns>A <see cref="NotExpression" />.</returns> ! public static Expression Not( Expression expression ) { ! return new NotExpression( expression ); } *************** *** 230,236 **** /// <param name="types"></param> /// <returns></returns> ! public static Expression Sql(SqlString sql, object[] values, IType[] types) { ! return new SQLExpression(sql, values, types); } --- 228,234 ---- /// <param name="types"></param> /// <returns></returns> ! public static Expression Sql( SqlString sql, object[ ] values, IType[ ] types ) { ! return new SQLExpression( sql, values, types ); } *************** *** 242,248 **** /// <param name="type"></param> /// <returns></returns> ! public static Expression Sql(SqlString sql, object value, IType type) { ! return new SQLExpression(sql, new object[] { value }, new IType[] { type } ); } --- 240,246 ---- /// <param name="type"></param> /// <returns></returns> ! public static Expression Sql( SqlString sql, object value, IType type ) { ! return new SQLExpression( sql, new object[ ] {value}, new IType[ ] {type} ); } *************** *** 252,258 **** /// <param name="sql"></param> /// <returns></returns> ! public static Expression Sql(SqlString sql) { ! return new SQLExpression(sql, NoObjects, NoTypes); } --- 250,256 ---- /// <param name="sql"></param> /// <returns></returns> ! public static Expression Sql( SqlString sql ) { ! return new SQLExpression( sql, NoObjects, NoTypes ); } *************** *** 262,284 **** /// <param name="sql"></param> /// <returns></returns> ! public static Expression Sql(string sql) { ! return new SQLExpression(new SqlString(sql), NoObjects, NoTypes); } ! /// <summary> /// Group expressions together in a single conjunction (A and B and C...) /// </summary> ! public static Conjunction Conjunction() { return new Conjunction(); } ! /// <summary> /// Group expressions together in a single disjunction (A or B or C...) /// </summary> ! public static Disjunction Disjunction() { return new Disjunction(); --- 260,282 ---- /// <param name="sql"></param> /// <returns></returns> ! public static Expression Sql( string sql ) { ! return new SQLExpression( new SqlString( sql ), NoObjects, NoTypes ); } ! /// <summary> /// Group expressions together in a single conjunction (A and B and C...) /// </summary> ! public static Conjunction Conjunction() { return new Conjunction(); } ! /// <summary> /// Group expressions together in a single disjunction (A or B or C...) /// </summary> ! public static Disjunction Disjunction() { return new Disjunction(); *************** *** 291,299 **** /// <param name="propertyNameValues">a dictionary from property names to values</param> /// <returns></returns> ! public static Expression AllEq(IDictionary propertyNameValues) { ! Conjunction conj = Conjunction(); ! foreach ( DictionaryEntry item in propertyNameValues ) { conj.Add( Eq( item.Key.ToString(), item.Value ) ); } --- 289,298 ---- /// <param name="propertyNameValues">a dictionary from property names to values</param> /// <returns></returns> ! public static Expression AllEq( IDictionary propertyNameValues ) ! { Conjunction conj = Conjunction(); ! foreach( DictionaryEntry item in propertyNameValues ) ! { conj.Add( Eq( item.Key.ToString(), item.Value ) ); } *************** *** 309,321 **** /// <param name="alias">The alias to use for the table.</param> /// <returns>A SqlString that contains a valid Sql fragment.</returns> ! public abstract SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias); /// <summary> /// Return typed values for all parameters in the rendered SQL fragment /// </summary> ! /// <param name="factory">The ISessionFactory that contains the mapping for the Type.</param> /// <param name="persistentClass">The Class the Expression is being built for.</param> /// <returns>An array of TypedValues for the Expression.</returns> ! public abstract TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass); /// <summary> --- 308,320 ---- /// <param name="alias">The alias to use for the table.</param> /// <returns>A SqlString that contains a valid Sql fragment.</returns> ! public abstract SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ); /// <summary> /// Return typed values for all parameters in the rendered SQL fragment /// </summary> ! /// <param name="sessionFactory">The ISessionFactory that contains the mapping for the Type.</param> /// <param name="persistentClass">The Class the Expression is being built for.</param> /// <returns>An array of TypedValues for the Expression.</returns> ! public abstract TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ); /// <summary> *************** *** 335,344 **** // I modified it to internal because Order use it. // --- ! internal static string[] GetColumns(ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string property, string alias) { ! return ( (IQueryable) sessionFactory.GetPersister(persistentClass) ).ToColumns(alias, property); } ! protected static TypedValue GetTypedValue(ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string propertyName, object value) { ! return new TypedValue( ( (IQueryable) sessionFactory.GetPersister(persistentClass) ).GetPropertyType(propertyName), value ); } --- 334,361 ---- // I modified it to internal because Order use it. // --- ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="property"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! internal static string[ ] GetColumns( ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string property, string alias ) ! { ! return ( ( IQueryable ) sessionFactory.GetPersister( persistentClass ) ).ToColumns( alias, property ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! /// <returns></returns> ! protected static TypedValue GetTypedValue( ISessionFactoryImplementor sessionFactory, System.Type persistentClass, string propertyName, object value ) ! { ! return new TypedValue( ( ( IQueryable ) sessionFactory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ), value ); } Index: InExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/InExpression.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InExpression.cs 28 Mar 2004 06:05:09 -0000 1.4 --- InExpression.cs 31 Dec 2004 17:52:39 -0000 1.5 *************** *** 1,5 **** - using System; - using System.Text; - using NHibernate.Engine; using NHibernate.Persister; --- 1,2 ---- *************** *** 8,83 **** using NHibernate.Util; ! namespace NHibernate.Expression { - /// <summary> /// InExpression - should only be used with a Single Value column - no multicolumn properties... /// </summary> ! public class InExpression : Expression { private readonly string propertyName; ! private readonly object[] values; ! ! internal InExpression(string propertyName, object[] values) { this.propertyName = propertyName; this.values = values; } - ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! string[] paramColumnNames = GetColumns(factory, persistentClass, propertyName , null); ! ! if (columnNames.Length!=1) throw new HibernateException("InExpression may only be used with single-column properties"); // each value should have its own parameter ! Parameter[] parameters = new Parameter[values.Length]; ! ! for(int i = 0; i < values.Length; i++) { // we can hardcode 0 because this will only be for a single column ! string paramInColumnNames = paramColumnNames[0] + StringHelper.Underscore + i; ! parameters[i] = Parameter.GenerateParameters(factory, alias, new string[]{paramInColumnNames}, propertyType)[0]; } ! ! sqlBuilder.Add(columnNames[0]) ! .Add(" in ("); ! bool commaNeeded = false; ! foreach(Parameter parameter in parameters) { ! if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); commaNeeded = true; ! sqlBuilder.Add(parameter); } ! sqlBuilder.Add(")"); ! return sqlBuilder.ToSqlString(); } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! TypedValue[] tvs = new TypedValue[ values.Length ]; ! for ( int i=0; i<tvs.Length; i++ ) { ! tvs[i] = GetTypedValue( sessionFactory, persistentClass, propertyName, values[i] ); } return tvs; } ! public override string ToString() { ! return propertyName + " in (" + StringHelper.ToString(values) + ')'; } ! } } \ No newline at end of file --- 5,103 ---- using NHibernate.Util; ! namespace NHibernate.Expression { /// <summary> /// InExpression - should only be used with a Single Value column - no multicolumn properties... /// </summary> ! public class InExpression : Expression { private readonly string propertyName; ! private readonly object[ ] values; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="values"></param> ! internal InExpression( string propertyName, object[ ] values ) { this.propertyName = propertyName; this.values = values; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! string[ ] paramColumnNames = GetColumns( factory, persistentClass, propertyName, null ); ! ! if( columnNames.Length != 1 ) ! { ! throw new HibernateException( "InExpression may only be used with single-column properties" ); ! } // each value should have its own parameter ! Parameter[ ] parameters = new Parameter[values.Length]; ! ! for( int i = 0; i < values.Length; i++ ) { // we can hardcode 0 because this will only be for a single column ! string paramInColumnNames = paramColumnNames[ 0 ] + StringHelper.Underscore + i; ! parameters[ i ] = Parameter.GenerateParameters( factory, alias, new string[ ] {paramInColumnNames}, propertyType )[ 0 ]; } ! ! sqlBuilder.Add( columnNames[ 0 ] ) ! .Add( " in (" ); ! bool commaNeeded = false; ! foreach( Parameter parameter in parameters ) { ! if( commaNeeded ) ! { ! sqlBuilder.Add( StringHelper.CommaSpace ); ! } commaNeeded = true; ! sqlBuilder.Add( parameter ); } ! sqlBuilder.Add( ")" ); ! return sqlBuilder.ToSqlString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! TypedValue[ ] tvs = new TypedValue[values.Length]; ! for( int i = 0; i < tvs.Length; i++ ) { ! tvs[ i ] = GetTypedValue( sessionFactory, persistentClass, propertyName, values[ i ] ); } return tvs; } ! /// <summary></summary> ! public override string ToString() { ! return propertyName + " in (" + StringHelper.ToString( values ) + ')'; } ! } } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:52:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22336 Modified Files: Disjunction.cs EqExpression.cs EqPropertyExpression.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: Disjunction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Disjunction.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Disjunction.cs 28 Mar 2004 06:05:09 -0000 1.2 --- Disjunction.cs 31 Dec 2004 17:52:25 -0000 1.3 *************** *** 1,4 **** - using System; - namespace NHibernate.Expression { --- 1,2 ---- *************** *** 8,15 **** public class Disjunction : Junction { ! protected override string Op { get { return " or "; } } } ! } --- 6,14 ---- public class Disjunction : Junction { ! /// <summary></summary> ! protected override string Op { get { return " or "; } } } ! } \ No newline at end of file Index: EqPropertyExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/EqPropertyExpression.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EqPropertyExpression.cs 2 Aug 2004 04:30:37 -0000 1.1 --- EqPropertyExpression.cs 31 Dec 2004 17:52:25 -0000 1.2 *************** *** 1,17 **** - using System; - namespace NHibernate.Expression { ! public class EqPropertyExpression : PropertyExpression ! { ! public EqPropertyExpression(string propertyName, string otherPropertyName) ! : base(propertyName, otherPropertyName) ! { ! } ! protected override string Op ! { ! get { return " = "; } ! } ! } } \ No newline at end of file --- 1,22 ---- namespace NHibernate.Expression { ! /// <summary></summary> ! public class EqPropertyExpression : PropertyExpression ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="otherPropertyName"></param> ! public EqPropertyExpression( string propertyName, string otherPropertyName ) ! : base( propertyName, otherPropertyName ) ! { ! } ! /// <summary></summary> ! protected override string Op ! { ! get { return " = "; } ! } ! } } \ No newline at end of file Index: EqExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/EqExpression.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EqExpression.cs 28 Mar 2004 06:05:09 -0000 1.4 --- EqExpression.cs 31 Dec 2004 17:52:25 -0000 1.5 *************** *** 1,20 **** ! using System; ! ! namespace NHibernate.Expression { ! /// <summary> /// An Expression that represents an "equal" constraint. /// </summary> ! public class EqExpression : SimpleExpression { ! ! internal EqExpression(string propertyName, object value) : base (propertyName, value) { } ! protected override string Op { get { return " = "; } } } ! } --- 1,23 ---- ! namespace NHibernate.Expression ! { /// <summary> /// An Expression that represents an "equal" constraint. /// </summary> ! public class EqExpression : SimpleExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="propertyName"></param> ! /// <param name="value"></param> ! internal EqExpression( string propertyName, object value ) : base( propertyName, value ) { } ! /// <summary></summary> ! protected override string Op { get { return " = "; } } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:52:20
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22278 Modified Files: AndExpression.cs BetweenExpression.cs Conjunction.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: BetweenExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/BetweenExpression.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BetweenExpression.cs 28 Mar 2004 06:05:09 -0000 1.5 --- BetweenExpression.cs 31 Dec 2004 17:52:10 -0000 1.6 *************** *** 1,23 **** - using System; - using System.Text; - using NHibernate.Engine; - using NHibernate.SqlCommand; using NHibernate.Persister; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Expression { - /// <summary> /// An Expression that represents a "between" constraint. /// </summary> ! public class BetweenExpression : Expression { private readonly string propertyName; private readonly object lo; private readonly object hi; ! /// <summary> /// Initialize a new instance of the BetweenExpression class for --- 1,18 ---- using NHibernate.Engine; using NHibernate.Persister; + using NHibernate.SqlCommand; using NHibernate.Type; ! namespace NHibernate.Expression { /// <summary> /// An Expression that represents a "between" constraint. /// </summary> ! public class BetweenExpression : Expression { private readonly string propertyName; private readonly object lo; private readonly object hi; ! /// <summary> /// Initialize a new instance of the BetweenExpression class for *************** *** 27,31 **** /// <param name="lo">The low value for the BetweenExpression.</param> /// <param name="hi">The high value for the BetweenExpression.</param> ! internal BetweenExpression(string propertyName, object lo, object hi) { this.propertyName = propertyName; --- 22,26 ---- /// <param name="lo">The low value for the BetweenExpression.</param> /// <param name="hi">The high value for the BetweenExpression.</param> ! internal BetweenExpression( string propertyName, object lo, object hi ) { this.propertyName = propertyName; *************** *** 34,90 **** } ! public override SqlString ToSqlString(ISessionFactoryImplementor factory, System.Type persistentClass, string alias) { //TODO: add a default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ((IQueryable)factory.GetPersister(persistentClass)).GetPropertyType(propertyName); ! string[] columnNames = GetColumns(factory, persistentClass, propertyName, alias); ! string[] paramColumnNames = GetColumns(factory, persistentClass, propertyName , null); ! string[] loParamColumnNames = new string[paramColumnNames.Length]; ! string[] hiParamColumnNames = new string[paramColumnNames.Length]; // we need to create a _lo and _hi parameter for each column. The columnNames // doesn't return a seperate column for the _lo and _hi so we need to... ! for(int i = 0; i < paramColumnNames.Length; i++) { ! loParamColumnNames[i] = paramColumnNames[i] + "_lo"; ! hiParamColumnNames[i] = paramColumnNames[i] + "_hi"; } ! Parameter[] parameters = new Parameter[paramColumnNames.Length * 2]; ! Parameter[] loParameters = Parameter.GenerateParameters(factory, alias, loParamColumnNames, propertyType); ! Parameter[] hiParameters = Parameter.GenerateParameters(factory, alias, hiParamColumnNames, propertyType); ! ! bool andNeeded = false; ! ! for(int i = 0; i < columnNames.Length; i++) { ! if(andNeeded) sqlBuilder.Add(" AND "); andNeeded = true; ! sqlBuilder.Add(columnNames[i]) ! .Add(" between ") ! .Add(loParameters[i]) ! .Add(" and ") ! .Add(hiParameters[i]); } return sqlBuilder.ToSqlString(); } ! ! public override TypedValue[] GetTypedValues(ISessionFactoryImplementor sessionFactory, System.Type persistentClass) { ! return new TypedValue[] { ! GetTypedValue(sessionFactory, persistentClass, propertyName, lo), ! GetTypedValue(sessionFactory, persistentClass, propertyName, hi) }; } ! public override string ToString() { return propertyName + " between " + lo + " and " + hi; ! } } ! } --- 29,103 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="factory"></param> ! /// <param name="persistentClass"></param> ! /// <param name="alias"></param> ! /// <returns></returns> ! public override SqlString ToSqlString( ISessionFactoryImplementor factory, System.Type persistentClass, string alias ) { //TODO: add a default capacity SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! IType propertyType = ( ( IQueryable ) factory.GetPersister( persistentClass ) ).GetPropertyType( propertyName ); ! string[ ] columnNames = GetColumns( factory, persistentClass, propertyName, alias ); ! string[ ] paramColumnNames = GetColumns( factory, persistentClass, propertyName, null ); ! string[ ] loParamColumnNames = new string[paramColumnNames.Length]; ! string[ ] hiParamColumnNames = new string[paramColumnNames.Length]; // we need to create a _lo and _hi parameter for each column. The columnNames // doesn't return a seperate column for the _lo and _hi so we need to... ! for( int i = 0; i < paramColumnNames.Length; i++ ) { ! loParamColumnNames[ i ] = paramColumnNames[ i ] + "_lo"; ! hiParamColumnNames[ i ] = paramColumnNames[ i ] + "_hi"; } ! Parameter[ ] parameters = new Parameter[paramColumnNames.Length*2]; ! Parameter[ ] loParameters = Parameter.GenerateParameters( factory, alias, loParamColumnNames, propertyType ); ! Parameter[ ] hiParameters = Parameter.GenerateParameters( factory, alias, hiParamColumnNames, propertyType ); ! ! bool andNeeded = false; ! ! for( int i = 0; i < columnNames.Length; i++ ) { ! if( andNeeded ) ! { ! sqlBuilder.Add( " AND " ); ! } andNeeded = true; ! sqlBuilder.Add( columnNames[ i ] ) ! .Add( " between " ) ! .Add( loParameters[ i ] ) ! .Add( " and " ) ! .Add( hiParameters[ i ] ); } return sqlBuilder.ToSqlString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="sessionFactory"></param> ! /// <param name="persistentClass"></param> ! /// <returns></returns> ! public override TypedValue[ ] GetTypedValues( ISessionFactoryImplementor sessionFactory, System.Type persistentClass ) { ! return new TypedValue[ ] ! { ! GetTypedValue( sessionFactory, persistentClass, propertyName, lo ), ! GetTypedValue( sessionFactory, persistentClass, propertyName, hi ) }; } ! /// <summary></summary> ! public override string ToString() { return propertyName + " between " + lo + " and " + hi; ! } } ! } \ No newline at end of file Index: AndExpression.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/AndExpression.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AndExpression.cs 28 Mar 2004 06:05:09 -0000 1.3 --- AndExpression.cs 31 Dec 2004 17:52:10 -0000 1.4 *************** *** 1,14 **** ! using System; ! ! namespace NHibernate.Expression { ! /// <summary> /// An Expression that combines two <see cref="Expression"/>s with an /// <c>and</c> between them. /// </summary> ! public class AndExpression : LogicalExpression { ! ! internal AndExpression(Expression lhs, Expression rhs) : base (lhs,rhs) { } --- 1,16 ---- ! namespace NHibernate.Expression ! { /// <summary> /// An Expression that combines two <see cref="Expression"/>s with an /// <c>and</c> between them. /// </summary> ! public class AndExpression : LogicalExpression { ! /// <summary> ! /// ! /// </summary> ! /// <param name="lhs"></param> ! /// <param name="rhs"></param> ! internal AndExpression( Expression lhs, Expression rhs ) : base( lhs, rhs ) { } *************** *** 18,22 **** /// </summary> /// <value>Returns "<c>and</c>"</value> ! protected override string Op { get { return "and"; } --- 20,24 ---- /// </summary> /// <value>Returns "<c>and</c>"</value> ! protected override string Op { get { return "and"; } Index: Conjunction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Expression/Conjunction.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Conjunction.cs 28 Mar 2004 06:05:09 -0000 1.3 --- Conjunction.cs 31 Dec 2004 17:52:10 -0000 1.4 *************** *** 1,4 **** - using System; - namespace NHibernate.Expression { --- 1,2 ---- *************** *** 8,15 **** public class Conjunction : Junction { ! protected override string Op { get { return " and "; } } } ! } --- 6,14 ---- public class Conjunction : Junction { ! /// <summary></summary> ! protected override string Op { get { return " and "; } } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:36:53
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19280 Modified Files: Key.cs QueryParameters.cs RowSelection.cs TypedValue.cs Versioning.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: TypedValue.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/TypedValue.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypedValue.cs 20 Feb 2003 15:57:11 -0000 1.1 --- TypedValue.cs 31 Dec 2004 17:36:41 -0000 1.2 *************** *** 1,25 **** - using System; using NHibernate.Type; ! namespace NHibernate.Engine { ! ! public sealed class TypedValue { private IType type; private object value; ! public TypedValue(IType type, object value) { this.type = type; this.value = value; } ! public object Value { get { return value; } set { this.value = value; } } ! public IType Type { get { return type; } set { type = value; } } } ! } --- 1,36 ---- using NHibernate.Type; ! namespace NHibernate.Engine ! { ! /// <summary></summary> ! public sealed class TypedValue ! { private IType type; private object value; ! /// <summary> ! /// ! /// </summary> ! /// <param name="type"></param> ! /// <param name="value"></param> ! public TypedValue( IType type, object value ) ! { this.type = type; this.value = value; } ! /// <summary></summary> ! public object Value ! { get { return value; } set { this.value = value; } } ! /// <summary></summary> ! public IType Type ! { get { return type; } set { type = value; } } } ! } \ No newline at end of file Index: Versioning.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Versioning.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Versioning.cs 28 Nov 2004 21:47:46 -0000 1.5 --- Versioning.cs 31 Dec 2004 17:36:41 -0000 1.6 *************** *** 1,15 **** ! using System; using NHibernate.Persister; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> /// Utility methods for managing versions and timestamps /// </summary> ! public class Versioning { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Versioning)); ! /// <summary> --- 1,15 ---- ! using log4net; using NHibernate.Persister; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> /// Utility methods for managing versions and timestamps /// </summary> ! public class Versioning { ! private static readonly ILog log = LogManager.GetLogger( typeof( Versioning ) ); ! /// <summary> *************** *** 19,26 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>Returns the next value for the version.</returns> ! public static object Increment(object version, IVersionType versionType) { ! object next = versionType.Next(version); ! if ( log.IsDebugEnabled ) log.Debug("Incrementing: " + version + " to " + next); return next; } --- 19,29 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>Returns the next value for the version.</returns> ! public static object Increment( object version, IVersionType versionType ) { ! object next = versionType.Next( version ); ! if( log.IsDebugEnabled ) ! { ! log.Debug( "Incrementing: " + version + " to " + next ); ! } return next; } *************** *** 31,38 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>A seed value to initialize the versioned property with.</returns> ! public static object Seed(IVersionType versionType) { object seed = versionType.Seed; ! if ( log.IsDebugEnabled ) log.Debug("Seeding: " + seed); return seed; } --- 34,44 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>A seed value to initialize the versioned property with.</returns> ! public static object Seed( IVersionType versionType ) { object seed = versionType.Seed; ! if( log.IsDebugEnabled ) ! { ! log.Debug( "Seeding: " + seed ); ! } return seed; } *************** *** 45,56 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { ! if ( fields[versionProperty]==null ) { ! fields[versionProperty] = Seed(versionType); return true; ! } ! else { return false; --- 51,62 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns><c>true</c> if the version property needs to be seeded with an initial value.</returns> ! public static bool SeedVersion( object[ ] fields, int versionProperty, IVersionType versionType ) { ! if( fields[ versionProperty ] == null ) { ! fields[ versionProperty ] = Seed( versionType ); return true; ! } ! else { return false; *************** *** 65,71 **** /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>The value of the version.</returns> ! private static object GetVersion(object[] fields, int versionProperty, IVersionType versionType) { ! return fields[versionProperty]; } --- 71,77 ---- /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> /// <returns>The value of the version.</returns> ! private static object GetVersion( object[ ] fields, int versionProperty, IVersionType versionType ) { ! return fields[ versionProperty ]; } *************** *** 77,83 **** /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! private static void SetVersion(object[] fields, object version, int versionProperty, IVersionType versionType) { ! fields[versionProperty] = version; } --- 83,89 ---- /// <param name="versionProperty">The index of the version property in the <c>fields</c> parameter.</param> /// <param name="versionType">The <see cref="IVersionType"/> of the versioned property.</param> ! private static void SetVersion( object[ ] fields, object version, int versionProperty, IVersionType versionType ) { ! fields[ versionProperty ] = version; } *************** *** 88,92 **** /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> ! public static void SetVersion(object[] fields, object version, IClassPersister persister) { SetVersion( fields, version, persister.VersionProperty, persister.VersionType ); --- 94,98 ---- /// <param name="version">The value the version should be set to in the <c>fields</c> parameter.</param> /// <param name="persister">The <see cref="IClassPersister"/> that is responsible for persisting the values of the <c>fields</c> parameter.</param> ! public static void SetVersion( object[ ] fields, object version, IClassPersister persister ) { SetVersion( fields, version, persister.VersionProperty, persister.VersionType ); *************** *** 102,113 **** /// Entity is not versioned. /// </returns> ! public static object GetVersion(object[] fields, IClassPersister persister) { ! return persister.IsVersioned ? GetVersion( fields, persister.VersionProperty, persister.VersionType) : null; } - - } ! } --- 108,117 ---- /// Entity is not versioned. /// </returns> ! public static object GetVersion( object[ ] fields, IClassPersister persister ) { ! return persister.IsVersioned ? GetVersion( fields, persister.VersionProperty, persister.VersionType ) : null; } } ! } \ No newline at end of file Index: QueryParameters.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/QueryParameters.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryParameters.cs 31 Oct 2004 04:30:59 -0000 1.1 --- QueryParameters.cs 31 Dec 2004 17:36:41 -0000 1.2 *************** *** 1,8 **** - using System; using System.Collections; using System.Text; ! using NHibernate.Type; - using NHibernate.Util; namespace NHibernate.Engine --- 1,6 ---- using System.Collections; using System.Text; ! using log4net; using NHibernate.Type; namespace NHibernate.Engine *************** *** 13,20 **** public class QueryParameters { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(QueryParameters) ); ! private IType[] _positionalParameterTypes; ! private object[] _positionalParameterValues; private RowSelection _rowSelection; private IDictionary _lockModes; --- 11,18 ---- public class QueryParameters { ! private static readonly ILog log = LogManager.GetLogger( typeof( QueryParameters ) ); ! private IType[ ] _positionalParameterTypes; ! private object[ ] _positionalParameterValues; private RowSelection _rowSelection; private IDictionary _lockModes; *************** *** 26,30 **** /// <param name="positionalParameterTypes">An array of <see cref="IType"/> objects for the parameters.</param> /// <param name="positionalParameterValues">An array of <see cref="object"/> objects for the parameters.</param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues) : this( positionalParameterTypes, positionalParameterValues, null, null ) { --- 24,28 ---- /// <param name="positionalParameterTypes">An array of <see cref="IType"/> objects for the parameters.</param> /// <param name="positionalParameterValues">An array of <see cref="object"/> objects for the parameters.</param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues ) : this( positionalParameterTypes, positionalParameterValues, null, null ) { *************** *** 38,42 **** /// <param name="lockModes">An <see cref="IDictionary"/> that is hql alias keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary lockModes, RowSelection rowSelection) : this( positionalParameterTypes, positionalParameterValues, null, lockModes, rowSelection ) { --- 36,40 ---- /// <param name="lockModes">An <see cref="IDictionary"/> that is hql alias keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues, IDictionary lockModes, RowSelection rowSelection ) : this( positionalParameterTypes, positionalParameterValues, null, lockModes, rowSelection ) { *************** *** 51,55 **** /// <param name="lockModes">An <see cref="IDictionary"/> that is <c>hql alias</c> keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary namedParameters, IDictionary lockModes, RowSelection rowSelection) { _positionalParameterTypes = positionalParameterTypes; --- 49,53 ---- /// <param name="lockModes">An <see cref="IDictionary"/> that is <c>hql alias</c> keyed to a LockMode value.</param> /// <param name="rowSelection"></param> ! public QueryParameters( IType[ ] positionalParameterTypes, object[ ] positionalParameterValues, IDictionary namedParameters, IDictionary lockModes, RowSelection rowSelection ) { _positionalParameterTypes = positionalParameterTypes; *************** *** 86,90 **** /// of the Parameter. /// </summary> ! public IType[] PositionalParameterTypes { get { return _positionalParameterTypes; } --- 84,88 ---- /// of the Parameter. /// </summary> ! public IType[ ] PositionalParameterTypes { get { return _positionalParameterTypes; } *************** *** 96,100 **** /// of the Parameter. /// </summary> ! public object[] PositionalParameterValues { get { return _positionalParameterValues; } --- 94,98 ---- /// of the Parameter. /// </summary> ! public object[ ] PositionalParameterValues { get { return _positionalParameterValues; } *************** *** 102,108 **** } ! public bool HasRowSelection { ! get { return _rowSelection!=null; } } --- 100,107 ---- } ! /// <summary></summary> ! public bool HasRowSelection { ! get { return _rowSelection != null; } } *************** *** 123,132 **** /// <see cref="PositionalParameterValues"/> are not equal. /// </exception> ! public void ValidateParameters() { ! int typesLength = PositionalParameterTypes!=null ? 0 : PositionalParameterTypes.Length; ! int valuesLength = PositionalParameterValues!=null ? 0 : PositionalParameterValues.Length; ! if( typesLength!=valuesLength ) { throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" ); --- 122,131 ---- /// <see cref="PositionalParameterValues"/> are not equal. /// </exception> ! public void ValidateParameters() { ! int typesLength = PositionalParameterTypes != null ? 0 : PositionalParameterTypes.Length; ! int valuesLength = PositionalParameterValues != null ? 0 : PositionalParameterValues.Length; ! if( typesLength != valuesLength ) { throw new QueryException( "Number of positional parameter types (" + typesLength + ") does not match number of positional parameter values (" + valuesLength + ")" ); *************** *** 134,150 **** } ! internal void LogParameters() { StringBuilder builder = new StringBuilder(); ! ! if( PositionalParameterTypes!=null && PositionalParameterTypes.Length>0 ) { ! for( int i=0; i<PositionalParameterTypes.Length; i++ ) { ! if( PositionalParameterTypes[i]!=null ) { ! builder.Append( PositionalParameterTypes[i].Name ); } ! else { builder.Append( "null type" ); --- 133,150 ---- } ! /// <summary></summary> ! internal void LogParameters() { StringBuilder builder = new StringBuilder(); ! ! if( PositionalParameterTypes != null && PositionalParameterTypes.Length > 0 ) { ! for( int i = 0; i < PositionalParameterTypes.Length; i++ ) { ! if( PositionalParameterTypes[ i ] != null ) { ! builder.Append( PositionalParameterTypes[ i ].Name ); } ! else { builder.Append( "null type" ); *************** *** 153,161 **** builder.Append( " = " ); ! if( PositionalParameterValues[i]!=null ) { ! builder.Append( PositionalParameterValues[i].ToString() ); } ! else { builder.Append( "null value" ); --- 153,161 ---- builder.Append( " = " ); ! if( PositionalParameterValues[ i ] != null ) { ! builder.Append( PositionalParameterValues[ i ].ToString() ); } ! else { builder.Append( "null value" ); *************** *** 165,169 **** } } ! else { builder.Append( "No Types and Values" ); --- 165,169 ---- } } ! else { builder.Append( "No Types and Values" ); *************** *** 174,176 **** } } ! } --- 174,176 ---- } } ! } \ No newline at end of file Index: Key.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Key.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Key.cs 16 Dec 2004 21:55:23 -0000 1.7 --- Key.cs 31 Dec 2004 17:36:40 -0000 1.8 *************** *** 1,7 **** using System; - using NHibernate.Persister; ! namespace NHibernate.Engine { /// <summary> --- 1,6 ---- using System; using NHibernate.Persister; ! namespace NHibernate.Engine { /// <summary> *************** *** 10,21 **** /// </summary> [Serializable] ! public sealed class Key { private object id; private object identifierSpace; ! private Key(object id, object identifierSpace) { ! if (id==null) throw new ArgumentException("null identifier", "id"); this.id = id; this.identifierSpace = identifierSpace; --- 9,23 ---- /// </summary> [Serializable] ! public sealed class Key { private object id; private object identifierSpace; ! private Key( object id, object identifierSpace ) { ! if( id == null ) ! { ! throw new ArgumentException( "null identifier", "id" ); ! } this.id = id; this.identifierSpace = identifierSpace; *************** *** 27,60 **** /// <param name="id"></param> /// <param name="p"></param> ! public Key(object id, IClassPersister p) : this ( id, p.IdentifierSpace ) { } /// <summary> /// The user-visible identifier /// </summary> ! public object Identifier { get { return id; } } ! public override bool Equals(object other) { Key otherKey = other as Key; ! if(otherKey==null) { return false; } ! return otherKey.identifierSpace.Equals(this.identifierSpace) && otherKey.id.Equals(this.id); } ! public override int GetHashCode() { return id.GetHashCode(); } ! public override string ToString() ! { ! return id.ToString(); ! } } ! } --- 29,71 ---- /// <param name="id"></param> /// <param name="p"></param> ! public Key( object id, IClassPersister p ) : this( id, p.IdentifierSpace ) ! { ! } /// <summary> /// The user-visible identifier /// </summary> ! public object Identifier { get { return id; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="other"></param> ! /// <returns></returns> ! public override bool Equals( object other ) { Key otherKey = other as Key; ! if( otherKey == null ) { return false; } ! return otherKey.identifierSpace.Equals( this.identifierSpace ) && otherKey.id.Equals( this.id ); } ! /// <summary></summary> ! public override int GetHashCode() { return id.GetHashCode(); } ! /// <summary></summary> ! public override string ToString() ! { ! return id.ToString(); ! } } ! } \ No newline at end of file Index: RowSelection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/RowSelection.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RowSelection.cs 28 Nov 2004 21:47:46 -0000 1.3 --- RowSelection.cs 31 Dec 2004 17:36:41 -0000 1.4 *************** *** 1,5 **** ! using System; ! ! namespace NHibernate.Engine { /// <summary> --- 1,3 ---- ! namespace NHibernate.Engine { /// <summary> *************** *** 7,11 **** /// records to return from the IDataReader. /// </summary> ! public sealed class RowSelection { /// <summary> --- 5,9 ---- /// records to return from the IDataReader. /// </summary> ! public sealed class RowSelection { /// <summary> *************** *** 13,17 **** /// </summary> public static readonly int NoValue = -1; ! private int firstRow = 0; private int maxRows = RowSelection.NoValue; --- 11,15 ---- /// </summary> public static readonly int NoValue = -1; ! private int firstRow = 0; private int maxRows = RowSelection.NoValue; *************** *** 23,27 **** /// <value>The Index of the First Rows to Select</value> /// <remarks>Defaults to 0 unless specifically set.</remarks> ! public int FirstRow { get { return firstRow; } --- 21,25 ---- /// <value>The Index of the First Rows to Select</value> /// <remarks>Defaults to 0 unless specifically set.</remarks> ! public int FirstRow { get { return firstRow; } *************** *** 34,38 **** /// <value>The Maximum Number of Rows to Select</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int MaxRows { get { return maxRows; } --- 32,36 ---- /// <value>The Maximum Number of Rows to Select</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int MaxRows { get { return maxRows; } *************** *** 45,49 **** /// <value>The Query Timeout</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int Timeout { get { return timeout; } --- 43,47 ---- /// <value>The Query Timeout</value> /// <remarks>Defaults to NoValue unless specifically set.</remarks> ! public int Timeout { get { return timeout; } *************** *** 51,53 **** } } ! } --- 49,51 ---- } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:36:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19205 Modified Files: Cascades.cs IBatcher.cs ICollectionSnapshot.cs ISessionFactoryImplementor.cs ISessionImplementor.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ISessionImplementor.cs 29 Nov 2004 18:43:20 -0000 1.25 --- ISessionImplementor.cs 31 Dec 2004 17:36:22 -0000 1.26 *************** *** 3,9 **** using NHibernate.Collection; using NHibernate.Persister; - using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> --- 3,8 ---- using NHibernate.Collection; using NHibernate.Persister; ! namespace NHibernate.Engine { /// <summary> *************** *** 11,17 **** /// such as implementors of <c>Type</c> or <c>ClassPersister</c> /// </summary> ! public interface ISessionImplementor : ISession { - /// <summary> /// Get the pre-flush identifier of the collection --- 10,15 ---- /// such as implementors of <c>Type</c> or <c>ClassPersister</c> /// </summary> ! public interface ISessionImplementor : ISession { /// <summary> /// Get the pre-flush identifier of the collection *************** *** 19,28 **** /// <param name="collection"></param> /// <returns></returns> ! object GetLoadedCollectionKey(PersistentCollection collection); /// <summary> /// Get the snapshot of the pre-flush collection state /// </summary> ! object GetSnapshot(PersistentCollection collection); /// <summary> --- 17,26 ---- /// <param name="collection"></param> /// <returns></returns> ! object GetLoadedCollectionKey( PersistentCollection collection ); /// <summary> /// Get the snapshot of the pre-flush collection state /// </summary> ! object GetSnapshot( PersistentCollection collection ); /// <summary> *************** *** 31,35 **** /// <param name="array"></param> /// <returns></returns> ! ArrayHolder GetArrayHolder(object array); /// <summary> --- 29,33 ---- /// <param name="array"></param> /// <returns></returns> ! ArrayHolder GetArrayHolder( object array ); /// <summary> *************** *** 37,41 **** /// </summary> /// <param name="holder"></param> ! void AddArrayHolder(ArrayHolder holder); /// <summary> --- 35,39 ---- /// </summary> /// <param name="holder"></param> ! void AddArrayHolder( ArrayHolder holder ); /// <summary> *************** *** 45,50 **** /// <param name="persister"></param> /// <param name="id"></param> ! void AddUninitializedCollection(PersistentCollection collection, CollectionPersister persister, object id); ! /// <summary> /// Register an initialized <c>PersistentCollection</c> --- 43,48 ---- /// <param name="persister"></param> /// <param name="id"></param> ! void AddUninitializedCollection( PersistentCollection collection, CollectionPersister persister, object id ); ! /// <summary> /// Register an initialized <c>PersistentCollection</c> *************** *** 53,57 **** /// <param name="persister"></param> /// <param name="id"></param> ! void AddInitializedCollection(PersistentCollection collection, CollectionPersister persister, object id); /// <summary> --- 51,55 ---- /// <param name="persister"></param> /// <param name="id"></param> ! void AddInitializedCollection( PersistentCollection collection, CollectionPersister persister, object id ); /// <summary> *************** *** 59,63 **** /// that the client is modifying it /// </summary> ! void Dirty(PersistentCollection collection); /// <summary> --- 57,61 ---- /// that the client is modifying it /// </summary> ! void Dirty( PersistentCollection collection ); /// <summary> *************** *** 66,70 **** /// <param name="coolection"></param> /// <param name="writing"></param> ! void Initialize(PersistentCollection coolection, bool writing); /// <summary> --- 64,68 ---- /// <param name="coolection"></param> /// <param name="writing"></param> ! void Initialize( PersistentCollection coolection, bool writing ); /// <summary> *************** *** 73,77 **** /// <param name="collection"></param> /// <returns></returns> ! bool IsInverseCollection(PersistentCollection collection); /// <summary> --- 71,75 ---- /// <param name="collection"></param> /// <returns></returns> ! bool IsInverseCollection( PersistentCollection collection ); /// <summary> *************** *** 81,86 **** /// <param name="id"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection(CollectionPersister persister, object id); ! /// <summary> /// new in h2.0.3 and no javadoc --- 79,84 ---- /// <param name="id"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection( CollectionPersister persister, object id ); ! /// <summary> /// new in h2.0.3 and no javadoc *************** *** 92,97 **** /// <param name="owner"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection(CollectionPersister persister, object id, object owner); ! /// <summary> /// new in h2.0.3 and no javadoc --- 90,95 ---- /// <param name="owner"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection( CollectionPersister persister, object id, object owner ); ! /// <summary> /// new in h2.0.3 and no javadoc *************** *** 100,110 **** /// <param name="id"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection(String role, object id); ! /// <summary> /// new in h2.0.3 and no javadoc /// </summary> void EndLoadingCollections(); ! /// <summary> --- 98,108 ---- /// <param name="id"></param> /// <returns></returns> ! PersistentCollection GetLoadingCollection( String role, object id ); ! /// <summary> /// new in h2.0.3 and no javadoc /// </summary> void EndLoadingCollections(); ! /// <summary> *************** *** 118,122 **** /// </returns> /// <exception cref="ObjectNotFoundException">No object could be found with that <c>id</c>.</exception> ! object InternalLoad(System.Type persistentClass, object id); /// <summary> --- 116,120 ---- /// </returns> /// <exception cref="ObjectNotFoundException">No object could be found with that <c>id</c>.</exception> ! object InternalLoad( System.Type persistentClass, object id ); /// <summary> *************** *** 127,131 **** /// <param name="id"></param> /// <returns></returns> ! object InternalLoadOneToOne(System.Type persistentClass, object id); /// <summary> --- 125,129 ---- /// <param name="id"></param> /// <returns></returns> ! object InternalLoadOneToOne( System.Type persistentClass, object id ); /// <summary> *************** *** 135,146 **** /// <param name="id"></param> /// <returns></returns> ! object ImmediateLoad(System.Type persistentClass, object id); - /// <summary> - /// Load an instance immediately. Do not return a proxy - /// </summary> - /// <param name="persistentClass"></param> - /// <param name="id"></param> - /// <returns></returns> /// <summary> /// System time before the start of the transaction --- 133,145 ---- /// <param name="id"></param> /// <returns></returns> ! object ImmediateLoad( System.Type persistentClass, object id ); ! ! // /// <summary> ! // /// Load an instance immediately. Do not return a proxy ! // /// </summary> ! // /// <param name="persistentClass"></param> ! // /// <param name="id"></param> ! // /// <returns></returns> /// <summary> /// System time before the start of the transaction *************** *** 155,159 **** ISessionFactoryImplementor Factory { get; } ! /// <summary> /// Get the prepared statement <c>Batcher</c> for this session --- 154,158 ---- ISessionFactoryImplementor Factory { get; } ! /// <summary> /// Get the prepared statement <c>Batcher</c> for this session *************** *** 166,170 **** /// </summary> /// <param name="obj"></param> ! void PostInsert(object obj); /// <summary> --- 165,169 ---- /// </summary> /// <param name="obj"></param> ! void PostInsert( object obj ); /// <summary> *************** *** 173,178 **** /// </summary> /// <param name="obj"></param> ! void PostDelete(object obj); ! /// <summary> /// After actually updating a row, record the fact that the database state has been update. --- 172,177 ---- /// </summary> /// <param name="obj"></param> ! void PostDelete( object obj ); ! /// <summary> /// After actually updating a row, record the fact that the database state has been update. *************** *** 181,185 **** /// <param name="updatedState">A updated snapshot of the values in the object.</param> /// <param name="nextVersion">The new version to assign to the <c>obj</c>.</param> ! void PostUpdate(object obj, object[] updatedState, object nextVersion); /// <summary> --- 180,184 ---- /// <param name="updatedState">A updated snapshot of the values in the object.</param> /// <param name="nextVersion">The new version to assign to the <c>obj</c>.</param> ! void PostUpdate( object obj, object[ ] updatedState, object nextVersion ); /// <summary> *************** *** 189,193 **** /// <param name="parameters"></param> /// <returns></returns> ! IList Find(string query, QueryParameters parameters); /// <summary> --- 188,192 ---- /// <param name="parameters"></param> /// <returns></returns> ! IList Find( string query, QueryParameters parameters ); /// <summary> *************** *** 197,201 **** /// <param name="parameters"></param> /// <returns></returns> ! IEnumerable Enumerable(string query, QueryParameters parameters); /// <summary> --- 196,200 ---- /// <param name="parameters"></param> /// <returns></returns> ! IEnumerable Enumerable( string query, QueryParameters parameters ); /// <summary> *************** *** 206,210 **** /// <param name="parameters"></param> /// <returns></returns> ! IList Filter(object collection, string filter, QueryParameters parameters); /// <summary> --- 205,209 ---- /// <param name="parameters"></param> /// <returns></returns> ! IList Filter( object collection, string filter, QueryParameters parameters ); /// <summary> *************** *** 215,219 **** /// <param name="parameters"></param> /// <returns></returns> ! IEnumerable EnumerableFilter(object collection, string filter, QueryParameters parameters); /// <summary> --- 214,218 ---- /// <param name="parameters"></param> /// <returns></returns> ! IEnumerable EnumerableFilter( object collection, string filter, QueryParameters parameters ); /// <summary> *************** *** 222,226 **** /// <param name="obj"></param> /// <returns></returns> ! IClassPersister GetPersister(object obj); /// <summary> --- 221,225 ---- /// <param name="obj"></param> /// <returns></returns> ! IClassPersister GetPersister( object obj ); /// <summary> *************** *** 231,235 **** /// <param name="obj"></param> /// <param name="lockMode"></param> ! void AddUninitializedEntity(Key key, object obj, LockMode lockMode); /// <summary> --- 230,234 ---- /// <param name="obj"></param> /// <param name="lockMode"></param> ! void AddUninitializedEntity( Key key, object obj, LockMode lockMode ); /// <summary> *************** *** 241,251 **** /// <param name="obj"></param> /// <param name="lockMode"></param> ! void PostHydrate(IClassPersister persister, object id, object[] values, object obj, LockMode lockMode); ! /// <summary> /// Perform the second step of 2-phase load (ie. fully initialize the entity instance) /// </summary> /// <param name="obj"></param> ! void InitializeEntity(object obj); /// <summary> --- 240,250 ---- /// <param name="obj"></param> /// <param name="lockMode"></param> ! void PostHydrate( IClassPersister persister, object id, object[ ] values, object obj, LockMode lockMode ); ! /// <summary> /// Perform the second step of 2-phase load (ie. fully initialize the entity instance) /// </summary> /// <param name="obj"></param> ! void InitializeEntity( object obj ); /// <summary> *************** *** 254,258 **** /// <param name="key"></param> /// <returns></returns> ! object GetEntity(Key key); /// <summary> --- 253,257 ---- /// <param name="key"></param> /// <returns></returns> ! object GetEntity( Key key ); /// <summary> *************** *** 264,268 **** /// <param name="impl"></param> /// <returns>Returns a the Proxy for the class or the parameter impl.</returns> ! object ProxyFor(IClassPersister persister, Key key, object impl); /// <summary> --- 263,267 ---- /// <param name="impl"></param> /// <returns>Returns a the Proxy for the class or the parameter impl.</returns> ! object ProxyFor( IClassPersister persister, Key key, object impl ); /// <summary> *************** *** 271,275 **** /// <param name="impl"></param> /// <returns></returns> ! object ProxyFor(object impl); /// <summary> --- 270,274 ---- /// <param name="impl"></param> /// <returns></returns> ! object ProxyFor( object impl ); /// <summary> *************** *** 284,288 **** /// <param name="obj"></param> /// <returns></returns> ! object GetEntityIdentifier(object obj); /// <summary> --- 283,287 ---- /// <param name="obj"></param> /// <returns></returns> ! object GetEntityIdentifier( object obj ); /// <summary> *************** *** 292,299 **** /// <param name="obj"></param> /// <returns></returns> ! object GetEntityIdentifierIfNotUnsaved(object obj); ! ! bool IsSaved(object obj); /// <summary> --- 291,302 ---- /// <param name="obj"></param> /// <returns></returns> ! object GetEntityIdentifierIfNotUnsaved( object obj ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="obj"></param> ! /// <returns></returns> ! bool IsSaved( object obj ); /// <summary> *************** *** 303,307 **** /// <param name="id"></param> /// <returns></returns> ! object Instantiate(System.Type clazz, object id); /// <summary> --- 306,310 ---- /// <param name="id"></param> /// <returns></returns> ! object Instantiate( System.Type clazz, object id ); /// <summary> *************** *** 310,314 **** /// <param name="entity"></param> /// <param name="lockMode"></param> ! void SetLockMode(object entity, LockMode lockMode); /// <summary> --- 313,317 ---- /// <param name="entity"></param> /// <param name="lockMode"></param> ! void SetLockMode( object entity, LockMode lockMode ); /// <summary> *************** *** 316,320 **** /// </summary> /// <param name="entity"></param> ! object GetVersion(object entity); /// <summary> --- 319,323 ---- /// </summary> /// <param name="entity"></param> ! object GetVersion( object entity ); /// <summary> *************** *** 323,327 **** /// <param name="entity"></param> /// <returns></returns> ! LockMode GetLockMode(object entity); /// <summary> --- 326,330 ---- /// <param name="entity"></param> /// <returns></returns> ! LockMode GetLockMode( object entity ); /// <summary> *************** *** 331,336 **** /// <param name="coll"></param> /// <returns></returns> ! ICollection GetOrphans(PersistentCollection coll); } ! } --- 334,339 ---- /// <param name="coll"></param> /// <returns></returns> ! ICollection GetOrphans( PersistentCollection coll ); } ! } \ No newline at end of file Index: ISessionFactoryImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ISessionFactoryImplementor.cs 21 Dec 2004 20:43:41 -0000 1.12 --- ISessionFactoryImplementor.cs 31 Dec 2004 17:36:22 -0000 1.13 *************** *** 1,12 **** - using System; using System.Collections; using System.Data; using NHibernate.Connection; using NHibernate.Persister; - using NHibernate.Collection; - using NHibernate.Dialect; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> --- 1,10 ---- using System.Collections; using System.Data; + using NHibernate.Collection; using NHibernate.Connection; using NHibernate.Persister; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> *************** *** 14,24 **** /// such as implementors of <c>IType</c>. /// </summary> ! public interface ISessionFactoryImplementor : IMapping, ISessionFactory { /// <summary> /// TODO: determine if this is more appropriate for ISessionFactory /// </summary> ! IConnectionProvider ConnectionProvider {get;} ! /// <summary> /// Gets the IsolationLevel an IDbTransaction should be set to. --- 12,22 ---- /// such as implementors of <c>IType</c>. /// </summary> ! public interface ISessionFactoryImplementor : IMapping, ISessionFactory { /// <summary> /// TODO: determine if this is more appropriate for ISessionFactory /// </summary> ! IConnectionProvider ConnectionProvider { get; } ! /// <summary> /// Gets the IsolationLevel an IDbTransaction should be set to. *************** *** 32,36 **** /// Get the persister for a class /// </summary> ! IClassPersister GetPersister(System.Type clazz); /// <summary> --- 30,34 ---- /// Get the persister for a class /// </summary> ! IClassPersister GetPersister( System.Type clazz ); /// <summary> *************** *** 40,44 **** /// <returns>The <see cref="IClassPersister"/> for the class.</returns> /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found.</exception> ! IClassPersister GetPersister(string className); /// <summary> --- 38,42 ---- /// <returns>The <see cref="IClassPersister"/> for the class.</returns> /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found.</exception> ! IClassPersister GetPersister( string className ); /// <summary> *************** *** 49,53 **** /// <returns>The <see cref="IClassPersister"/> for the class.</returns> /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found and throwException is <c>true</c>.</exception> ! IClassPersister GetPersister(string className, bool throwException); /// <summary> --- 47,51 ---- /// <returns>The <see cref="IClassPersister"/> for the class.</returns> /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found and throwException is <c>true</c>.</exception> ! IClassPersister GetPersister( string className, bool throwException ); /// <summary> *************** *** 56,60 **** /// <param name="role"></param> /// <returns></returns> ! CollectionPersister GetCollectionPersister(string role); /// <summary> --- 54,58 ---- /// <param name="role"></param> /// <returns></returns> ! CollectionPersister GetCollectionPersister( string role ); /// <summary> *************** *** 84,88 **** /// <param name="queryString"></param> /// <returns></returns> ! IType[] GetReturnTypes(string queryString); /// <summary> --- 82,86 ---- /// <param name="queryString"></param> /// <returns></returns> ! IType[ ] GetReturnTypes( string queryString ); /// <summary> *************** *** 91,95 **** /// <param name="queryString"></param> /// <returns></returns> ! ICollection GetNamedParameters(string queryString); /// <summary> --- 89,93 ---- /// <param name="queryString"></param> /// <returns></returns> ! ICollection GetNamedParameters( string queryString ); /// <summary> *************** *** 103,107 **** /// </summary> /// <param name="conn"></param> ! void CloseConnection(IDbConnection conn); /// <summary> --- 101,105 ---- /// </summary> /// <param name="conn"></param> ! void CloseConnection( IDbConnection conn ); /// <summary> *************** *** 110,114 **** /// <param name="clazz"></param> /// <returns></returns> ! string[] GetImplementors(System.Type clazz); /// <summary> --- 108,112 ---- /// <param name="clazz"></param> /// <returns></returns> ! string[ ] GetImplementors( System.Type clazz ); /// <summary> *************** *** 117,121 **** /// <param name="name"></param> /// <returns></returns> ! string GetImportedClassName(string name); } ! } --- 115,119 ---- /// <param name="name"></param> /// <returns></returns> ! string GetImportedClassName( string name ); } ! } \ No newline at end of file Index: Cascades.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Cascades.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cascades.cs 13 Apr 2004 14:59:10 -0000 1.10 --- Cascades.cs 31 Dec 2004 17:36:22 -0000 1.11 *************** *** 1,16 **** - using System; using System.Collections; ! using NHibernate.Type; ! using NHibernate.Proxy; ! using NHibernate.Persister; using NHibernate.Collection; ! ! namespace NHibernate.Engine { ! /// <summary> /// The types of children to cascade to /// </summary> ! public enum CascadePoint { /// <summary> /// A cascade point that occurs just after the insertion of the parent --- 1,15 ---- using System.Collections; ! using log4net; using NHibernate.Collection; + using NHibernate.Persister; + using NHibernate.Type; ! namespace NHibernate.Engine ! { /// <summary> /// The types of children to cascade to /// </summary> ! public enum CascadePoint ! { /// <summary> /// A cascade point that occurs just after the insertion of the parent *************** *** 42,77 **** /// Summary description for Cascades. /// </summary> ! public class Cascades { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Cascades)); ! /// <summary> /// A session action that may be cascaded from parent entity to its children /// </summary> ! public abstract class CascadingAction { ! protected CascadingAction() {} /// <summary> /// Cascade the action to the child object /// </summary> ! public abstract void Cascade(ISessionImplementor session, object child); /// <summary> /// Should this action be cascaded to the given (possibly unitilized) collection? /// </summary> ! public abstract bool ShouldCascadeCollection(object collection); public abstract bool DeleteOrphans(); public static CascadingAction ActionDelete = new ActionDeleteClass(); ! ! private class ActionDeleteClass : CascadingAction { ! public override void Cascade(ISessionImplementor session, object child) { ! log.Debug("cascading to delete()"); ! if(session.IsSaved(child)) session.Delete(child); } ! public override bool ShouldCascadeCollection(object collection) { return true; --- 41,86 ---- /// Summary description for Cascades. /// </summary> ! public class Cascades ! { ! private static readonly ILog log = LogManager.GetLogger( typeof( Cascades ) ); ! /// <summary> /// A session action that may be cascaded from parent entity to its children /// </summary> ! public abstract class CascadingAction ! { ! /// <summary></summary> ! protected CascadingAction() ! { ! } /// <summary> /// Cascade the action to the child object /// </summary> ! public abstract void Cascade( ISessionImplementor session, object child ); /// <summary> /// Should this action be cascaded to the given (possibly unitilized) collection? /// </summary> ! public abstract bool ShouldCascadeCollection( object collection ); + /// <summary></summary> public abstract bool DeleteOrphans(); + /// <summary></summary> public static CascadingAction ActionDelete = new ActionDeleteClass(); ! ! private class ActionDeleteClass : CascadingAction { ! public override void Cascade( ISessionImplementor session, object child ) { ! log.Debug( "cascading to delete()" ); ! if( session.IsSaved( child ) ) ! { ! session.Delete( child ); ! } } ! public override bool ShouldCascadeCollection( object collection ) { return true; *************** *** 85,101 **** } public static CascadingAction ActionEvict = new ActionEvictClass(); ! ! private class ActionEvictClass : CascadingAction { ! public override void Cascade(ISessionImplementor session, object child) { ! log.Debug("cascading to evict()"); ! session.Evict(child); } ! public override bool ShouldCascadeCollection(object collection) { ! return CollectionIsInitialized(collection); } --- 94,111 ---- } + /// <summary></summary> public static CascadingAction ActionEvict = new ActionEvictClass(); ! ! private class ActionEvictClass : CascadingAction { ! public override void Cascade( ISessionImplementor session, object child ) { ! log.Debug( "cascading to evict()" ); ! session.Evict( child ); } ! public override bool ShouldCascadeCollection( object collection ) { ! return CollectionIsInitialized( collection ); } *************** *** 107,122 **** } public static CascadingAction ActionSaveUpdate = new ActionSaveUpdateClass(); ! ! private class ActionSaveUpdateClass : CascadingAction { ! public override void Cascade(ISessionImplementor session, object child) { ! log.Debug("cascading to SaveOrUpdate()"); ! session.SaveOrUpdate(child); } ! public override bool ShouldCascadeCollection(object collection) { ! return CollectionIsInitialized(collection); // saves/updates don't cascade to uninitialized collections } --- 117,134 ---- } + /// <summary></summary> public static CascadingAction ActionSaveUpdate = new ActionSaveUpdateClass(); ! ! private class ActionSaveUpdateClass : CascadingAction { ! public override void Cascade( ISessionImplementor session, object child ) { ! log.Debug( "cascading to SaveOrUpdate()" ); ! session.SaveOrUpdate( child ); } ! public override bool ShouldCascadeCollection( object collection ) ! { ! return CollectionIsInitialized( collection ); // saves/updates don't cascade to uninitialized collections } *************** *** 129,141 **** } ! private static bool CollectionIsInitialized( object collection ) { ! return !(collection is PersistentCollection) || ( (PersistentCollection) collection).WasInitialized; } } ! public abstract class CascadeStyle { ! protected CascadeStyle() { } /// <summary> --- 141,157 ---- } ! private static bool CollectionIsInitialized( object collection ) { ! return !( collection is PersistentCollection ) || ( ( PersistentCollection ) collection ).WasInitialized; } } ! /// <summary></summary> ! public abstract class CascadeStyle { ! /// <summary></summary> ! protected CascadeStyle() ! { ! } /// <summary> *************** *** 144,160 **** /// <param name="action"></param> /// <returns></returns> ! public abstract bool DoCascade(CascadingAction action); //TODO: H2.0.3 - it looks like the CascadeStyle subclasses are defined outside of the CascadeStyle // class ! /// <summary> /// Save/Delete/Update/Evict + delete orphans /// </summary> public static CascadeStyle StyleAllGC = new StyleAllGCClass(); ! private class StyleAllGCClass : CascadeStyle { ! public override bool DoCascade(CascadingAction action) { return true; --- 160,176 ---- /// <param name="action"></param> /// <returns></returns> ! public abstract bool DoCascade( CascadingAction action ); //TODO: H2.0.3 - it looks like the CascadeStyle subclasses are defined outside of the CascadeStyle // class ! /// <summary> /// Save/Delete/Update/Evict + delete orphans /// </summary> public static CascadeStyle StyleAllGC = new StyleAllGCClass(); ! private class StyleAllGCClass : CascadeStyle { ! public override bool DoCascade( CascadingAction action ) { return true; *************** *** 167,174 **** public static CascadeStyle StyleAll = new StyleAllClass(); ! ! private class StyleAllClass : CascadeStyle { ! public override bool DoCascade(CascadingAction action) { return true; --- 183,190 ---- public static CascadeStyle StyleAll = new StyleAllClass(); ! ! private class StyleAllClass : CascadeStyle { ! public override bool DoCascade( CascadingAction action ) { return true; *************** *** 181,187 **** public static CascadeStyle StyleSaveUpdate = new StyleSaveUpdateClass(); ! private class StyleSaveUpdateClass : CascadeStyle { ! public override bool DoCascade(CascadingAction action) { return action == CascadingAction.ActionSaveUpdate; --- 197,203 ---- public static CascadeStyle StyleSaveUpdate = new StyleSaveUpdateClass(); ! private class StyleSaveUpdateClass : CascadeStyle { ! public override bool DoCascade( CascadingAction action ) { return action == CascadingAction.ActionSaveUpdate; *************** *** 193,200 **** /// </summary> public static CascadeStyle StyleOnlyDelete = new StyleOnlyDeleteClass(); ! ! private class StyleOnlyDeleteClass : CascadeStyle { ! public override bool DoCascade(CascadingAction action) { return action == CascadingAction.ActionDelete; --- 209,216 ---- /// </summary> public static CascadeStyle StyleOnlyDelete = new StyleOnlyDeleteClass(); ! ! private class StyleOnlyDeleteClass : CascadeStyle { ! public override bool DoCascade( CascadingAction action ) { return action == CascadingAction.ActionDelete; *************** *** 208,214 **** public static CascadeStyle StyleNone = new StyleNoneClass(); ! private class StyleNoneClass : CascadeStyle { ! public override bool DoCascade(CascadingAction action) { return false; --- 224,230 ---- public static CascadeStyle StyleNone = new StyleNoneClass(); ! private class StyleNoneClass : CascadeStyle { ! public override bool DoCascade( CascadingAction action ) { return false; *************** *** 222,230 **** /// is determined by the <c>Unsaved-Value</c> attribute in the mapping file. /// </summary> ! public class IdentifierValue { private object value; ! protected IdentifierValue() { this.value = null; --- 238,247 ---- /// is determined by the <c>Unsaved-Value</c> attribute in the mapping file. /// </summary> ! public class IdentifierValue { private object value; ! /// <summary></summary> ! protected IdentifierValue() { this.value = null; *************** *** 236,240 **** /// </summary> /// <param name="value"></param> ! public IdentifierValue(object value) { this.value = value; --- 253,257 ---- /// </summary> /// <param name="value"></param> ! public IdentifierValue( object value ) { this.value = value; *************** *** 244,251 **** /// Does the given identifier belong to a new instance /// </summary> ! public virtual bool IsUnsaved(object id) { ! if ( log.IsDebugEnabled ) log.Debug("unsaved-value: " + value); ! return id==null || value.Equals(id); } --- 261,271 ---- /// Does the given identifier belong to a new instance /// </summary> ! public virtual bool IsUnsaved( object id ) { ! if( log.IsDebugEnabled ) ! { ! log.Debug( "unsaved-value: " + value ); ! } ! return id == null || value.Equals( id ); } *************** *** 255,263 **** public static IdentifierValue SaveAny = new SaveAnyClass(); ! private class SaveAnyClass : IdentifierValue { ! public override bool IsUnsaved(object id) { ! log.Debug("unsaved-value strategy ANY"); return true; } --- 275,283 ---- public static IdentifierValue SaveAny = new SaveAnyClass(); ! private class SaveAnyClass : IdentifierValue { ! public override bool IsUnsaved( object id ) { ! log.Debug( "unsaved-value strategy ANY" ); return true; } *************** *** 269,277 **** public static IdentifierValue SaveNone = new SaveNoneClass(); ! private class SaveNoneClass : IdentifierValue { ! public override bool IsUnsaved(object id) { ! log.Debug("unsaved-value strategy NONE"); return false; } --- 289,297 ---- public static IdentifierValue SaveNone = new SaveNoneClass(); ! private class SaveNoneClass : IdentifierValue { ! public override bool IsUnsaved( object id ) { ! log.Debug( "unsaved-value strategy NONE" ); return false; } *************** *** 283,302 **** /// </summary> public static IdentifierValue SaveNull = new SaveNullClass(); ! ! private class SaveNullClass : IdentifierValue { ! public override bool IsUnsaved(object id) { ! log.Debug("unsaved-value strategy NULL"); ! return id==null; } } } ! [Obsolete("This is being replaced by the Cascade with a deleteOrphans as the last param.")] ! private static void Cascade(ISessionImplementor session, object child, IType type, CascadingAction action, CascadePoint cascadeTo) ! { ! Cascade(session, child, type, action, cascadeTo, false); ! } /// <summary> --- 303,322 ---- /// </summary> public static IdentifierValue SaveNull = new SaveNullClass(); ! ! private class SaveNullClass : IdentifierValue { ! public override bool IsUnsaved( object id ) { ! log.Debug( "unsaved-value strategy NULL" ); ! return id == null; } } } ! // [System.Obsolete( "This is being replaced by the Cascade with a deleteOrphans as the last param." )] ! // private static void Cascade( ISessionImplementor session, object child, IType type, CascadingAction action, CascadePoint cascadeTo ) ! // { ! // Cascade( session, child, type, action, cascadeTo, false ); ! // } /// <summary> *************** *** 309,348 **** /// <param name="cascadeTo"></param> /// <param name="deleteOrphans"></param> ! private static void Cascade(ISessionImplementor session, object child, IType type, CascadingAction action, CascadePoint cascadeTo, bool deleteOrphans) { ! if (child != null) { ! if ( type.IsAssociationType ) { ! if ( ((IAssociationType)type).ForeignKeyType.CascadeNow(cascadeTo) ) { ! if ( type.IsEntityType || type.IsObjectType ) { ! action.Cascade(session, child); ! } ! else if ( type.IsPersistentCollectionType ) { CascadePoint cascadeVia; ! if ( cascadeTo == CascadePoint.CascadeAfterInsertBeforeDelete ) { cascadeVia = CascadePoint.CascadeAfterInsertBeforeDeleteViaCollection; ! } ! else { cascadeVia = cascadeTo; } ! PersistentCollectionType pctype = (PersistentCollectionType) type; CollectionPersister persister = session.Factory.GetCollectionPersister( pctype.Role ); IType elemType = persister.ElementType; ! // cascade to current collection elements ICollection iter; ! if (action.ShouldCascadeCollection(child)) { ! if ( log.IsDebugEnabled ) log.Debug( "cascading to collection: " + pctype.Role ); ! iter = pctype.GetElementsCollection(child); ! } ! else { //TODO: this hack assumes that shouldCascadeCollection() always --- 329,371 ---- /// <param name="cascadeTo"></param> /// <param name="deleteOrphans"></param> ! private static void Cascade( ISessionImplementor session, object child, IType type, CascadingAction action, CascadePoint cascadeTo, bool deleteOrphans ) { ! if( child != null ) { ! if( type.IsAssociationType ) { ! if( ( ( IAssociationType ) type ).ForeignKeyType.CascadeNow( cascadeTo ) ) { ! if( type.IsEntityType || type.IsObjectType ) { ! action.Cascade( session, child ); ! } ! else if( type.IsPersistentCollectionType ) { CascadePoint cascadeVia; ! if( cascadeTo == CascadePoint.CascadeAfterInsertBeforeDelete ) { cascadeVia = CascadePoint.CascadeAfterInsertBeforeDeleteViaCollection; ! } ! else { cascadeVia = cascadeTo; } ! PersistentCollectionType pctype = ( PersistentCollectionType ) type; CollectionPersister persister = session.Factory.GetCollectionPersister( pctype.Role ); IType elemType = persister.ElementType; ! // cascade to current collection elements ICollection iter; ! if( action.ShouldCascadeCollection( child ) ) { ! if( log.IsDebugEnabled ) ! { ! log.Debug( "cascading to collection: " + pctype.Role ); ! } ! iter = pctype.GetElementsCollection( child ); ! } ! else { //TODO: this hack assumes that shouldCascadeCollection() always *************** *** 350,388 **** // of the semantics - what we need is to change // shouldCascadeCollection() to getCollectionCascadeIterator() ! if (child is PersistentCollection) { ! PersistentCollection pc = (PersistentCollection) child; ! if ( pc.HasQueuedAdds ) { iter = pc.QueuedAddsCollection; ! } ! else { iter = null; } ! } ! else { iter = null; } ! } ! if (iter!=null) { ! foreach(object obj in iter) { ! Cascade(session, obj, elemType, action, cascadeVia, false); } } // handle oprhaned entities!! ! if( deleteOrphans && action.DeleteOrphans() && child is PersistentCollection) { ! PersistentCollection pc = (PersistentCollection)child; ! if(pc.WasInitialized) { ! ICollection orphanColl = session.GetOrphans(pc); ! foreach(object obj in orphanColl) { ! session.Delete(obj); } } --- 373,411 ---- // of the semantics - what we need is to change // shouldCascadeCollection() to getCollectionCascadeIterator() ! if( child is PersistentCollection ) { ! PersistentCollection pc = ( PersistentCollection ) child; ! if( pc.HasQueuedAdds ) { iter = pc.QueuedAddsCollection; ! } ! else { iter = null; } ! } ! else { iter = null; } ! } ! if( iter != null ) { ! foreach( object obj in iter ) { ! Cascade( session, obj, elemType, action, cascadeVia, false ); } } // handle oprhaned entities!! ! if( deleteOrphans && action.DeleteOrphans() && child is PersistentCollection ) { ! PersistentCollection pc = ( PersistentCollection ) child; ! if( pc.WasInitialized ) { ! ICollection orphanColl = session.GetOrphans( pc ); ! foreach( object obj in orphanColl ) { ! session.Delete( obj ); } } *************** *** 390,403 **** } } ! } ! else if (type.IsComponentType ) { ! IAbstractComponentType ctype = ((IAbstractComponentType) type); ! object[] children = ctype.GetPropertyValues(child, session); ! IType[] types = ctype.Subtypes; ! for (int i=0; i<types.Length; i++) { ! if (ctype.Cascade(i).DoCascade(action) ) ! Cascade(session, children[i], types[i], action, cascadeTo, deleteOrphans); } } --- 413,428 ---- } } ! } ! else if( type.IsComponentType ) { ! IAbstractComponentType ctype = ( ( IAbstractComponentType ) type ); ! object[ ] children = ctype.GetPropertyValues( child, session ); ! IType[ ] types = ctype.Subtypes; ! for( int i = 0; i < types.Length; i++ ) { ! if( ctype.Cascade( i ).DoCascade( action ) ) ! { ! Cascade( session, children[ i ], types[ i ], action, cascadeTo, deleteOrphans ); ! } } } *************** *** 413,431 **** /// <param name="action"></param> /// <param name="cascadeTo"></param> ! public static void Cascade(ISessionImplementor session, IClassPersister persister, object parent, Cascades.CascadingAction action, CascadePoint cascadeTo) { ! if ( persister.HasCascades ) { ! if ( log.IsDebugEnabled ) log.Debug( "processing cascades for: " + persister.ClassName); ! IType[] types = persister.PropertyTypes; ! Cascades.CascadeStyle[] cascadeStyles = persister.PropertyCascadeStyles; ! for (int i=0; i<types.Length; i++) { ! if ( cascadeStyles[i].DoCascade(action) ) ! Cascade(session, persister.GetPropertyValue(parent, i), types[i], action, cascadeTo, cascadeStyles[i]==CascadeStyle.StyleAllGC ); } - if ( log.IsDebugEnabled ) log.Debug( "done processing cascades for: " + persister.ClassName ); } ! } } ! } ! --- 438,464 ---- /// <param name="action"></param> /// <param name="cascadeTo"></param> ! public static void Cascade( ISessionImplementor session, IClassPersister persister, object parent, CascadingAction action, CascadePoint cascadeTo ) ! { ! if( persister.HasCascades ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "processing cascades for: " + persister.ClassName ); ! } ! IType[ ] types = persister.PropertyTypes; ! CascadeStyle[ ] cascadeStyles = persister.PropertyCascadeStyles; ! for( int i = 0; i < types.Length; i++ ) ! { ! if( cascadeStyles[ i ].DoCascade( action ) ) ! { ! Cascade( session, persister.GetPropertyValue( parent, i ), types[ i ], action, cascadeTo, cascadeStyles[ i ] == CascadeStyle.StyleAllGC ); ! } ! } ! if( log.IsDebugEnabled ) ! { ! log.Debug( "done processing cascades for: " + persister.ClassName ); } } ! } } ! } \ No newline at end of file Index: IBatcher.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IBatcher.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IBatcher.cs 14 Sep 2004 17:49:54 -0000 1.4 --- IBatcher.cs 31 Dec 2004 17:36:22 -0000 1.5 *************** *** 1,8 **** using System; using System.Data; - using NHibernate.SqlCommand; ! namespace NHibernate.Engine { /// <summary> --- 1,7 ---- using System; using System.Data; using NHibernate.SqlCommand; ! namespace NHibernate.Engine { /// <summary> *************** *** 21,25 **** /// </para> /// </remarks> ! public interface IBatcher { /// <summary> --- 20,24 ---- /// </para> /// </remarks> ! public interface IBatcher { /// <summary> *************** *** 35,39 **** /// does NOT cause the batch to execute... /// </remarks> ! IDbCommand PrepareQueryCommand(SqlString sql, bool scrollable); /// <summary> --- 34,38 ---- /// does NOT cause the batch to execute... /// </remarks> ! IDbCommand PrepareQueryCommand( SqlString sql, bool scrollable ); /// <summary> *************** *** 43,47 **** /// <param name="cmd">The <see cref="IDbCommand"/> to close.</param> /// <param name="reader">The <see cref="IDataReader"/> to close.</param> ! void CloseQueryCommand(IDbCommand cmd, IDataReader reader); /// <summary> --- 42,46 ---- /// <param name="cmd">The <see cref="IDbCommand"/> to close.</param> /// <param name="reader">The <see cref="IDataReader"/> to close.</param> ! void CloseQueryCommand( IDbCommand cmd, IDataReader reader ); /// <summary> *************** *** 51,55 **** /// <param name="sql">The SqlString to convert to an IDbCommand.</param> /// <returns></returns> ! IDbCommand PrepareCommand(SqlString sql); /// <summary> --- 50,54 ---- /// <param name="sql">The SqlString to convert to an IDbCommand.</param> /// <returns></returns> ! IDbCommand PrepareCommand( SqlString sql ); /// <summary> *************** *** 58,62 **** /// <param name="cm">The <see cref="IDbCommand"/> to ensure is closed.</param> /// <param name="reader">The <see cref="IDataReader"/> to ensure is closed.</param> ! void CloseCommand(IDbCommand cm, IDataReader reader); /// <summary> --- 57,61 ---- /// <param name="cm">The <see cref="IDbCommand"/> to ensure is closed.</param> /// <param name="reader">The <see cref="IDataReader"/> to ensure is closed.</param> ! void CloseCommand( IDbCommand cm, IDataReader reader ); /// <summary> *************** *** 70,74 **** /// <param name="sql"></param> /// <returns></returns> ! IDbCommand PrepareBatchCommand(SqlString sql); /// <summary> --- 69,73 ---- /// <param name="sql"></param> /// <returns></returns> ! IDbCommand PrepareBatchCommand( SqlString sql ); /// <summary> *************** *** 81,85 **** /// expect. /// </remarks> ! void AddToBatch(int expectedRowCount); /// <summary> --- 80,84 ---- /// expect. /// </remarks> ! void AddToBatch( int expectedRowCount ); /// <summary> *************** *** 103,107 **** /// <see cref="IDataReader"/>s it can have are followed. /// </remarks> ! IDataReader ExecuteReader(IDbCommand cmd); /// <summary> --- 102,106 ---- /// <see cref="IDataReader"/>s it can have are followed. /// </remarks> ! IDataReader ExecuteReader( IDbCommand cmd ); /// <summary> *************** *** 113,117 **** /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open /// <see cref="IDataReader"/>s it can have are followed. ! int ExecuteNonQuery(IDbCommand cmd); /// <summary> --- 112,117 ---- /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open /// <see cref="IDataReader"/>s it can have are followed. ! /// </remarks> ! int ExecuteNonQuery( IDbCommand cmd ); /// <summary> *************** *** 119,123 **** /// </summary> /// <param name="e"></param> ! void AbortBatch(Exception e); /// <summary> --- 119,123 ---- /// </summary> /// <param name="e"></param> ! void AbortBatch( Exception e ); /// <summary> *************** *** 129,134 **** /// A wrapper for calling the <c>IDriver.GenerateCommand</c> that adds logging. /// </remarks> ! IDbCommand Generate(SqlString sqlString); } ! } --- 129,134 ---- /// A wrapper for calling the <c>IDriver.GenerateCommand</c> that adds logging. /// </remarks> ! IDbCommand Generate( SqlString sqlString ); } ! } \ No newline at end of file Index: ICollectionSnapshot.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ICollectionSnapshot.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ICollectionSnapshot.cs 29 Nov 2004 04:45:51 -0000 1.4 --- ICollectionSnapshot.cs 31 Dec 2004 17:36:22 -0000 1.5 *************** *** 1,10 **** ! using System; ! ! namespace NHibernate.Engine { /// <summary> /// Defines a complete "snapshot" of a particular collection. /// </summary> ! public interface ICollectionSnapshot { /// <summary> --- 1,8 ---- ! namespace NHibernate.Engine { /// <summary> /// Defines a complete "snapshot" of a particular collection. /// </summary> ! public interface ICollectionSnapshot { /// <summary> *************** *** 12,21 **** /// </summary> object Key { get; } ! /// <summary> /// Gets the role that identifies this Collection. /// </summary> string Role { get; } ! /// <summary> /// Gets the snapshot copy of the Collection's elements. --- 10,19 ---- /// </summary> object Key { get; } ! /// <summary> /// Gets the role that identifies this Collection. /// </summary> string Role { get; } ! /// <summary> /// Gets the snapshot copy of the Collection's elements. *************** *** 28,32 **** /// <summary> ! /// Gets a <see cref="Boolean"/> indicating if some action has been performed on the /// actual collection instance that has modified it. /// </summary> --- 26,30 ---- /// <summary> ! /// Gets a <see cref="bool"/> indicating if some action has been performed on the /// actual collection instance that has modified it. /// </summary> *************** *** 39,46 **** /// <summary> ! /// Gets a <see cref="Boolean"/> indicating if the underlying collection has been /// initialized yet. /// </summary> ! bool IsInitialized{ get; } } ! } --- 37,44 ---- /// <summary> ! /// Gets a <see cref="bool"/> indicating if the underlying collection has been /// initialized yet. /// </summary> ! bool IsInitialized { get; } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:26:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16861 Modified Files: NHybridDataReader.cs NpgsqlDriver.cs OdbcDriver.cs OleDbDriver.cs OracleClientDriver.cs SqlClientDriver.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: OracleClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OracleClientDriver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleClientDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 --- OracleClientDriver.cs 31 Dec 2004 17:26:01 -0000 1.3 *************** *** 1,6 **** - using System; - using System.Data; - using System.Reflection; - namespace NHibernate.Driver { --- 1,2 ---- *************** *** 8,47 **** /// A NHibernate Driver for using the Oracle DataProvider. /// </summary> ! public class OracleClientDriver: DriverBase { private System.Type connectionType; private System.Type commandType; public OracleClientDriver() { ! connectionType = System.Type.GetType("System.Data.OracleClient.OracleConnection, System.Data.OracleClient, version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); ! commandType = System.Type.GetType("System.Data.OracleClient.OracleCommand, System.Data.OracleClient, version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); } public override System.Type CommandType { ! get { return commandType; } } public override System.Type ConnectionType { ! get { return connectionType; } } ! public override bool UseNamedPrefixInSql { ! get {return true;} } ! public override bool UseNamedPrefixInParameter { ! get {return true;} } ! public override string NamedPrefix { ! get {return ":";} } } ! } ! --- 4,48 ---- /// A NHibernate Driver for using the Oracle DataProvider. /// </summary> ! public class OracleClientDriver : DriverBase { private System.Type connectionType; private System.Type commandType; + /// <summary></summary> public OracleClientDriver() { ! connectionType = System.Type.GetType( "System.Data.OracleClient.OracleConnection, System.Data.OracleClient, version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ); ! commandType = System.Type.GetType( "System.Data.OracleClient.OracleCommand, System.Data.OracleClient, version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ); } + /// <summary></summary> public override System.Type CommandType { ! get { return commandType; } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return connectionType; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { ! get { return true; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return true; } } ! /// <summary></summary> ! public override string NamedPrefix { ! get { return ":"; } } } ! } \ No newline at end of file Index: SqlClientDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/SqlClientDriver.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SqlClientDriver.cs 25 Aug 2004 03:56:30 -0000 1.6 --- SqlClientDriver.cs 31 Dec 2004 17:26:01 -0000 1.7 *************** *** 1,6 **** - using System; using System.Data; ! using NHibernate.SqlCommand; namespace NHibernate.Driver --- 1,6 ---- using System.Data; ! using System.Data.SqlClient; using NHibernate.SqlCommand; + using NHibernate.SqlTypes; namespace NHibernate.Driver *************** *** 11,51 **** public class SqlClientDriver : DriverBase { public SqlClientDriver() { } ! public override System.Type CommandType { ! get { return typeof(System.Data.SqlClient.SqlCommand); } } public override System.Type ConnectionType { ! get { return typeof(System.Data.SqlClient.SqlConnection); } } public override IDbConnection CreateConnection() { ! return new System.Data.SqlClient.SqlConnection(); } ! public override IDbCommand CreateCommand() { return new System.Data.SqlClient.SqlCommand(); } ! public override bool UseNamedPrefixInSql { ! get {return true;} } ! public override bool UseNamedPrefixInParameter { ! get {return true;} } ! public override string NamedPrefix { ! get {return "@";} } --- 11,59 ---- public class SqlClientDriver : DriverBase { + /// <summary></summary> public SqlClientDriver() { } ! ! /// <summary></summary> public override System.Type CommandType { ! get { return typeof( System.Data.SqlClient.SqlCommand ); } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return typeof( SqlConnection ); } } + /// <summary></summary> public override IDbConnection CreateConnection() { ! return new SqlConnection(); } ! /// <summary></summary> ! public override IDbCommand CreateCommand() { return new System.Data.SqlClient.SqlCommand(); } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { ! get { return true; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return true; } } ! /// <summary></summary> ! public override string NamedPrefix { ! get { return "@"; } } *************** *** 62,66 **** public override bool SupportsMultipleOpenReaders { ! get { return false; } } --- 70,74 ---- public override bool SupportsMultipleOpenReaders { ! get { return false; } } *************** *** 77,83 **** /// to be set. /// </remarks> ! protected override IDbDataParameter GenerateParameter(IDbCommand command, string name, Parameter parameter, Dialect.Dialect dialect) { ! IDbDataParameter dbParam = base.GenerateParameter(command, name, parameter, dialect); // take a look at the SqlType and determine if this is one that MsSql needs to set Size or --- 85,91 ---- /// to be set. /// </remarks> ! protected override IDbDataParameter GenerateParameter( IDbCommand command, string name, Parameter parameter, Dialect.Dialect dialect ) { ! IDbDataParameter dbParam = base.GenerateParameter( command, name, parameter, dialect ); // take a look at the SqlType and determine if this is one that MsSql needs to set Size or *************** *** 89,95 **** ParameterPrecisionScale pps = null; ! switch( parameter.SqlType.DbType ) { - case DbType.AnsiString: case DbType.AnsiStringFixedLength: --- 97,102 ---- ParameterPrecisionScale pps = null; ! switch( parameter.SqlType.DbType ) { case DbType.AnsiString: case DbType.AnsiStringFixedLength: *************** *** 100,108 **** case DbType.Binary: pl = parameter as ParameterLength; ! if( parameter.SqlType is SqlTypes.BinaryBlobSqlType) { dbParam.Size = dialect.MaxBinaryBlobSize; } ! else { dbParam.Size = dialect.MaxBinarySize; --- 107,115 ---- case DbType.Binary: pl = parameter as ParameterLength; ! if( parameter.SqlType is BinaryBlobSqlType ) { dbParam.Size = dialect.MaxBinaryBlobSize; } ! else { dbParam.Size = dialect.MaxBinarySize; *************** *** 113,125 **** case DbType.StringFixedLength: pl = parameter as ParameterLength; ! if( parameter.SqlType is SqlTypes.StringClobSqlType) { dbParam.Size = dialect.MaxStringClobSize; } ! else { dbParam.Size = dialect.MaxStringSize; } ! break; case DbType.Decimal: pps = parameter as ParameterPrecisionScale; --- 120,132 ---- case DbType.StringFixedLength: pl = parameter as ParameterLength; ! if( parameter.SqlType is StringClobSqlType ) { dbParam.Size = dialect.MaxStringClobSize; } ! else { dbParam.Size = dialect.MaxStringSize; } ! break; case DbType.Decimal: pps = parameter as ParameterPrecisionScale; *************** *** 132,140 **** // if one of these is not null then override the default values // set in the earlier switch statement. ! if( pl!=null ) { ! dbParam.Size = pl.Length; } ! else if( pps!=null ) { dbParam.Precision = pps.Precision; --- 139,147 ---- // if one of these is not null then override the default values // set in the earlier switch statement. ! if( pl != null ) { ! dbParam.Size = pl.Length; } ! else if( pps != null ) { dbParam.Precision = pps.Precision; *************** *** 143,150 **** return dbParam; ! } ! } ! } --- 150,157 ---- return dbParam; ! } ! } ! } \ No newline at end of file Index: OleDbDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OleDbDriver.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OleDbDriver.cs 18 May 2004 05:02:27 -0000 1.4 --- OleDbDriver.cs 31 Dec 2004 17:26:01 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using System.Data.OleDb; namespace NHibernate.Driver *************** *** 12,54 **** public class OleDbDriver : DriverBase { public OleDbDriver() { } ! public override System.Type CommandType { ! get { return typeof(System.Data.OleDb.OleDbCommand); } } public override System.Type ConnectionType { ! get { return typeof(System.Data.OleDb.OleDbConnection); } } public override IDbConnection CreateConnection() { ! return new System.Data.OleDb.OleDbConnection(); } ! public override IDbCommand CreateCommand() { ! return new System.Data.OleDb.OleDbCommand(); } ! public override bool UseNamedPrefixInSql { ! get {return false;} } ! public override bool UseNamedPrefixInParameter { ! get {return false;} } ! public override string NamedPrefix { ! get {return String.Empty;} } } ! } --- 13,63 ---- public class OleDbDriver : DriverBase { + /// <summary></summary> public OleDbDriver() { } ! ! /// <summary></summary> public override System.Type CommandType { ! get { return typeof( OleDbCommand ); } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return typeof( OleDbConnection ); } } + /// <summary></summary> public override IDbConnection CreateConnection() { ! return new OleDbConnection(); } ! /// <summary></summary> ! public override IDbCommand CreateCommand() { ! return new OleDbCommand(); } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { ! get { return false; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return false; } } ! /// <summary></summary> ! public override string NamedPrefix { ! get { return String.Empty; } } } ! } \ No newline at end of file Index: NHybridDataReader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NHybridDataReader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHybridDataReader.cs 14 Sep 2004 17:49:54 -0000 1.1 --- NHybridDataReader.cs 31 Dec 2004 17:26:01 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using log4net; namespace NHibernate.Driver *************** *** 22,29 **** public class NHybridDataReader : IDataReader { ! log4net.ILog log = log4net.LogManager.GetLogger( typeof(NHybridDataReader) ); ! IDataReader _reader; ! bool _isMidstream = false; /// <summary> --- 23,30 ---- public class NHybridDataReader : IDataReader { ! private ILog log = LogManager.GetLogger( typeof( NHybridDataReader ) ); ! private IDataReader _reader; ! private bool _isMidstream = false; /// <summary> *************** *** 31,35 **** /// </summary> /// <param name="reader">The underlying IDataReader to use.</param> ! public NHybridDataReader(IDataReader reader) : this(reader, false) { } --- 32,36 ---- /// </summary> /// <param name="reader">The underlying IDataReader to use.</param> ! public NHybridDataReader( IDataReader reader ) : this( reader, false ) { } *************** *** 40,50 **** /// <param name="reader">The underlying IDataReader to use.</param> /// <param name="inMemory"><c>true</c> if the contents of the IDataReader should be read into memory right away.</param> ! public NHybridDataReader(IDataReader reader, bool inMemory) { ! if( inMemory ) { _reader = new NDataReader( reader, false ); } ! else { _reader = reader; --- 41,51 ---- /// <param name="reader">The underlying IDataReader to use.</param> /// <param name="inMemory"><c>true</c> if the contents of the IDataReader should be read into memory right away.</param> ! public NHybridDataReader( IDataReader reader, bool inMemory ) { ! if( inMemory ) { _reader = new NDataReader( reader, false ); } ! else { _reader = reader; *************** *** 59,69 **** /// This will result in a no op if the reader is closed or is already in memory. /// </remarks> ! public void ReadIntoMemory() { ! if( _reader.IsClosed==false && _reader.GetType()!=typeof(NDataReader) ) { ! if( log.IsDebugEnabled ) { ! log.Debug("Moving IDataReader into an NDataReader. It was converted in midstream " + _isMidstream.ToString() ); } _reader = new NDataReader( _reader, _isMidstream ); --- 60,70 ---- /// This will result in a no op if the reader is closed or is already in memory. /// </remarks> ! public void ReadIntoMemory() { ! if( _reader.IsClosed == false && _reader.GetType() != typeof( NDataReader ) ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "Moving IDataReader into an NDataReader. It was converted in midstream " + _isMidstream.ToString() ); } _reader = new NDataReader( _reader, _isMidstream ); *************** *** 75,79 **** /// </summary> /// <value><c>true</c> if NextResult and Read have been called on the <see cref="IDataReader"/>.</value> ! public bool IsMidstream { get { return _isMidstream; } --- 76,80 ---- /// </summary> /// <value><c>true</c> if NextResult and Read have been called on the <see cref="IDataReader"/>.</value> ! public bool IsMidstream { get { return _isMidstream; } *************** *** 82,85 **** --- 83,87 ---- #region IDataReader Members + /// <summary></summary> public int RecordsAffected { *************** *** 87,90 **** --- 89,93 ---- } + /// <summary></summary> public bool IsClosed { *************** *** 92,95 **** --- 95,99 ---- } + /// <summary></summary> public bool NextResult() { *************** *** 99,102 **** --- 103,107 ---- } + /// <summary></summary> public void Close() { *************** *** 104,107 **** --- 109,113 ---- } + /// <summary></summary> public bool Read() { *************** *** 110,113 **** --- 116,120 ---- } + /// <summary></summary> public int Depth { *************** *** 115,118 **** --- 122,126 ---- } + /// <summary></summary> public DataTable GetSchemaTable() { *************** *** 124,127 **** --- 132,136 ---- #region IDisposable Members + /// <summary></summary> public void Dispose() { *************** *** 133,191 **** #region IDataRecord Members ! public int GetInt32(int i) { ! return _reader.GetInt32(i); } ! public object this[string name] { ! get { return _reader[name]; } } ! object System.Data.IDataRecord.this[int i] { ! get { return _reader[i]; } } ! public object GetValue(int i) { ! return _reader.GetValue(i); } ! public bool IsDBNull(int i) { ! return _reader.IsDBNull(i); } ! public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { return _reader.GetBytes( i, fieldOffset, buffer, bufferoffset, length ); } ! public byte GetByte(int i) { ! return _reader.GetByte(i); } ! public System.Type GetFieldType(int i) { ! return _reader.GetFieldType(i); } ! public decimal GetDecimal(int i) { ! return _reader.GetDecimal(i); } ! public int GetValues(object[] values) { return _reader.GetValues( values ); } ! public string GetName(int i) { ! return _reader.GetName(i); } public int FieldCount { --- 142,252 ---- #region IDataRecord Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public int GetInt32( int i ) { ! return _reader.GetInt32( i ); } ! /// <summary></summary> ! public object this[ string name ] { ! get { return _reader[ name ]; } } ! /// <summary></summary> ! object IDataRecord.this[ int i ] { ! get { return _reader[ i ]; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public object GetValue( int i ) { ! return _reader.GetValue( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public bool IsDBNull( int i ) { ! return _reader.IsDBNull( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <param name="fieldOffset"></param> ! /// <param name="buffer"></param> ! /// <param name="bufferoffset"></param> ! /// <param name="length"></param> ! /// <returns></returns> ! public long GetBytes( int i, long fieldOffset, byte[ ] buffer, int bufferoffset, int length ) { return _reader.GetBytes( i, fieldOffset, buffer, bufferoffset, length ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public byte GetByte( int i ) { ! return _reader.GetByte( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public System.Type GetFieldType( int i ) { ! return _reader.GetFieldType( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public decimal GetDecimal( int i ) { ! return _reader.GetDecimal( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="values"></param> ! /// <returns></returns> ! public int GetValues( object[ ] values ) { return _reader.GetValues( values ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public string GetName( int i ) { ! return _reader.GetName( i ); } + /// <summary></summary> public int FieldCount { *************** *** 193,262 **** } ! public long GetInt64(int i) { ! return _reader.GetInt64(i); } ! public double GetDouble(int i) { ! return _reader.GetDouble(i); } ! public bool GetBoolean(int i) { ! return _reader.GetBoolean(i); } ! public Guid GetGuid(int i) { ! return _reader.GetGuid(i); } ! public DateTime GetDateTime(int i) { ! return _reader.GetDateTime(i); } ! public int GetOrdinal(string name) { ! return _reader.GetOrdinal(name); } ! public string GetDataTypeName(int i) { ! return _reader.GetDataTypeName(i); } ! public float GetFloat(int i) { ! return _reader.GetFloat(i); } ! public IDataReader GetData(int i) { ! return _reader.GetData(i); } ! public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) { return _reader.GetChars( i, fieldoffset, buffer, bufferoffset, length ); } ! public string GetString(int i) { ! return _reader.GetString(i); } ! public char GetChar(int i) { ! return _reader.GetChar(i); } ! public short GetInt16(int i) { ! return _reader.GetInt16(i); } #endregion } ! } --- 254,392 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public long GetInt64( int i ) { ! return _reader.GetInt64( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public double GetDouble( int i ) { ! return _reader.GetDouble( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public bool GetBoolean( int i ) { ! return _reader.GetBoolean( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public Guid GetGuid( int i ) { ! return _reader.GetGuid( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public DateTime GetDateTime( int i ) { ! return _reader.GetDateTime( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="name"></param> ! /// <returns></returns> ! public int GetOrdinal( string name ) { ! return _reader.GetOrdinal( name ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public string GetDataTypeName( int i ) { ! return _reader.GetDataTypeName( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public float GetFloat( int i ) { ! return _reader.GetFloat( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public IDataReader GetData( int i ) { ! return _reader.GetData( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <param name="fieldoffset"></param> ! /// <param name="buffer"></param> ! /// <param name="bufferoffset"></param> ! /// <param name="length"></param> ! /// <returns></returns> ! public long GetChars( int i, long fieldoffset, char[ ] buffer, int bufferoffset, int length ) { return _reader.GetChars( i, fieldoffset, buffer, bufferoffset, length ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public string GetString( int i ) { ! return _reader.GetString( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public char GetChar( int i ) { ! return _reader.GetChar( i ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public short GetInt16( int i ) { ! return _reader.GetInt16( i ); } #endregion } ! } \ No newline at end of file Index: NpgsqlDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NpgsqlDriver.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NpgsqlDriver.cs 27 Dec 2004 02:26:13 -0000 1.2 --- NpgsqlDriver.cs 31 Dec 2004 17:26:01 -0000 1.3 *************** *** 1,4 **** - using System; - namespace NHibernate.Driver { --- 1,2 ---- *************** *** 29,48 **** private System.Type commandType; public NpgsqlDriver() { ! connectionType = System.Type.GetType("Npgsql.NpgsqlConnection, Npgsql"); ! commandType = System.Type.GetType("Npgsql.NpgsqlCommand, Npgsql"); ! if( connectionType==null || commandType==null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. " + ! "Please ensure that the Assemblies needed to communicate with PostgreSQL " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } public override System.Type CommandType { --- 27,48 ---- private System.Type commandType; + /// <summary></summary> public NpgsqlDriver() { ! connectionType = System.Type.GetType( "Npgsql.NpgsqlConnection, Npgsql" ); ! commandType = System.Type.GetType( "Npgsql.NpgsqlCommand, Npgsql" ); ! if( connectionType == null || commandType == null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly Npgsql.dll could not be found. " + ! "Please ensure that the Assemblies needed to communicate with PostgreSQL " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } + /// <summary></summary> public override System.Type CommandType { *************** *** 50,53 **** --- 50,54 ---- } + /// <summary></summary> public override System.Type ConnectionType { *************** *** 55,78 **** } ! public override bool UseNamedPrefixInSql { get { return true; } } ! public override bool UseNamedPrefixInParameter { get { return true; } } ! public override string NamedPrefix { get { return ":"; } } public override bool SupportsMultipleOpenReaders { ! get { return true; } } public override bool SupportsPreparingCommands { --- 56,84 ---- } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { get { return true; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { get { return true; } } ! /// <summary></summary> ! public override string NamedPrefix { get { return ":"; } } + /// <summary></summary> public override bool SupportsMultipleOpenReaders { ! get { return true; } } + /// <summary></summary> public override bool SupportsPreparingCommands { *************** *** 84,87 **** } } ! } ! --- 90,92 ---- } } ! } \ No newline at end of file Index: OdbcDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OdbcDriver.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OdbcDriver.cs 18 May 2004 05:02:27 -0000 1.4 --- OdbcDriver.cs 31 Dec 2004 17:26:01 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Data; + using System.Data.Odbc; namespace NHibernate.Driver *************** *** 12,53 **** public class OdbcDriver : DriverBase { public OdbcDriver() { } ! public override System.Type CommandType { ! get { return typeof(System.Data.Odbc.OdbcCommand); } } public override System.Type ConnectionType { ! get { return typeof(System.Data.Odbc.OdbcConnection); } } public override IDbConnection CreateConnection() { ! return new System.Data.Odbc.OdbcConnection(); } ! public override IDbCommand CreateCommand() { ! return new System.Data.Odbc.OdbcCommand(); } ! public override bool UseNamedPrefixInSql { ! get {return false;} } ! public override bool UseNamedPrefixInParameter { ! get {return false;} } ! public override string NamedPrefix { ! get {return String.Empty;} } } ! } --- 13,62 ---- public class OdbcDriver : DriverBase { + /// <summary></summary> public OdbcDriver() { } ! ! /// <summary></summary> public override System.Type CommandType { ! get { return typeof( OdbcCommand ); } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return typeof( OdbcConnection ); } } + /// <summary></summary> public override IDbConnection CreateConnection() { ! return new OdbcConnection(); } ! /// <summary></summary> ! public override IDbCommand CreateCommand() { ! return new OdbcCommand(); } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { ! get { return false; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return false; } } ! /// <summary></summary> ! public override string NamedPrefix { ! get { return String.Empty; } } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:25:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16811 Modified Files: DB2Driver.cs DriverBase.cs FirebirdDriver.cs IDriver.cs MySqlDataDriver.cs NDataReader.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: DriverBase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/DriverBase.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DriverBase.cs 22 Nov 2004 03:55:58 -0000 1.9 --- DriverBase.cs 31 Dec 2004 17:25:35 -0000 1.10 *************** *** 2,6 **** using System.Data; using System.Text; - using NHibernate.SqlCommand; using NHibernate.Util; --- 2,5 ---- *************** *** 13,53 **** public abstract class DriverBase : IDriver { - #region IDriver Members ! public abstract System.Type CommandType {get; } ! public abstract System.Type ConnectionType {get; } ! public virtual IDbConnection CreateConnection() { ! return (IDbConnection) Activator.CreateInstance(ConnectionType); } public virtual IDbCommand CreateCommand() { ! return (IDbCommand) Activator.CreateInstance(CommandType); } ! public abstract bool UseNamedPrefixInSql {get;} ! public abstract bool UseNamedPrefixInParameter {get;} ! public abstract string NamedPrefix {get;} ! public string FormatNameForSql(string parameterName) { ! return UseNamedPrefixInSql ? (NamedPrefix + parameterName): StringHelper.SqlParameter; } ! public string FormatNameForSql(string tableAlias, string parameterName) { ! if(!UseNamedPrefixInSql) return StringHelper.SqlParameter; ! ! if(tableAlias!=null && tableAlias.Length > 0) { return NamedPrefix + tableAlias + parameterName; } ! else { return NamedPrefix + parameterName; --- 12,72 ---- public abstract class DriverBase : IDriver { #region IDriver Members ! /// <summary></summary> ! public abstract System.Type CommandType { get; } ! /// <summary></summary> ! public abstract System.Type ConnectionType { get; } ! /// <summary></summary> ! public virtual IDbConnection CreateConnection() { ! return ( IDbConnection ) Activator.CreateInstance( ConnectionType ); } + /// <summary></summary> public virtual IDbCommand CreateCommand() { ! return ( IDbCommand ) Activator.CreateInstance( CommandType ); } ! /// <summary></summary> ! public abstract bool UseNamedPrefixInSql { get; } ! /// <summary></summary> ! public abstract bool UseNamedPrefixInParameter { get; } ! /// <summary></summary> ! public abstract string NamedPrefix { get; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="parameterName"></param> ! /// <returns></returns> ! public string FormatNameForSql( string parameterName ) { ! return UseNamedPrefixInSql ? ( NamedPrefix + parameterName ) : StringHelper.SqlParameter; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="tableAlias"></param> ! /// <param name="parameterName"></param> ! /// <returns></returns> ! public string FormatNameForSql( string tableAlias, string parameterName ) { ! if( !UseNamedPrefixInSql ) ! { ! return StringHelper.SqlParameter; ! } ! ! if( tableAlias != null && tableAlias.Length > 0 ) { return NamedPrefix + tableAlias + parameterName; } ! else { return NamedPrefix + parameterName; *************** *** 55,73 **** } ! public string FormatNameForParameter(string parameterName) { ! return UseNamedPrefixInParameter ? (NamedPrefix + parameterName) : parameterName; } ! public string FormatNameForParameter(string tableAlias, string parameterName) { ! if(!UseNamedPrefixInParameter) return parameterName; ! ! if(tableAlias!=null && tableAlias.Length > 0) { return NamedPrefix + tableAlias + parameterName; } ! else { return NamedPrefix + parameterName; --- 74,106 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="parameterName"></param> ! /// <returns></returns> ! public string FormatNameForParameter( string parameterName ) { ! return UseNamedPrefixInParameter ? ( NamedPrefix + parameterName ) : parameterName; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="tableAlias"></param> ! /// <param name="parameterName"></param> ! /// <returns></returns> ! public string FormatNameForParameter( string tableAlias, string parameterName ) { ! if( !UseNamedPrefixInParameter ) ! { ! return parameterName; ! } ! ! if( tableAlias != null && tableAlias.Length > 0 ) { return NamedPrefix + tableAlias + parameterName; } ! else { return NamedPrefix + parameterName; *************** *** 75,113 **** } ! public virtual bool SupportsMultipleOpenReaders { ! get { return true;} } ! public virtual bool SupportsPreparingCommands ! { get { return true; } } ! public virtual IDbCommand GenerateCommand(Dialect.Dialect dialect, SqlString sqlString) { int paramIndex = 0; IDbCommand cmd = this.CreateCommand(); ! StringBuilder builder = new StringBuilder(sqlString.SqlParts.Length * 15); ! for(int i = 0; i < sqlString.SqlParts.Length; i++) { ! object part = sqlString.SqlParts[i]; Parameter parameter = part as Parameter; ! ! if(parameter!=null) { string paramName = "p" + paramIndex; ! builder.Append ( this.FormatNameForSql(paramName) ); ! ! IDbDataParameter dbParam = GenerateParameter(cmd, paramName, parameter, dialect); - cmd.Parameters.Add(dbParam); - paramIndex++; } ! else { ! builder.Append((string)part); } } --- 108,154 ---- } ! /// <summary></summary> ! public virtual bool SupportsMultipleOpenReaders { ! get { return true; } } ! /// <summary></summary> ! public virtual bool SupportsPreparingCommands ! { get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="dialect"></param> ! /// <param name="sqlString"></param> ! /// <returns></returns> ! public virtual IDbCommand GenerateCommand( Dialect.Dialect dialect, SqlString sqlString ) { int paramIndex = 0; IDbCommand cmd = this.CreateCommand(); ! StringBuilder builder = new StringBuilder( sqlString.SqlParts.Length*15 ); ! for( int i = 0; i < sqlString.SqlParts.Length; i++ ) { ! object part = sqlString.SqlParts[ i ]; Parameter parameter = part as Parameter; ! ! if( parameter != null ) { string paramName = "p" + paramIndex; ! builder.Append( this.FormatNameForSql( paramName ) ); ! ! IDbDataParameter dbParam = GenerateParameter( cmd, paramName, parameter, dialect ); ! ! cmd.Parameters.Add( dbParam ); paramIndex++; } ! else { ! builder.Append( ( string ) part ); } } *************** *** 118,122 **** } ! public virtual IDbCommand GenerateCommand(Dialect.Dialect dialect, string sqlString) { IDbCommand cmd = this.CreateCommand(); --- 159,169 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="dialect"></param> ! /// <param name="sqlString"></param> ! /// <returns></returns> ! public virtual IDbCommand GenerateCommand( Dialect.Dialect dialect, string sqlString ) { IDbCommand cmd = this.CreateCommand(); *************** *** 140,149 **** /// those values are not set, only the DbType and ParameterName are set. /// </remarks> ! protected virtual IDbDataParameter GenerateParameter(IDbCommand command, string name, Parameter parameter, Dialect.Dialect dialect) { IDbDataParameter dbParam = command.CreateParameter(); dbParam.DbType = parameter.SqlType.DbType; ! ! dbParam.ParameterName = this.FormatNameForParameter(name); return dbParam; --- 187,196 ---- /// those values are not set, only the DbType and ParameterName are set. /// </remarks> ! protected virtual IDbDataParameter GenerateParameter( IDbCommand command, string name, Parameter parameter, Dialect.Dialect dialect ) { IDbDataParameter dbParam = command.CreateParameter(); dbParam.DbType = parameter.SqlType.DbType; ! ! dbParam.ParameterName = this.FormatNameForParameter( name ); return dbParam; *************** *** 152,154 **** #endregion } ! } --- 199,201 ---- #endregion } ! } \ No newline at end of file Index: IDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/IDriver.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IDriver.cs 16 Aug 2004 05:21:12 -0000 1.6 --- IDriver.cs 31 Dec 2004 17:25:35 -0000 1.7 *************** *** 1,5 **** - using System; using System.Data; - using NHibernate.SqlCommand; --- 1,3 ---- *************** *** 38,42 **** public interface IDriver { - /// <summary> /// The Type used to create an IDbConnection --- 36,39 ---- *************** *** 73,77 **** /// the <c>?</c> can be a placeholder for the parameter in the SQL statement. /// </remarks> ! bool UseNamedPrefixInSql {get;} /// <summary> --- 70,74 ---- /// the <c>?</c> can be a placeholder for the parameter in the SQL statement. /// </remarks> ! bool UseNamedPrefixInSql { get; } /// <summary> *************** *** 86,90 **** /// <code>IDbParameter param = cmd.Parameters["paramName"]</code>. /// </remarks> ! bool UseNamedPrefixInParameter {get;} /// <summary> --- 83,87 ---- /// <code>IDbParameter param = cmd.Parameters["paramName"]</code>. /// </remarks> ! bool UseNamedPrefixInParameter { get; } /// <summary> *************** *** 94,98 **** /// Sql Server uses <c>"@"</c> and Oracle uses <c>":"</c>. /// </remarks> ! string NamedPrefix {get;} /// <summary> --- 91,95 ---- /// Sql Server uses <c>"@"</c> and Oracle uses <c>":"</c>. /// </remarks> ! string NamedPrefix { get; } /// <summary> *************** *** 102,106 **** /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbCommand.CommandText</returns> ! string FormatNameForSql(string parameterName); /// <summary> --- 99,103 ---- /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbCommand.CommandText</returns> ! string FormatNameForSql( string parameterName ); /// <summary> *************** *** 111,115 **** /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbCommand.CommandText</returns> ! string FormatNameForSql(string tableAlias, string parameterName); --- 108,112 ---- /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbCommand.CommandText</returns> ! string FormatNameForSql( string tableAlias, string parameterName ); *************** *** 123,127 **** /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbParameter.</returns> ! string FormatNameForParameter(string parameterName); /// <summary> --- 120,124 ---- /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbParameter.</returns> ! string FormatNameForParameter( string parameterName ); /// <summary> *************** *** 135,140 **** /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbParameter.</returns> ! string FormatNameForParameter(string tableAlias, string parameterName); ! /// <summary> /// Does this Driver support having more than 1 open IDataReader with --- 132,137 ---- /// <param name="parameterName">The unformatted name of the parameter</param> /// <returns>A parameter formatted for an IDbParameter.</returns> ! string FormatNameForParameter( string tableAlias, string parameterName ); ! /// <summary> /// Does this Driver support having more than 1 open IDataReader with *************** *** 180,184 **** /// <param name="sqlString">The SqlString that contains the sql and parameters.</param> /// <returns>An IDbCommand with the CommandText and Parameters fully set.</returns> ! IDbCommand GenerateCommand(Dialect.Dialect dialect, SqlString sqlString); /// <summary> --- 177,181 ---- /// <param name="sqlString">The SqlString that contains the sql and parameters.</param> /// <returns>An IDbCommand with the CommandText and Parameters fully set.</returns> ! IDbCommand GenerateCommand( Dialect.Dialect dialect, SqlString sqlString ); /// <summary> *************** *** 190,198 **** /// <returns>An IDbCommand with the CommandText fully set.</returns> /// <remarks>This can not be used to build an IDbCommand that needs to contain Parameters.</remarks> ! IDbCommand GenerateCommand(Dialect.Dialect dialect, string sqlString); ! ! } ! } --- 187,193 ---- /// <returns>An IDbCommand with the CommandText fully set.</returns> /// <remarks>This can not be used to build an IDbCommand that needs to contain Parameters.</remarks> ! IDbCommand GenerateCommand( Dialect.Dialect dialect, string sqlString ); } ! } \ No newline at end of file Index: NDataReader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/NDataReader.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NDataReader.cs 8 Nov 2004 00:18:06 -0000 1.4 --- NDataReader.cs 31 Dec 2004 17:25:35 -0000 1.5 *************** *** 3,9 **** using System.Data; ! namespace NHibernate.Driver { - /// <summary> /// Some Data Providers (ie - SqlClient) do not support Multiple Active Result Sets (MARS). --- 3,8 ---- using System.Data; [...1000 lines suppressed...] ! /// ! /// </summary> ! /// <param name="rowIndex"></param> ! /// <param name="values"></param> ! /// <returns></returns> ! public int GetValues( int rowIndex, object[ ] values ) { ! Array.Copy( records[ rowIndex ], 0, values, 0, colCount ); return colCount; } ! /// <summary></summary> ! public int RowCount { ! get { return records.Length; } } ! } } ! } \ No newline at end of file Index: FirebirdDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/FirebirdDriver.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FirebirdDriver.cs 27 Dec 2004 02:26:13 -0000 1.4 --- FirebirdDriver.cs 31 Dec 2004 17:25:35 -0000 1.5 *************** *** 1,4 **** - using System; - namespace NHibernate.Driver { --- 1,2 ---- *************** *** 11,54 **** private System.Type commandType; public FirebirdDriver() { ! connectionType = System.Type.GetType("FirebirdSql.Data.Firebird.FbConnection, FirebirdSql.Data.Firebird"); ! commandType = System.Type.GetType("FirebirdSql.Data.Firebird.FbCommand, FirebirdSql.Data.Firebird"); ! ! if( connectionType==null || commandType==null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly FirebirdSql.Data could not be found. " + ! "Please ensure that the Assemblies needed to communicate with Firebird " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } public override System.Type CommandType { ! get { return commandType; } } public override System.Type ConnectionType { ! get { return connectionType; } } ! public override bool UseNamedPrefixInSql { ! get {return true;} } ! public override bool UseNamedPrefixInParameter { ! get {return true;} } ! public override string NamedPrefix { ! get {return "@";} } } ! } --- 9,58 ---- private System.Type commandType; + /// <summary></summary> public FirebirdDriver() { ! connectionType = System.Type.GetType( "FirebirdSql.Data.Firebird.FbConnection, FirebirdSql.Data.Firebird" ); ! commandType = System.Type.GetType( "FirebirdSql.Data.Firebird.FbCommand, FirebirdSql.Data.Firebird" ); ! ! if( connectionType == null || commandType == null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly FirebirdSql.Data could not be found. " + ! "Please ensure that the Assemblies needed to communicate with Firebird " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } + /// <summary></summary> public override System.Type CommandType { ! get { return commandType; } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return connectionType; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { ! get { return true; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return true; } } ! /// <summary></summary> ! public override string NamedPrefix { ! get { return "@"; } } } ! } \ No newline at end of file Index: MySqlDataDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/MySqlDataDriver.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MySqlDataDriver.cs 27 Dec 2004 02:26:13 -0000 1.3 --- MySqlDataDriver.cs 31 Dec 2004 17:25:35 -0000 1.4 *************** *** 1,7 **** ! using System; ! ! namespace NHibernate.Driver { - /// <summary> /// The MySqlDataDriver Driver provides a database driver for MySql. --- 1,4 ---- ! namespace NHibernate.Driver { /// <summary> /// The MySqlDataDriver Driver provides a database driver for MySql. *************** *** 24,51 **** private System.Type commandType; public MySqlDataDriver() { ! connectionType = System.Type.GetType("MySql.Data.MySqlClient.MySqlConnection, MySql.Data"); ! commandType = System.Type.GetType("MySql.Data.MySqlClient.MySqlCommand, MySql.Data"); ! if( connectionType==null || commandType==null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. " + ! "Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } public override System.Type CommandType { ! get { return commandType; } } public override System.Type ConnectionType { ! get { return connectionType; } } --- 21,51 ---- private System.Type commandType; + /// <summary></summary> public MySqlDataDriver() { ! connectionType = System.Type.GetType( "MySql.Data.MySqlClient.MySqlConnection, MySql.Data" ); ! commandType = System.Type.GetType( "MySql.Data.MySqlClient.MySqlCommand, MySql.Data" ); ! if( connectionType == null || commandType == null ) { ! throw new HibernateException( ! "The IDbCommand and IDbConnection implementation in the Assembly MySql.Data could not be found. " + ! "Please ensure that the Assemblies MySql.Data.dll and ICSharpCode.SharpZipLib.dll " + ! "are in the Global Assembly Cache or in a location that NHibernate " + ! "can use System.Type.GetType(string) to load the types from." ); } } + /// <summary></summary> public override System.Type CommandType { ! get { return commandType; } } + /// <summary></summary> public override System.Type ConnectionType { ! get { return connectionType; } } *************** *** 54,68 **** /// </summary> /// <value><c>true</c> - MySql uses <c>?</c> in the sql.</value> ! public override bool UseNamedPrefixInSql { ! get {return true;} } ! /// <summary> ! /// ! /// </summary> ! public override bool UseNamedPrefixInParameter { ! get {return true;} } --- 54,66 ---- /// </summary> /// <value><c>true</c> - MySql uses <c>?</c> in the sql.</value> ! public override bool UseNamedPrefixInSql { ! get { return true; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { ! get { return true; } } *************** *** 71,77 **** /// </summary> /// <value><c>?</c> is used to locate parameters in sql.</value> ! public override string NamedPrefix { ! get {return "?";} } --- 69,75 ---- /// </summary> /// <value><c>?</c> is used to locate parameters in sql.</value> ! public override string NamedPrefix { ! get { return "?"; } } *************** *** 83,87 **** public override bool SupportsMultipleOpenReaders { ! get { return false; } } --- 81,85 ---- public override bool SupportsMultipleOpenReaders { ! get { return false; } } *************** *** 96,98 **** } } ! } --- 94,96 ---- } } ! } \ No newline at end of file Index: DB2Driver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/DB2Driver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DB2Driver.cs 8 Nov 2004 00:18:06 -0000 1.1 --- DB2Driver.cs 31 Dec 2004 17:25:35 -0000 1.2 *************** *** 11,20 **** private System.Type commandType; public DB2Driver() { ! connectionType = System.Type.GetType("IBM.Data.DB2.DB2Connection, IBM.Data.DB2"); ! commandType = System.Type.GetType("IBM.Data.DB2.DB2Command, IBM.Data.DB2"); } public override System.Type CommandType { --- 11,24 ---- private System.Type commandType; + /// <summary> + /// + /// </summary> public DB2Driver() { ! connectionType = System.Type.GetType( "IBM.Data.DB2.DB2Connection, IBM.Data.DB2" ); ! commandType = System.Type.GetType( "IBM.Data.DB2.DB2Command, IBM.Data.DB2" ); } + /// <summary></summary> public override System.Type CommandType { *************** *** 22,25 **** --- 26,30 ---- } + /// <summary></summary> public override System.Type ConnectionType { *************** *** 27,49 **** } ! public override bool UseNamedPrefixInSql { get { return false; } } ! public override bool UseNamedPrefixInParameter { get { return false; } } ! public override string NamedPrefix { get { return String.Empty; } } public override bool SupportsMultipleOpenReaders { ! get { return false; } } } ! } --- 32,58 ---- } ! /// <summary></summary> ! public override bool UseNamedPrefixInSql { get { return false; } } ! /// <summary></summary> ! public override bool UseNamedPrefixInParameter { get { return false; } } ! /// <summary></summary> ! public override string NamedPrefix { get { return String.Empty; } } + /// <summary></summary> public override bool SupportsMultipleOpenReaders { ! get { return false; } } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 17:07:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13407 Modified Files: DB2Dialect.cs Dialect.cs FirebirdDialect.cs GenericDialect.cs MsSql2000Dialect.cs MsSql7Dialect.cs MySQLDialect.cs Oracle9Dialect.cs OracleDialect.cs PostgreSQLDialect.cs QueryFunctionStandard.cs SybaseDialect.cs TypeNames.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: FirebirdDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/FirebirdDialect.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FirebirdDialect.cs 29 Jul 2004 16:45:05 -0000 1.7 --- FirebirdDialect.cs 31 Dec 2004 17:07:24 -0000 1.8 *************** *** 1,5 **** - using System; using System.Data; - using NHibernate.SqlTypes; namespace NHibernate.Dialect --- 1,3 ---- *************** *** 10,68 **** public class FirebirdDialect : Dialect { public FirebirdDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)"); Register( DbType.AnsiStringFixedLength, 8000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(255)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "BLOB"); // should use the IType.ClobType ! Register( DbType.Binary, 2147483647, "BLOB SUB_TYPE 0" );// should use the IType.BlobType ! Register( DbType.Boolean, "SMALLINT" ); Register( DbType.Byte, "SMALLINT" ); ! Register( DbType.Currency, "DECIMAL(16,4)"); ! Register( DbType.Date, "DATE"); Register( DbType.DateTime, "TIMESTAMP" ); Register( DbType.Decimal, "DECIMAL(18,0)" ); // NUMERIC(18,0) is equivalent to DECIMAL(18,0) ! Register( DbType.Decimal, 18, "DECIMAL(18, $1)"); ! Register( DbType.Double, "DOUBLE PRECISION" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "FLOAT" ); ! Register( DbType.StringFixedLength, "CHAR(255)"); ! Register( DbType.StringFixedLength, 4000, "CHAR($1)"); Register( DbType.String, "VARCHAR(255)" ); Register( DbType.String, 4000, "VARCHAR($1)" ); ! Register( DbType.String, 1073741823, "BLOB SUB_TYPE 1" );// should use the IType.ClobType Register( DbType.Time, "TIME" ); } public override string AddColumnString { ! get ! { ! return "add"; ! } } ! public override string GetSequenceNextValString(string sequenceName) { ! return string.Format("select gen_id({0}, 1 ) from RDB$DATABASE", sequenceName); } ! public override string GetCreateSequenceString(string sequenceName) { ! return string.Format("create generator {0}", sequenceName); } ! public override string GetDropSequenceString(string sequenceName) { ! return string.Format("drop generator {0}", sequenceName); } public override bool SupportsSequences { ! get { return true; } } } ! } --- 8,81 ---- public class FirebirdDialect : Dialect { + /// <summary></summary> public FirebirdDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)" ); Register( DbType.AnsiStringFixedLength, 8000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(255)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "BLOB" ); // should use the IType.ClobType ! Register( DbType.Binary, 2147483647, "BLOB SUB_TYPE 0" ); // should use the IType.BlobType ! Register( DbType.Boolean, "SMALLINT" ); Register( DbType.Byte, "SMALLINT" ); ! Register( DbType.Currency, "DECIMAL(16,4)" ); ! Register( DbType.Date, "DATE" ); Register( DbType.DateTime, "TIMESTAMP" ); Register( DbType.Decimal, "DECIMAL(18,0)" ); // NUMERIC(18,0) is equivalent to DECIMAL(18,0) ! Register( DbType.Decimal, 18, "DECIMAL(18, $1)" ); ! Register( DbType.Double, "DOUBLE PRECISION" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "FLOAT" ); ! Register( DbType.StringFixedLength, "CHAR(255)" ); ! Register( DbType.StringFixedLength, 4000, "CHAR($1)" ); Register( DbType.String, "VARCHAR(255)" ); Register( DbType.String, 4000, "VARCHAR($1)" ); ! Register( DbType.String, 1073741823, "BLOB SUB_TYPE 1" ); // should use the IType.ClobType Register( DbType.Time, "TIME" ); } + /// <summary></summary> public override string AddColumnString { ! get { return "add"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetSequenceNextValString( string sequenceName ) { ! return string.Format( "select gen_id({0}, 1 ) from RDB$DATABASE", sequenceName ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetCreateSequenceString( string sequenceName ) { ! return string.Format( "create generator {0}", sequenceName ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetDropSequenceString( string sequenceName ) { ! return string.Format( "drop generator {0}", sequenceName ); } + /// <summary></summary> public override bool SupportsSequences { ! get { return true; } } } ! } \ No newline at end of file Index: OracleDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/OracleDialect.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OracleDialect.cs 16 Aug 2004 05:30:58 -0000 1.5 --- OracleDialect.cs 31 Dec 2004 17:07:24 -0000 1.6 *************** *** 1,26 **** - using System; - using NHibernate.SqlCommand; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect for Oracle, compatible with Oracle 8. /// </summary> ! public class OracleDialect : Oracle9Dialect { ! public OracleDialect() : base() { } ! ! public override JoinFragment CreateOuterJoinFragment() { return new OracleJoinFragment(); } ! public override CaseFragment CreateCaseFragment() { ! return new DecodeCaseFragment(this); } } ! } --- 1,27 ---- using NHibernate.SqlCommand; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect for Oracle, compatible with Oracle 8. /// </summary> ! public class OracleDialect : Oracle9Dialect { ! /// <summary></summary> ! public OracleDialect() : base() { } ! ! /// <summary></summary> ! public override JoinFragment CreateOuterJoinFragment() { return new OracleJoinFragment(); } ! /// <summary></summary> ! public override CaseFragment CreateCaseFragment() { ! return new DecodeCaseFragment( this ); } } ! } \ No newline at end of file Index: SybaseDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/SybaseDialect.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SybaseDialect.cs 29 Oct 2004 05:52:44 -0000 1.11 --- SybaseDialect.cs 31 Dec 2004 17:07:24 -0000 1.12 *************** *** 1,14 **** ! using System; ! using System.Data; ! ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect compatible with Sybase. /// </summary> ! public class SybaseDialect : Dialect { ! ! public SybaseDialect() : base() { ! /* Java mapping was: --- 1,14 ---- ! using NHibernate.Cfg; + namespace NHibernate.Dialect + { /// <summary> /// An SQL dialect compatible with Sybase. /// </summary> ! public class SybaseDialect : Dialect ! { ! /// <summary></summary> ! public SybaseDialect() : base() ! { /* Java mapping was: *************** *** 29,62 **** Types.BLOB, "IMAGE" ); Types.CLOB, "TEXT" ); ! */ ! ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; } ! public override string AddColumnString { get { return "add"; } } ! public override string NullColumnString { get { return " null"; } } ! public override bool QualifyIndexName { get { return false; } } ! ! public override bool SupportsForUpdate { get { return false; } } ! ! public override bool SupportsIdentityColumns { get { return true; } } ! public override string IdentitySelectString { get { return "select @@identity"; } } ! public override string IdentityColumnString { ! get { return "IDENTITY NOT NULL"; } } ! public override string NoColumnsInsertString { get { return "DEFAULT VALUES"; } } --- 29,82 ---- Types.BLOB, "IMAGE" ); Types.CLOB, "TEXT" ); ! */ ! ! DefaultProperties[ Environment.OuterJoin ] = "true"; } ! /// <summary></summary> ! public override string AddColumnString ! { get { return "add"; } } ! ! /// <summary></summary> ! public override string NullColumnString ! { get { return " null"; } } ! ! /// <summary></summary> ! public override bool QualifyIndexName ! { get { return false; } } ! ! /// <summary></summary> ! public override bool SupportsForUpdate ! { get { return false; } } ! ! /// <summary></summary> ! public override bool SupportsIdentityColumns ! { get { return true; } } ! ! /// <summary></summary> ! public override string IdentitySelectString ! { get { return "select @@identity"; } } ! ! /// <summary></summary> ! public override string IdentityColumnString ! { ! get { return "IDENTITY NOT NULL"; } } ! /// <summary></summary> ! public override string NoColumnsInsertString ! { get { return "DEFAULT VALUES"; } } Index: TypeNames.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/TypeNames.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TypeNames.cs 19 Jul 2004 03:24:02 -0000 1.4 --- TypeNames.cs 31 Dec 2004 17:07:24 -0000 1.5 *************** *** 1,9 **** - using System; using System.Collections; using System.Data; - using NHibernate.Util; ! namespace NHibernate.Dialect { /// <summary> --- 1,7 ---- using System.Collections; using System.Data; using NHibernate.Util; ! namespace NHibernate.Dialect { /// <summary> *************** *** 40,44 **** /// </code> /// </remarks> ! public class TypeNames { private string placeholder; --- 38,42 ---- /// </code> /// </remarks> ! public class TypeNames { private string placeholder; *************** *** 50,54 **** /// </summary> /// <param name="placeholder">String to be replaced by actual size/length in type names</param> ! public TypeNames(string placeholder) { this.placeholder = placeholder; --- 48,52 ---- /// </summary> /// <param name="placeholder">String to be replaced by actual size/length in type names</param> ! public TypeNames( string placeholder ) { this.placeholder = placeholder; *************** *** 60,66 **** /// <param name="typecode">the type key</param> /// <returns>the default type name associated with the specified key</returns> ! public string Get(DbType typecode) { ! return (string) defaults[typecode]; } --- 58,64 ---- /// <param name="typecode">the type key</param> /// <returns>the default type name associated with the specified key</returns> ! public string Get( DbType typecode ) { ! return ( string ) defaults[ typecode ]; } *************** *** 74,88 **** /// default type name otherwise /// </returns> ! public string Get(DbType typecode, int size) { ! IDictionary map = weighted[typecode] as IDictionary; ! if (map != null && map.Count > 0) { ! foreach(int entrySize in map.Keys) { ! if (size <= entrySize) { return StringHelper.ReplaceOnce( ! (string) map[entrySize], placeholder, size.ToString() --- 72,86 ---- /// default type name otherwise /// </returns> ! public string Get( DbType typecode, int size ) { ! IDictionary map = weighted[ typecode ] as IDictionary; ! if( map != null && map.Count > 0 ) { ! foreach( int entrySize in map.Keys ) { ! if( size <= entrySize ) { return StringHelper.ReplaceOnce( ! ( string ) map[ entrySize ], placeholder, size.ToString() *************** *** 91,95 **** } } ! return StringHelper.ReplaceOnce(Get(typecode), placeholder, size.ToString()); } --- 89,93 ---- } } ! return StringHelper.ReplaceOnce( Get( typecode ), placeholder, size.ToString() ); } *************** *** 98,118 **** /// </summary> /// <param name="typecode">the type key</param> ! /// <param name="size">the (maximum) type size/length</param> /// <param name="value">The associated name</param> ! public void Put(DbType typecode, int capacity, string value) { SequencedHashMap map = weighted[ typecode ] as SequencedHashMap; ! if (map==null) { ! weighted[typecode] = map = new SequencedHashMap(); } ! map[capacity] = value; } ! public void Put(DbType typecode, string value) { ! defaults[typecode] = value; } } ! } --- 96,121 ---- /// </summary> /// <param name="typecode">the type key</param> ! /// <param name="capacity">the (maximum) type size/length</param> /// <param name="value">The associated name</param> ! public void Put( DbType typecode, int capacity, string value ) { SequencedHashMap map = weighted[ typecode ] as SequencedHashMap; ! if( map == null ) { ! weighted[ typecode ] = map = new SequencedHashMap(); } ! map[ capacity ] = value; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="typecode"></param> ! /// <param name="value"></param> ! public void Put( DbType typecode, string value ) { ! defaults[ typecode ] = value; } } ! } \ No newline at end of file Index: GenericDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/GenericDialect.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GenericDialect.cs 19 Jul 2004 03:24:02 -0000 1.9 --- GenericDialect.cs 31 Dec 2004 17:07:24 -0000 1.10 *************** *** 1,38 **** - using System; using System.Data; ! using NHibernate.SqlTypes; ! ! namespace NHibernate.Dialect { /// <summary> /// A generic SQL dialect which may or may not work on any actual databases /// </summary> ! public class GenericDialect : Dialect { ! public GenericDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR($1)"); Register( DbType.AnsiString, "VARCHAR($1)" ); ! Register( DbType.Binary, "VARBINARY($1)"); ! Register( DbType.Boolean, "BIT" ); Register( DbType.Byte, "TINYINT" ); ! Register( DbType.Currency, "MONEY"); ! Register( DbType.Date, "DATE"); Register( DbType.DateTime, "DATETIME" ); ! Register( DbType.Decimal, "DECIMAL(19, $1)"); ! Register( DbType.Double, "DOUBLE PRECISION" ); Register( DbType.Guid, "UNIQUEIDENTIFIER" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INT" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "REAL" ); ! Register( DbType.StringFixedLength, "NCHAR($1)"); Register( DbType.String, "NVARCHAR($1)" ); Register( DbType.Time, "TIME" ); ! } ! public override string AddColumnString { get { return "add column"; } --- 1,37 ---- using System.Data; ! namespace NHibernate.Dialect { /// <summary> /// A generic SQL dialect which may or may not work on any actual databases /// </summary> ! public class GenericDialect : Dialect { ! /// <summary></summary> ! public GenericDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR($1)" ); ! Register( DbType.Binary, "VARBINARY($1)" ); ! Register( DbType.Boolean, "BIT" ); Register( DbType.Byte, "TINYINT" ); ! Register( DbType.Currency, "MONEY" ); ! Register( DbType.Date, "DATE" ); Register( DbType.DateTime, "DATETIME" ); ! Register( DbType.Decimal, "DECIMAL(19, $1)" ); ! Register( DbType.Double, "DOUBLE PRECISION" ); Register( DbType.Guid, "UNIQUEIDENTIFIER" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INT" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "REAL" ); ! Register( DbType.StringFixedLength, "NCHAR($1)" ); Register( DbType.String, "NVARCHAR($1)" ); Register( DbType.Time, "TIME" ); ! } ! /// <summary></summary> ! public override string AddColumnString { get { return "add column"; } *************** *** 40,42 **** } ! } --- 39,41 ---- } ! } \ No newline at end of file Index: MySQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MySQLDialect.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MySQLDialect.cs 6 Dec 2004 03:39:23 -0000 1.21 --- MySQLDialect.cs 31 Dec 2004 17:07:24 -0000 1.22 *************** *** 2,20 **** using System.Data; using System.Text; - using NHibernate.SqlCommand; using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Dialect { /// <summary> /// A SQL dialect for MySQL /// </summary> ! public class MySQLDialect : Dialect { ! public MySQLDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)"); Register( DbType.AnsiStringFixedLength, 255, "CHAR($1)" ); Register( DbType.AnsiStringFixedLength, 65535, "TEXT" ); --- 2,21 ---- using System.Data; using System.Text; using NHibernate.SqlCommand; using NHibernate.SqlTypes; using NHibernate.Util; + using Environment = NHibernate.Cfg.Environment; ! namespace NHibernate.Dialect { /// <summary> /// A SQL dialect for MySQL /// </summary> ! public class MySQLDialect : Dialect { ! /// <summary></summary> ! public MySQLDialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)" ); Register( DbType.AnsiStringFixedLength, 255, "CHAR($1)" ); Register( DbType.AnsiStringFixedLength, 65535, "TEXT" ); *************** *** 24,38 **** Register( DbType.AnsiString, 65535, "TEXT" ); Register( DbType.AnsiString, 16777215, "MEDIUMTEXT" ); ! Register( DbType.Binary, "LONGBLOB"); ! Register( DbType.Binary, 127, "TINYBLOB"); ! Register( DbType.Binary, 65535, "BLOB"); ! Register( DbType.Binary, 16777215, "MEDIUMBLOB"); ! Register( DbType.Boolean, "TINYINT(1)" ); Register( DbType.Byte, "TINYINT UNSIGNED" ); ! Register( DbType.Currency, "MONEY"); ! Register( DbType.Date, "DATE"); Register( DbType.DateTime, "DATETIME" ); Register( DbType.Decimal, "NUMERIC(19,5)" ); ! Register( DbType.Decimal, 19, "NUMERIC(19, $1)"); Register( DbType.Double, "DOUBLE" ); Register( DbType.Guid, "VARCHAR(40)" ); --- 25,39 ---- Register( DbType.AnsiString, 65535, "TEXT" ); Register( DbType.AnsiString, 16777215, "MEDIUMTEXT" ); ! Register( DbType.Binary, "LONGBLOB" ); ! Register( DbType.Binary, 127, "TINYBLOB" ); ! Register( DbType.Binary, 65535, "BLOB" ); ! Register( DbType.Binary, 16777215, "MEDIUMBLOB" ); ! Register( DbType.Boolean, "TINYINT(1)" ); Register( DbType.Byte, "TINYINT UNSIGNED" ); ! Register( DbType.Currency, "MONEY" ); ! Register( DbType.Date, "DATE" ); Register( DbType.DateTime, "DATETIME" ); Register( DbType.Decimal, "NUMERIC(19,5)" ); ! Register( DbType.Decimal, 19, "NUMERIC(19, $1)" ); Register( DbType.Double, "DOUBLE" ); Register( DbType.Guid, "VARCHAR(40)" ); *************** *** 40,45 **** Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "FLOAT" ); ! Register( DbType.StringFixedLength, "CHAR(255)"); Register( DbType.StringFixedLength, 255, "CHAR($1)" ); Register( DbType.StringFixedLength, 65535, "TEXT" ); --- 41,46 ---- Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "FLOAT" ); ! Register( DbType.StringFixedLength, "CHAR(255)" ); Register( DbType.StringFixedLength, 255, "CHAR($1)" ); Register( DbType.StringFixedLength, 65535, "TEXT" ); *************** *** 50,101 **** Register( DbType.String, 16777215, "MEDIUMTEXT" ); Register( DbType.Time, "TIME" ); ! ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; } ! public override string AddColumnString { ! get{ return "add column"; } } ! public override bool DropConstraints { get { return false; } } ! public override bool QualifyIndexName { get { return false; } } ! ! public override bool SupportsIdentityColumns { get { return true; } } ! public override string IdentitySelectString { ! get {return "SELECT LAST_INSERT_ID()";} } public override string IdentityColumnString { ! get{return "NOT NULL AUTO_INCREMENT"; } } ! protected override char CloseQuote { ! get { return '`';} } protected override char OpenQuote { ! get { return '`';} } ! public override bool SupportsLimit { ! get { return true; } } public override bool PreferLimit { --- 51,113 ---- Register( DbType.String, 16777215, "MEDIUMTEXT" ); Register( DbType.Time, "TIME" ); ! ! DefaultProperties[ Environment.OuterJoin ] = "true"; } ! /// <summary></summary> ! public override string AddColumnString { ! get { return "add column"; } } ! ! /// <summary></summary> ! public override bool DropConstraints { get { return false; } } ! ! /// <summary></summary> ! public override bool QualifyIndexName { get { return false; } } ! ! /// <summary></summary> ! public override bool SupportsIdentityColumns { get { return true; } } ! ! /// <summary></summary> public override string IdentitySelectString { ! get { return "SELECT LAST_INSERT_ID()"; } } + /// <summary></summary> public override string IdentityColumnString { ! get { return "NOT NULL AUTO_INCREMENT"; } } ! /// <summary></summary> protected override char CloseQuote { ! get { return '`'; } } + /// <summary></summary> protected override char OpenQuote { ! get { return '`'; } } ! /// <summary></summary> ! public override bool SupportsLimit { ! get { return true; } } + /// <summary></summary> public override bool PreferLimit { *************** *** 103,107 **** } ! public override SqlString GetLimitString(SqlString querySqlString) { Parameter p1 = new Parameter(); --- 115,124 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="querySqlString"></param> ! /// <returns></returns> ! public override SqlString GetLimitString( SqlString querySqlString ) { Parameter p1 = new Parameter(); *************** *** 115,144 **** SqlStringBuilder pagingBuilder = new SqlStringBuilder(); ! pagingBuilder.Add(querySqlString); ! pagingBuilder.Add(" limit "); ! pagingBuilder.Add(p1); ! pagingBuilder.Add(", "); ! pagingBuilder.Add(p2); return pagingBuilder.ToSqlString(); } ! public override string GetAddForeignKeyConstraintString(string constraintName, string[] foreignKey, string referencedTable, string[] primaryKey) { ! string cols = String.Join(StringHelper.CommaSpace, foreignKey); ! return new StringBuilder(30) ! .Append(" add index (") ! .Append(cols) ! .Append("), add constraint ") ! .Append(constraintName) ! .Append(" foreign key (") ! .Append(cols) ! .Append(") references ") ! .Append(referencedTable) ! .Append(" (") ! .Append( String.Join(StringHelper.CommaSpace, primaryKey) ) ! .Append(')') .ToString(); } } ! } --- 132,169 ---- SqlStringBuilder pagingBuilder = new SqlStringBuilder(); ! pagingBuilder.Add( querySqlString ); ! pagingBuilder.Add( " limit " ); ! pagingBuilder.Add( p1 ); ! pagingBuilder.Add( ", " ); ! pagingBuilder.Add( p2 ); return pagingBuilder.ToSqlString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="constraintName"></param> ! /// <param name="foreignKey"></param> ! /// <param name="referencedTable"></param> ! /// <param name="primaryKey"></param> ! /// <returns></returns> ! public override string GetAddForeignKeyConstraintString( string constraintName, string[ ] foreignKey, string referencedTable, string[ ] primaryKey ) { ! string cols = String.Join( StringHelper.CommaSpace, foreignKey ); ! return new StringBuilder( 30 ) ! .Append( " add index (" ) ! .Append( cols ) ! .Append( "), add constraint " ) ! .Append( constraintName ) ! .Append( " foreign key (" ) ! .Append( cols ) ! .Append( ") references " ) ! .Append( referencedTable ) ! .Append( " (" ) ! .Append( String.Join( StringHelper.CommaSpace, primaryKey ) ) ! .Append( ')' ) .ToString(); } } ! } \ No newline at end of file Index: PostgreSQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PostgreSQLDialect.cs 29 Oct 2004 05:52:44 -0000 1.11 --- PostgreSQLDialect.cs 31 Dec 2004 17:07:24 -0000 1.12 *************** *** 1,55 **** - using System; using System.Data; ! using NHibernate.SqlCommand; using NHibernate.SqlTypes; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect for PostgreSQL. /// </summary> ! public class PostgreSQLDialect : Dialect { ! public PostgreSQLDialect() { ! Register( DbType.AnsiStringFixedLength, "char(255)"); Register( DbType.AnsiStringFixedLength, 8000, "char($1)" ); Register( DbType.AnsiString, "varchar(255)" ); Register( DbType.AnsiString, 8000, "varchar($1)" ); ! Register( DbType.AnsiString, 2147483647, "text"); Register( DbType.Binary, 2147483647, "bytea" ); ! Register( DbType.Boolean, "boolean" ); Register( DbType.Byte, "int2" ); ! Register( DbType.Currency, "decimal(16,4)"); ! Register( DbType.Date, "date"); Register( DbType.DateTime, "timestamp" ); Register( DbType.Decimal, "decimal(19,5)" ); ! Register( DbType.Decimal, 19, "decimal(18, $1)"); ! Register( DbType.Double, "float8" ); Register( DbType.Int16, "int2" ); Register( DbType.Int32, "int4" ); Register( DbType.Int64, "int8" ); ! Register( DbType.Single, "float4" ); ! Register( DbType.StringFixedLength, "char(255)"); ! Register( DbType.StringFixedLength, 4000, "char($1)"); Register( DbType.String, "varchar(255)" ); Register( DbType.String, 4000, "varchar($1)" ); ! Register( DbType.String, 1073741823, "text" );// Register( DbType.Time, "time" ); ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; } ! public override string AddColumnString { get { return "add column"; } } ! public override bool DropConstraints { get { return false; } } public override string CascadeConstraintsString { --- 1,58 ---- using System.Data; ! using NHibernate.Cfg; using NHibernate.SqlCommand; using NHibernate.SqlTypes; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect for PostgreSQL. /// </summary> ! public class PostgreSQLDialect : Dialect { ! /// <summary></summary> ! public PostgreSQLDialect() { ! Register( DbType.AnsiStringFixedLength, "char(255)" ); Register( DbType.AnsiStringFixedLength, 8000, "char($1)" ); Register( DbType.AnsiString, "varchar(255)" ); Register( DbType.AnsiString, 8000, "varchar($1)" ); ! Register( DbType.AnsiString, 2147483647, "text" ); Register( DbType.Binary, 2147483647, "bytea" ); ! Register( DbType.Boolean, "boolean" ); Register( DbType.Byte, "int2" ); ! Register( DbType.Currency, "decimal(16,4)" ); ! Register( DbType.Date, "date" ); Register( DbType.DateTime, "timestamp" ); Register( DbType.Decimal, "decimal(19,5)" ); ! Register( DbType.Decimal, 19, "decimal(18, $1)" ); ! Register( DbType.Double, "float8" ); Register( DbType.Int16, "int2" ); Register( DbType.Int32, "int4" ); Register( DbType.Int64, "int8" ); ! Register( DbType.Single, "float4" ); ! Register( DbType.StringFixedLength, "char(255)" ); ! Register( DbType.StringFixedLength, 4000, "char($1)" ); Register( DbType.String, "varchar(255)" ); Register( DbType.String, 4000, "varchar($1)" ); ! Register( DbType.String, 1073741823, "text" ); // Register( DbType.Time, "time" ); ! DefaultProperties[ Environment.OuterJoin ] = "true"; } ! /// <summary></summary> ! public override string AddColumnString { get { return "add column"; } } ! /// <summary></summary> ! public override bool DropConstraints { get { return false; } } + /// <summary></summary> public override string CascadeConstraintsString { *************** *** 57,91 **** } ! public override string GetSequenceNextValString(string sequenceName) { return string.Concat( "select nextval ('", sequenceName, "')" ); } ! public override string GetCreateSequenceString(string sequenceName) { return "create sequence " + sequenceName; } ! public override string GetDropSequenceString(string sequenceName) { return "drop sequence " + sequenceName; } ! ! public override bool SupportsSequences { get { return true; } } public override bool SupportsLimit { ! get { return true; } } ! public override bool BindLimitParametersInReverseOrder { get { return true; } } ! public override SqlString GetLimitString(SqlString querySqlString) { Parameter p1 = new Parameter(); --- 60,117 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetSequenceNextValString( string sequenceName ) { return string.Concat( "select nextval ('", sequenceName, "')" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetCreateSequenceString( string sequenceName ) { return "create sequence " + sequenceName; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sequenceName"></param> ! /// <returns></returns> ! public override string GetDropSequenceString( string sequenceName ) { return "drop sequence " + sequenceName; } ! ! /// <summary></summary> ! public override bool SupportsSequences { get { return true; } } + /// <summary></summary> public override bool SupportsLimit { ! get { return true; } } ! /// <summary></summary> ! public override bool BindLimitParametersInReverseOrder { get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="querySqlString"></param> ! /// <returns></returns> ! public override SqlString GetLimitString( SqlString querySqlString ) { Parameter p1 = new Parameter(); *************** *** 99,111 **** SqlStringBuilder pagingBuilder = new SqlStringBuilder(); ! pagingBuilder.Add(querySqlString); ! pagingBuilder.Add(" limit "); ! pagingBuilder.Add(p1); ! pagingBuilder.Add(" offset "); ! pagingBuilder.Add(p2); return pagingBuilder.ToSqlString(); } public override bool SupportsForUpdateOf { --- 125,138 ---- SqlStringBuilder pagingBuilder = new SqlStringBuilder(); ! pagingBuilder.Add( querySqlString ); ! pagingBuilder.Add( " limit " ); ! pagingBuilder.Add( p1 ); ! pagingBuilder.Add( " offset " ); ! pagingBuilder.Add( p2 ); return pagingBuilder.ToSqlString(); } + /// <summary></summary> public override bool SupportsForUpdateOf { *************** *** 113,115 **** } } ! } --- 140,142 ---- } } ! } \ No newline at end of file Index: QueryFunctionStandard.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/QueryFunctionStandard.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryFunctionStandard.cs 6 Apr 2004 02:26:53 -0000 1.1 --- QueryFunctionStandard.cs 31 Dec 2004 17:07:24 -0000 1.2 *************** *** 1,4 **** - using System; - using NHibernate.Engine; using NHibernate.Hql; --- 1,2 ---- *************** *** 19,27 **** private IType returnType = null; public QueryFunctionStandard() { } ! public QueryFunctionStandard(IType returnType) { this.returnType = returnType; --- 17,30 ---- private IType returnType = null; + /// <summary></summary> public QueryFunctionStandard() { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="returnType"></param> ! public QueryFunctionStandard( IType returnType ) { this.returnType = returnType; *************** *** 30,51 **** #region IQueryFunctionInfo Members ! public IType QueryFunctionType(IType columnType, IMapping mapping) { ! if(returnType==null) return columnType; return returnType; } public bool IsFunctionArgs { ! get{ return true;} } public bool IsFunctionNoArgsUseParanthesis { ! get { return true;} } #endregion } ! } --- 33,65 ---- #region IQueryFunctionInfo Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="columnType"></param> ! /// <param name="mapping"></param> ! /// <returns></returns> ! public IType QueryFunctionType( IType columnType, IMapping mapping ) { ! if( returnType == null ) ! { ! return columnType; ! } return returnType; } + /// <summary></summary> public bool IsFunctionArgs { ! get { return true; } } + /// <summary></summary> public bool IsFunctionNoArgsUseParanthesis { ! get { return true; } } #endregion } ! } \ No newline at end of file Index: DB2Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/DB2Dialect.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DB2Dialect.cs 8 Nov 2004 00:18:00 -0000 1.5 --- DB2Dialect.cs 31 Dec 2004 17:07:20 -0000 1.6 *************** *** 1,39 **** - using System; using System.Data; using System.Text; ! using NHibernate.SqlCommand; using NHibernate.SqlTypes; ! namespace NHibernate.Dialect { - /// <summary> /// An SQL dialect for DB2. /// </summary> ! public class DB2Dialect : Dialect { ! ! public DB2Dialect() { ! Register( DbType.AnsiStringFixedLength, "CHAR(254)"); Register( DbType.AnsiStringFixedLength, 254, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(254)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "CLOB"); Register( DbType.Binary, 2147483647, "BLOB" ); ! Register( DbType.Boolean, "SMALLINT" ); Register( DbType.Byte, "SMALLINT" ); ! Register( DbType.Currency, "DECIMAL(16,4)"); ! Register( DbType.Date, "DATE"); Register( DbType.DateTime, "TIMESTAMP" ); Register( DbType.Decimal, "DECIMAL(19,5)" ); ! Register( DbType.Decimal, 19, "DECIMAL(19, $1)"); ! Register( DbType.Double, "DOUBLE" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "REAL" ); ! Register( DbType.StringFixedLength, "CHAR(254)"); ! Register( DbType.StringFixedLength, 254, "CHAR($1)"); Register( DbType.String, "VARCHAR(254)" ); Register( DbType.String, 8000, "VARCHAR($1)" ); --- 1,38 ---- using System.Data; using System.Text; ! using NHibernate.Cfg; using NHibernate.SqlCommand; using NHibernate.SqlTypes; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect for DB2. /// </summary> ! public class DB2Dialect : Dialect ! { ! /// <summary></summary> ! public DB2Dialect() { ! Register( DbType.AnsiStringFixedLength, "CHAR(254)" ); Register( DbType.AnsiStringFixedLength, 254, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(254)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "CLOB" ); Register( DbType.Binary, 2147483647, "BLOB" ); ! Register( DbType.Boolean, "SMALLINT" ); Register( DbType.Byte, "SMALLINT" ); ! Register( DbType.Currency, "DECIMAL(16,4)" ); ! Register( DbType.Date, "DATE" ); Register( DbType.DateTime, "TIMESTAMP" ); Register( DbType.Decimal, "DECIMAL(19,5)" ); ! Register( DbType.Decimal, 19, "DECIMAL(19, $1)" ); ! Register( DbType.Double, "DOUBLE" ); Register( DbType.Int16, "SMALLINT" ); Register( DbType.Int32, "INTEGER" ); Register( DbType.Int64, "BIGINT" ); ! Register( DbType.Single, "REAL" ); ! Register( DbType.StringFixedLength, "CHAR(254)" ); ! Register( DbType.StringFixedLength, 254, "CHAR($1)" ); Register( DbType.String, "VARCHAR(254)" ); Register( DbType.String, 8000, "VARCHAR($1)" ); *************** *** 41,113 **** Register( DbType.Time, "TIME" ); ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; } ! public override string AddColumnString { get { return "add column"; } } ! public override bool DropConstraints { get { return false; } } ! public override bool SupportsIdentityColumns { get { return true; } } ! public override string IdentitySelectString { get { return "values IDENTITY_VAL_LOCAL()"; } } ! public override string IdentityColumnString { get { return "not null generated by default as identity"; } } ! public override string IdentityInsertString { get { return "default"; } } ! ! public override string GetSequenceNextValString(string sequenceName) { return "values nextval for " + sequenceName; } ! public override string GetCreateSequenceString(string sequenceName) { return "create sequence " + sequenceName; } ! public override string GetDropSequenceString(string sequenceName) { return string.Concat( "drop sequence ", sequenceName, " restrict" ); } ! ! public override bool SupportsSequences { get { return true; } } public override bool SupportsLimit { ! get { return true; } } ! public override bool BindLimitParametersInReverseOrder { get { return false; } } public override bool UseMaxForLimit { ! get { return true; } } ! public override SqlString GetLimitString(SqlString querySqlString) { Parameter p1 = new Parameter(); --- 40,130 ---- Register( DbType.Time, "TIME" ); ! DefaultProperties[ Environment.OuterJoin ] = "true"; } ! /// <summary></summary> ! public override string AddColumnString { get { return "add column"; } } ! /// <summary></summary> ! public override bool DropConstraints { get { return false; } } ! /// <summary></summary> ! public override bool SupportsIdentityColumns { get { return true; } } ! /// <summary></summary> ! public override string IdentitySelectString { get { return "values IDENTITY_VAL_LOCAL()"; } } ! /// <summary></summary> ! public override string IdentityColumnString { get { return "not null generated by default as identity"; } } ! /// <summary></summary> ! public override string IdentityInsertString { get { return "default"; } } ! ! /// <summary></summary> ! public override string GetSequenceNextValString( string sequenceName ) { return "values nextval for " + sequenceName; } ! /// <summary></summary> ! public override string GetCreateSequenceString( string sequenceName ) { return "create sequence " + sequenceName; } ! /// <summary></summary> ! public override string GetDropSequenceString( string sequenceName ) { return string.Concat( "drop sequence ", sequenceName, " restrict" ); } ! ! /// <summary></summary> ! public override bool SupportsSequences { get { return true; } } + /// <summary></summary> public override bool SupportsLimit { ! get { return true; } } ! /// <summary></summary> ! public override bool BindLimitParametersInReverseOrder { get { return false; } } + /// <summary></summary> public override bool UseMaxForLimit { ! get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="querySqlString"></param> ! /// <returns></returns> ! public override SqlString GetLimitString( SqlString querySqlString ) { Parameter p1 = new Parameter(); *************** *** 127,136 **** // build a new query and extract the order by part ! foreach (object sqlPart in querySqlString.SqlParts) { string sqlPartString = sqlPart as string; ! if (sqlPartString != null) { ! if (sqlPartString.ToLower().TrimStart().StartsWith("order by")) { isInOrderBy = true; --- 144,153 ---- // build a new query and extract the order by part ! foreach( object sqlPart in querySqlString.SqlParts ) { string sqlPartString = sqlPart as string; ! if( sqlPartString != null ) { ! if( sqlPartString.ToLower().TrimStart().StartsWith( "order by" ) ) { isInOrderBy = true; *************** *** 138,163 **** } ! if (isInOrderBy && sqlPart is string) { ! orderByStringBuilder.Append((string)sqlPart); } else { ! pagingBuilder.AddObject(sqlPart); } } ! string rownumClause = "rownumber() over(" + orderByStringBuilder.ToString() + ") as rownum, "; // Add the rownum clause first, right after the original select ! pagingBuilder.Insert(1, rownumClause); // Add the rest ! pagingBuilder.Insert(0, "select * from ("); ! pagingBuilder.Add(") as tempresult "); // Add the where clause ! pagingBuilder.Add(" where rownum between "); ! pagingBuilder.Add(p1); ! pagingBuilder.Add(" and "); ! pagingBuilder.Add(p2); ! return pagingBuilder.ToSqlString(); } --- 155,180 ---- } ! if( isInOrderBy && sqlPart is string ) { ! orderByStringBuilder.Append( ( string ) sqlPart ); } else { ! pagingBuilder.AddObject( sqlPart ); } } ! string rownumClause = "rownumber() over(" + orderByStringBuilder.ToString() + ") as rownum, "; // Add the rownum clause first, right after the original select ! pagingBuilder.Insert( 1, rownumClause ); // Add the rest ! pagingBuilder.Insert( 0, "select * from (" ); ! pagingBuilder.Add( ") as tempresult " ); // Add the where clause ! pagingBuilder.Add( " where rownum between " ); ! pagingBuilder.Add( p1 ); ! pagingBuilder.Add( " and " ); ! pagingBuilder.Add( p2 ); ! return pagingBuilder.ToSqlString(); } Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MsSql2000Dialect.cs 29 Oct 2004 05:52:44 -0000 1.20 --- MsSql2000Dialect.cs 31 Dec 2004 17:07:24 -0000 1.21 *************** *** 1,30 **** - using System; using System.Data; ! using NHibernate.SqlCommand; - using NHibernate.SqlTypes; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect compatible with Microsoft SQL Server 2000. /// </summary> ! public class MsSql2000Dialect: Dialect { ! ! public MsSql2000Dialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)"); Register( DbType.AnsiStringFixedLength, 8000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(255)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "TEXT"); ! Register( DbType.Binary, "VARBINARY(8000)"); ! Register( DbType.Binary, 8000, "VARBINARY($1)"); Register( DbType.Binary, 2147483647, "IMAGE" ); ! Register( DbType.Boolean, "BIT" ); Register( DbType.Byte, "TINYINT" ); ! Register( DbType.Currency, "MONEY"); ! Register( DbType.Date, "DATETIME"); Register( DbType.DateTime, "DATETIME" ); // TODO: figure out if this is the good way to fix the problem --- 1,28 ---- using System.Data; ! using NHibernate.Cfg; using NHibernate.SqlCommand; ! namespace NHibernate.Dialect { /// <summary> /// An SQL dialect compatible with Microsoft SQL Server 2000. /// </summary> ! public class MsSql2000Dialect : Dialect { ! /// <summary></summary> ! public MsSql2000Dialect() : base() { ! Register( DbType.AnsiStringFixedLength, "CHAR(255)" ); Register( DbType.AnsiStringFixedLength, 8000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR(255)" ); Register( DbType.AnsiString, 8000, "VARCHAR($1)" ); ! Register( DbType.AnsiString, 2147483647, "TEXT" ); ! Register( DbType.Binary, "VARBINARY(8000)" ); ! Register( DbType.Binary, 8000, "VARBINARY($1)" ); Register( DbType.Binary, 2147483647, "IMAGE" ); ! Register( DbType.Boolean, "BIT" ); Register( DbType.Byte, "TINYINT" ); ! Register( DbType.Currency, "MONEY" ); ! Register( DbType.Date, "DATETIME" ); Register( DbType.DateTime, "DATETIME" ); // TODO: figure out if this is the good way to fix the problem *************** *** 35,40 **** // sql-type="decimal(20,5)" if they need to do that. The Decimal parameter and ddl will get generated // correctly with minimal work. ! Register( DbType.Decimal, "DECIMAL(19,5)" ); ! Register( DbType.Decimal, 19, "DECIMAL(19, $1)"); Register( DbType.Double, "DOUBLE PRECISION" ); //synonym for FLOAT(53) Register( DbType.Guid, "UNIQUEIDENTIFIER" ); --- 33,38 ---- // sql-type="decimal(20,5)" if they need to do that. The Decimal parameter and ddl will get generated // correctly with minimal work. ! Register( DbType.Decimal, "DECIMAL(19,5)" ); ! Register( DbType.Decimal, 19, "DECIMAL(19, $1)" ); Register( DbType.Double, "DOUBLE PRECISION" ); //synonym for FLOAT(53) Register( DbType.Guid, "UNIQUEIDENTIFIER" ); *************** *** 43,74 **** Register( DbType.Int64, "BIGINT" ); Register( DbType.Single, "REAL" ); //synonym for FLOAT(24) ! Register( DbType.StringFixedLength, "NCHAR(255)"); ! Register( DbType.StringFixedLength, 4000, "NCHAR($1)"); Register( DbType.String, "NVARCHAR(255)" ); Register( DbType.String, 4000, "NVARCHAR($1)" ); Register( DbType.String, 1073741823, "NTEXT" ); Register( DbType.Time, "DATETIME" ); ! ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; } ! public override string AddColumnString { get { return "add"; } } ! public override string NullColumnString { get { return " null"; } } ! public override bool QualifyIndexName { get { return false; } } ! ! public override bool SupportsForUpdate { get { return false; } } ! /// <summary> /// MsSql allows the use of SELECT SCOPE_IDENTITY to be in the same --- 41,78 ---- Register( DbType.Int64, "BIGINT" ); Register( DbType.Single, "REAL" ); //synonym for FLOAT(24) ! Register( DbType.StringFixedLength, "NCHAR(255)" ); ! Register( DbType.StringFixedLength, 4000, "NCHAR($1)" ); Register( DbType.String, "NVARCHAR(255)" ); Register( DbType.String, 4000, "NVARCHAR($1)" ); Register( DbType.String, 1073741823, "NTEXT" ); Register( DbType.Time, "DATETIME" ); ! ! DefaultProperties[ Environment.OuterJoin ] = "true"; } ! /// <summary></summary> ! public override string AddColumnString { get { return "add"; } } ! ! /// <summary></summary> ! public override string NullColumnString { get { return " null"; } } ! ! /// <summary></summary> ! public override bool QualifyIndexName { get { return false; } } ! ! /// <summary></summary> ! public override bool SupportsForUpdate { get { return false; } } ! /// <summary> /// MsSql allows the use of SELECT SCOPE_IDENTITY to be in the same *************** *** 78,84 **** public override bool SupportsIdentitySelectInInsert { ! get { return true; } } ! /// <summary> /// Add the Identity Select string to the Insert Sql. --- 82,88 ---- public override bool SupportsIdentitySelectInInsert { ! get { return true; } } ! /// <summary> /// Add the Identity Select string to the Insert Sql. *************** *** 86,113 **** /// <param name="insertSql">The SqlString that contains the INSERT sql.</param> /// <returns>A new SqlString with <c>; SELECT SCOPE_IDENTITY()</c> at the end.</returns> ! public override SqlString AddIdentitySelectToInsert(SqlString insertSql) { return insertSql.Append( "; " + IdentitySelectString ); } ! public override bool SupportsIdentityColumns { get { return true; } } ! public override string IdentitySelectString { get { return "select SCOPE_IDENTITY()"; } } ! public override string IdentityColumnString { ! get { return "IDENTITY NOT NULL"; } } ! public override string NoColumnsInsertString { get { return "DEFAULT VALUES"; } ! } public override int MaxAnsiStringSize { --- 90,123 ---- /// <param name="insertSql">The SqlString that contains the INSERT sql.</param> /// <returns>A new SqlString with <c>; SELECT SCOPE_IDENTITY()</c> at the end.</returns> ! public override SqlString AddIdentitySelectToInsert( SqlString insertSql ) { return insertSql.Append( "; " + IdentitySelectString ); } ! /// <summary></summary> ! public override bool SupportsIdentityColumns { get { return true; } } ! /// <summary></summary> ! public override string IdentitySelectString { get { return "select SCOPE_IDENTITY()"; } } ! ! /// <summary></summary> ! public override string IdentityColumnString { ! get { return "IDENTITY NOT NULL"; } } ! /// <summary></summary> ! public override string NoColumnsInsertString { get { return "DEFAULT VALUES"; } ! } + /// <summary></summary> public override int MaxAnsiStringSize { *************** *** 115,147 **** } ! public override int MaxBinaryBlobSize { get { return 2147483647; } } ! public override int MaxBinarySize { get { return 8000; } ! } ! public override int MaxStringClobSize { get { return 1073741823; } } public override int MaxStringSize { ! get { return 4000; } } ! protected override char CloseQuote { ! get { return ']';} } protected override char OpenQuote { ! get { return '[';} } --- 125,162 ---- } ! /// <summary></summary> ! public override int MaxBinaryBlobSize { get { return 2147483647; } } ! ! /// <summary></summary> public override int MaxBinarySize { get { return 8000; } ! } ! /// <summary></summary> ! public override int MaxStringClobSize { get { return 1073741823; } } + /// <summary></summary> public override int MaxStringSize { ! get { return 4000; } } ! /// <summary></summary> protected override char CloseQuote { ! get { return ']'; } } + /// <summary></summary> protected override char OpenQuote { ! get { return '['; } } *************** *** 155,170 **** /// is an OpenQuote. /// </remarks> ! protected override string Quote(string name) { ! return OpenQuote + name.Replace(CloseQuote.ToString(), new string(CloseQuote, 2) ) + CloseQuote; } ! public override string UnQuote(string quoted) { ! if ( IsQuoted(quoted) ) ! quoted = quoted.Substring(1,quoted.Length - 2); ! return quoted.Replace( new string(CloseQuote, 2), CloseQuote.ToString() ); } } ! } --- 170,192 ---- /// is an OpenQuote. /// </remarks> ! protected override string Quote( string name ) { ! return OpenQuote + name.Replace( CloseQuote.ToString(), new string( CloseQuote, 2 ) ) + CloseQuote; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="quoted"></param> ! /// <returns></returns> ! public override string UnQuote( string quoted ) { ! if( IsQuoted( quoted ) ) ! { ! quoted = quoted.Substring( 1, quoted.Length - 2 ); ! } ! return quoted.Replace( new string( CloseQuote, 2 ), CloseQuote.ToString() ); } } ! } \ No newline at end of file Index: Oracle9Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Oracle9Dialect.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Oracle9Dialect.cs 29 Oct 2004 05:52:44 -0000 1.15 --- Oracle9Dialect.cs 31 Dec 2004 17:07:24 -0000 1.16 *************** *** 1,7 **** - using System; using System.Collections; using System.Data; ! using System.Text; ! using NHibernate.Engine; using NHibernate.Hql; --- 1,5 ---- using System.Collections; using System.Data; ! using NHibernate.Cfg; using NHibernate.Engine; using NHibernate.Hql; *************** *** 9,15 **** using NHibernate.SqlTypes; using NHibernate.Type; - using NHibernate.Util; ! namespace NHibernate.Dialect { /// <summary> --- 7,12 ---- using NHibernate.SqlTypes; using NHibernate.Type; ! namespace NHibernate.Dialect { /// <summary> *************** *** 17,45 **** /// An SQL dialect for Oracle 9 /// </summary> ! public class Oracle9Dialect : Dialect { - private readonly IDictionary aggregateFunctions = new Hashtable(); ! public Oracle9Dialect() : base() { // DefaultProperties[Cfg.Environment.UseStreamsForBinary] = "true"; ! DefaultProperties[Cfg.Environment.OuterJoin] = "true"; ! Register( DbType.AnsiStringFixedLength, "CHAR(255)"); Register( DbType.AnsiStringFixedLength, 2000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR2(255)" ); Register( DbType.AnsiString, 2000, "VARCHAR2($1)" ); ! Register( DbType.AnsiString, 2147483647, "CLOB"); // should use the IType.ClobType ! Register( DbType.Binary, "RAW(2000)"); ! Register( DbType.Binary, 2000, "RAW($1)"); Register( DbType.Binary, 2147483647, "BLOB" ); ! Register( DbType.Boolean, "NUMBER(1,0)" ); Register( DbType.Byte, "NUMBER(3,0)" ); ! Register( DbType.Currency, "NUMBER(19,1)"); ! Register( DbType.Date, "DATE"); Register( DbType.DateTime, "DATE" ); ! 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 --- 14,42 ---- /// An SQL dialect for Oracle 9 /// </summary> ! public class Oracle9Dialect : Dialect { private readonly IDictionary aggregateFunctions = new Hashtable(); ! /// <summary></summary> ! public Oracle9Dialect() : base() { // DefaultProperties[Cfg.Environment.UseStreamsForBinary] = "true"; ! DefaultProperties[ Environment.OuterJoin ] = "true"; ! Register( DbType.AnsiStringFixedLength, "CHAR(255)" ); Register( DbType.AnsiStringFixedLength, 2000, "CHAR($1)" ); Register( DbType.AnsiString, "VARCHAR2(255)" ); Register( DbType.AnsiString, 2000, "VARCHAR2($1)" ); ! Register( DbType.AnsiString, 2147483647, "CLOB" ); // should use the IType.ClobType ! Register( DbType.Binary, "RAW(2000)" ); ! Register( DbType.Binary, 2000, "RAW($1)" ); Register( DbType.Binary, 2147483647, "BLOB" ); ! Register( DbType.Boolean, "NUMBER(1,0)" ); Register( DbType.Byte, "NUMBER(3,0)" ); ! Register( DbType.Currency, "NUMBER(19,1)" ); ! Register( DbType.Date, "DATE" ); Register( DbType.DateTime, "DATE" ); ! 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 *************** *** 51,56 **** Register( DbType.Int64, "NUMBER(20,0)" ); Register( DbType.Single, "FLOAT(24)" ); ! Register( DbType.StringFixedLength, "NCHAR(255)"); ! Register( DbType.StringFixedLength, 2000, "NCHAR($1)"); Register( DbType.String, "NVARCHAR2(255)" ); Register( DbType.String, 2000, "NVARCHAR2($1)" ); --- 48,53 ---- Register( DbType.Int64, "NUMBER(20,0)" ); Register( DbType.Single, "FLOAT(24)" ); ! Register( DbType.StringFixedLength, "NCHAR(255)" ); ! Register( DbType.StringFixedLength, 2000, "NCHAR($1)" ); Register( DbType.String, "NVARCHAR2(255)" ); Register( DbType.String, 2000, "NVARCHAR2($1)" ); *************** *** 59,128 **** // add all the functions from the base into this instance ! foreach(DictionaryEntry de in base.AggregateFunctions) { ! aggregateFunctions[de.Key] = de.Value; } ! aggregateFunctions["trunc"] = new QueryFunctionStandard(); ! aggregateFunctions["round"] = new QueryFunctionStandard(); ! aggregateFunctions["abs"] = new QueryFunctionStandard(NHibernate.Int32); ! aggregateFunctions["sign"] = new QueryFunctionStandard(NHibernate.Int32); ! aggregateFunctions["ceil"] = new QueryFunctionStandard(NHibernate.Int32); ! aggregateFunctions["floor"] = new QueryFunctionStandard(NHibernate.Int32); ! aggregateFunctions["sqrt"] = new QueryFunctionStandard(); ! aggregateFunctions["exp"] = new QueryFunctionStandard(); ! aggregateFunctions["ln"] = new QueryFunctionStandard(); ! aggregateFunctions["sin"] = new QueryFunctionStandard(); ! aggregateFunctions["sinh"] = new QueryFunctionStandard(); ! aggregateFunctions["cos"] = new QueryFunctionStandard(); ! aggregateFunctions["cosh"] = new QueryFunctionStandard(); ! aggregateFunctions["tan"] = new QueryFunctionStandard(); ! aggregateFunctions["tanh"] = new QueryFunctionStandard(); ! aggregateFunctions["stddev"] = new QueryFunctionStandard(); ! aggregateFunctions["variance"] = new QueryFunctionStandard(); ! aggregateFunctions["sysdate"] = new SysdateQueryFunctionInfo(); ! aggregateFunctions["lastday"] = new QueryFunctionStandard(NHibernate.Date); } ! ! public override string AddColumnString { get { return "add"; } } ! public override string GetSequenceNextValString(string sequenceName) { return "select " + sequenceName + ".nextval from dual"; } ! ! public override string GetCreateSequenceString(string sequenceName) { return "create sequence " + sequenceName + " INCREMENT BY 1 START WITH... [truncated message content] |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9573 Modified Files: ConnectionProvider.cs ConnectionProviderFactory.cs DriverConnectionProvider.cs IConnectionProvider.cs UserSuppliedConnectionProvider.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/IConnectionProvider.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.5 --- IConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.6 *************** *** 1,9 **** - using System; - using System.Data; using System.Collections; ! using NHibernate.Driver; ! namespace NHibernate.Connection { /// <summary> --- 1,7 ---- using System.Collections; ! using System.Data; using NHibernate.Driver; ! namespace NHibernate.Connection { /// <summary> *************** *** 15,21 **** /// a public default constructor. /// </remarks> ! public interface IConnectionProvider { - /// <summary> /// The Driver this ConnectionProvider should use to communicate with the .NET Data Provider --- 13,18 ---- /// a public default constructor. /// </remarks> ! public interface IConnectionProvider { /// <summary> /// The Driver this ConnectionProvider should use to communicate with the .NET Data Provider *************** *** 23,27 **** /// <value></value> /// <remarks></remarks> ! IDriver Driver {get;} /// <summary> --- 20,24 ---- /// <value></value> /// <remarks></remarks> ! IDriver Driver { get; } /// <summary> *************** *** 29,33 **** /// </summary> /// <param name="settings">The connection provider settings</param> ! void Configure(IDictionary settings); /// <summary> --- 26,30 ---- /// </summary> /// <param name="settings">The connection provider settings</param> ! void Configure( IDictionary settings ); /// <summary> *************** *** 41,45 **** /// </summary> /// <param name="conn">An ADO.NET connection</param> ! void CloseConnection(IDbConnection conn); /// <summary> --- 38,42 ---- /// </summary> /// <param name="conn">An ADO.NET connection</param> ! void CloseConnection( IDbConnection conn ); /// <summary> *************** *** 57,59 **** } ! } --- 54,56 ---- } ! } \ No newline at end of file Index: DriverConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/DriverConnectionProvider.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DriverConnectionProvider.cs 1 Sep 2004 03:28:28 -0000 1.3 --- DriverConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.4 *************** *** 1,7 **** using System; - using System.Collections; using System.Data; ! ! using NHibernate.Driver; namespace NHibernate.Connection --- 1,5 ---- using System; using System.Data; ! using log4net; namespace NHibernate.Connection *************** *** 12,51 **** public class DriverConnectionProvider : ConnectionProvider { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(DriverConnectionProvider)); ! public DriverConnectionProvider() { } ! ! public override IDbConnection GetConnection() { ! log.Debug("Obtaining IDbConnection from Driver"); ! try { IDbConnection conn = Driver.CreateConnection(); ! conn.ConnectionString = ConnectionString; conn.Open(); return conn; ! } ! catch (Exception e) { ! throw new ADOException("Could not create connection from Driver", e); } } ! public override bool IsStatementCache { get { return false; } } public override void Close() { ! 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(); --- 10,59 ---- public class DriverConnectionProvider : ConnectionProvider { ! private static readonly ILog log = LogManager.GetLogger( typeof( DriverConnectionProvider ) ); ! ! /// <summary></summary> public DriverConnectionProvider() { } ! /// <summary> ! /// ! /// </summary> ! /// <returns></returns> ! public override IDbConnection GetConnection() { ! log.Debug( "Obtaining IDbConnection from Driver" ); ! try { IDbConnection conn = Driver.CreateConnection(); ! conn.ConnectionString = ConnectionString; conn.Open(); return conn; ! } ! catch( Exception e ) { ! throw new ADOException( "Could not create connection from Driver", e ); } } ! /// <summary></summary> ! public override bool IsStatementCache { get { return false; } } + /// <summary></summary> public override void Close() { ! log.Info( "cleaning up connection pool" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="conn"></param> ! 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(); *************** *** 53,57 **** - } ! } --- 61,64 ---- } ! } \ No newline at end of file Index: ConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/ConnectionProvider.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConnectionProvider.cs 21 Nov 2004 22:56:28 -0000 1.8 --- ConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.9 *************** *** 2,8 **** using System.Collections; using System.Data; ! using NHibernate.Driver; ! using NHibernate.Util; namespace NHibernate.Connection --- 2,8 ---- using System.Collections; using System.Data; ! using log4net; using NHibernate.Driver; ! using Environment = NHibernate.Cfg.Environment; namespace NHibernate.Connection *************** *** 13,33 **** public abstract class ConnectionProvider : IConnectionProvider, IDisposable { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConnectionProvider)); private string connString = null; private IDriver driver = null; ! public virtual void CloseConnection(IDbConnection conn) { ! log.Debug("Closing connection"); ! try { conn.Close(); ! } ! catch(Exception e) { ! throw new ADOException("Could not close " + conn.GetType().ToString() + " connection", e); } } ! /// <summary> /// Configures the ConnectionProvider with the Driver and the ConnectionString. --- 13,37 ---- public abstract class ConnectionProvider : IConnectionProvider, IDisposable { ! private static readonly ILog log = LogManager.GetLogger( typeof( ConnectionProvider ) ); private string connString = null; private IDriver driver = null; ! /// <summary> ! /// ! /// </summary> ! /// <param name="conn"></param> ! public virtual void CloseConnection( IDbConnection conn ) { ! log.Debug( "Closing connection" ); ! try { conn.Close(); ! } ! catch( Exception e ) { ! throw new ADOException( "Could not close " + conn.GetType().ToString() + " connection", e ); } } ! /// <summary> /// Configures the ConnectionProvider with the Driver and the ConnectionString. *************** *** 35,50 **** /// <param name="settings">A name/value Dictionary that contains the settings for this ConnectionProvider.</param> /// <exception cref="HibernateException">Thrown when a ConnectionString could not be found or the Driver Class could not be loaded.</exception> ! public virtual void Configure(IDictionary settings) { log.Info( "Configuring ConnectionProvider" ); ! ! connString = settings[ Cfg.Environment.ConnectionString ] as string; ! if (connString==null) { ! throw new HibernateException("Could not find connection string setting"); } ! ! ConfigureDriver(settings); ! } --- 39,54 ---- /// <param name="settings">A name/value Dictionary that contains the settings for this ConnectionProvider.</param> /// <exception cref="HibernateException">Thrown when a ConnectionString could not be found or the Driver Class could not be loaded.</exception> ! public virtual void Configure( IDictionary settings ) { log.Info( "Configuring ConnectionProvider" ); ! ! connString = settings[ Environment.ConnectionString ] as string; ! if( connString == null ) { ! throw new HibernateException( "Could not find connection string setting" ); } ! ! ConfigureDriver( settings ); ! } *************** *** 53,72 **** /// </summary> /// <param name="settings">A name/value Dictionary that contains the settings for the Driver.</param> ! protected virtual void ConfigureDriver(IDictionary settings) { ! string driverClass = settings[ Cfg.Environment.ConnectionDriver] as string; ! if(driverClass==null) { ! throw new HibernateException("The " + Cfg.Environment.ConnectionDriver + " must be specified in the NHibernate configuration section."); } ! else { ! try { ! driver = (IDriver) Activator.CreateInstance(System.Type.GetType(driverClass)); } ! catch (Exception e) { ! throw new HibernateException("Could not create the driver from " + driverClass + ".", e); } --- 57,76 ---- /// </summary> /// <param name="settings">A name/value Dictionary that contains the settings for the Driver.</param> ! protected virtual void ConfigureDriver( IDictionary settings ) { ! string driverClass = settings[ Environment.ConnectionDriver ] as string; ! if( driverClass == null ) { ! throw new HibernateException( "The " + Environment.ConnectionDriver + " must be specified in the NHibernate configuration section." ); } ! else { ! try { ! driver = ( IDriver ) Activator.CreateInstance( System.Type.GetType( driverClass ) ); } ! catch( Exception e ) { ! throw new HibernateException( "Could not create the driver from " + driverClass + ".", e ); } *************** *** 74,85 **** } ! protected virtual string ConnectionString { ! get { return connString;} } ! public IDriver Driver { ! get {return driver;} } --- 78,95 ---- } ! /// <summary> ! /// ! /// </summary> ! protected virtual string ConnectionString { ! get { return connString; } } ! /// <summary> ! /// ! /// </summary> ! public IDriver Driver { ! get { return driver; } } *************** *** 88,99 **** /// </summary> /// <returns></returns> ! public abstract IDbConnection GetConnection(); ! public abstract bool IsStatementCache {get;} public abstract void Close(); #region IDisposable Members public void Dispose() { --- 98,118 ---- /// </summary> /// <returns></returns> ! public abstract IDbConnection GetConnection(); ! /// <summary> ! /// ! /// </summary> ! public abstract bool IsStatementCache { get; } + /// <summary> + /// + /// </summary> public abstract void Close(); #region IDisposable Members + /// <summary> + /// + /// </summary> public void Dispose() { *************** *** 103,105 **** #endregion } ! } --- 122,124 ---- #endregion } ! } \ No newline at end of file Index: UserSuppliedConnectionProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/UserSuppliedConnectionProvider.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UserSuppliedConnectionProvider.cs 18 Jun 2004 13:59:05 -0000 1.5 --- UserSuppliedConnectionProvider.cs 31 Dec 2004 16:46:43 -0000 1.6 *************** *** 1,9 **** using System; - using System.Data; using System.Collections; ! using NHibernate.Driver; ! ! namespace NHibernate.Connection { /// <summary> --- 1,8 ---- using System; using System.Collections; + using System.Data; + using log4net; ! namespace NHibernate.Connection { /// <summary> *************** *** 14,29 **** /// This implementation indicates that the user is expected to supply an ADO.NET connection /// </remarks> ! public class UserSuppliedConnectionProvider : ConnectionProvider { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(UserSuppliedConnectionProvider)); ! ! public override void CloseConnection(IDbConnection conn) { ! throw new InvalidOperationException("The User is responsible for closing ADO.NET connection - not NHibernate."); } ! public override IDbConnection GetConnection() { ! throw new InvalidOperationException("The user must provide an ADO.NET connection - NHibernate is not creating it."); } --- 13,36 ---- /// This implementation indicates that the user is expected to supply an ADO.NET connection /// </remarks> ! public class UserSuppliedConnectionProvider : ConnectionProvider { ! private static readonly ILog log = LogManager.GetLogger( typeof( UserSuppliedConnectionProvider ) ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="conn"></param> ! public override void CloseConnection( IDbConnection conn ) { ! throw new InvalidOperationException( "The User is responsible for closing ADO.NET connection - not NHibernate." ); } ! /// <summary> ! /// ! /// </summary> ! /// <returns></returns> ! public override IDbConnection GetConnection() { ! throw new InvalidOperationException( "The user must provide an ADO.NET connection - NHibernate is not creating it." ); } *************** *** 36,51 **** /// NHibernate to use a Connection supplied by the User. /// </remarks> ! public override void Configure(IDictionary settings) { ! log.Warn("No connection properties specified - the user must supply an ADO.NET connection"); ! ! ConfigureDriver(settings); } ! public override bool IsStatementCache { get { return false; } } public override void Close() { --- 43,60 ---- /// NHibernate to use a Connection supplied by the User. /// </remarks> ! public override void Configure( IDictionary settings ) { ! log.Warn( "No connection properties specified - the user must supply an ADO.NET connection" ); ! ! ConfigureDriver( settings ); } ! /// <summary></summary> ! public override bool IsStatementCache { get { return false; } } + /// <summary></summary> public override void Close() { *************** *** 56,58 **** } ! } --- 65,67 ---- } ! } \ No newline at end of file Index: ConnectionProviderFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Connection/ConnectionProviderFactory.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConnectionProviderFactory.cs 22 Nov 2004 03:52:17 -0000 1.7 --- ConnectionProviderFactory.cs 31 Dec 2004 16:46:43 -0000 1.8 *************** *** 1,49 **** using System; using System.Collections; ! using System.Configuration; ! using System.Data; ! ! using NHibernate.Cfg; ! namespace NHibernate.Connection { /// <summary> /// Instanciates a connection provider given configuration properties. /// </summary> ! public sealed class ConnectionProviderFactory { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ConnectionProviderFactory)); ! // cannot be instantiated ! private ConnectionProviderFactory() { ! throw new InvalidOperationException("ConnectionProviderFactory can not be instantiated."); } ! public static IConnectionProvider NewConnectionProvider(IDictionary settings) { IConnectionProvider connections = null; ! string providerClass = settings[Cfg.Environment.ConnectionProvider] as string; ! if (providerClass != null) { ! try { ! log.Info("Intitializing connection provider: " + providerClass); ! connections = (IConnectionProvider) Activator.CreateInstance(System.Type.GetType(providerClass)); ! } ! catch (Exception e) { ! log.Fatal("Could not instantiate connection provider", e); ! throw new HibernateException("Could not instantiate connection provider: " + providerClass); } ! } ! else { connections = new UserSuppliedConnectionProvider(); } ! connections.Configure(settings); return connections; } } ! } --- 1,52 ---- using System; using System.Collections; ! using log4net; ! using Environment = NHibernate.Cfg.Environment; ! namespace NHibernate.Connection { /// <summary> /// Instanciates a connection provider given configuration properties. /// </summary> ! public sealed class ConnectionProviderFactory { ! private static readonly ILog log = LogManager.GetLogger( typeof( ConnectionProviderFactory ) ); ! // cannot be instantiated ! private ConnectionProviderFactory() { ! throw new InvalidOperationException( "ConnectionProviderFactory can not be instantiated." ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="settings"></param> ! /// <returns></returns> ! public static IConnectionProvider NewConnectionProvider( IDictionary settings ) { IConnectionProvider connections = null; ! string providerClass = settings[ Environment.ConnectionProvider ] as string; ! if( providerClass != null ) { ! try { ! log.Info( "Intitializing connection provider: " + providerClass ); ! connections = ( IConnectionProvider ) Activator.CreateInstance( System.Type.GetType( providerClass ) ); ! } ! catch( Exception e ) { ! log.Fatal( "Could not instantiate connection provider", e ); ! throw new HibernateException( "Could not instantiate connection provider: " + providerClass ); } ! } ! else { connections = new UserSuppliedConnectionProvider(); } ! connections.Configure( settings ); return connections; } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 16:36:58
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7676 Modified Files: ArrayHolder.cs Bag.cs CollectionPersister.cs IdentifierBag.cs List.cs Map.cs PersistentCollection.cs Set.cs SortedMap.cs SortedSet.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Bag.cs 29 Nov 2004 04:45:50 -0000 1.10 --- Bag.cs 31 Dec 2004 16:36:46 -0000 1.11 *************** *** 2,6 **** using System.Collections; using System.Data; - using NHibernate.Engine; using NHibernate.Type; --- 2,5 ---- *************** *** 22,37 **** private IList bagIdentifiers; ! public Bag(ISessionImplementor session) : base(session) { } ! public Bag(ISessionImplementor session, ICollection coll) : base(session) { bag = coll as IList; ! ! if(bag == null) { bag = new ArrayList(); ! ((ArrayList)bag).AddRange(coll); } --- 21,45 ---- private IList bagIdentifiers; ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! public Bag( ISessionImplementor session ) : base( session ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="coll"></param> ! public Bag( ISessionImplementor session, ICollection coll ) : base( session ) { bag = coll as IList; ! ! if( bag == null ) { bag = new ArrayList(); ! ( ( ArrayList ) bag ).AddRange( coll ); } *************** *** 40,54 **** } ! public Bag(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) : base(session) { ! BeforeInitialize(persister); ! object[] array = (object[])disassembled; ! for(int i=0; i<array.Length; i++) { ! bag.Add(persister.ElementType.Assemble(array[i], session, owner)); } initialized = true; } public override ICollection Elements() { --- 48,73 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! public Bag( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) : base( session ) { ! BeforeInitialize( persister ); ! object[ ] array = ( object[ ] ) disassembled; ! for( int i = 0; i < array.Length; i++ ) { ! bag.Add( persister.ElementType.Assemble( array[ i ], session, owner ) ); } initialized = true; } + /// <summary> + /// + /// </summary> + /// <returns></returns> public override ICollection Elements() { *************** *** 56,64 **** } public override bool Empty { ! get{ return bag.Count==0;} } public override ICollection Entries() { --- 75,90 ---- } + /// <summary> + /// + /// </summary> public override bool Empty { ! get { return bag.Count == 0; } } + /// <summary> + /// + /// </summary> + /// <returns></returns> public override ICollection Entries() { *************** *** 66,78 **** } ! public override void EndRead(CollectionPersister persister, object owner) { ! for(int i = 0 ;i < bagIdentifiers.Count; i++) { ! object element = persister.ElementType.ResolveIdentifier(bagIdentifiers[i], session, owner); bag.Add( element ); } ! if( Additions!=null ) { DelayedAddAll( Additions ); --- 92,109 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <param name="owner"></param> ! public override void EndRead( CollectionPersister persister, object owner ) { ! for( int i = 0; i < bagIdentifiers.Count; i++ ) { ! object element = persister.ElementType.ResolveIdentifier( bagIdentifiers[ i ], session, owner ); bag.Add( element ); } ! if( Additions != null ) { DelayedAddAll( Additions ); *************** *** 82,99 **** ! public override object ReadFrom(IDataReader reader, CollectionPersister persister, object owner) { ! object elementIdentifier = persister.ReadElementIdentifier(reader, owner, session); bagIdentifiers.Add( elementIdentifier ); ! return elementIdentifier; } ! public override void WriteTo(IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder) { ! persister.WriteElement(st, entry, writeOrder, session); } ! public override void BeforeInitialize(CollectionPersister persister) { this.bag = new ArrayList(); --- 113,149 ---- ! /// <summary> ! /// ! /// </summary> ! /// <param name="reader"></param> ! /// <param name="persister"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object ReadFrom( IDataReader reader, CollectionPersister persister, object owner ) { ! object elementIdentifier = persister.ReadElementIdentifier( reader, owner, session ); bagIdentifiers.Add( elementIdentifier ); ! return elementIdentifier; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="persister"></param> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="writeOrder"></param> ! public override void WriteTo( IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder ) { ! persister.WriteElement( st, entry, writeOrder, session ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! public override void BeforeInitialize( CollectionPersister persister ) { this.bag = new ArrayList(); *************** *** 101,123 **** } ! public override bool EqualsSnapshot(IType elementType) { ! IList sn = (IList)GetSnapshot(); ! if(sn.Count!=bag.Count) return false; ! foreach(object elt in bag) { ! if ( CountOccurrences(elt, bag, elementType)!=CountOccurrences(elt, sn, elementType) ) return false; } ! return true; } ! private int CountOccurrences(object element, IList list, IType elementType) { int result = 0; ! foreach(object obj in list) { ! if ( elementType.Equals(element, obj) ) result++; } --- 151,194 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="elementType"></param> ! /// <returns></returns> ! public override bool EqualsSnapshot( IType elementType ) { ! IList sn = ( IList ) GetSnapshot(); ! if( sn.Count != bag.Count ) ! { ! return false; ! } ! foreach( object elt in bag ) { ! if( CountOccurrences( elt, bag, elementType ) != CountOccurrences( elt, sn, elementType ) ) ! { ! return false; ! } } ! return true; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="element"></param> ! /// <param name="list"></param> ! /// <param name="elementType"></param> ! /// <returns></returns> ! private int CountOccurrences( object element, IList list, IType elementType ) { int result = 0; ! foreach( object obj in list ) { ! if( elementType.Equals( element, obj ) ) ! { ! result++; ! } } *************** *** 125,155 **** } ! protected override object Snapshot(CollectionPersister persister) { ArrayList clonedList = new ArrayList( bag.Count ); ! foreach(object obj in bag) { ! clonedList.Add( persister.ElementType.DeepCopy(obj) ); } return clonedList; } ! public override ICollection GetOrphans(object snapshot) { ! IList sn = (IList)snapshot; ArrayList result = new ArrayList(); ! result.AddRange(sn); ! PersistentCollection.IdentityRemoveAll(result, bag, session); return result; } ! public override object Disassemble(CollectionPersister persister) { int length = bag.Count; ! object[] result = new object[length]; ! for(int i = 0; i<length; i++) { ! result[i] = persister.ElementType.Disassemble(bag[i], session); } --- 196,241 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! protected override object Snapshot( CollectionPersister persister ) { ArrayList clonedList = new ArrayList( bag.Count ); ! foreach( object obj in bag ) { ! clonedList.Add( persister.ElementType.DeepCopy( obj ) ); } return clonedList; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="snapshot"></param> ! /// <returns></returns> ! public override ICollection GetOrphans( object snapshot ) { ! IList sn = ( IList ) snapshot; ArrayList result = new ArrayList(); ! result.AddRange( sn ); ! PersistentCollection.IdentityRemoveAll( result, bag, session ); return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override object Disassemble( CollectionPersister persister ) { int length = bag.Count; ! object[ ] result = new object[length]; ! for( int i = 0; i < length; i++ ) { ! result[ i ] = persister.ElementType.Disassemble( bag[ i ], session ); } *************** *** 168,172 **** /// <c>many-to-many</c> so it is just recreated. /// </returns> ! public override bool NeedsRecreate(CollectionPersister persister) { return !persister.IsOneToMany; --- 254,258 ---- /// <c>many-to-many</c> so it is just recreated. /// </returns> ! public override bool NeedsRecreate( CollectionPersister persister ) { return !persister.IsOneToMany; *************** *** 178,206 **** // same element twice. It could be considered a bug // in the mapping dtd that <bag> allows <one-to-many>. ! // Anyway, here we implement <set> semantics for a // <one-to-many> <bag>! ! ! public override ICollection GetDeletes(IType elemType) { ArrayList deletes = new ArrayList(); ! IList sn = (IList)GetSnapshot(); int i = 0; ! ! foreach(object oldObject in sn) { bool found = false; ! if(bag.Count>i && elemType.Equals(oldObject, bag[i++])) { //a shortcut if its location didn't change! found = true; } ! else { //search for it ! foreach(object newObject in bag) { ! if( elemType.Equals(oldObject, newObject) ) { found = true; --- 264,297 ---- // same element twice. It could be considered a bug // in the mapping dtd that <bag> allows <one-to-many>. ! // Anyway, here we implement <set> semantics for a // <one-to-many> <bag>! ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override ICollection GetDeletes( IType elemType ) { ArrayList deletes = new ArrayList(); ! IList sn = ( IList ) GetSnapshot(); int i = 0; ! ! foreach( object oldObject in sn ) { bool found = false; ! if( bag.Count > i && elemType.Equals( oldObject, bag[ i++ ] ) ) { //a shortcut if its location didn't change! found = true; } ! else { //search for it ! foreach( object newObject in bag ) { ! if( elemType.Equals( oldObject, newObject ) ) { found = true; *************** *** 209,213 **** } } ! if(!found) deletes.Add(oldObject); } --- 300,307 ---- } } ! if( !found ) ! { ! deletes.Add( oldObject ); ! } } *************** *** 215,232 **** } ! public override bool NeedsInserting(object entry, int i, IType elemType) { ! IList sn = (IList)GetSnapshot(); ! if( sn.Count>i && elemType.Equals(sn[i], entry) ) { // a shortcut if its location didn't change return false; } ! else { //search for it ! foreach( object oldObject in sn ) { ! if( elemType.Equals(oldObject, entry) ) return false; } return true; --- 309,336 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override bool NeedsInserting( object entry, int i, IType elemType ) { ! IList sn = ( IList ) GetSnapshot(); ! if( sn.Count > i && elemType.Equals( sn[ i ], entry ) ) { // a shortcut if its location didn't change return false; } ! else { //search for it ! foreach( object oldObject in sn ) { ! if( elemType.Equals( oldObject, entry ) ) ! { ! return false; ! } } return true; *************** *** 234,245 **** } ! public override bool NeedsUpdating(object entry, int i, IType elemType) { return false; } - #region IList Members public bool IsReadOnly { --- 338,358 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override bool NeedsUpdating( object entry, int i, IType elemType ) { return false; } #region IList Members + /// <summary> + /// + /// </summary> public bool IsReadOnly { *************** *** 247,288 **** } ! public object this[int index] { ! get ! { Read(); ! return bag[index]; } set { Write(); ! bag[index] = value; } } ! public void RemoveAt(int index) { Write(); ! bag.RemoveAt(index); } ! public void Insert(int index, object value) { Write(); ! bag.Insert(index, value); } ! public void Remove(object value) { Write(); ! bag.Remove(value); } ! public bool Contains(object value) { Read(); ! return bag.Contains(value); } public void Clear() { --- 360,425 ---- } ! /// <summary> ! /// ! /// </summary> ! public object this[ int index ] { ! get ! { Read(); ! return bag[ index ]; } set { Write(); ! bag[ index ] = value; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="index"></param> ! public void RemoveAt( int index ) { Write(); ! bag.RemoveAt( index ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="index"></param> ! /// <param name="value"></param> ! public void Insert( int index, object value ) { Write(); ! bag.Insert( index, value ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! public void Remove( object value ) { Write(); ! bag.Remove( value ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public bool Contains( object value ) { Read(); ! return bag.Contains( value ); } + /// <summary> + /// + /// </summary> public void Clear() { *************** *** 291,308 **** } ! public int IndexOf(object value) { Read(); ! return bag.IndexOf(value); } ! public int Add(object value) { ! if ( !QueueAdd(value) ) { Write(); ! return bag.Add(value); } ! else { //TODO: take a look at this - I don't like it because it changes the --- 428,455 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public int IndexOf( object value ) { Read(); ! return bag.IndexOf( value ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public int Add( object value ) { ! if( !QueueAdd( value ) ) { Write(); ! return bag.Add( value ); } ! else { //TODO: take a look at this - I don't like it because it changes the *************** *** 313,316 **** --- 460,466 ---- } + /// <summary> + /// + /// </summary> public bool IsFixedSize { *************** *** 322,325 **** --- 472,478 ---- #region ICollection Members + /// <summary> + /// + /// </summary> public override bool IsSynchronized { *************** *** 327,330 **** --- 480,486 ---- } + /// <summary> + /// + /// </summary> public override int Count { *************** *** 336,348 **** } ! public override void CopyTo(Array array, int index) { Read(); ! bag.CopyTo(array, index); } public override object SyncRoot { ! get { return this; } } --- 492,512 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="array"></param> ! /// <param name="index"></param> ! public override void CopyTo( Array array, int index ) { Read(); ! bag.CopyTo( array, index ); } + /// <summary> + /// + /// </summary> public override object SyncRoot { ! get { return this; } } *************** *** 351,354 **** --- 515,522 ---- #region IEnumerable Members + /// <summary> + /// + /// </summary> + /// <returns></returns> public override IEnumerator GetEnumerator() { *************** *** 358,381 **** #endregion ! ! public override void DelayedAddAll(ICollection coll) { ! foreach(object obj in coll) { ! bag.Add(obj); } } ! public override object GetIndex(object entry, int i) { ! throw new NotSupportedException("Bags don't have indexes"); } ! public override bool EntryExists(object entry, int i) { ! return entry!=null; } } ! } --- 526,565 ---- #endregion ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="coll"></param> ! public override void DelayedAddAll( ICollection coll ) { ! foreach( object obj in coll ) { ! bag.Add( obj ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public override object GetIndex( object entry, int i ) { ! throw new NotSupportedException( "Bags don't have indexes" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public override bool EntryExists( object entry, int i ) { ! return entry != null; } } ! } \ No newline at end of file Index: Map.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Map.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Map.cs 22 Sep 2004 22:33:05 -0000 1.16 --- Map.cs 31 Dec 2004 16:36:46 -0000 1.17 *************** *** 1,9 **** using System; - using System.Data; using System.Collections; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.Collection { /// <summary> --- 1,10 ---- using System; using System.Collections; + using System.Collections.Specialized; + using System.Data; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.Collection { /// <summary> *************** *** 12,44 **** /// </summary> [Serializable] ! public class Map : PersistentCollection, IDictionary { ! protected IDictionary map; protected IDictionary mapIdentifiers; ! protected override object Snapshot(CollectionPersister persister) { Hashtable clonedMap = new Hashtable( map.Count ); ! foreach(DictionaryEntry e in map) { ! clonedMap[e.Key] = persister.ElementType.DeepCopy( e.Value ); } return clonedMap; } ! public override ICollection GetOrphans(object snapshot) { ! IDictionary sn = (IDictionary)snapshot; ! ArrayList result = new ArrayList(sn.Values.Count); ! result.AddRange(sn.Values); ! PersistentCollection.IdentityRemoveAll(result, map.Values, session); return result; } ! public override bool EqualsSnapshot(IType elementType) { ! IDictionary xmap = (IDictionary) GetSnapshot(); ! if ( xmap.Count!=this.map.Count ) return false; ! foreach(DictionaryEntry entry in map) { ! if ( elementType.IsDirty( entry.Value, xmap[entry.Key], session)) return false; } return true; --- 13,70 ---- /// </summary> [Serializable] ! public class Map : PersistentCollection, IDictionary { ! /// <summary></summary> protected IDictionary map; + /// <summary></summary> protected IDictionary mapIdentifiers; ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! protected override object Snapshot( CollectionPersister persister ) ! { Hashtable clonedMap = new Hashtable( map.Count ); ! foreach( DictionaryEntry e in map ) ! { ! clonedMap[ e.Key ] = persister.ElementType.DeepCopy( e.Value ); } return clonedMap; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="snapshot"></param> ! /// <returns></returns> ! public override ICollection GetOrphans( object snapshot ) { ! IDictionary sn = ( IDictionary ) snapshot; ! ArrayList result = new ArrayList( sn.Values.Count ); ! result.AddRange( sn.Values ); ! PersistentCollection.IdentityRemoveAll( result, map.Values, session ); return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="elementType"></param> ! /// <returns></returns> ! public override bool EqualsSnapshot( IType elementType ) { ! IDictionary xmap = ( IDictionary ) GetSnapshot(); ! if( xmap.Count != this.map.Count ) ! { ! return false; ! } ! foreach( DictionaryEntry entry in map ) ! { ! if( elementType.IsDirty( entry.Value, xmap[ entry.Key ], session ) ) ! { ! return false; ! } } return true; *************** *** 49,54 **** /// </summary> /// <param name="session">The ISession the Map should be a part of.</param> ! public Map(ISessionImplementor session) : base(session) { } ! /// <summary> /// Construct an initialized Map from its disassembled state. --- 75,82 ---- /// </summary> /// <param name="session">The ISession the Map should be a part of.</param> ! public Map( ISessionImplementor session ) : base( session ) ! { ! } ! /// <summary> /// Construct an initialized Map from its disassembled state. *************** *** 58,67 **** /// <param name="disassembled">The disassembled Map.</param> /// <param name="owner">The owner object.</param> ! public Map(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) : base(session) { ! BeforeInitialize(persister); ! object[] array = (object[]) disassembled; ! for (int i=0; i<array.Length; i+=2) ! map[ persister.IndexType.Assemble( array[i], session, owner) ] = ! persister.ElementType.Assemble( array[i+1], session, owner ); initialized = true; } --- 86,98 ---- /// <param name="disassembled">The disassembled Map.</param> /// <param name="owner">The owner object.</param> ! public Map( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) : base( session ) ! { ! BeforeInitialize( persister ); ! object[ ] array = ( object[ ] ) disassembled; ! for( int i = 0; i < array.Length; i += 2 ) ! { ! map[ persister.IndexType.Assemble( array[ i ], session, owner ) ] = ! persister.ElementType.Assemble( array[ i + 1 ], session, owner ); ! } initialized = true; } *************** *** 72,76 **** /// <param name="session">The ISession the Map should be a part of.</param> /// <param name="map">The IDictionary that contains the initial values.</param> ! public Map(ISessionImplementor session, IDictionary map) : base(session) { this.map = map; --- 103,107 ---- /// <param name="session">The ISession the Map should be a part of.</param> /// <param name="map">The IDictionary that contains the initial values.</param> ! public Map( ISessionImplementor session, IDictionary map ) : base( session ) { this.map = map; *************** *** 79,95 **** } ! ! public override void BeforeInitialize(CollectionPersister persister) { ! ! if(persister.HasOrdering) { // if this Persister has an Ordering then use the ListDictionary because // it maintains items in the Dictionary in the same order as they were // added. ! this.map = new System.Collections.Specialized.ListDictionary(); ! this.mapIdentifiers = new System.Collections.Specialized.ListDictionary(); } ! else { this.map = new Hashtable(); --- 110,128 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! public override void BeforeInitialize( CollectionPersister persister ) { ! if( persister.HasOrdering ) { // if this Persister has an Ordering then use the ListDictionary because // it maintains items in the Dictionary in the same order as they were // added. ! this.map = new ListDictionary(); ! this.mapIdentifiers = new ListDictionary(); } ! else { this.map = new Hashtable(); *************** *** 98,103 **** } ! public override int Count { ! get { Read(); return map.Count; --- 131,139 ---- } ! /// <summary></summary> ! public override int Count ! { ! get ! { Read(); return map.Count; *************** *** 105,274 **** } ! public override bool IsSynchronized { get { return false; } } ! public bool IsFixedSize { get { return false; } } ! public bool IsReadOnly { get { return false; } } ! public override object SyncRoot { get { return this; } } ! public ICollection Keys { ! get ! { Read(); ! return map.Keys; } } ! public ICollection Values { ! get ! { Read(); return map.Values; } ! } ! public override IEnumerator GetEnumerator() { Read(); return map.GetEnumerator(); ! } ! IEnumerator IEnumerable.GetEnumerator() { Read(); return map.GetEnumerator(); ! } ! IDictionaryEnumerator IDictionary.GetEnumerator() { Read(); return map.GetEnumerator(); } ! public override void CopyTo(System.Array array, int index) { Read(); ! map.CopyTo(array, index); } ! public void Add(object key, object value) { Write(); ! map.Add(key, value); } ! public bool Contains(object key) { Read(); ! return map.Contains(key); } ! public object this [object key] { ! get { Read(); ! return map[key]; } ! set { Write(); ! map[key] = value; } } ! public void Remove(object key) { Write(); ! map.Remove(key); } ! public void Clear() { Write(); map.Clear(); } ! public override void EndRead(CollectionPersister persister, object owner) { ! foreach(DictionaryEntry entry in mapIdentifiers){ object index = entry.Key; object elementIdentifier = entry.Value; ! object element = persister.ElementType.ResolveIdentifier(elementIdentifier, session, owner); ! map[index] = element; } } ! public override ICollection Elements() { return map.Values; } ! public override bool Empty { ! get { return map.Count==0; } } ! public override string ToString() { Read(); return map.ToString(); } ! public override void WriteTo(IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder) { ! DictionaryEntry e = (DictionaryEntry) entry; ! persister.WriteElement(st, e.Value, writeOrder, session); ! persister.WriteIndex(st, e.Key, writeOrder, session); } ! public override object ReadFrom(IDataReader rs, CollectionPersister persister, object owner) { //object element = persister.ReadElement(rs, owner, session); ! object elementIdentifier = persister.ReadElementIdentifier(rs, owner, session); ! object index = persister.ReadIndex(rs, session); ! map[index] = null; ! mapIdentifiers[index] = elementIdentifier; return elementIdentifier; } ! public override ICollection Entries() { ArrayList entries = new ArrayList(); ! foreach(DictionaryEntry entry in map) { ! entries.Add(entry); } return entries; } ! public override object Disassemble(CollectionPersister persister) { ! object[] result = new object[map.Count * 2]; ! int i=0; ! foreach(DictionaryEntry e in map) { ! result[i++] = persister.IndexType.Disassemble( e.Key, session ); ! result[i++] = persister.ElementType.Disassemble( e.Value, session ); } return result; } ! public override ICollection GetDeletes(IType elemType) { IList deletes = new ArrayList(); ! foreach(DictionaryEntry e in ((IDictionary)GetSnapshot())) { object key = e.Key; ! if ( e.Value!=null && map[key]==null ) deletes.Add(key); } return deletes; } ! public override bool NeedsInserting(object entry, int i, IType elemType) { ! IDictionary sn = (IDictionary) GetSnapshot(); ! DictionaryEntry e = (DictionaryEntry) entry; ! return (e.Value!=null && sn[e.Key] == null); } ! public override bool NeedsUpdating(object entry, int i, IType elemType) { ! IDictionary sn = (IDictionary) GetSnapshot(); ! DictionaryEntry e = (DictionaryEntry) entry; ! object snValue = sn[e.Key]; ! return (e.Value != null && snValue!=null && elemType.IsDirty(snValue, e.Value, session) ); } ! public override object GetIndex(object entry, int i) { ! return ((DictionaryEntry)entry).Key; } ! public override bool EntryExists(object entry, int i) { ! return ( (DictionaryEntry)entry).Value!=null; } - } ! } --- 141,446 ---- } ! /// <summary></summary> ! public override bool IsSynchronized ! { get { return false; } } ! ! /// <summary></summary> ! public bool IsFixedSize ! { get { return false; } } ! ! /// <summary></summary> ! public bool IsReadOnly ! { get { return false; } } ! ! /// <summary></summary> ! public override object SyncRoot ! { get { return this; } } ! ! /// <summary></summary> ! public ICollection Keys { ! get ! { Read(); ! return map.Keys; } } ! ! /// <summary></summary> ! public ICollection Values { ! get ! { Read(); return map.Values; } ! } ! ! /// <summary></summary> ! public override IEnumerator GetEnumerator() ! { Read(); return map.GetEnumerator(); ! } ! /// <summary></summary> ! IEnumerator IEnumerable.GetEnumerator() ! { Read(); return map.GetEnumerator(); ! } ! /// <summary></summary> ! IDictionaryEnumerator IDictionary.GetEnumerator() ! { Read(); return map.GetEnumerator(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="array"></param> ! /// <param name="index"></param> ! public override void CopyTo( Array array, int index ) ! { Read(); ! map.CopyTo( array, index ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! public void Add( object key, object value ) ! { Write(); ! map.Add( key, value ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <returns></returns> ! public bool Contains( object key ) ! { Read(); ! return map.Contains( key ); } ! /// <summary></summary> ! public object this[ object key ] ! { ! get ! { Read(); ! return map[ key ]; } ! set ! { Write(); ! map[ key ] = value; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Remove( object key ) ! { Write(); ! map.Remove( key ); } ! /// <summary></summary> ! public void Clear() ! { Write(); map.Clear(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <param name="owner"></param> ! public override void EndRead( CollectionPersister persister, object owner ) ! { ! foreach( DictionaryEntry entry in mapIdentifiers ) ! { object index = entry.Key; object elementIdentifier = entry.Value; ! object element = persister.ElementType.ResolveIdentifier( elementIdentifier, session, owner ); ! map[ index ] = element; } } ! /// <summary></summary> ! public override ICollection Elements() ! { return map.Values; } ! ! /// <summary></summary> ! public override bool Empty ! { ! get { return map.Count == 0; } } ! ! /// <summary></summary> ! public override string ToString() ! { Read(); return map.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="persister"></param> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="writeOrder"></param> ! public override void WriteTo( IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder ) ! { ! DictionaryEntry e = ( DictionaryEntry ) entry; ! persister.WriteElement( st, e.Value, writeOrder, session ); ! persister.WriteIndex( st, e.Key, writeOrder, session ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="persister"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object ReadFrom( IDataReader rs, CollectionPersister persister, object owner ) ! { //object element = persister.ReadElement(rs, owner, session); ! object elementIdentifier = persister.ReadElementIdentifier( rs, owner, session ); ! object index = persister.ReadIndex( rs, session ); ! map[ index ] = null; ! mapIdentifiers[ index ] = elementIdentifier; return elementIdentifier; } ! /// <summary></summary> ! public override ICollection Entries() ! { ArrayList entries = new ArrayList(); ! foreach( DictionaryEntry entry in map ) ! { ! entries.Add( entry ); } return entries; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override object Disassemble( CollectionPersister persister ) ! { ! object[ ] result = new object[map.Count*2]; ! int i = 0; ! foreach( DictionaryEntry e in map ) ! { ! result[ i++ ] = persister.IndexType.Disassemble( e.Key, session ); ! result[ i++ ] = persister.ElementType.Disassemble( e.Value, session ); } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override ICollection GetDeletes( IType elemType ) ! { IList deletes = new ArrayList(); ! foreach( DictionaryEntry e in ( ( IDictionary ) GetSnapshot() ) ) ! { object key = e.Key; ! if( e.Value != null && map[ key ] == null ) ! { ! deletes.Add( key ); ! } } return deletes; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override bool NeedsInserting( object entry, int i, IType elemType ) ! { ! IDictionary sn = ( IDictionary ) GetSnapshot(); ! DictionaryEntry e = ( DictionaryEntry ) entry; ! return ( e.Value != null && sn[ e.Key ] == null ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public override bool NeedsUpdating( object entry, int i, IType elemType ) ! { ! IDictionary sn = ( IDictionary ) GetSnapshot(); ! DictionaryEntry e = ( DictionaryEntry ) entry; ! object snValue = sn[ e.Key ]; ! return ( e.Value != null && snValue != null && elemType.IsDirty( snValue, e.Value, session ) ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public override object GetIndex( object entry, int i ) ! { ! return ( ( DictionaryEntry ) entry ).Key; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public override bool EntryExists( object entry, int i ) ! { ! return ( ( DictionaryEntry ) entry ).Value != null; } } ! } \ No newline at end of file Index: PersistentCollection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/PersistentCollection.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PersistentCollection.cs 29 Nov 2004 04:45:50 -0000 1.17 --- PersistentCollection.cs 31 Dec 2004 16:36:46 -0000 1.18 *************** *** 1,9 **** using System; - using System.Data; using System.Collections; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.Collection { /// <summary> --- 1,10 ---- using System; using System.Collections; + using System.Data; + using log4net; using NHibernate.Engine; using NHibernate.Type; ! namespace NHibernate.Collection { /// <summary> *************** *** 36,69 **** public abstract class PersistentCollection : ICollection { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(PersistentCollection)); ! [NonSerialized] protected ISessionImplementor session; protected bool initialized; ! [NonSerialized] private ArrayList additions; private ICollectionSnapshot collectionSnapshot; ! [NonSerialized] protected bool directlyAccessible; //careful: these methods do not initialize the collection public abstract ICollection Elements(); public abstract bool Empty { get; } ! public void Read() { ! Initialize(false); } ! private bool IsConnectedToSession ! { ! get {return session!=null && session.IsOpen;} } ! protected void Write() { ! Initialize(true); ! if (IsConnectedToSession) { ! session.Dirty(this); ! } ! else { collectionSnapshot.SetDirty(); --- 37,86 ---- public abstract class PersistentCollection : ICollection { ! private static readonly ILog log = LogManager.GetLogger( typeof( PersistentCollection ) ); ! /// <summary></summary> ! [NonSerialized] ! protected ISessionImplementor session; ! ! /// <summary></summary> protected bool initialized; ! ! [NonSerialized] ! private ArrayList additions; ! private ICollectionSnapshot collectionSnapshot; ! ! /// <summary></summary> ! [NonSerialized] ! protected bool directlyAccessible; //careful: these methods do not initialize the collection + + /// <summary></summary> public abstract ICollection Elements(); + + /// <summary></summary> public abstract bool Empty { get; } ! /// <summary></summary> ! public void Read() { ! Initialize( false ); } ! private bool IsConnectedToSession ! { ! get { return session != null && session.IsOpen; } } ! /// <summary></summary> ! protected void Write() { ! Initialize( true ); ! if( IsConnectedToSession ) { ! session.Dirty( this ); ! } ! else { collectionSnapshot.SetDirty(); *************** *** 71,95 **** } ! private bool MayQueueAdd { ! get { ! return !initialized && ! IsConnectedToSession && ! session.IsInverseCollection(this); } } ! protected bool QueueAdd(object element) { ! if ( MayQueueAdd ) { ! if (additions == null) additions = new ArrayList(10); ! additions.Add(element); ! session.Dirty(this); //needed so that we remove this collection from the JCS cache return true; ! } ! else { return false; --- 88,116 ---- } ! private bool MayQueueAdd { ! get { ! return !initialized && ! IsConnectedToSession && ! session.IsInverseCollection( this ); } } ! /// <summary></summary> ! protected bool QueueAdd( object element ) { ! if( MayQueueAdd ) { ! if( additions == null ) ! { ! additions = new ArrayList( 10 ); ! } ! additions.Add( element ); ! session.Dirty( this ); //needed so that we remove this collection from the JCS cache return true; ! } ! else { return false; *************** *** 97,109 **** } ! protected bool QueueAddAll(ICollection coll) { ! if ( MayQueueAdd ) { ! if (additions==null) additions = new ArrayList(20); ! additions.AddRange(coll); return true; ! } ! else { return false; --- 118,134 ---- } ! /// <summary></summary> ! protected bool QueueAddAll( ICollection coll ) { ! if( MayQueueAdd ) { ! if( additions == null ) ! { ! additions = new ArrayList( 20 ); ! } ! additions.AddRange( coll ); return true; ! } ! else { return false; *************** *** 112,124 **** //TODO: H2.0.3 new method ! public virtual void DelayedAddAll(ICollection coll) { ! throw new AssertionFailure("Collection does not support delayed initialization."); } // TODO: h2.0.3 synhc - I don't see AddAll in the H code... ! public virtual bool AddAll(ICollection coll) { ! throw new AssertionFailure("Collection does not support delayed initialization"); } --- 137,158 ---- //TODO: H2.0.3 new method ! /// <summary> ! /// ! /// </summary> ! /// <param name="coll"></param> ! public virtual void DelayedAddAll( ICollection coll ) { ! throw new AssertionFailure( "Collection does not support delayed initialization." ); } // TODO: h2.0.3 synhc - I don't see AddAll in the H code... ! /// <summary> ! /// ! /// </summary> ! /// <param name="coll"></param> ! /// <returns></returns> ! public virtual bool AddAll( ICollection coll ) { ! throw new AssertionFailure( "Collection does not support delayed initialization" ); } *************** *** 128,132 **** /// </summary> /// <value>An <see cref="ArrayList"/> of objects or null.</value> ! protected ArrayList Additions { get { return additions; } --- 162,166 ---- /// </summary> /// <value>An <see cref="ArrayList"/> of objects or null.</value> ! protected ArrayList Additions { get { return additions; } *************** *** 142,148 **** /// any Queued Additions. /// </remarks> ! public virtual void PostFlush() { ! if( additions!=null ) { additions.Clear(); --- 176,182 ---- /// any Queued Additions. /// </remarks> ! public virtual void PostFlush() { ! if( additions != null ) { additions.Clear(); *************** *** 150,154 **** } ! protected PersistentCollection(ISessionImplementor session) { this.session = session; --- 184,192 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! protected PersistentCollection( ISessionImplementor session ) { this.session = session; *************** *** 161,169 **** /// <param name="lazy"></param> /// <returns></returns> ! public virtual object GetInitialValue(bool lazy) { ! if ( !lazy ) { ! session.Initialize(this, false); initialized = true; } --- 199,207 ---- /// <param name="lazy"></param> /// <returns></returns> ! public virtual object GetInitialValue( bool lazy ) { ! if( !lazy ) { ! session.Initialize( this, false ); initialized = true; } *************** *** 171,175 **** } ! public virtual object GetCachedValue() { initialized = true; //TODO: only needed for query FETCH so should move out of here --- 209,214 ---- } ! /// <summary></summary> ! public virtual object GetCachedValue() { initialized = true; //TODO: only needed for query FETCH so should move out of here *************** *** 180,194 **** /// Override on some subclasses /// </summary> ! public virtual void BeginRead() { // override on some subclasses } ! /// <summary> /// It is my thoughts to have this be the portion that takes care of /// converting the Identifier to the element... /// </summary> ! [Obsolete("Should be replaced with EndRead(CollectionPersister, object) - need to verify")] ! public virtual void EndRead() { // override on some subclasses --- 219,233 ---- /// Override on some subclasses /// </summary> ! public virtual void BeginRead() { // override on some subclasses } ! /// <summary> /// It is my thoughts to have this be the portion that takes care of /// converting the Identifier to the element... /// </summary> ! [Obsolete( "Should be replaced with EndRead(CollectionPersister, object) - need to verify" )] ! public virtual void EndRead() { // override on some subclasses *************** *** 202,245 **** /// <param name="persister"></param> /// <param name="owner"></param> ! public abstract void EndRead(CollectionPersister persister, object owner) ; ! public void Initialize(bool writing) { ! if (!initialized) { ! if ( IsConnectedToSession ) { ! try { ! session.Initialize(this, writing); initialized = true; // do this after setting initialized to true or it will recurse ! if (additions!=null) { ! DelayedAddAll(additions); additions = null; } ! } ! catch (Exception e) { ! log.Error("Failed to lazily initialize a collection", e); ! throw new LazyInitializationException("Failed to lazily initialize a collection", e); } ! } ! else { ! throw new LazyInitializationException("Failed to lazily initialize a collection - no session"); } } } ! public bool UnsetSession(ISessionImplementor session) { ! if (session==this.session) { ! this.session=null; return true; } ! else { return false; --- 241,293 ---- /// <param name="persister"></param> /// <param name="owner"></param> ! public abstract void EndRead( CollectionPersister persister, object owner ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="writing"></param> ! public void Initialize( bool writing ) { ! if( !initialized ) { ! if( IsConnectedToSession ) { ! try { ! session.Initialize( this, writing ); initialized = true; // do this after setting initialized to true or it will recurse ! if( additions != null ) { ! DelayedAddAll( additions ); additions = null; } ! } ! catch( Exception e ) { ! log.Error( "Failed to lazily initialize a collection", e ); ! throw new LazyInitializationException( "Failed to lazily initialize a collection", e ); } ! } ! else { ! throw new LazyInitializationException( "Failed to lazily initialize a collection - no session" ); } } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public bool UnsetSession( ISessionImplementor session ) { ! if( session == this.session ) { ! this.session = null; return true; } ! else { return false; *************** *** 247,263 **** } ! public bool SetSession(ISessionImplementor session) { ! if (session == this.session) { return false; ! } ! else { ! if ( IsConnectedToSession ) { ! throw new HibernateException("Illegal attempt to associate a collection with two open sessions"); ! } ! else { this.session = session; --- 295,316 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public bool SetSession( ISessionImplementor session ) { ! if( session == this.session ) { return false; ! } ! else { ! if( IsConnectedToSession ) { ! throw new HibernateException( "Illegal attempt to associate a collection with two open sessions" ); ! } ! else { this.session = session; *************** *** 281,295 **** /// <c>Read()</c> or <c>Write()</c>. /// </remarks> ! public virtual bool IsDirectlyAccessible { get { return directlyAccessible; } } ! public virtual bool IsArrayHolder { get { return false; } } public abstract ICollection Entries(); ! /// <summary> /// Reads the elements Identifier from the reader. --- 334,356 ---- /// <c>Read()</c> or <c>Write()</c>. /// </remarks> ! public virtual bool IsDirectlyAccessible { get { return directlyAccessible; } } ! /// <summary> ! /// ! /// </summary> ! public virtual bool IsArrayHolder ! { get { return false; } } + /// <summary> + /// + /// </summary> + /// <returns></returns> public abstract ICollection Entries(); ! /// <summary> /// Reads the elements Identifier from the reader. *************** *** 299,312 **** /// <param name="owner">The owner of this Collection.</param> /// <returns>The value of the Identifier.</returns> ! public abstract object ReadFrom(IDataReader reader, CollectionPersister role, object owner); ! ! public abstract void WriteTo(IDbCommand st, CollectionPersister role, object entry, int i, bool writeOrder); ! public abstract object GetIndex(object entry, int i); ! public abstract void BeforeInitialize(CollectionPersister persister); ! public abstract bool EqualsSnapshot(IType elementType); ! protected abstract object Snapshot(CollectionPersister persister); ! public abstract object Disassemble(CollectionPersister persister); /// <summary> --- 360,409 ---- /// <param name="owner">The owner of this Collection.</param> /// <returns>The value of the Identifier.</returns> ! public abstract object ReadFrom( IDataReader reader, CollectionPersister role, object owner ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="role"></param> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="writeOrder"></param> ! public abstract void WriteTo( IDbCommand st, CollectionPersister role, object entry, int i, bool writeOrder ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public abstract object GetIndex( object entry, int i ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! public abstract void BeforeInitialize( CollectionPersister persister ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="elementType"></param> ! /// <returns></returns> ! public abstract bool EqualsSnapshot( IType elementType ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! protected abstract object Snapshot( CollectionPersister persister ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! public abstract object Disassemble( CollectionPersister persister ); /// <summary> *************** *** 320,331 **** /// need to be recreated. /// </returns> ! public virtual bool NeedsRecreate(CollectionPersister persister) { return false; } ! public object GetSnapshot(CollectionPersister persister) { ! return (persister==null) ? null : Snapshot(persister); } --- 417,433 ---- /// need to be recreated. /// </returns> ! public virtual bool NeedsRecreate( CollectionPersister persister ) { return false; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persister"></param> ! /// <returns></returns> ! public object GetSnapshot( CollectionPersister persister ) { ! return ( persister == null ) ? null : Snapshot( persister ); } *************** *** 334,368 **** /// </summary> /// TODO: H2.0.3 declares this as final ! public void ForceLoad() { Read(); } ! public abstract bool EntryExists(object entry, int i); ! public abstract bool NeedsInserting(object entry, int i, IType elemType); ! public abstract bool NeedsUpdating(object entry, int i, IType elemType); ! public abstract ICollection GetDeletes(IType elemType); ! protected object GetSnapshot() { ! return session.GetSnapshot(this); } ! public bool WasInitialized { get { return initialized; } } ! public bool HasQueuedAdds { ! get { return additions!= null; } } ! public ICollection QueuedAddsCollection { get { return additions; } } ! public virtual ICollectionSnapshot CollectionSnapshot { get { return collectionSnapshot; } --- 436,504 ---- /// </summary> /// TODO: H2.0.3 declares this as final ! public void ForceLoad() { Read(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <returns></returns> ! public abstract bool EntryExists( object entry, int i ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public abstract bool NeedsInserting( object entry, int i, IType elemType ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="entry"></param> ! /// <param name="i"></param> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public abstract bool NeedsUpdating( object entry, int i, IType elemType ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="elemType"></param> ! /// <returns></returns> ! public abstract ICollection GetDeletes( IType elemType ); ! ! ! /// <summary></summary> ! protected object GetSnapshot() { ! return session.GetSnapshot( this ); } ! /// <summary></summary> ! public bool WasInitialized { get { return initialized; } } ! /// <summary></summary> ! public bool HasQueuedAdds { ! get { return additions != null; } } ! /// <summary></summary> ! public ICollection QueuedAddsCollection { get { return additions; } } ! /// <summary></summary> ! public virtual ICollectionSnapshot CollectionSnapshot { get { return collectionSnapshot; } *************** *** 381,404 **** /// </param> /// <param name="i">The index of the Entry while enumerating through the Collection.</param> ! public virtual void PreInsert(CollectionPersister persister, object entry, int i) {} ! ! public abstract ICollection GetOrphans(object snapshot); ! public static void IdentityRemoveAll(IList list, ICollection collection, ISessionImplementor session) { IEnumerator enumer = collection.GetEnumerator(); ! while(enumer.MoveNext()) PersistentCollection.IdentityRemove(list, enumer.Current, session); } ! public static void IdentityRemove(IList list, object obj, ISessionImplementor session) { int indexOfEntityToRemove = -1; ! if(session.IsSaved(obj)) { ! object idOfCurrent = session.GetEntityIdentifierIfNotUnsaved(obj); ! for(int i = 0; i < list.Count; i++) { ! object idOfOld = session.GetEntityIdentifierIfNotUnsaved(list[i]); ! if(idOfCurrent.Equals(idOfOld) ) { // in hibernate this used the Iterator to remove the item - since in .NET --- 517,563 ---- /// </param> /// <param name="i">The index of the Entry while enumerating through the Collection.</param> ! public virtual void PreInsert( CollectionPersister persister, object entry, int i ) ! { ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="snapshot"></param> ! /// <returns></returns> ! public abstract ICollection GetOrphans( object snapshot ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="list"></param> ! /// <param name="collection"></param> ! /// <param name="session"></param> ! public static void IdentityRemoveAll( IList list, ICollection collection, ISessionImplementor session ) { IEnumerator enumer = collection.GetEnumerator(); ! while( enumer.MoveNext() ) ! { ! PersistentCollection.IdentityRemove( list, enumer.Current, session ); ! } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="list"></param> ! /// <param name="obj"></param> ! /// <param name="session"></param> ! public static void IdentityRemove( IList list, object obj, ISessionImplementor session ) { int indexOfEntityToRemove = -1; ! if( session.IsSaved( obj ) ) { ! object idOfCurrent = session.GetEntityIdentifierIfNotUnsaved( obj ); ! for( int i = 0; i < list.Count; i++ ) { ! object idOfOld = session.GetEntityIdentifierIfNotUnsaved( list[ i ] ); ! if( idOfCurrent.Equals( idOfOld ) ) { // in hibernate this used the Iterator to remove the item - since in .NET *************** *** 409,417 **** } ! if(indexOfEntityToRemove != -1) list.RemoveAt(indexOfEntityToRemove); } } - #region - Hibernate Collection Proxy Classes --- 568,578 ---- } ! if( indexOfEntityToRemove != -1 ) ! { ! list.RemoveAt( indexOfEntityToRemove ); ! } } } #region - Hibernate Collection Proxy Classes *************** *** 421,426 **** * Hibernate needs to be made aware of. If .net changes their collection interfaces * then we can readd these back in. ! */ ! #endregion --- 582,586 ---- * Hibernate needs to be made aware of. If .net changes their collection interfaces * then we can readd these back in. ! */ #endregion *************** *** 428,447 **** #region ICollection Members ! public abstract bool IsSynchronized ! { ! get; ! } ! public abstract int Count ! { ! get; ! } ! public abstract void CopyTo(Array array, int index); ! public abstract object SyncRoot ! { ! get; ! } #endregion --- 588,606 ---- #region ICollection Members ! /// <summary></summary> ! public abstract bool IsSynchronized { get; } ! /// <summary></summary> ! public abstract int Count { get; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="array"></param> ! /// <param name="index"></param> ! public abstract void CopyTo( Array array, int index ); ! /// <summary></summary> ! public abstract object SyncRoot { get; } #endregion *************** *** 449,452 **** --- 608,612 ---- #region IEnumerable Members + /// <summary></summary> public abstract IEnumerator GetEnumerator(); *************** *** 454,459 **** } - ! ! } --- 614,617 ---- } ! } \ No newline at end of file Index: List.cs =======... [truncated message content] |
From: Kevin W. <kev...@us...> - 2004-12-31 15:54:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27563 Modified Files: Configuration.cs Environment.cs Mappings.cs Settings.cs SettingsFactory.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: Mappings.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Mappings.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Mappings.cs 16 Dec 2004 04:54:07 -0000 1.10 --- Mappings.cs 31 Dec 2004 15:54:08 -0000 1.11 *************** *** 1,9 **** - using System; using System.Collections; ! using NHibernate.Cache; using NHibernate.Mapping; ! namespace NHibernate.Cfg { /// <summary> --- 1,8 ---- using System.Collections; ! using log4net; using NHibernate.Cache; using NHibernate.Mapping; ! namespace NHibernate.Cfg { /// <summary> *************** *** 11,17 **** /// </summary> /// <remarks>Represents a single <c><hibernate-mapping></c> element.</remarks> ! public class Mappings { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Mappings)); private IDictionary classes; --- 10,16 ---- /// </summary> /// <remarks>Represents a single <c><hibernate-mapping></c> element.</remarks> ! public class Mappings { ! private static readonly ILog log = LogManager.GetLogger( typeof( Mappings ) ); private IDictionary classes; *************** *** 27,31 **** private IDictionary caches; ! internal Mappings(IDictionary classes, IDictionary collections, IDictionary tables, IDictionary queries, IDictionary imports, IDictionary caches, IList secondPasses) { this.classes = classes; --- 26,40 ---- private IDictionary caches; ! /// <summary> ! /// ! /// </summary> ! /// <param name="classes"></param> ! /// <param name="collections"></param> ! /// <param name="tables"></param> ! /// <param name="queries"></param> ! /// <param name="imports"></param> ! /// <param name="caches"></param> ! /// <param name="secondPasses"></param> ! internal Mappings( IDictionary classes, IDictionary collections, IDictionary tables, IDictionary queries, IDictionary imports, IDictionary caches, IList secondPasses ) { this.classes = classes; *************** *** 44,51 **** /// <param name="cache">The <see cref="ICacheConcurrencyStrategy"/> to use for caching.</param> /// <exception cref="MappingException">Thrown when <c>name</c> already has a <c>cache</c> associated with it.</exception> ! public void AddCache(string name, ICacheConcurrencyStrategy cache) { object old = caches[ name ]; ! if( old!=null ) { throw new MappingException( "duplicate cache region" ); --- 53,60 ---- /// <param name="cache">The <see cref="ICacheConcurrencyStrategy"/> to use for caching.</param> /// <exception cref="MappingException">Thrown when <c>name</c> already has a <c>cache</c> associated with it.</exception> ! public void AddCache( string name, ICacheConcurrencyStrategy cache ) { object old = caches[ name ]; ! if( old != null ) { throw new MappingException( "duplicate cache region" ); *************** *** 54,79 **** } ! public void AddClass(PersistentClass persistentClass) { ! object old = classes[persistentClass.PersistentClazz]; ! if (old!=null) log.Warn ( "duplicate class mapping: " + persistentClass.PersistentClazz.Name ); ! classes[persistentClass.PersistentClazz] = persistentClass; } ! public void AddCollection(Mapping.Collection collection) { ! object old = collections[collection.Role]; ! if (old!=null) log.Warn ( "duplicate collection role: " + collection.Role ); ! collections[collection.Role] = collection; } ! public PersistentClass GetClass(System.Type type) { ! return (PersistentClass) classes[type]; } ! public Mapping.Collection GetCollection(string role) { ! return (Mapping.Collection) collections[role]; } --- 63,112 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentClass"></param> ! public void AddClass( PersistentClass persistentClass ) { ! object old = classes[ persistentClass.PersistentClazz ]; ! if( old != null ) ! { ! log.Warn( "duplicate class mapping: " + persistentClass.PersistentClazz.Name ); ! } ! classes[ persistentClass.PersistentClazz ] = persistentClass; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="collection"></param> ! public void AddCollection( Mapping.Collection collection ) { ! object old = collections[ collection.Role ]; ! if( old != null ) ! { ! log.Warn( "duplicate collection role: " + collection.Role ); ! } ! collections[ collection.Role ] = collection; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> ! public PersistentClass GetClass( System.Type type ) { ! return ( PersistentClass ) classes[ type ]; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! /// <returns></returns> ! public Mapping.Collection GetCollection( string role ) { ! return ( Mapping.Collection ) collections[ role ]; } *************** *** 85,89 **** /// <param name="rename">The new name to use in Hql for the class.</param> /// <exception cref="MappingException">Thrown when the rename already identifies another Class.</exception> ! public void AddImport(string className, string rename) { // if the imports dictionary already contains the rename, then make sure --- 118,122 ---- /// <param name="rename">The new name to use in Hql for the class.</param> /// <exception cref="MappingException">Thrown when the rename already identifies another Class.</exception> ! public void AddImport( string className, string rename ) { // if the imports dictionary already contains the rename, then make sure *************** *** 91,123 **** // then we probably have 2 classes with the same name in a different namespace. To // prevent this error one of the classes needs to have the attribute " ! if( imports.Contains(rename) && (string)imports[rename]!=className ) { ! throw new MappingException("duplicate import: " + rename); } ! imports[rename] = className; } ! public Table AddTable(string schema, string name) { string key = schema != null ? schema + "." + name : name; ! Table table = (Table) tables[key]; ! if (table==null) { table = new Table(); table.Name = name; table.Schema = schema; ! tables[key] = table; } return table; } ! public Table GetTable(string schema, string name) { string key = schema != null ? schema + "." + name : name; ! return (Table) tables[key]; } ! public string SchemaName { get { return schemaName; } --- 124,169 ---- // then we probably have 2 classes with the same name in a different namespace. To // prevent this error one of the classes needs to have the attribute " ! if( imports.Contains( rename ) && ( string ) imports[ rename ] != className ) { ! throw new MappingException( "duplicate import: " + rename ); } ! imports[ rename ] = className; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="schema"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public Table AddTable( string schema, string name ) { string key = schema != null ? schema + "." + name : name; ! Table table = ( Table ) tables[ key ]; ! if( table == null ) { table = new Table(); table.Name = name; table.Schema = schema; ! tables[ key ] = table; } return table; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="schema"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public Table GetTable( string schema, string name ) { string key = schema != null ? schema + "." + name : name; ! return ( Table ) tables[ key ]; } ! /// <summary></summary> ! public string SchemaName { get { return schemaName; } *************** *** 125,154 **** } ! public string DefaultCascade { ! get { return defaultCascade; } set { defaultCascade = value; } } ! public string DefaultAccess { get { return defaultAccess; } set { defaultAccess = value; } } ! public void AddQuery(string name, string query) { ! object old = queries[name]; ! if (old!=null) log.Warn("duplicate query name: " + name); ! queries[name] = query; } ! public string GetQuery(string name) { ! return (string) queries[name]; } ! internal void AddSecondPass(Binder.SecondPass sp) { ! secondPasses.Add(sp); } --- 171,220 ---- } ! /// <summary></summary> ! public string DefaultCascade { ! get { return defaultCascade; } set { defaultCascade = value; } } ! /// <summary></summary> ! public string DefaultAccess { get { return defaultAccess; } set { defaultAccess = value; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="name"></param> ! /// <param name="query"></param> ! public void AddQuery( string name, string query ) { ! object old = queries[ name ]; ! if( old != null ) ! { ! log.Warn( "duplicate query name: " + name ); ! } ! queries[ name ] = query; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="name"></param> ! /// <returns></returns> ! public string GetQuery( string name ) { ! return ( string ) queries[ name ]; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sp"></param> ! internal void AddSecondPass( Binder.SecondPass sp ) { ! secondPasses.Add( sp ); } *************** *** 165,173 **** /// name of <c>MyClass</c>. /// </remarks> ! public bool IsAutoImport { ! get { return autoImport; } set { autoImport = value; } } } ! } --- 231,239 ---- /// name of <c>MyClass</c>. /// </remarks> ! public bool IsAutoImport { ! get { return autoImport; } set { autoImport = value; } } } ! } \ No newline at end of file Index: Environment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Environment.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Environment.cs 21 Dec 2004 20:43:41 -0000 1.21 --- Environment.cs 31 Dec 2004 15:54:08 -0000 1.22 *************** *** 1,11 **** - using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; ! using System.Xml; ! ! using NHibernate.Util; ! namespace NHibernate.Cfg { /// <summary> --- 1,9 ---- using System.Collections; using System.Collections.Specialized; using System.Configuration; ! using log4net; ! using log4net.Config; ! namespace NHibernate.Cfg { /// <summary> *************** *** 26,69 **** /// </list> /// </remarks> ! public class Environment { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(Environment)); private static IDictionary properties = new Hashtable(); ! public const string ConnectionProvider = "hibernate.connection.provider"; public const string ConnectionDriver = "hibernate.connection.driver_class"; public const string ConnectionString = "hibernate.connection.connection_string"; public const string Isolation = "hibernate.connection.isolation"; public const string SessionFactoryName = "hibernate.session_factory_name"; public const string Dialect = "hibernate.dialect"; public const string DefaultSchema = "hibernate.default_schema"; public const string ShowSql = "hibernate.show_sql"; public const string OuterJoin = "hibernate.use_outer_join"; public const string OutputStylesheet = "hibernate.xml.output_stylesheet"; public const string TransactionStrategy = "hibernate.transaction.factory_class"; public const string TransactionManagerStrategy = "hibernate.transaction.manager_lookup_class"; public const string QuerySubstitutions = "hibernate.query.substitutions"; public const string QueryImports = "hibernate.query.imports"; public const string CacheProvider = "hibernate.cache.provider_class"; public const string PrepareSql = "hibernate.prepare_sql"; ! static Environment() { ! log4net.Config.DOMConfigurator.Configure(); ! NameValueCollection props = System.Configuration.ConfigurationSettings.GetConfig("nhibernate") as NameValueCollection; ! if (props==null) { ! log.Debug("no hibernate settings in app.config/web.config were found"); return; } ! ! foreach(string key in props.Keys) { ! properties[key] = props[key]; } ! } --- 24,84 ---- /// </list> /// </remarks> ! public class Environment { ! private static readonly ILog log = LogManager.GetLogger( typeof( Environment ) ); private static IDictionary properties = new Hashtable(); ! ! /// <summary></summary> public const string ConnectionProvider = "hibernate.connection.provider"; + /// <summary></summary> public const string ConnectionDriver = "hibernate.connection.driver_class"; + /// <summary></summary> public const string ConnectionString = "hibernate.connection.connection_string"; + /// <summary></summary> public const string Isolation = "hibernate.connection.isolation"; + /// <summary></summary> public const string SessionFactoryName = "hibernate.session_factory_name"; + /// <summary></summary> public const string Dialect = "hibernate.dialect"; + /// <summary></summary> public const string DefaultSchema = "hibernate.default_schema"; + /// <summary></summary> public const string ShowSql = "hibernate.show_sql"; + /// <summary></summary> public const string OuterJoin = "hibernate.use_outer_join"; + /// <summary></summary> public const string OutputStylesheet = "hibernate.xml.output_stylesheet"; + /// <summary></summary> public const string TransactionStrategy = "hibernate.transaction.factory_class"; + /// <summary></summary> public const string TransactionManagerStrategy = "hibernate.transaction.manager_lookup_class"; + /// <summary></summary> public const string QuerySubstitutions = "hibernate.query.substitutions"; + /// <summary></summary> public const string QueryImports = "hibernate.query.imports"; + /// <summary></summary> public const string CacheProvider = "hibernate.cache.provider_class"; + /// <summary></summary> public const string PrepareSql = "hibernate.prepare_sql"; ! /// <summary></summary> ! static Environment() { ! DOMConfigurator.Configure(); ! NameValueCollection props = ConfigurationSettings.GetConfig( "nhibernate" ) as NameValueCollection; ! if( props == null ) { ! log.Debug( "no hibernate settings in app.config/web.config were found" ); return; } ! ! foreach( string key in props.Keys ) { ! properties[ key ] = props[ key ]; } ! } *************** *** 74,85 **** /// This is the replacement for hibernate.properties /// </remarks> ! public static IDictionary Properties { ! get ! { ! IDictionary copy = new Hashtable(properties.Count); ! foreach(DictionaryEntry de in properties) { ! copy[de.Key] = de.Value; } return copy; --- 89,100 ---- /// This is the replacement for hibernate.properties /// </remarks> ! public static IDictionary Properties { ! get ! { ! IDictionary copy = new Hashtable( properties.Count ); ! foreach( DictionaryEntry de in properties ) { ! copy[ de.Key ] = de.Value; } return copy; *************** *** 87,94 **** } ! public static bool UseStreamsForBinary { ! get { return true; } } } ! } --- 102,110 ---- } ! /// <summary></summary> ! public static bool UseStreamsForBinary { ! get { return true; } } } ! } \ No newline at end of file Index: Configuration.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Configuration.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Configuration.cs 16 Dec 2004 04:54:07 -0000 1.25 --- Configuration.cs 31 Dec 2004 15:54:07 -0000 1.26 *************** *** 5,11 **** using System.Xml; using System.Xml.Schema; ! using NHibernate.Cache; - using NHibernate.Dialect; using NHibernate.Engine; using NHibernate.Id; --- 5,10 ---- using System.Xml; using System.Xml.Schema; [...1500 lines suppressed...] /// <returns></returns> ! public IDictionary Imports { ! get ! { ! return imports; ! } } } ! } --- 900,907 ---- /// </summary> /// <returns></returns> ! public IDictionary Imports { ! get { return imports; } } } ! } \ No newline at end of file Index: Settings.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Settings.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Settings.cs 21 Dec 2004 20:43:41 -0000 1.3 --- Settings.cs 31 Dec 2004 15:54:08 -0000 1.4 *************** *** 1,9 **** - using System; using System.Collections; using System.Data; - using NHibernate.Cache; using NHibernate.Connection; - using NHibernate.Dialect; using NHibernate.Transaction; --- 1,6 ---- *************** *** 26,30 **** private string _defaultSchemaName; private bool _prepareSql; ! public bool IsShowSqlEnabled { --- 23,28 ---- private string _defaultSchemaName; private bool _prepareSql; ! ! /// <summary></summary> public bool IsShowSqlEnabled { *************** *** 33,36 **** --- 31,35 ---- } + /// <summary></summary> public bool IsOuterJoinFetchEnabled { *************** *** 39,42 **** --- 38,42 ---- } + /// <summary></summary> public IDictionary QuerySubstitutions { *************** *** 45,48 **** --- 45,49 ---- } + /// <summary></summary> public Dialect.Dialect Dialect { *************** *** 51,54 **** --- 52,56 ---- } + /// <summary></summary> public string DefaultSchemaName { *************** *** 57,60 **** --- 59,63 ---- } + /// <summary></summary> public IsolationLevel IsolationLevel { *************** *** 62,66 **** set { _isolationLevel = value; } } ! public IConnectionProvider ConnectionProvider { --- 65,70 ---- set { _isolationLevel = value; } } ! ! /// <summary></summary> public IConnectionProvider ConnectionProvider { *************** *** 69,72 **** --- 73,77 ---- } + /// <summary></summary> public ITransactionFactory TransactionFactory { *************** *** 75,78 **** --- 80,84 ---- } + /// <summary></summary> public string SessionFactoryName { *************** *** 81,84 **** --- 87,91 ---- } + /// <summary></summary> public ICacheProvider CacheProvider { *************** *** 87,90 **** --- 94,98 ---- } + /// <summary></summary> public bool PrepareSql { *************** *** 93,95 **** } } ! } --- 101,103 ---- } } ! } \ No newline at end of file Index: SettingsFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/SettingsFactory.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SettingsFactory.cs 21 Dec 2004 20:43:41 -0000 1.2 --- SettingsFactory.cs 31 Dec 2004 15:54:08 -0000 1.3 *************** *** 3,7 **** using System.Data; using System.Text; ! using NHibernate.Cache; using NHibernate.Connection; --- 3,7 ---- using System.Data; using System.Text; ! using log4net; using NHibernate.Cache; using NHibernate.Connection; *************** *** 17,21 **** public sealed class SettingsFactory { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(SettingsFactory) ); private SettingsFactory() --- 17,21 ---- public sealed class SettingsFactory { ! private static readonly ILog log = LogManager.GetLogger( typeof( SettingsFactory ) ); private SettingsFactory() *************** *** 24,48 **** } ! public static Settings BuildSettings(IDictionary properties) { Settings settings = new Settings(); Dialect.Dialect dialect = null; ! try { dialect = Dialect.Dialect.GetDialect( properties ); IDictionary temp = new Hashtable(); ! ! foreach( DictionaryEntry de in dialect.DefaultProperties ) { temp[ de.Key ] = de.Value; } ! foreach( DictionaryEntry de in properties ) { temp[ de.Key ] = de.Value; } properties = temp; ! } ! catch( HibernateException he ) { log.Warn( "No dialect set - using GenericDialect: " + he.Message ); --- 24,53 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="properties"></param> ! /// <returns></returns> ! public static Settings BuildSettings( IDictionary properties ) { Settings settings = new Settings(); Dialect.Dialect dialect = null; ! try { dialect = Dialect.Dialect.GetDialect( properties ); IDictionary temp = new Hashtable(); ! ! foreach( DictionaryEntry de in dialect.DefaultProperties ) { temp[ de.Key ] = de.Value; } ! foreach( DictionaryEntry de in properties ) { temp[ de.Key ] = de.Value; } properties = temp; ! } ! catch( HibernateException he ) { log.Warn( "No dialect set - using GenericDialect: " + he.Message ); *************** *** 50,95 **** } ! ! bool useOuterJoin = PropertiesHelper.GetBoolean(Cfg.Environment.OuterJoin, properties, true); log.Info( "use outer join fetching: " + useOuterJoin ); ! IConnectionProvider connectionProvider = ConnectionProviderFactory.NewConnectionProvider(properties); ITransactionFactory transactionFactory = new TransactionFactory(); //Transaction BuildTransactionFactory(properties); ! string isolationString = PropertiesHelper.GetString( Cfg.Environment.Isolation, properties, String.Empty ); IsolationLevel isolation = IsolationLevel.Unspecified; ! if( isolationString.Length > 0) { ! try { ! isolation = (IsolationLevel)Enum.Parse( typeof(IsolationLevel), isolationString ); log.Info( "Using Isolation Level: " + isolation.ToString() ); } ! catch( ArgumentException ae ) { log.Error( "error configuring IsolationLevel " + isolationString, ae ); ! throw new HibernateException( "The isolation level of " + isolationString + " is not a valid IsolationLevel. Please " + ! "use one of the Member Names from the IsolationLevel.", ae ); } } ! string defaultSchema = properties[Cfg.Environment.DefaultSchema] as string; ! if ( defaultSchema!=null) log.Info ("Default schema set to: " + defaultSchema); ! ! bool showSql = PropertiesHelper.GetBoolean( Cfg.Environment.ShowSql, properties, false ); ! if (showSql) log.Info("echoing all SQL to stdout"); // queries: ! IDictionary querySubstitutions = PropertiesHelper.ToDictionary( Cfg.Environment.QuerySubstitutions, " ,=;:\n\t\r\f", properties ); ! if ( log.IsInfoEnabled ) { ! StringBuilder sb = new StringBuilder("Query language substitutions: "); ! foreach(DictionaryEntry entry in querySubstitutions) { ! sb.AppendFormat("{0}={1};", entry.Key, entry.Value); } ! log.Info(sb.ToString()); } --- 55,106 ---- } ! ! bool useOuterJoin = PropertiesHelper.GetBoolean( Environment.OuterJoin, properties, true ); log.Info( "use outer join fetching: " + useOuterJoin ); ! IConnectionProvider connectionProvider = ConnectionProviderFactory.NewConnectionProvider( properties ); ITransactionFactory transactionFactory = new TransactionFactory(); //Transaction BuildTransactionFactory(properties); ! string isolationString = PropertiesHelper.GetString( Environment.Isolation, properties, String.Empty ); IsolationLevel isolation = IsolationLevel.Unspecified; ! if( isolationString.Length > 0 ) { ! try { ! isolation = ( IsolationLevel ) Enum.Parse( typeof( IsolationLevel ), isolationString ); log.Info( "Using Isolation Level: " + isolation.ToString() ); } ! catch( ArgumentException ae ) { log.Error( "error configuring IsolationLevel " + isolationString, ae ); ! throw new HibernateException( "The isolation level of " + isolationString + " is not a valid IsolationLevel. Please " + ! "use one of the Member Names from the IsolationLevel.", ae ); } } ! string defaultSchema = properties[ Environment.DefaultSchema ] as string; ! if( defaultSchema != null ) ! { ! log.Info( "Default schema set to: " + defaultSchema ); ! } ! ! bool showSql = PropertiesHelper.GetBoolean( Environment.ShowSql, properties, false ); ! if( showSql ) ! { ! log.Info( "echoing all SQL to stdout" ); ! } // queries: ! IDictionary querySubstitutions = PropertiesHelper.ToDictionary( Environment.QuerySubstitutions, " ,=;:\n\t\r\f", properties ); ! if( log.IsInfoEnabled ) { ! StringBuilder sb = new StringBuilder( "Query language substitutions: " ); ! foreach( DictionaryEntry entry in querySubstitutions ) { ! sb.AppendFormat( "{0}={1};", entry.Key, entry.Value ); } ! log.Info( sb.ToString() ); } *************** *** 97,112 **** ICacheProvider cacheProvider = null; log.Info( "cache provider: " + cacheClassName ); ! try { ! cacheProvider = (ICacheProvider) Activator.CreateInstance( ReflectHelper.ClassForName( cacheClassName ) ); } ! catch( Exception e ) { throw new HibernateException( "could not instantiate CacheProvider: " + cacheClassName, e ); } ! bool prepareSql = PropertiesHelper.GetBoolean( Environment.PrepareSql, properties, true ); ! string sessionFactoryName = (string) properties[ Cfg.Environment.SessionFactoryName ]; settings.DefaultSchemaName = defaultSchema; --- 108,123 ---- ICacheProvider cacheProvider = null; log.Info( "cache provider: " + cacheClassName ); ! try { ! cacheProvider = ( ICacheProvider ) Activator.CreateInstance( ReflectHelper.ClassForName( cacheClassName ) ); } ! catch( Exception e ) { throw new HibernateException( "could not instantiate CacheProvider: " + cacheClassName, e ); } ! bool prepareSql = PropertiesHelper.GetBoolean( Environment.PrepareSql, properties, true ); ! string sessionFactoryName = ( string ) properties[ Environment.SessionFactoryName ]; settings.DefaultSchemaName = defaultSchema; *************** *** 124,130 **** return settings; ! } } ! } --- 135,141 ---- return settings; ! } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 15:38:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21261 Modified Files: IMapping.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IMapping.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IMapping.cs 20 Feb 2003 21:52:07 -0000 1.2 --- IMapping.cs 31 Dec 2004 15:38:35 -0000 1.3 *************** *** 1,12 **** - using System; using NHibernate.Type; ! namespace NHibernate.Engine { /// <summary> /// Defines operations common to "compiled" mappings (ie. <c>SessionFactory</c>) and /// "uncompiled" mappings (ie <c>Configuration</c> that are used by implementors of <c>IType</c> /// </summary> ! public interface IMapping { ! IType GetIdentifierType(System.Type persistentType); } ! } --- 1,18 ---- using NHibernate.Type; ! namespace NHibernate.Engine ! { /// <summary> /// Defines operations common to "compiled" mappings (ie. <c>SessionFactory</c>) and /// "uncompiled" mappings (ie <c>Configuration</c> that are used by implementors of <c>IType</c> /// </summary> ! public interface IMapping ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentType"></param> ! /// <returns></returns> ! IType GetIdentifierType( System.Type persistentType ); } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 15:38:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21158 Modified Files: IInterceptor.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IInterceptor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IInterceptor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IInterceptor.cs 14 Mar 2003 22:09:17 -0000 1.3 --- IInterceptor.cs 31 Dec 2004 15:38:09 -0000 1.4 *************** *** 1,7 **** - using System; using System.Collections; using NHibernate.Type; ! namespace NHibernate { /// <summary> /// Allows user code to inspect and/or change property values before they are written and after they --- 1,7 ---- using System.Collections; using NHibernate.Type; ! namespace NHibernate ! { /// <summary> /// Allows user code to inspect and/or change property values before they are written and after they *************** *** 20,28 **** /// </para> /// </remarks> ! public interface IInterceptor { ! /// <summary> /// Called just before an object is initialized /// </summary> /// <remarks> /// The interceptor may change the <c>state</c>, which will be propagated to the persistent --- 20,33 ---- /// </para> /// </remarks> ! public interface IInterceptor ! { /// <summary> /// Called just before an object is initialized /// </summary> + /// <param name="entity"></param> + /// <param name="id"></param> + /// <param name="propertyNames"></param> + /// <param name="state"></param> + /// <param name="types"></param> /// <remarks> /// The interceptor may change the <c>state</c>, which will be propagated to the persistent *************** *** 30,38 **** /// uninitialized instance of the class.</remarks> /// <returns><c>true</c> if the user modified the <c>state</c> in any way</returns> ! bool OnLoad(object entity, object id, object[] state, string[] propertyNames, IType[] types); /// <summary> /// Called when an object is detected to be dirty, during a flush. /// </summary> /// <remarks> /// The interceptor may modify the detected <c>currentState</c>, which will be propagated to --- 35,49 ---- /// uninitialized instance of the class.</remarks> /// <returns><c>true</c> if the user modified the <c>state</c> in any way</returns> ! bool OnLoad( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ); /// <summary> /// Called when an object is detected to be dirty, during a flush. /// </summary> + /// <param name="currentState"></param> + /// <param name="entity"></param> + /// <param name="id"></param> + /// <param name="previousState"></param> + /// <param name="propertyNames"></param> + /// <param name="types"></param> /// <remarks> /// The interceptor may modify the detected <c>currentState</c>, which will be propagated to *************** *** 43,51 **** /// </remarks> /// <returns><c>true</c> if the user modified the <c>currentState</c> in any way</returns> ! bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types); /// <summary> /// Called before an object is saved /// </summary> /// <remarks> /// The interceptor may modify the <c>state</c>, which will be used for the SQL <c>INSERT</c> --- 54,67 ---- /// </remarks> /// <returns><c>true</c> if the user modified the <c>currentState</c> in any way</returns> ! bool OnFlushDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ); /// <summary> /// Called before an object is saved /// </summary> + /// <param name="entity"></param> + /// <param name="id"></param> + /// <param name="propertyNames"></param> + /// <param name="state"></param> + /// <param name="types"></param> /// <remarks> /// The interceptor may modify the <c>state</c>, which will be used for the SQL <c>INSERT</c> *************** *** 53,65 **** /// </remarks> /// <returns><c>true</c> if the user modified the <c>state</c> in any way</returns> ! bool OnSave(object entity, object id, object[] state, string[] propertyNames, IType[] types); /// <summary> /// Called before an object is deleted /// </summary> /// <remarks> /// It is not recommended that the interceptor modify the <c>state</c>. /// </remarks> ! void OnDelete(object entity, object id, object[] state, string[] propertyNames, IType[] types); /// <summary> --- 69,86 ---- /// </remarks> /// <returns><c>true</c> if the user modified the <c>state</c> in any way</returns> ! bool OnSave( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ); /// <summary> /// Called before an object is deleted /// </summary> + /// <param name="entity"></param> + /// <param name="id"></param> + /// <param name="propertyNames"></param> + /// <param name="state"></param> + /// <param name="types"></param> /// <remarks> /// It is not recommended that the interceptor modify the <c>state</c>. /// </remarks> ! void OnDelete( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ); /// <summary> *************** *** 67,71 **** /// </summary> /// <param name="entities">The entities</param> ! void PreFlush(ICollection entities); /// <summary> --- 88,92 ---- /// </summary> /// <param name="entities">The entities</param> ! void PreFlush( ICollection entities ); /// <summary> *************** *** 74,78 **** /// </summary> /// <param name="entities">The entitites</param> ! void PostFlush(ICollection entities); /// <summary> --- 95,99 ---- /// </summary> /// <param name="entities">The entitites</param> ! void PostFlush( ICollection entities ); /// <summary> *************** *** 89,93 **** /// <param name="entity">A transient entity</param> /// <returns></returns> ! object IsUnsaved(object entity); /// <summary> --- 110,114 ---- /// <param name="entity">A transient entity</param> /// <returns></returns> ! object IsUnsaved( object entity ); /// <summary> *************** *** 102,108 **** /// </remarks> /// <param name="entity">A persistent entity</param> /// <returns>An array of dirty property indicies or <c>null</c> to choose default behavior</returns> ! int[] FindDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types); ! /// <summary> /// Instantiate the entity class. Return <c>null</c> to indicate that Hibernate should use the default --- 123,134 ---- /// </remarks> /// <param name="entity">A persistent entity</param> + /// <param name="currentState"></param> + /// <param name="id"></param> + /// <param name="previousState"></param> + /// <param name="propertyNames"></param> + /// <param name="types"></param> /// <returns>An array of dirty property indicies or <c>null</c> to choose default behavior</returns> ! int[ ] FindDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ); ! /// <summary> /// Instantiate the entity class. Return <c>null</c> to indicate that Hibernate should use the default *************** *** 112,117 **** /// <param name="id">The identifier of the new instance</param> /// <returns>An instance of the class, or <c>null</c> to choose default behaviour</returns> ! object Instantiate(System.Type type, object id); ! } ! } --- 138,143 ---- /// <param name="id">The identifier of the new instance</param> /// <returns>An instance of the class, or <c>null</c> to choose default behaviour</returns> ! object Instantiate( System.Type type, object id ); ! } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 15:24:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18449 Modified Files: CachedItem.cs CacheException.cs CacheFactory.cs HashtableCache.cs HashtableCacheProvider.cs ICache.cs ICacheConcurrencyStrategy.cs ICacheProvider.cs NonstrictReadWriteCache.cs ReadOnlyCache.cs ReadWriteCache.cs Timestamper.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: CacheFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheFactory.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CacheFactory.cs 20 Dec 2004 04:48:29 -0000 1.3 --- CacheFactory.cs 31 Dec 2004 15:24:29 -0000 1.4 *************** *** 1,4 **** - using System; using System.Xml; namespace NHibernate.Cache --- 1,4 ---- using System.Xml; + using log4net; namespace NHibernate.Cache *************** *** 9,13 **** public class CacheFactory { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(CacheFactory) ); private CacheFactory() --- 9,13 ---- public class CacheFactory { ! private static readonly ILog log = LogManager.GetLogger( typeof( CacheFactory ) ); private CacheFactory() *************** *** 16,21 **** --- 16,24 ---- } + /// <summary></summary> public const string ReadOnly = "read-only"; + /// <summary></summary> public const string ReadWrite = "read-write"; + /// <summary></summary> public const string NonstrictReadWrite = "nonstrict-read-write"; *************** *** 27,35 **** /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> ! public static ICacheConcurrencyStrategy CreateCache(XmlNode node, string name, bool mutable) { ! return CacheFactory.CreateCache( node.Attributes["usage"].Value, name, mutable ); } ! /// <summary> /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. --- 30,38 ---- /// <param name="mutable"><c>true</c> if the object being stored in the cache is mutable.</param> /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> ! public static ICacheConcurrencyStrategy CreateCache( XmlNode node, string name, bool mutable ) { ! return CacheFactory.CreateCache( node.Attributes[ "usage" ].Value, name, mutable ); } ! /// <summary> /// Creates an <see cref="ICacheConcurrencyStrategy"/> from the parameters. *************** *** 40,55 **** /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> // was private in h2.1 ! public static ICacheConcurrencyStrategy CreateCache(string usage, string name, bool mutable) { ! if( log.IsDebugEnabled ) { log.Debug( "cache for: " + name + "usage strategy: " + usage ); } ! ICacheConcurrencyStrategy ccs = null; ! switch( usage ) { ! case CacheFactory.ReadOnly : ! if( mutable ) { log.Warn( "read-only cache configured for mutable: " + name ); --- 43,58 ---- /// <returns>An <see cref="ICacheConcurrencyStrategy"/> to use for this object in the <see cref="ICache"/>.</returns> // was private in h2.1 ! public static ICacheConcurrencyStrategy CreateCache( string usage, string name, bool mutable ) { ! if( log.IsDebugEnabled ) { log.Debug( "cache for: " + name + "usage strategy: " + usage ); } ! ICacheConcurrencyStrategy ccs = null; ! switch( usage ) { ! case CacheFactory.ReadOnly: ! if( mutable ) { log.Warn( "read-only cache configured for mutable: " + name ); *************** *** 57,74 **** ccs = new ReadOnlyCache(); break; ! case CacheFactory.ReadWrite : ccs = new ReadWriteCache(); break; ! case CacheFactory.NonstrictReadWrite : ccs = new NonstrictReadWriteCache(); break; ! default : throw new MappingException( "cache usage attribute should be read-write, read-only, nonstrict-read-write, or transactional" ); } return ccs; ! } } ! } --- 60,77 ---- ccs = new ReadOnlyCache(); break; ! case CacheFactory.ReadWrite: ccs = new ReadWriteCache(); break; ! case CacheFactory.NonstrictReadWrite: ccs = new NonstrictReadWriteCache(); break; ! default: throw new MappingException( "cache usage attribute should be read-write, read-only, nonstrict-read-write, or transactional" ); } return ccs; ! } } ! } \ No newline at end of file Index: CachedItem.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CachedItem.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CachedItem.cs 20 Dec 2004 04:48:28 -0000 1.4 --- CachedItem.cs 31 Dec 2004 15:24:29 -0000 1.5 *************** *** 16,19 **** --- 16,23 ---- private object value; + /// <summary> + /// + /// </summary> + /// <param name="value"></param> public CachedItem(object value) { *************** *** 32,35 **** --- 36,42 ---- } + /// <summary> + /// + /// </summary> public long UnlockTimestamp { Index: Timestamper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/Timestamper.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Timestamper.cs 20 Dec 2004 04:48:29 -0000 1.8 --- Timestamper.cs 31 Dec 2004 15:24:29 -0000 1.9 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate.Cache { /// <summary> *************** *** 10,39 **** /// strickly increasing, but usually are. /// </remarks> ! public sealed class Timestamper { private static object lockObject = new object(); ! // hibernate is using System.currentMilliSeconds which is calculated // from jan 1, 1970 ! private static long baseDateMs = (new DateTime(1970, 1, 1).Ticks)/10000; ! private static short counter = 0; private static long time; private const int BinDigits = 12; ! public const short OneMs = 1<<BinDigits; //(4096 is the value) ! public static long Next() { ! lock( lockObject ) { // Ticks is accurate down to 100 nanoseconds - hibernate uses milliseconds // to help calculate next time so drop the nanoseconds portion.(1ms==1000000ns) ! long newTime = ( (System.DateTime.Now.Ticks/10000) - baseDateMs ) << BinDigits; ! if (time < newTime) { time = newTime; counter = 0; ! } ! else if (counter < OneMs - 1) { counter++; --- 10,44 ---- /// strickly increasing, but usually are. /// </remarks> ! public sealed class Timestamper { private static object lockObject = new object(); ! // hibernate is using System.currentMilliSeconds which is calculated // from jan 1, 1970 ! private static long baseDateMs = ( new DateTime( 1970, 1, 1 ).Ticks )/10000; ! private static short counter = 0; private static long time; private const int BinDigits = 12; ! /// <summary></summary> ! public const short OneMs = 1 << BinDigits; //(4096 is the value) ! /// <summary> ! /// ! /// </summary> ! /// <returns></returns> ! public static long Next() { ! lock( lockObject ) { // Ticks is accurate down to 100 nanoseconds - hibernate uses milliseconds // to help calculate next time so drop the nanoseconds portion.(1ms==1000000ns) ! long newTime = ( ( DateTime.Now.Ticks/10000 ) - baseDateMs ) << BinDigits; ! if( time < newTime ) { time = newTime; counter = 0; ! } ! else if( counter < OneMs - 1 ) { counter++; *************** *** 48,50 **** } } ! } --- 53,55 ---- } } ! } \ No newline at end of file Index: ICacheProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ICacheProvider.cs 30 Oct 2004 21:20:17 -0000 1.2 --- ICacheProvider.cs 31 Dec 2004 15:24:29 -0000 1.3 *************** *** 1,11 **** - using System; using System.Collections; ! namespace NHibernate.Cache { /// <summary> /// Support for pluggable caches /// </summary> ! public interface ICacheProvider { /// <summary> --- 1,10 ---- using System.Collections; ! namespace NHibernate.Cache { /// <summary> /// Support for pluggable caches /// </summary> ! public interface ICacheProvider { /// <summary> *************** *** 15,20 **** /// <param name="properties">configuration settings</param> /// <returns></returns> ! ICache BuildCache(string regionName, IDictionary properties ); ! /// <summary> /// generate a timestamp --- 14,19 ---- /// <param name="properties">configuration settings</param> /// <returns></returns> ! ICache BuildCache( string regionName, IDictionary properties ); ! /// <summary> /// generate a timestamp *************** *** 23,26 **** long NextTimestamp(); } ! } ! --- 22,24 ---- long NextTimestamp(); } ! } \ No newline at end of file Index: NonstrictReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/NonstrictReadWriteCache.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NonstrictReadWriteCache.cs 29 Oct 2004 05:55:26 -0000 1.3 --- NonstrictReadWriteCache.cs 31 Dec 2004 15:24:29 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,6 ---- using System; + using log4net; ! namespace NHibernate.Cache { /// <summary> *************** *** 8,17 **** public class NonstrictReadWriteCache : ICacheConcurrencyStrategy { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(NonstrictReadWriteCache)); private static readonly long timeout = 10000; private ICache _cache; ! public NonstrictReadWriteCache() { } --- 9,19 ---- public class NonstrictReadWriteCache : ICacheConcurrencyStrategy { ! private static readonly ILog log = LogManager.GetLogger( typeof( NonstrictReadWriteCache ) ); private static readonly long timeout = 10000; private ICache _cache; ! /// <summary></summary> ! public NonstrictReadWriteCache() { } *************** *** 19,33 **** #region ICacheConcurrencyStrategy Members ! public object Get(object key, long txTimestamp) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache lookup: " + key ); } ! object result = _cache.Get(key); ! if( result!=null & !(result is Int64) ) { ! if (log.IsDebugEnabled) { log.Debug( "Cache hit" ); --- 21,41 ---- #region ICacheConcurrencyStrategy Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="txTimestamp"></param> ! /// <returns></returns> ! public object Get( object key, long txTimestamp ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache lookup: " + key ); } ! object result = _cache.Get( key ); ! if( result != null & !( result is Int64 ) ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache hit" ); *************** *** 35,41 **** return result; } ! else { ! if( log.IsDebugEnabled ) { log.Debug( "Cache miss" ); --- 43,49 ---- return result; } ! else { ! if( log.IsDebugEnabled ) { log.Debug( "Cache miss" ); *************** *** 46,69 **** } ! public bool Put(object key, object value, long txTimestamp) { object result = _cache.Get( key ); ! if( result==null ) { ! if( log.IsDebugEnabled ) { ! log.Debug("Caching new: " + key); } } ! else if( (result is Int64) && ( (Int64)result < txTimestamp / Timestamper.OneMs ) ) { // note that this is not guaranteed to be correct in a cluster // because system times could be inconsistent ! if( log.IsDebugEnabled ) { log.Debug( "Caching invalidated: " + key ); } } ! else { return false; // note early exit --- 54,84 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! /// <param name="txTimestamp"></param> ! /// <returns></returns> ! public bool Put( object key, object value, long txTimestamp ) { object result = _cache.Get( key ); ! if( result == null ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "Caching new: " + key ); } } ! else if( ( result is Int64 ) && ( ( Int64 ) result < txTimestamp/Timestamper.OneMs ) ) { // note that this is not guaranteed to be correct in a cluster // because system times could be inconsistent ! if( log.IsDebugEnabled ) { log.Debug( "Caching invalidated: " + key ); } } ! else { return false; // note early exit *************** *** 74,86 **** } ! public void Lock(object key) { // in case the server crashes, we need the lock to timeout ! _cache.Put( key, ( timeout + Timestamper.Next() / Timestamper.OneMs ) ); } ! public void Release(object key) { ! if( log.IsDebugEnabled ) { log.Debug( "Invalidating: " + key ); --- 89,109 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Lock( object key ) { // in case the server crashes, we need the lock to timeout ! _cache.Put( key, ( timeout + Timestamper.Next()/Timestamper.OneMs ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Release( object key ) { ! if( log.IsDebugEnabled ) { log.Debug( "Invalidating: " + key ); *************** *** 88,97 **** //remove the lock (any later transactions can recache) ! _cache.Put( key, Timestamper.Next() / Timestamper.OneMs ); } ! public void Remove(object key) { ! if( log.IsDebugEnabled ) { log.Debug( "Removing: " + key ); --- 111,124 ---- //remove the lock (any later transactions can recache) ! _cache.Put( key, Timestamper.Next()/Timestamper.OneMs ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Remove( object key ) { ! if( log.IsDebugEnabled ) { log.Debug( "Removing: " + key ); *************** *** 100,106 **** } public void Clear() { ! if( log.IsDebugEnabled ) { log.Debug( "Clearing" ); --- 127,134 ---- } + /// <summary></summary> public void Clear() { ! if( log.IsDebugEnabled ) { log.Debug( "Clearing" ); *************** *** 109,119 **** } public void Destroy() { ! try { _cache.Destroy(); } ! catch(Exception e) { log.Warn( "Could not destroy cache", e ); --- 137,148 ---- } + /// <summary></summary> public void Destroy() { ! try { _cache.Destroy(); } ! catch( Exception e ) { log.Warn( "Could not destroy cache", e ); *************** *** 121,125 **** } ! public ICache Cache { get { return _cache; } --- 150,155 ---- } ! /// <summary></summary> ! public ICache Cache { get { return _cache; } *************** *** 129,131 **** #endregion } ! } --- 159,161 ---- #endregion } ! } \ No newline at end of file Index: HashtableCacheProvider.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/HashtableCacheProvider.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HashtableCacheProvider.cs 30 Oct 2004 21:20:17 -0000 1.2 --- HashtableCacheProvider.cs 31 Dec 2004 15:24:29 -0000 1.3 *************** *** 1,6 **** - using System; using System.Collections; ! namespace NHibernate.Cache { /// <summary> --- 1,5 ---- using System.Collections; ! namespace NHibernate.Cache { /// <summary> *************** *** 12,20 **** #region ICacheProvider Members ! public ICache BuildCache(string regionName, IDictionary properties) { return new HashtableCache( regionName ); } public long NextTimestamp() { --- 11,29 ---- #region ICacheProvider Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="regionName"></param> ! /// <param name="properties"></param> ! /// <returns></returns> ! public ICache BuildCache( string regionName, IDictionary properties ) { return new HashtableCache( regionName ); } + /// <summary> + /// + /// </summary> + /// <returns></returns> public long NextTimestamp() { *************** *** 24,26 **** #endregion } ! } --- 33,35 ---- #endregion } ! } \ No newline at end of file Index: ICacheConcurrencyStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheConcurrencyStrategy.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ICacheConcurrencyStrategy.cs 20 Dec 2004 04:48:29 -0000 1.4 --- ICacheConcurrencyStrategy.cs 31 Dec 2004 15:24:29 -0000 1.5 *************** *** 1,5 **** ! using System; ! ! namespace NHibernate.Cache { /// <summary> --- 1,3 ---- ! namespace NHibernate.Cache { /// <summary> *************** *** 16,21 **** /// </para> /// </remarks> ! public interface ICacheConcurrencyStrategy ! { /// <summary> /// Attempt to retrieve an object from the Cache --- 14,19 ---- /// </para> /// </remarks> ! public interface ICacheConcurrencyStrategy ! { /// <summary> /// Attempt to retrieve an object from the Cache *************** *** 25,29 **** /// <returns>The cached object or <c>null</c></returns> /// <exception cref="CacheException"></exception> ! object Get(object key, long txTimestamp); /// <summary> --- 23,27 ---- /// <returns>The cached object or <c>null</c></returns> /// <exception cref="CacheException"></exception> ! object Get( object key, long txTimestamp ); /// <summary> *************** *** 35,39 **** /// <returns><c>true</c> if the object was successfully cached</returns> /// <exception cref="CacheException"></exception> ! bool Put(object key, object value, long txTimestamp); /// <summary> --- 33,37 ---- /// <returns><c>true</c> if the object was successfully cached</returns> /// <exception cref="CacheException"></exception> ! bool Put( object key, object value, long txTimestamp ); /// <summary> *************** *** 42,46 **** /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Lock(object key); /// <summary> --- 40,44 ---- /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Lock( object key ); /// <summary> *************** *** 49,53 **** /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Release(object key); /// <summary> --- 47,51 ---- /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Release( object key ); /// <summary> *************** *** 56,60 **** /// <param name="key"></param> /// <exception cref="CacheException"></exception> ! void Remove(object key); /// <summary> --- 54,58 ---- /// <param name="key"></param> /// <exception cref="CacheException"></exception> ! void Remove( object key ); /// <summary> *************** *** 74,78 **** /// </summary> /// <value>The <see cref="ICache"/> for this strategy to use.</value> ! ICache Cache { get; set ;} } ! } --- 72,76 ---- /// </summary> /// <value>The <see cref="ICache"/> for this strategy to use.</value> ! ICache Cache { get; set; } } ! } \ No newline at end of file Index: ReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadWriteCache.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReadWriteCache.cs 20 Dec 2004 04:48:29 -0000 1.6 --- ReadWriteCache.cs 31 Dec 2004 15:24:29 -0000 1.7 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,6 ---- using System; + using log4net; ! namespace NHibernate.Cache { /// <summary> *************** *** 10,20 **** /// Works at the "Read Committed" isolation level /// </remarks> ! public class ReadWriteCache : ICacheConcurrencyStrategy { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(ReadWriteCache) ); private readonly object lockObject = new object(); private ICache _cache; ! public ReadWriteCache() { } --- 11,22 ---- /// Works at the "Read Committed" isolation level /// </remarks> ! public class ReadWriteCache : ICacheConcurrencyStrategy { ! private static readonly ILog log = LogManager.GetLogger( typeof( ReadWriteCache ) ); private readonly object lockObject = new object(); private ICache _cache; ! /// <summary></summary> ! public ReadWriteCache() { } *************** *** 22,50 **** #region ICacheConcurrencyStrategy Members ! public object Get(object key, long txTimestamp) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { ! log.Debug("Cache lookup: " + key); } ! CachedItem item = _cache.Get(key) as CachedItem; ! if ( ! item!=null && ! item.FreshTimestamp < txTimestamp && ! item.IsFresh // || txTimestamp < item.LockTimestamp ! ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache hit: " + key ); } return item.Value; ! } ! else { ! if( log.IsDebugEnabled ) { log.Debug( "Cache miss: " + key ); --- 24,58 ---- #region ICacheConcurrencyStrategy Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="txTimestamp"></param> ! /// <returns></returns> ! public object Get( object key, long txTimestamp ) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "Cache lookup: " + key ); } ! CachedItem item = _cache.Get( key ) as CachedItem; ! if( ! item != null && ! item.FreshTimestamp < txTimestamp && ! item.IsFresh // || txTimestamp < item.LockTimestamp ! ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache hit: " + key ); } return item.Value; ! } ! else { ! if( log.IsDebugEnabled ) { log.Debug( "Cache miss: " + key ); *************** *** 58,72 **** // in this class until unlocked ! public void Lock(object key) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { ! log.Debug("Invalidating: " + key); } ! CachedItem item = _cache.Get( key ) as CachedItem; ! if ( item==null ) item = new CachedItem( null ); item.Lock(); _cache.Put( key, item ); --- 66,87 ---- // in this class until unlocked ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Lock( object key ) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "Invalidating: " + key ); } ! CachedItem item = _cache.Get( key ) as CachedItem; ! if( item == null ) ! { ! item = new CachedItem( null ); ! } item.Lock(); _cache.Put( key, item ); *************** *** 74,102 **** } ! public bool Put(object key, object value, long txTimestamp) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Caching: " + key ); } ! CachedItem item = _cache.Get( key ) as CachedItem; ! if ( ! item==null || ! (item.IsUnlocked && !item.IsFresh && item.UnlockTimestamp < txTimestamp) ! ) { _cache.Put( key, new CachedItem( value ) ); ! if( log.IsDebugEnabled ) { log.Debug( "Cached: " + key ); } return true; ! } else { ! if( log.IsDebugEnabled ) { log.Debug( "Could not cache: " + key ); --- 89,124 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! /// <param name="txTimestamp"></param> ! /// <returns></returns> ! public bool Put( object key, object value, long txTimestamp ) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Caching: " + key ); } ! CachedItem item = _cache.Get( key ) as CachedItem; ! if( ! item == null || ! ( item.IsUnlocked && !item.IsFresh && item.UnlockTimestamp < txTimestamp ) ! ) { _cache.Put( key, new CachedItem( value ) ); ! if( log.IsDebugEnabled ) { log.Debug( "Cached: " + key ); } return true; ! } else { ! if( log.IsDebugEnabled ) { log.Debug( "Could not cache: " + key ); *************** *** 107,125 **** } ! public void Release(object key) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Releasing: " + key ); } CachedItem item = _cache.Get( key ) as CachedItem; ! if( item!=null ) { item.Unlock(); _cache.Put( key, item ); ! } ! else { log.Warn( "An item was expired by the cache while it was locked" ); --- 129,151 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Release( object key ) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Releasing: " + key ); } CachedItem item = _cache.Get( key ) as CachedItem; ! if( item != null ) { item.Unlock(); _cache.Put( key, item ); ! } ! else { log.Warn( "An item was expired by the cache while it was locked" ); *************** *** 128,148 **** } ! public void Clear() { _cache.Clear(); } ! public void Remove(object key) { _cache.Remove( key ); } ! public void Destroy() { ! try { _cache.Destroy(); } ! catch(Exception e) { log.Warn( "Could not destroy cache", e ); --- 154,184 ---- } ! /// <summary> ! /// ! /// </summary> ! public void Clear() { _cache.Clear(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Remove( object key ) { _cache.Remove( key ); } ! /// <summary> ! /// ! /// </summary> ! public void Destroy() { ! try { _cache.Destroy(); } ! catch( Exception e ) { log.Warn( "Could not destroy cache", e ); *************** *** 150,154 **** } ! public ICache Cache { get { return _cache; } --- 186,193 ---- } ! /// <summary> ! /// ! /// </summary> ! public ICache Cache { get { return _cache; } *************** *** 157,161 **** #endregion - } ! } --- 196,199 ---- #endregion } ! } \ No newline at end of file Index: HashtableCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/HashtableCache.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HashtableCache.cs 29 Oct 2004 05:55:26 -0000 1.4 --- HashtableCache.cs 31 Dec 2004 15:24:29 -0000 1.5 *************** *** 1,7 **** - using System; using System.Collections; - using System.Runtime.CompilerServices; ! namespace NHibernate.Cache { /// <summary> --- 1,5 ---- using System.Collections; ! namespace NHibernate.Cache { /// <summary> *************** *** 10,18 **** public class HashtableCache : ICache { ! private static object synchObject = new object(); private Hashtable cache = new Hashtable(); private string region; ! public HashtableCache(string region) { this.region = region; --- 8,20 ---- public class HashtableCache : ICache { ! // private static object synchObject = new object(); private Hashtable cache = new Hashtable(); private string region; ! /// <summary> ! /// ! /// </summary> ! /// <param name="region"></param> ! public HashtableCache( string region ) { this.region = region; *************** *** 20,39 **** #region ICache Members ! ! public object Get(object key) { ! return cache[key]; } ! public void Put(object key, object value) { ! cache[key] = value; } ! public void Remove(object key) { ! cache.Remove(key); } public void Clear() { --- 22,45 ---- #region ICache Members ! ! /// <summary></summary> ! public object Get( object key ) { ! return cache[ key ]; } ! /// <summary></summary> ! public void Put( object key, object value ) { ! cache[ key ] = value; } ! /// <summary></summary> ! public void Remove( object key ) { ! cache.Remove( key ); } + /// <summary></summary> public void Clear() { *************** *** 49,58 **** } public string Region { ! set { region = value; } } #endregion } ! } --- 55,65 ---- } + /// <summary></summary> public string Region { ! set { region = value; } } #endregion } ! } \ No newline at end of file Index: ReadOnlyCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadOnlyCache.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReadOnlyCache.cs 20 Dec 2004 04:48:29 -0000 1.7 --- ReadOnlyCache.cs 31 Dec 2004 15:24:29 -0000 1.8 *************** *** 1,17 **** using System; ! namespace NHibernate.Cache { /// <summary> /// Caches data that is never updated /// </summary> ! public class ReadOnlyCache : ICacheConcurrencyStrategy { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ReadOnlyCache)); ! private object lockObject = new object(); private ICache _cache; ! public ReadOnlyCache() { } --- 1,19 ---- using System; + using log4net; ! namespace NHibernate.Cache { /// <summary> /// Caches data that is never updated /// </summary> ! public class ReadOnlyCache : ICacheConcurrencyStrategy { ! private static readonly ILog log = LogManager.GetLogger( typeof( ReadOnlyCache ) ); ! private object lockObject = new object(); private ICache _cache; ! /// <summary></summary> ! public ReadOnlyCache() { } *************** *** 19,27 **** #region ICacheConcurrencyStrategy Members ! public object Get(object key, long timestamp) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache lookup: " + key ); --- 21,35 ---- #region ICacheConcurrencyStrategy Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="timestamp"></param> ! /// <returns></returns> ! public object Get( object key, long timestamp ) { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { log.Debug( "Cache lookup: " + key ); *************** *** 29,33 **** object result = _cache.Get( key ); ! if ( result!=null && log.IsDebugEnabled ) { log.Debug( "Cache hit" ); --- 37,41 ---- object result = _cache.Get( key ); ! if( result != null && log.IsDebugEnabled ) { log.Debug( "Cache hit" ); *************** *** 41,99 **** } ! public void Lock(object key) { ! log.Error("Application attempted to edit read only item: " + key); ! throw new InvalidOperationException("Can't write to a readonly object"); } ! public bool Put(object key, object value, long timestamp) { ! ! lock( lockObject ) { ! if (log.IsDebugEnabled) { ! log.Debug("Caching: " + key); } ! _cache.Put(key, value); return true; } } ! public void Release(object key) { ! log.Error("Application attempted to edit read only item: " + key); ! throw new InvalidOperationException("Can't write to a readonly object"); } ! public void Clear() { _cache.Clear(); } ! public void Remove(object key) { ! _cache.Remove(key); } ! public void Destroy() { ! try { _cache.Destroy(); } ! catch(Exception e) { ! log.Warn("Could not destroy cache", e); } } ! public ICache Cache { get { return _cache; } set { _cache = value; } } - - #endregion } ! } --- 49,134 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Lock( object key ) { ! log.Error( "Application attempted to edit read only item: " + key ); ! throw new InvalidOperationException( "Can't write to a readonly object" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! /// <param name="timestamp"></param> ! /// <returns></returns> ! public bool Put( object key, object value, long timestamp ) ! { ! lock( lockObject ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "Caching: " + key ); } ! _cache.Put( key, value ); return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Release( object key ) { ! log.Error( "Application attempted to edit read only item: " + key ); ! throw new InvalidOperationException( "Can't write to a readonly object" ); } ! /// <summary> ! /// ! /// </summary> ! public void Clear() { _cache.Clear(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! public void Remove( object key ) { ! _cache.Remove( key ); } ! /// <summary> ! /// ! /// </summary> ! public void Destroy() { ! try { _cache.Destroy(); } ! catch( Exception e ) { ! log.Warn( "Could not destroy cache", e ); } } ! /// <summary> ! /// ! /// </summary> ! public ICache Cache { get { return _cache; } set { _cache = value; } } + #endregion } ! } \ No newline at end of file Index: ICache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICache.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICache.cs 29 Oct 2004 05:55:26 -0000 1.5 --- ICache.cs 31 Dec 2004 15:24:29 -0000 1.6 *************** *** 1,5 **** ! using System; ! ! namespace NHibernate.Cache { /// <summary> --- 1,3 ---- ! namespace NHibernate.Cache { /// <summary> *************** *** 14,20 **** /// </para> /// </remarks> ! public interface ICache { - /// <summary> /// Get the object from the Cache --- 12,17 ---- /// </para> /// </remarks> ! public interface ICache { /// <summary> /// Get the object from the Cache *************** *** 22,28 **** /// <param name="key"></param> /// <returns></returns> ! object Get(object key); ! void Put(object key, object value); /// <summary> --- 19,30 ---- /// <param name="key"></param> /// <returns></returns> ! object Get( object key ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! void Put( object key, object value ); /// <summary> *************** *** 31,35 **** /// <param name="key">The Key of the Item in the Cache to remove.</param> /// <exception cref="CacheException"></exception> ! void Remove(object key); /// <summary> --- 33,37 ---- /// <param name="key">The Key of the Item in the Cache to remove.</param> /// <exception cref="CacheException"></exception> ! void Remove( object key ); /// <summary> *************** *** 49,56 **** /// </summary> /// <exception cref="CacheException"></exception> ! string Region {set;} } ! } --- 51,58 ---- /// </summary> /// <exception cref="CacheException"></exception> ! string Region { set; } } ! } \ No newline at end of file Index: CacheException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CacheException.cs 20 Dec 2004 04:48:28 -0000 1.4 --- CacheException.cs 31 Dec 2004 15:24:29 -0000 1.5 *************** *** 9,17 **** public class CacheException : HibernateException { ! public CacheException(string message) : base( message ) { } ! public CacheException(Exception e) : base( e ) { } --- 9,25 ---- public class CacheException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public CacheException( string message ) : base( message ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="e"></param> ! public CacheException( Exception e ) : base( e ) { } |
From: Kevin W. <kev...@us...> - 2004-12-31 15:24:22
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18384 Modified Files: HibernateException.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: HibernateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/HibernateException.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HibernateException.cs 2 Dec 2004 21:26:01 -0000 1.7 --- HibernateException.cs 31 Dec 2004 15:24:05 -0000 1.8 *************** *** 2,8 **** using System.Runtime.Serialization; ! namespace NHibernate { - /// <summary> /// Any exception that occurs in the O-R persistence layer. --- 2,7 ---- using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> /// Any exception that occurs in the O-R persistence layer. *************** *** 10,34 **** /// <remarks>Exceptions that occur in the database layer are left as native exceptions</remarks> [Serializable] ! public class HibernateException : ApplicationException { ! public HibernateException() : base( String.Empty ) ! { } ! public HibernateException(Exception e) : base( e.Message, e ) ! { } ! public HibernateException(string message, Exception e) : base( message, e ) ! { } ! public HibernateException(string message) : base( message ) ! { } ! protected HibernateException(SerializationInfo info, StreamingContext context) : base(info, context) ! { } } ! } --- 9,54 ---- /// <remarks>Exceptions that occur in the database layer are left as native exceptions</remarks> [Serializable] ! public class HibernateException : ApplicationException { ! /// <summary> ! /// ! /// </summary> ! public HibernateException() : base( String.Empty ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="e"></param> ! public HibernateException( Exception e ) : base( e.Message, e ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="e"></param> ! public HibernateException( string message, Exception e ) : base( message, e ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public HibernateException( string message ) : base( message ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected HibernateException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 14:59:27
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13157 Modified Files: NHibernate-1.1.sln Log Message: removed references to hbm2net and nant task projects Index: NHibernate-1.1.sln =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate-1.1.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NHibernate-1.1.sln 25 Jul 2004 11:42:49 -0000 1.3 --- NHibernate-1.1.sln 31 Dec 2004 14:59:17 -0000 1.4 *************** *** 12,23 **** EndProjectSection EndProject - Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.hbm2net-1.1", "NHibernate.Tool.hbm2net\NHibernate.Tool.hbm2net-1.1.csproj", "{136FFE16-EE3B-4556-90FB-E265113CB13F}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tasks-1.1", "NHibernate.Tasks\NHibernate.Tasks-1.1.csproj", "{C6F085E3-17FA-424A-9A09-143F3E177FEB}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject Global GlobalSection(SolutionConfiguration) = preSolution --- 12,15 ---- *************** *** 38,49 **** {E3482030-5828-4112-9906-D4C5153DCE3F}.Release.ActiveCfg = Release|.NET {E3482030-5828-4112-9906-D4C5153DCE3F}.Release.Build.0 = Release|.NET - {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.ActiveCfg = Debug|.NET - {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.Build.0 = Debug|.NET - {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.ActiveCfg = Release|.NET - {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.Build.0 = Release|.NET - {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.ActiveCfg = Debug|.NET - {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.Build.0 = Debug|.NET - {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.ActiveCfg = Release|.NET - {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution --- 30,33 ---- |
From: Michael D. <mik...@us...> - 2004-12-30 16:55:47
|
Update of /cvsroot/nhibernate/NHibernateContrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26347 Modified Files: NHibernateContribSolution.build Log Message: Moved NHibernate.Tasks and NHibernate.Tool.hbm2net over to the NHibernateContrib module. Index: NHibernateContribSolution.build =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/NHibernateContribSolution.build,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NHibernateContribSolution.build 16 Dec 2004 15:26:11 -0000 1.6 --- NHibernateContribSolution.build 30 Dec 2004 16:55:37 -0000 1.7 *************** *** 1,3 **** ! <?xml version="1.0" ?> <project --- 1,3 ---- ! <?xml version="1.0" ?> <project *************** *** 112,121 **** <!-- copy framework-nuetral libraries --> - <!-- - There are none right now <copy todir="${build.dir}/bin"> <fileset basedir="lib"> <includes name="Commons.*" /> - <includes name="DotNetMock.*" /> <includes name="HashCodeProvider.*" /> <includes name="NAnt.Core.*" /> --- 112,118 ---- *************** *** 123,127 **** </fileset> </copy> - --> <!-- copy framework-specific libraries --> --- 120,123 ---- *************** *** 140,143 **** --- 136,142 ---- <nant target="build" buildfile="src/Nullables.Tests/Nullables.Tests.build" /> <nant target="build" buildfile="src/BantamTech.SysCache/syscache.build" /> + <nant target="build" buildfile="src/NHibernate.Tool.Net2Hbm/NHibernate.Tool.Net2Hbm.build" /> + <nant target="build" buildfile="src/NHibernate.Tool.hbm2net/NHibernate.Tool.hbm2net.build" /> + <nant target="build" buildfile="src/NHibernate.Tasks/NHibernate.Tasks.build" /> </target> *************** *** 209,212 **** --- 208,214 ---- <includes name="Nullables.dll" /> <includes name="Nullables.NHibernate.dll" /> + <includes name="NHibernate.Tool.hbm2ddl.dll" /> + <includes name="NHibernate.Tool.hbm2net.dll" /> + <includes name="NHibernate.Tool.Net2Hbm.dll" /> </assemblies> *************** *** 273,281 **** <includes name="${lib.dir}/**" /> ! <!-- ! exclude the Clover modified source files. ! --> <excludes name="${clover.src}/**" /> <!-- copy all of the source --> <includes name="src/**" /> --- 275,285 ---- <includes name="${lib.dir}/**" /> ! <!-- exclude the Clover modified source files. --> <excludes name="${clover.src}/**" /> + <!-- exclude ReSharper stuff --> + <excludes name="**/_ReSharper*" /> + <excludes name="**/*.resharperoptions" /> + <!-- copy all of the source --> <includes name="src/**" /> *************** *** 292,299 **** <excludes name="**/obj/**" /> - <!-- exclude ReSharper stuff --> - <excludes name="**/_ReSharper*" /> - <excludes name="**/*.resharperoptions" /> - <!-- exclude any keys that exist on the build machine --> <excludes name="**/*.snk" /> --- 296,299 ---- |
From: Michael D. <mik...@us...> - 2004-12-30 16:55:47
|
Update of /cvsroot/nhibernate/NHibernateContrib/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26347/src Modified Files: NHibernateContrib-1.1.sln Log Message: Moved NHibernate.Tasks and NHibernate.Tool.hbm2net over to the NHibernateContrib module. Index: NHibernateContrib-1.1.sln =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernateContrib-1.1.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernateContrib-1.1.sln 8 Dec 2004 01:15:54 -0000 1.1 --- NHibernateContrib-1.1.sln 30 Dec 2004 16:55:37 -0000 1.2 *************** *** 20,23 **** --- 20,35 ---- EndProjectSection EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.Net2Hbm-1.1", "NHibernate.Tool.Net2Hbm\NHibernate.Tool.Net2Hbm-1.1.csproj", "{FD72BBE4-AA77-459A-9F1D-6B7C7143CF2A}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.hbm2net-1.1", "NHibernate.Tool.hbm2net\NHibernate.Tool.hbm2net-1.1.csproj", "{136FFE16-EE3B-4556-90FB-E265113CB13F}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tasks-1.1", "NHibernate.Tasks\NHibernate.Tasks-1.1.csproj", "{C6F085E3-17FA-424A-9A09-143F3E177FEB}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 46,49 **** --- 58,73 ---- {53E01216-76B6-4920-A386-2486ACEE5AEA}.Release.ActiveCfg = Release|.NET {53E01216-76B6-4920-A386-2486ACEE5AEA}.Release.Build.0 = Release|.NET + {FD72BBE4-AA77-459A-9F1D-6B7C7143CF2A}.Debug.ActiveCfg = Debug|.NET + {FD72BBE4-AA77-459A-9F1D-6B7C7143CF2A}.Debug.Build.0 = Debug|.NET + {FD72BBE4-AA77-459A-9F1D-6B7C7143CF2A}.Release.ActiveCfg = Release|.NET + {FD72BBE4-AA77-459A-9F1D-6B7C7143CF2A}.Release.Build.0 = Release|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.ActiveCfg = Debug|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.Build.0 = Debug|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.ActiveCfg = Release|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.Build.0 = Release|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.ActiveCfg = Debug|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.Build.0 = Debug|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.ActiveCfg = Release|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution |