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...> - 2005-01-01 14:20:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/DriverTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11094 Added Files: NullReferenceFixture.cs Log Message: added test for NH-177 --- NEW FILE: NullReferenceFixture.cs --- using System; using System.Collections; using NUnit.Framework; namespace NHibernate.Test.DriverTest { /// <summary> /// http://jira.nhibernate.org/browse/NH-177 /// </summary> [TestFixture] public class NullReferenceFixture : TestCase { [SetUp] public void Setup() { ExportSchema( new string[] { "Simple.hbm.xml"} ); } /// <summary> /// No value is assigned for the given named parameter /// </summary> /// <remarks> /// Was giving a NullReferenceException in NHibernate.Driver.DriverBase.GenerateParameter /// at the line "dbParam.DbType = parameter.SqlType.DbType;" because "parameter" existed /// but all properties were null. /// </remarks> [Test] public void NoParameterNameNullReference() { ISession s = null; try { s = sessions.OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); Assert.IsNotNull( q ); q.List(); } catch( ADOException ae ) { Assert.IsTrue( ae.InnerException is QueryException ); Assert.IsTrue( ae.InnerException.Message.StartsWith( "No value assigned to parameter" ) ); } catch( Exception e ) { Console.WriteLine( e.ToString() ); throw; } finally { s.Close(); } } /// <summary> /// query succeeds when the parameter is assigned a value /// </summary> [Test] public void NamedParameterAssignedNoError() { ISession s = null; try { s = sessions.OpenSession(); Console.WriteLine( "about to run query" ); IQuery q = s.CreateQuery( "from Simple s where s.Name = :missing" ); Assert.IsNotNull( q ); q.SetString( "missing", "nhibernate" ); IList list = q.List(); Assert.IsNotNull( list ); } catch( Exception e ) { Console.WriteLine( e.ToString() ); throw; } finally { s.Close(); } } } } |
From: Kevin W. <kev...@us...> - 2005-01-01 14:19:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10954 Modified Files: NHibernate.Test-1.1.csproj Log Message: added test for NH-177 Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** NHibernate.Test-1.1.csproj 30 Dec 2004 16:25:12 -0000 1.57 --- NHibernate.Test-1.1.csproj 1 Jan 2005 14:19:41 -0000 1.58 *************** *** 91,99 **** /> <Reference - Name = "nunit.framework" - AssemblyName = "nunit.framework" - HintPath = "..\..\lib\net\1.1\nunit.framework.dll" - /> - <Reference Name = "log4net" AssemblyName = "log4net" --- 91,94 ---- *************** *** 105,108 **** --- 100,108 ---- HintPath = "..\..\lib\net\1.1\Iesi.Collections.dll" /> + <Reference + Name = "nunit.framework" + AssemblyName = "nunit.framework" + HintPath = "..\..\lib\net\1.1\nunit.framework.dll" + /> </References> </Build> *************** *** 255,258 **** --- 255,263 ---- /> <File + RelPath = "DriverTest\NullReferenceFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DriverTest\OracleClientDriverFixture.cs" SubType = "Code" |
From: Kevin W. <kev...@us...> - 2005-01-01 03:37:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2110 Modified Files: EntityType.cs PersistentCollectionType.cs TypeType.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: PersistentCollectionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PersistentCollectionType.cs 31 Dec 2004 23:54:56 -0000 1.17 --- PersistentCollectionType.cs 1 Jan 2005 03:37:34 -0000 1.18 *************** *** 268,276 **** public abstract PersistentCollection Wrap( ISessionImplementor session, object collection ); ! /** ! * Note: return true because this type is castable to IAssociationType. Not because ! * all collections are associations. ! */ ! /// <summary></summary> public override bool IsAssociationType --- 268,273 ---- public abstract PersistentCollection Wrap( ISessionImplementor session, object collection ); ! // Note: return true because this type is castable to IAssociationType. Not because ! // all collections are associations. /// <summary></summary> public override bool IsAssociationType Index: TypeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TypeType.cs 31 Dec 2004 23:56:09 -0000 1.5 --- TypeType.cs 1 Jan 2005 03:37:34 -0000 1.6 *************** *** 84,88 **** /// <param name="index">The index of the <see cref="IDbDataParameter"/> to start writing the value to.</param> /// <remarks> ! /// This uses the <see cref="NHibernate.String.Set(IDbCommand, Object,Int32)"/> method of the /// <see cref="NHibernate.String"/> object to do the work. /// </remarks> --- 84,88 ---- /// <param name="index">The index of the <see cref="IDbDataParameter"/> to start writing the value to.</param> /// <remarks> ! /// This uses the <see cref="NullableType.Set(IDbCommand, Object,Int32)"/> method of the /// <see cref="NHibernate.String"/> object to do the work. /// </remarks> Index: EntityType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/EntityType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EntityType.cs 31 Dec 2004 23:52:52 -0000 1.7 --- EntityType.cs 1 Jan 2005 03:37:34 -0000 1.8 *************** *** 60,68 **** } ! /** ! * This returns the wrong class for an entity with a proxy. Theoretically ! * it should return the proxy class, but it doesn't. ! */ ! /// <summary></summary> public override sealed System.Type ReturnedClass --- 60,65 ---- } ! // This returns the wrong class for an entity with a proxy. Theoretically ! // it should return the proxy class, but it doesn't. /// <summary></summary> public override sealed System.Type ReturnedClass |
From: Kevin W. <kev...@us...> - 2005-01-01 03:36:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1963 Modified Files: SessionImpl.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** SessionImpl.cs 31 Dec 2004 19:54:42 -0000 1.58 --- SessionImpl.cs 1 Jan 2005 03:36:43 -0000 1.59 *************** *** 2099,2109 **** } - /** - * Return the object with the specified id or throw exception if no row with that id exists. Defer the load, - * return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. - */ - /// <summary> ! /// /// </summary> /// <param name="clazz"></param> --- 2099,2105 ---- } /// <summary> ! /// Return the object with the specified id or throw exception if no row with that id exists. Defer the load, ! /// return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. /// </summary> /// <param name="clazz"></param> |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1843 Modified Files: QueryException.cs StaleObjectStateException.cs TransactionException.cs TransientObjectException.cs ValidationFailure.cs WrongClassException.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: TransientObjectException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/TransientObjectException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TransientObjectException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- TransientObjectException.cs 1 Jan 2005 03:35:39 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 8,14 **** /// </summary> [Serializable] ! public class TransientObjectException : HibernateException { ! public TransientObjectException(string message): base(message) { } } ! } --- 8,20 ---- /// </summary> [Serializable] ! public class TransientObjectException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public TransientObjectException( string message ) : base( message ) ! { ! } } ! } \ No newline at end of file Index: StaleObjectStateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/StaleObjectStateException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StaleObjectStateException.cs 13 Sep 2004 05:37:37 -0000 1.2 --- StaleObjectStateException.cs 1 Jan 2005 03:35:39 -0000 1.3 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,6 ---- using System; + using log4net; ! namespace NHibernate { /// <summary> *************** *** 9,39 **** /// </summary> [Serializable] ! public class StaleObjectStateException : HibernateException { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(StaleObjectStateException)); private System.Type persistentType; private object identifier; ! public StaleObjectStateException(System.Type persistentType, object identifier) : base("Row was updated or deleted by another transaction") { this.persistentType = persistentType; this.identifier = identifier; ! log4net.LogManager.GetLogger( typeof(StaleObjectStateException) ).Error("An operation failed due to stale data", this); } ! public System.Type PersistentType ! { get { return persistentType; } } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + " for " + persistentType.FullName + " instance with identifier: " + identifier; } } } ! } --- 10,48 ---- /// </summary> [Serializable] ! public class StaleObjectStateException : HibernateException { ! private static readonly ILog log = LogManager.GetLogger( typeof( StaleObjectStateException ) ); private System.Type persistentType; private object identifier; ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentType"></param> ! /// <param name="identifier"></param> ! public StaleObjectStateException( System.Type persistentType, object identifier ) : base( "Row was updated or deleted by another transaction" ) { this.persistentType = persistentType; this.identifier = identifier; ! LogManager.GetLogger( typeof( StaleObjectStateException ) ).Error( "An operation failed due to stale data", this ); } ! /// <summary></summary> ! public System.Type PersistentType ! { get { return persistentType; } } ! /// <summary></summary> ! public object Identifier { get { return identifier; } } ! /// <summary></summary> ! public override string Message { get { return base.Message + " for " + persistentType.FullName + " instance with identifier: " + identifier; } } } ! } \ No newline at end of file Index: WrongClassException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/WrongClassException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WrongClassException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- WrongClassException.cs 1 Jan 2005 03:35:39 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 8,17 **** /// </summary> [Serializable] ! public class WrongClassException : HibernateException { private object identifier; private System.Type type; ! public WrongClassException(string message, object identifier, System.Type type) : base(message) { this.identifier = identifier; --- 8,23 ---- /// </summary> [Serializable] ! public class WrongClassException : HibernateException { private object identifier; private System.Type type; ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="identifier"></param> ! /// <param name="type"></param> ! public WrongClassException( string message, object identifier, System.Type type ) : base( message ) { this.identifier = identifier; *************** *** 19,41 **** } ! public object Identifier { get { return identifier; } } ! public System.Type Type { get { return type; } } ! public override string Message { ! get { return "Object with id: " + identifier + " was not of the specified sublcass: " + type.FullName ! + " (" + base.Message + ")" ; } } } ! } --- 25,51 ---- } ! /// <summary></summary> ! public object Identifier { get { return identifier; } } ! /// <summary></summary> ! public System.Type Type { get { return type; } } ! /// <summary></summary> ! public override string Message { ! get ! { return "Object with id: " + identifier + " was not of the specified sublcass: " + type.FullName ! + " (" + base.Message + ")"; } } } ! } \ No newline at end of file Index: TransactionException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/TransactionException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TransactionException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- TransactionException.cs 1 Jan 2005 03:35:39 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 7,15 **** /// </summary> [Serializable] ! public class TransactionException : HibernateException { ! public TransactionException(string message, Exception root) : base(message, root) {} ! public TransactionException(string message) : base(message) {} } ! } --- 7,28 ---- /// </summary> [Serializable] ! public class TransactionException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public TransactionException( string message, Exception root ) : base( message, root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public TransactionException( string message ) : base( message ) ! { ! } } ! } \ No newline at end of file Index: QueryException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/QueryException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QueryException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- QueryException.cs 1 Jan 2005 03:35:39 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 7,21 **** /// </summary> [Serializable] ! public class QueryException : HibernateException { private string queryString; ! public QueryException(string message) : base(message) {} ! public QueryException(string message, Exception e) : base(message, e) {} ! public QueryException(Exception e) : base(e) {} ! public string QueryString { get { return queryString; } --- 7,41 ---- /// </summary> [Serializable] ! public class QueryException : HibernateException { private string queryString; ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public QueryException( string message ) : base( message ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="e"></param> ! public QueryException( string message, Exception e ) : base( message, e ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="e"></param> ! public QueryException( Exception e ) : base( e ) ! { ! } ! /// <summary></summary> ! public string QueryString { get { return queryString; } *************** *** 23,30 **** } ! public override string Message { get { return base.Message + " [" + queryString + "]"; } } } ! } --- 43,51 ---- } ! /// <summary></summary> ! public override string Message { get { return base.Message + " [" + queryString + "]"; } } } ! } \ No newline at end of file Index: ValidationFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ValidationFailure.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ValidationFailure.cs 21 Sep 2004 12:43:26 -0000 1.3 --- ValidationFailure.cs 1 Jan 2005 03:35:39 -0000 1.4 *************** *** 2,6 **** using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> --- 2,6 ---- using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> *************** *** 9,23 **** /// </summary> [Serializable] ! public class ValidationFailure : HibernateException { ! public ValidationFailure(string msg) : base(msg) {} ! public ValidationFailure(string msg, Exception e) : base(msg, e) {} ! public ValidationFailure(Exception e) : base("A validation failure occured", e) {} ! public ValidationFailure() : base("A validation failure occured") {} ! protected ValidationFailure(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 9,52 ---- /// </summary> [Serializable] ! public class ValidationFailure : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="msg"></param> ! public ValidationFailure( string msg ) : base( msg ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="msg"></param> ! /// <param name="e"></param> ! public ValidationFailure( string msg, Exception e ) : base( msg, e ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="e"></param> ! public ValidationFailure( Exception e ) : base( "A validation failure occured", e ) ! { ! } ! /// <summary></summary> ! public ValidationFailure() : base( "A validation failure occured" ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected ValidationFailure( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1675 Modified Files: NHibernate.cs ObjectDeletedException.cs ObjectNotFoundException.cs PersistentObjectException.cs PropertyAccessException.cs PropertyNotFoundException.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: ObjectDeletedException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectDeletedException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectDeletedException.cs 22 Nov 2004 03:50:03 -0000 1.4 --- ObjectDeletedException.cs 1 Jan 2005 03:34:16 -0000 1.5 *************** *** 2,6 **** using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> --- 2,6 ---- using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> *************** *** 8,39 **** /// </summary> [Serializable] ! public class ObjectDeletedException : HibernateException { private object identifier; ! public ObjectDeletedException(string message, object identifier) : base(message) { this.identifier = identifier; } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + ": " + identifier; } } ! public ObjectDeletedException(string message, Exception root) : this(message, root.Message) {} ! public ObjectDeletedException(string message) : this(message, message) {} ! public ObjectDeletedException(Exception root) : this(root.Message, root.Message) {} ! public ObjectDeletedException() : this(string.Empty, string.Empty) {} ! protected ObjectDeletedException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 8,75 ---- /// </summary> [Serializable] ! public class ObjectDeletedException : HibernateException { private object identifier; ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="identifier"></param> ! public ObjectDeletedException( string message, object identifier ) : base( message ) { this.identifier = identifier; } ! /// <summary></summary> ! public object Identifier { get { return identifier; } } ! /// <summary></summary> ! public override string Message { get { return base.Message + ": " + identifier; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public ObjectDeletedException( string message, Exception root ) : this( message, root.Message ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public ObjectDeletedException( string message ) : this( message, message ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public ObjectDeletedException( Exception root ) : this( root.Message, root.Message ) ! { ! } ! /// <summary></summary> ! public ObjectDeletedException() : this( string.Empty, string.Empty ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected ObjectDeletedException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: PropertyAccessException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PropertyAccessException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PropertyAccessException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- PropertyAccessException.cs 1 Jan 2005 03:34:16 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 7,11 **** /// </summary> [Serializable] ! public class PropertyAccessException : HibernateException { private System.Type persistentType; --- 7,11 ---- /// </summary> [Serializable] ! public class PropertyAccessException : HibernateException { private System.Type persistentType; *************** *** 13,17 **** private bool wasSetter; ! public PropertyAccessException(Exception root, string message, bool wasSetter, System.Type persistentType, string propertyName) : base(message, root) { this.persistentType = persistentType; --- 13,25 ---- private bool wasSetter; ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! /// <param name="message"></param> ! /// <param name="wasSetter"></param> ! /// <param name="persistentType"></param> ! /// <param name="propertyName"></param> ! public PropertyAccessException( Exception root, string message, bool wasSetter, System.Type persistentType, string propertyName ) : base( message, root ) { this.persistentType = persistentType; *************** *** 20,34 **** } ! public System.Type PersistentType { get { return persistentType; } } ! public override string Message { get { ! return base.Message + ! ( wasSetter ? " setter of " : " getter of ") + persistentType.FullName + "." + --- 28,44 ---- } ! /// <summary></summary> ! public System.Type PersistentType { get { return persistentType; } } ! /// <summary></summary> ! public override string Message { get { ! return base.Message + ! ( wasSetter ? " setter of " : " getter of " ) + persistentType.FullName + "." + *************** *** 37,39 **** } } ! } --- 47,49 ---- } } ! } \ No newline at end of file Index: PropertyNotFoundException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PropertyNotFoundException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PropertyNotFoundException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- PropertyNotFoundException.cs 1 Jan 2005 03:34:16 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 7,15 **** /// </summary> [Serializable] ! public class PropertyNotFoundException : MappingException { ! public PropertyNotFoundException(string message, Exception root) : base(message, root) {} ! public PropertyNotFoundException(Exception root) : base(root) {} ! public PropertyNotFoundException(string message) : base(message) {} } ! } --- 7,36 ---- /// </summary> [Serializable] ! public class PropertyNotFoundException : MappingException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public PropertyNotFoundException( string message, Exception root ) : base( message, root ) ! { ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public PropertyNotFoundException( Exception root ) : base( root ) ! { ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public PropertyNotFoundException( string message ) : base( message ) ! { ! } } ! } \ No newline at end of file Index: NHibernate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NHibernate.cs 11 Dec 2004 20:08:16 -0000 1.24 --- NHibernate.cs 1 Jan 2005 03:34:16 -0000 1.25 *************** *** 1,12 **** using System; - using System.IO; - using NHibernate.Collection; using NHibernate.Proxy; - using NHibernate.SqlTypes; using NHibernate.Type; ! namespace NHibernate { ! /// <summary> /// Provides access to the full range of NHibernate built-in types. --- 1,9 ---- using System; using NHibernate.Collection; using NHibernate.Proxy; using NHibernate.Type; ! namespace NHibernate ! { /// <summary> /// Provides access to the full range of NHibernate built-in types. *************** *** 14,29 **** /// Also a factory for new Blobs and Clobs. /// </summary> ! public class NHibernate { ! /// <summary> /// NHibernate Ansi String type /// </summary> ! public static readonly NullableType AnsiString = new AnsiStringType(); ! /// <summary> /// NHibernate binary type /// </summary> ! public static readonly NullableType Binary = new BinaryType(); ! /// <summary> /// NHibernate binary blob type --- 11,26 ---- /// Also a factory for new Blobs and Clobs. /// </summary> ! public class NHibernate ! { /// <summary> /// NHibernate Ansi String type /// </summary> ! public static readonly NullableType AnsiString = new AnsiStringType(); ! /// <summary> /// NHibernate binary type /// </summary> ! public static readonly NullableType Binary = new BinaryType(); ! /// <summary> /// NHibernate binary blob type *************** *** 34,179 **** /// NHibernate boolean type /// </summary> ! public static readonly NullableType Boolean = new BooleanType(); ! /// <summary> /// NHibernate byte type /// </summary> ! public static readonly NullableType Byte = new ByteType(); ! /// <summary> /// NHibernate character type /// </summary> ! public static readonly NullableType Character = new CharType(); ! /// <summary> /// NHibernate Culture Info type /// </summary> ! public static readonly NullableType CultureInfo = new CultureInfoType(); ! /// <summary> /// NHibernate date type /// </summary> ! public static readonly NullableType DateTime = new DateTimeType(); ! /// <summary> /// NHibernate date type /// </summary> ! public static readonly NullableType Date = new DateType(); /// <summary> /// NHibernate decimal type /// </summary> ! public static readonly NullableType Decimal = new DecimalType(); ! /// <summary> /// NHibernate double type /// </summary> ! public static readonly NullableType Double = new DoubleType(); ! /// <summary> /// NHibernate Guid type. /// </summary> ! public static readonly NullableType Guid = new GuidType(); ! /// <summary> /// NHibernate System.Int16 (short in C#) type /// </summary> ! public static readonly NullableType Int16 = new Int16Type(); ! /// <summary> /// NHibernate System.Int32 (int in C#) type /// </summary> ! public static readonly NullableType Int32 = new Int32Type(); ! /// <summary> /// NHibernate System.Int64 (long in C#) type /// </summary> ! public static readonly NullableType Int64 = new Int64Type(); /// <summary> /// NHibernate System.SByte type /// </summary> ! public static readonly NullableType SByte = new SByteType(); /// <summary> /// NHIbernate System.Single (float in C#) Type /// </summary> ! public static readonly NullableType Single = new SingleType(); /// <summary> /// NHibernate String type /// </summary> ! public static readonly NullableType String = new StringType(); ! /// <summary> /// NHibernate string clob type /// </summary> ! public static readonly NullableType StringClob = new StringClobType(); ! /// <summary> /// NHibernate Time type /// </summary> ! public static readonly NullableType Time = new TimeType(); ! /// <summary> /// NHibernate Ticks type /// </summary> ! public static readonly NullableType Ticks = new TicksType(); ! /// <summary> /// NHibernate Ticks type /// </summary> ! public static readonly NullableType TimeSpan = new TimeSpanType(); /// <summary> /// NHibernate Timestamp type /// </summary> ! public static readonly NullableType Timestamp = new TimestampType(); ! /// <summary> /// NHibernate TrueFalse type /// </summary> ! public static readonly NullableType TrueFalse = new TrueFalseType(); ! /// <summary> /// NHibernate YesNo type /// </summary> ! public static readonly NullableType YesNo = new YesNoType(); /// <summary> /// NHibernate class type /// </summary> ! public static readonly NullableType Class = new TypeType(); ! /// <summary> /// NHibernate serializable type /// </summary> ! public static readonly NullableType Serializable = new SerializableType(); /// <summary> /// NHibernate System.Object type /// </summary> ! public static readonly IType Object = new ObjectType(); ! ! /// <summary> ! /// NHibernate blob type ! /// </summary> ! //public static readonly NullableType Blob = new BlobType(); ! ! /// <summary> ! /// NHibernate clob type ! /// </summary> ! //public static readonly NullableType Clob = new ClobType(); ! /// <summary> /// Cannot be instantiated. /// </summary> ! private NHibernate() ! { ! throw new NotSupportedException(); } ! ! /// <summary> /// A NHibernate persistent enum type --- 31,174 ---- /// NHibernate boolean type /// </summary> ! public static readonly NullableType Boolean = new BooleanType(); ! /// <summary> /// NHibernate byte type /// </summary> ! public static readonly NullableType Byte = new ByteType(); ! /// <summary> /// NHibernate character type /// </summary> ! public static readonly NullableType Character = new CharType(); ! /// <summary> /// NHibernate Culture Info type /// </summary> ! public static readonly NullableType CultureInfo = new CultureInfoType(); ! /// <summary> /// NHibernate date type /// </summary> ! public static readonly NullableType DateTime = new DateTimeType(); ! /// <summary> /// NHibernate date type /// </summary> ! public static readonly NullableType Date = new DateType(); /// <summary> /// NHibernate decimal type /// </summary> ! public static readonly NullableType Decimal = new DecimalType(); ! /// <summary> /// NHibernate double type /// </summary> ! public static readonly NullableType Double = new DoubleType(); ! /// <summary> /// NHibernate Guid type. /// </summary> ! public static readonly NullableType Guid = new GuidType(); ! /// <summary> /// NHibernate System.Int16 (short in C#) type /// </summary> ! public static readonly NullableType Int16 = new Int16Type(); ! /// <summary> /// NHibernate System.Int32 (int in C#) type /// </summary> ! public static readonly NullableType Int32 = new Int32Type(); ! /// <summary> /// NHibernate System.Int64 (long in C#) type /// </summary> ! public static readonly NullableType Int64 = new Int64Type(); /// <summary> /// NHibernate System.SByte type /// </summary> ! public static readonly NullableType SByte = new SByteType(); /// <summary> /// NHIbernate System.Single (float in C#) Type /// </summary> ! public static readonly NullableType Single = new SingleType(); /// <summary> /// NHibernate String type /// </summary> ! public static readonly NullableType String = new StringType(); ! /// <summary> /// NHibernate string clob type /// </summary> ! public static readonly NullableType StringClob = new StringClobType(); ! /// <summary> /// NHibernate Time type /// </summary> ! public static readonly NullableType Time = new TimeType(); ! /// <summary> /// NHibernate Ticks type /// </summary> ! public static readonly NullableType Ticks = new TicksType(); ! /// <summary> /// NHibernate Ticks type /// </summary> ! public static readonly NullableType TimeSpan = new TimeSpanType(); /// <summary> /// NHibernate Timestamp type /// </summary> ! public static readonly NullableType Timestamp = new TimestampType(); ! /// <summary> /// NHibernate TrueFalse type /// </summary> ! public static readonly NullableType TrueFalse = new TrueFalseType(); ! /// <summary> /// NHibernate YesNo type /// </summary> ! public static readonly NullableType YesNo = new YesNoType(); /// <summary> /// NHibernate class type /// </summary> ! public static readonly NullableType Class = new TypeType(); ! /// <summary> /// NHibernate serializable type /// </summary> ! public static readonly NullableType Serializable = new SerializableType(); /// <summary> /// NHibernate System.Object type /// </summary> ! public static readonly IType Object = new ObjectType(); ! ! // /// <summary> ! // /// NHibernate blob type ! // /// </summary> ! // public static readonly NullableType Blob = new BlobType(); ! // /// <summary> ! // /// NHibernate clob type ! // /// </summary> ! // public static readonly NullableType Clob = new ClobType(); /// <summary> /// Cannot be instantiated. /// </summary> ! private NHibernate() ! { ! throw new NotSupportedException(); } ! ! /// <summary> /// A NHibernate persistent enum type *************** *** 181,189 **** /// <param name="enumClass"></param> /// <returns></returns> ! public static IType Enum(System.Type enumClass) { ! return new PersistentEnumType(enumClass); } ! ! /// <summary> /// A NHibernate serializable type --- 176,185 ---- /// <param name="enumClass"></param> /// <returns></returns> ! public static IType Enum( System.Type enumClass ) ! { ! return new PersistentEnumType( enumClass ); } ! ! /// <summary> /// A NHibernate serializable type *************** *** 191,196 **** /// <param name="serializableClass"></param> /// <returns></returns> ! public static IType GetSerializable(System.Type serializableClass) { ! return new SerializableType(serializableClass); } --- 187,193 ---- /// <param name="serializableClass"></param> /// <returns></returns> ! public static IType GetSerializable( System.Type serializableClass ) ! { ! return new SerializableType( serializableClass ); } *************** *** 198,208 **** /// A NHibernate serializable type /// </summary> ! /// <param name="metaType">a type mapping <see cref="NHibernate.Type.IType"/> to a single column</param> /// <param name="identifierType">the entity identifier type</param> /// <returns></returns> ! public static IType Any(IType metaType, IType identifierType) { ! return new ObjectType(metaType, identifierType); } ! /// <summary> /// A NHibernate persistent object (entity) type --- 195,206 ---- /// A NHibernate serializable type /// </summary> ! /// <param name="metaType">a type mapping <see cref="Type.IType"/> to a single column</param> /// <param name="identifierType">the entity identifier type</param> /// <returns></returns> ! public static IType Any( IType metaType, IType identifierType ) ! { ! return new ObjectType( metaType, identifierType ); } ! /// <summary> /// A NHibernate persistent object (entity) type *************** *** 210,219 **** /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> ! [Obsolete("use NHibernate.Entity instead")] ! public static IType Association(System.Type persistentClass) { // not really a many-to-one association *necessarily* ! return new ManyToOneType(persistentClass); } ! /// <summary> /// A NHibernate persistent object (entity) type --- 208,218 ---- /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> ! [Obsolete( "use NHibernate.Entity instead" )] ! public static IType Association( System.Type persistentClass ) ! { // not really a many-to-one association *necessarily* ! return new ManyToOneType( persistentClass ); } ! /// <summary> /// A NHibernate persistent object (entity) type *************** *** 221,230 **** /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> ! public static IType Entity(System.Type persistentClass) { // not really a many-to-one association *necessarily* ! return new ManyToOneType(persistentClass); } ! /// <summary> /// A NHibernate custom type --- 220,229 ---- /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> ! public static IType Entity( System.Type persistentClass ) { // not really a many-to-one association *necessarily* ! return new ManyToOneType( persistentClass ); } ! /// <summary> /// A NHibernate custom type *************** *** 232,237 **** /// <param name="userTypeClass">a class that implements UserType</param> /// <returns></returns> ! public static IType Custom(System.Type userTypeClass) { ! if( typeof(ICompositeUserType).IsAssignableFrom( userTypeClass )) { return new CompositeCustomType( userTypeClass ); --- 231,237 ---- /// <param name="userTypeClass">a class that implements UserType</param> /// <returns></returns> ! public static IType Custom( System.Type userTypeClass ) ! { ! if( typeof( ICompositeUserType ).IsAssignableFrom( userTypeClass ) ) { return new CompositeCustomType( userTypeClass ); *************** *** 239,247 **** else { ! return new CustomType(userTypeClass); } } ! ! /// <summary> /// Force initialization of a proxy or persistent collection. --- 239,247 ---- else { ! return new CustomType( userTypeClass ); } } ! ! /// <summary> /// Force initialization of a proxy or persistent collection. *************** *** 249,254 **** /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <exception cref="HibernateException">if we can't initialize the proxy at this time, eg. the Session was closed</exception> ! public static void Initialize(object proxy) { ! if( proxy==null ) { return; --- 249,255 ---- /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <exception cref="HibernateException">if we can't initialize the proxy at this time, eg. the Session was closed</exception> ! public static void Initialize( object proxy ) ! { ! if( proxy == null ) { return; *************** *** 256,264 **** else if( proxy is INHibernateProxy ) { ! NHibernateProxyHelper.GetLazyInitializer( (INHibernateProxy) proxy ).Initialize(); } else if( proxy is PersistentCollection ) { ! ( (PersistentCollection) proxy ).ForceLoad(); } } --- 257,265 ---- else if( proxy is INHibernateProxy ) { ! NHibernateProxyHelper.GetLazyInitializer( ( INHibernateProxy ) proxy ).Initialize(); } else if( proxy is PersistentCollection ) { ! ( ( PersistentCollection ) proxy ).ForceLoad(); } } *************** *** 269,283 **** /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <returns>true if the argument is already initialized, or is not a proxy or collection</returns> ! public static bool IsInitialized(object proxy) { ! if ( proxy is INHibernateProxy ) { ! return !NHibernateProxyHelper.GetLazyInitializer( (INHibernateProxy) proxy ).IsUninitialized; ! } ! else if ( proxy is PersistentCollection ) { ! return ( (PersistentCollection) proxy).WasInitialized; ! } ! else { return true; --- 270,284 ---- /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <returns>true if the argument is already initialized, or is not a proxy or collection</returns> ! public static bool IsInitialized( object proxy ) { ! if( proxy is INHibernateProxy ) { ! return !NHibernateProxyHelper.GetLazyInitializer( ( INHibernateProxy ) proxy ).IsUninitialized; ! } ! else if( proxy is PersistentCollection ) { ! return ( ( PersistentCollection ) proxy ).WasInitialized; ! } ! else { return true; *************** *** 291,306 **** /// <param name="proxy">a persistable object or proxy</param> /// <returns>the true class of the instance</returns> ! public System.Type GetClass(object proxy) { ! if(proxy is INHibernateProxy) { ! return NHibernateProxyHelper.GetLazyInitializer( (INHibernateProxy) proxy ).GetImplementation().GetType(); } ! else { return proxy.GetType(); } } ! /* /// <summary> --- 292,307 ---- /// <param name="proxy">a persistable object or proxy</param> /// <returns>the true class of the instance</returns> ! public System.Type GetClass( object proxy ) { ! if( proxy is INHibernateProxy ) { ! return NHibernateProxyHelper.GetLazyInitializer( ( INHibernateProxy ) proxy ).GetImplementation().GetType(); } ! else { return proxy.GetType(); } } ! /* /// <summary> *************** *** 376,378 **** */ } ! } --- 377,379 ---- */ } ! } \ No newline at end of file Index: ObjectNotFoundException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectNotFoundException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectNotFoundException.cs 22 Nov 2004 03:50:03 -0000 1.4 --- ObjectNotFoundException.cs 1 Jan 2005 03:34:16 -0000 1.5 *************** *** 2,18 **** using System.Runtime.Serialization; ! namespace NHibernate { - /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> [Serializable] ! public class ObjectNotFoundException : HibernateException { private object identifier; private System.Type type; ! public ObjectNotFoundException(string message, object identifier, System.Type type) : base(message) { this.identifier = identifier; --- 2,23 ---- using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> [Serializable] ! public class ObjectNotFoundException : HibernateException { private object identifier; private System.Type type; ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="identifier"></param> ! /// <param name="type"></param> ! public ObjectNotFoundException( string message, object identifier, System.Type type ) : base( message ) { this.identifier = identifier; *************** *** 20,44 **** } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + ": " + identifier + ", of class: " + type.FullName; } } ! public System.Type Type { get { return type; } } - public ObjectNotFoundException(string message, Exception root) : this(message, root.Message, typeof(ObjectNotFoundException)) {} ! public ObjectNotFoundException(string message) : this(message, message, typeof(ObjectNotFoundException)) {} ! public ObjectNotFoundException(Exception root) : this(root.Message, root.Message, typeof(ObjectNotFoundException)) {} ! protected ObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 25,79 ---- } ! /// <summary></summary> ! public object Identifier { get { return identifier; } } ! /// <summary></summary> ! public override string Message { get { return base.Message + ": " + identifier + ", of class: " + type.FullName; } } ! /// <summary></summary> ! public System.Type Type { get { return type; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public ObjectNotFoundException( string message, Exception root ) : this( message, root.Message, typeof( ObjectNotFoundException ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public ObjectNotFoundException( string message ) : this( message, message, typeof( ObjectNotFoundException ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public ObjectNotFoundException( Exception root ) : this( root.Message, root.Message, typeof( ObjectNotFoundException ) ) ! { ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected ObjectNotFoundException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: PersistentObjectException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PersistentObjectException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PersistentObjectException.cs 22 Nov 2004 03:50:03 -0000 1.3 --- PersistentObjectException.cs 1 Jan 2005 03:34:16 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 8,14 **** /// </summary> [Serializable] ! public class PersistentObjectException : HibernateException { ! public PersistentObjectException(string message) : base(message) {} } ! } --- 8,20 ---- /// </summary> [Serializable] ! public class PersistentObjectException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public PersistentObjectException( string message ) : base( message ) ! { ! } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 03:34:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1607 Modified Files: ITransaction.cs IUserType.cs IValidatable.cs LazyInitializationException.cs LockMode.cs MappingException.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: ITransaction.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ITransaction.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ITransaction.cs 15 Sep 2004 03:17:46 -0000 1.2 --- ITransaction.cs 1 Jan 2005 03:34:01 -0000 1.3 *************** *** 1,6 **** - using System; using System.Data; ! namespace NHibernate { /// <summary> /// Allows the application to define units of work, while maintaining abstraction from the --- 1,6 ---- using System.Data; ! namespace NHibernate ! { /// <summary> /// Allows the application to define units of work, while maintaining abstraction from the *************** *** 15,20 **** /// at a time. Implementors are not intended to be threadsafe. /// </remarks> ! public interface ITransaction { ! /// <summary> /// Flush the associated <c>ISession</c> and end the unit of work. --- 15,20 ---- /// at a time. Implementors are not intended to be threadsafe. /// </remarks> ! public interface ITransaction ! { /// <summary> /// Flush the associated <c>ISession</c> and end the unit of work. *************** *** 43,47 **** /// </remarks> bool WasCommitted { get; } ! /// <summary> /// Enlist the <see cref="IDbCommand"/> in the current Transaction. --- 43,47 ---- /// </remarks> bool WasCommitted { get; } ! /// <summary> /// Enlist the <see cref="IDbCommand"/> in the current Transaction. *************** *** 51,55 **** /// It is okay for this to be a no op implementation. /// </remarks> ! void Enlist(IDbCommand command); } ! } --- 51,55 ---- /// It is okay for this to be a no op implementation. /// </remarks> ! void Enlist( IDbCommand command ); } ! } \ No newline at end of file Index: LockMode.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LockMode.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LockMode.cs 9 Aug 2004 03:10:26 -0000 1.4 --- LockMode.cs 1 Jan 2005 03:34:01 -0000 1.5 *************** *** 1,6 **** using System; - using System.Collections; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 13,22 **** /// </remarks> [Serializable] ! public sealed class LockMode { private int level; private string name; ! private LockMode(int level, string name) { this.level = level; --- 12,26 ---- /// </remarks> [Serializable] ! public sealed class LockMode { private int level; private string name; ! /// <summary> ! /// ! /// </summary> ! /// <param name="level"></param> ! /// <param name="name"></param> ! private LockMode( int level, string name ) { this.level = level; *************** *** 24,28 **** } ! public override string ToString() { return name; --- 28,33 ---- } ! /// <summary></summary> ! public override string ToString() { return name; *************** *** 32,43 **** /// Is this lock mode more restrictive than the given lock mode? /// </summary> ! public bool GreaterThan(LockMode mode) { return level > mode.level; } /// <summary> /// Is this lock mode less restrictive than the given lock mode? /// </summary> ! public bool LessThan(LockMode mode) { return level < mode.level; --- 37,51 ---- /// Is this lock mode more restrictive than the given lock mode? /// </summary> ! /// <param name="mode"></param> ! public bool GreaterThan( LockMode mode ) { return level > mode.level; } + /// <summary> /// Is this lock mode less restrictive than the given lock mode? /// </summary> ! /// <param name="mode"></param> ! public bool LessThan( LockMode mode ) { return level < mode.level; *************** *** 51,55 **** /// might be obtained if necessary. /// </remarks> ! public static LockMode None = new LockMode(0, "None"); /// <summary> --- 59,63 ---- /// might be obtained if necessary. /// </remarks> ! public static LockMode None = new LockMode( 0, "None" ); /// <summary> *************** *** 59,63 **** /// Objects are loaded in <c>Read</c> mode by default /// </remarks> ! public static LockMode Read = new LockMode(5, "Read"); /// <summary> --- 67,71 ---- /// Objects are loaded in <c>Read</c> mode by default /// </remarks> ! public static LockMode Read = new LockMode( 5, "Read" ); /// <summary> *************** *** 68,72 **** /// SQL <c>SELECT ... FOR UPDATE</c> /// </remarks> ! public static LockMode Upgrade = new LockMode(10, "Upgrade"); /// <summary> --- 76,80 ---- /// SQL <c>SELECT ... FOR UPDATE</c> /// </remarks> ! public static LockMode Upgrade = new LockMode( 10, "Upgrade" ); /// <summary> *************** *** 77,81 **** /// The semantics of this lock mode, once obtained, are the same as <c>Upgrade</c> /// </remarks> ! public static LockMode UpgradeNoWait = new LockMode(10, "UpgradeNoWait"); /// <summary> --- 85,89 ---- /// The semantics of this lock mode, once obtained, are the same as <c>Upgrade</c> /// </remarks> ! public static LockMode UpgradeNoWait = new LockMode( 10, "UpgradeNoWait" ); /// <summary> *************** *** 85,93 **** /// This is not a valid mode for <c>Load()</c> or <c>Lock()</c>. /// </remarks> ! public static LockMode Write = new LockMode(10, "Write"); //TODO: need to implement .NET equivalent of readResolve - believe it is // the IObjectReference interface... ! } ! } --- 93,101 ---- /// This is not a valid mode for <c>Load()</c> or <c>Lock()</c>. /// </remarks> ! public static LockMode Write = new LockMode( 10, "Write" ); //TODO: need to implement .NET equivalent of readResolve - believe it is // the IObjectReference interface... ! } ! } \ No newline at end of file Index: IUserType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IUserType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IUserType.cs 6 Dec 2004 03:01:26 -0000 1.4 --- IUserType.cs 1 Jan 2005 03:34:01 -0000 1.5 *************** *** 1,8 **** - using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate { /// <summary> /// The inteface to be implemented by user-defined types. --- 1,7 ---- using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate ! { /// <summary> /// The inteface to be implemented by user-defined types. *************** *** 22,37 **** /// </para> /// <para> ! /// Alternatively, custom types could implement <see cref="Types.IType"/> directly or extend one of the /// abstract classes in <c>NHibernate.Type</c>. This approach risks future incompatible changes /// to classes or intefaces in the package. /// </para> /// </remarks> ! public interface IUserType { /// <summary> /// The SQL types for the columns mapped by this type. /// </summary> ! SqlType[] SqlTypes {get;} ! /// <summary> /// The type returned by <c>NullSafeGet()</c> --- 21,36 ---- /// </para> /// <para> ! /// Alternatively, custom types could implement <see cref="Type.IType"/> directly or extend one of the /// abstract classes in <c>NHibernate.Type</c>. This approach risks future incompatible changes /// to classes or intefaces in the package. /// </para> /// </remarks> ! public interface IUserType { /// <summary> /// The SQL types for the columns mapped by this type. /// </summary> ! SqlType[] SqlTypes { get; } ! /// <summary> /// The type returned by <c>NullSafeGet()</c> *************** *** 46,51 **** /// <param name="y"></param> /// <returns></returns> ! bool Equals(object x, object y); ! /// <summary> /// Retrieve an instance of the mapped class from a JDBC resultset. --- 45,50 ---- /// <param name="y"></param> /// <returns></returns> ! bool Equals( object x, object y ); ! /// <summary> /// Retrieve an instance of the mapped class from a JDBC resultset. *************** *** 57,63 **** /// <returns></returns> /// <exception cref="HibernateException">HibernateException</exception> ! /// <exception cref="SQLException">SQLException</exception> ! object NullSafeGet(IDataReader rs, string[] names, object owner); ! /// <summary> /// Write an instance of the mapped class to a prepared statement. --- 56,62 ---- /// <returns></returns> /// <exception cref="HibernateException">HibernateException</exception> ! // /// <exception cref="SQLException">SQLException</exception> ! object NullSafeGet( IDataReader rs, string[] names, object owner ); ! /// <summary> /// Write an instance of the mapped class to a prepared statement. *************** *** 69,75 **** /// <param name="index">command parameter index</param> /// <exception cref="HibernateException">HibernateException</exception> ! /// <exception cref="SQLException">SQLException</exception> ! void NullSafeSet(IDbCommand cmd, object value, int index); ! /// <summary> /// Return a deep copy of the persistent state, stopping at entities and at collections. --- 68,74 ---- /// <param name="index">command parameter index</param> /// <exception cref="HibernateException">HibernateException</exception> ! // /// <exception cref="SQLException">SQLException</exception> ! void NullSafeSet( IDbCommand cmd, object value, int index ); ! /// <summary> /// Return a deep copy of the persistent state, stopping at entities and at collections. *************** *** 77,82 **** /// <param name="value">generally a collection element or entity field</param> /// <returns>a copy</returns> ! object DeepCopy(object value); ! /// <summary> /// Are objects of this type mutable? --- 76,81 ---- /// <param name="value">generally a collection element or entity field</param> /// <returns>a copy</returns> ! object DeepCopy( object value ); ! /// <summary> /// Are objects of this type mutable? *************** *** 85,87 **** } ! } --- 84,86 ---- } ! } \ No newline at end of file Index: MappingException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/MappingException.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MappingException.cs 22 Nov 2004 03:50:03 -0000 1.5 --- MappingException.cs 1 Jan 2005 03:34:01 -0000 1.6 *************** *** 2,6 **** using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> --- 2,6 ---- using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> *************** *** 9,23 **** /// </summary> [Serializable] ! public class MappingException : HibernateException { ! public MappingException(string message, Exception root) : base(message, root) {} ! public MappingException(Exception root) : base(root) { } ! public MappingException(string message) : base(message) {} ! public MappingException() : base() {} ! protected MappingException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 9,52 ---- /// </summary> [Serializable] ! public class MappingException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public MappingException( string message, Exception root ) : base( message, root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public MappingException( Exception root ) : base( root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public MappingException( string message ) : base( message ) ! { ! } ! /// <summary></summary> ! public MappingException() : base() ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected MappingException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: LazyInitializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LazyInitializationException.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LazyInitializationException.cs 22 Nov 2004 03:50:03 -0000 1.5 --- LazyInitializationException.cs 1 Jan 2005 03:34:01 -0000 1.6 *************** *** 1,6 **** using System; using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> --- 1,7 ---- using System; using System.Runtime.Serialization; + using log4net; ! namespace NHibernate { /// <summary> *************** *** 9,27 **** /// </summary> [Serializable] ! public class LazyInitializationException : Exception { ! public LazyInitializationException(Exception root) : this(root.Message) {} ! public LazyInitializationException(string message) : base(message) { ! log4net.LogManager.GetLogger( typeof(LazyInitializationException) ).Error(message, this); } ! public LazyInitializationException(string message, Exception root) : this(message + " " + root.Message) {} ! public LazyInitializationException() : this("LazyInitalizationException") {} ! protected LazyInitializationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 10,55 ---- /// </summary> [Serializable] ! public class LazyInitializationException : Exception { ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public LazyInitializationException( Exception root ) : this( root.Message ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public LazyInitializationException( string message ) : base( message ) { ! LogManager.GetLogger( typeof( LazyInitializationException ) ).Error( message, this ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public LazyInitializationException( string message, Exception root ) : this( message + " " + root.Message ) ! { ! } ! /// <summary></summary> ! public LazyInitializationException() : this( "LazyInitalizationException" ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected LazyInitializationException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: IValidatable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IValidatable.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IValidatable.cs 17 Feb 2003 18:16:13 -0000 1.1 --- IValidatable.cs 1 Jan 2005 03:34:01 -0000 1.2 *************** *** 1,11 **** ! using System; ! ! namespace NHibernate { /// <summary> /// Implemented by persistent classes with invariants that must be checked before inserting /// into or updating the database /// </summary> ! public interface IValidatable { ! /// <summary> /// Validate the state of the object before persisting it. If a violation occurs, --- 1,10 ---- ! namespace NHibernate ! { /// <summary> /// Implemented by persistent classes with invariants that must be checked before inserting /// into or updating the database /// </summary> ! public interface IValidatable ! { /// <summary> /// Validate the state of the object before persisting it. If a violation occurs, *************** *** 15,17 **** void Validate(); } ! } --- 14,16 ---- void Validate(); } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 03:33:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1542 Modified Files: IInterceptor.cs ILifecycle.cs InstantiationException.cs IQuery.cs ISession.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** IQuery.cs 31 Dec 2004 23:57:30 -0000 1.12 --- IQuery.cs 1 Jan 2005 03:33:40 -0000 1.13 *************** *** 52,56 **** /// The Hibernate types of the query result set. /// </summary> ! IType[ ] ReturnTypes { get; } /// <summary> --- 52,56 ---- /// The Hibernate types of the query result set. /// </summary> ! IType[] ReturnTypes { get; } /// <summary> *************** *** 58,62 **** /// </summary> /// <value>The parameter names, in no particular order</value> ! string[ ] NamedParameters { get; } /// <summary> --- 58,62 ---- /// </summary> /// <value>The parameter names, in no particular order</value> ! string[] NamedParameters { get; } /// <summary> *************** *** 176,180 **** /// <param name="val"></param> /// <returns></returns> ! IQuery SetBinary( int position, byte[ ] val ); /// <summary> --- 176,180 ---- /// <param name="val"></param> /// <returns></returns> ! IQuery SetBinary( int position, byte[] val ); /// <summary> *************** *** 296,300 **** /// <param name="val"></param> /// <returns></returns> ! IQuery SetBinary( string name, byte[ ] val ); /// <summary> --- 296,300 ---- /// <param name="val"></param> /// <returns></returns> ! IQuery SetBinary( string name, byte[] val ); /// <summary> Index: ILifecycle.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ILifecycle.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ILifecycle.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ILifecycle.cs 1 Jan 2005 03:33:40 -0000 1.2 *************** *** 1,6 **** ! using System; ! ! namespace NHibernate { ! /// <summary> /// Provides callbacks from the <c>ISession</c> to the persistent object. Persistent classes may --- 1,4 ---- ! namespace NHibernate ! { /// <summary> /// Provides callbacks from the <c>ISession</c> to the persistent object. Persistent classes may *************** *** 32,37 **** /// </para> /// </remarks> ! public interface ILifecycle { ! /// <summary> /// Called when an entity is saved --- 30,35 ---- /// </para> /// </remarks> ! public interface ILifecycle ! { /// <summary> /// Called when an entity is saved *************** *** 39,43 **** /// <param name="s">The session</param> /// <returns>If we should veto the save</returns> ! LifecycleVeto OnSave(ISession s); /// <summary> --- 37,41 ---- /// <param name="s">The session</param> /// <returns>If we should veto the save</returns> ! LifecycleVeto OnSave( ISession s ); /// <summary> *************** *** 50,54 **** /// <param name="s">The session</param> /// <returns>If we should veto the update</returns> ! LifecycleVeto OnUpdate(ISession s); /// <summary> --- 48,52 ---- /// <param name="s">The session</param> /// <returns>If we should veto the update</returns> ! LifecycleVeto OnUpdate( ISession s ); /// <summary> *************** *** 57,61 **** /// <param name="s">The session</param> /// <returns>If we should veto the delete</returns> ! LifecycleVeto OnDelete(ISession s); /// <summary> --- 55,59 ---- /// <param name="s">The session</param> /// <returns>If we should veto the delete</returns> ! LifecycleVeto OnDelete( ISession s ); /// <summary> *************** *** 68,75 **** /// <param name="s">The session</param> /// <param name="id">The identifier</param> ! void OnLoad(ISession s, object id); } ! public enum LifecycleVeto { /// <summary> /// Veto the action --- 66,75 ---- /// <param name="s">The session</param> /// <param name="id">The identifier</param> ! void OnLoad( ISession s, object id ); } ! /// <summary></summary> ! public enum LifecycleVeto ! { /// <summary> /// Veto the action *************** *** 81,83 **** NoVeto } ! } --- 81,83 ---- NoVeto } ! } \ No newline at end of file Index: InstantiationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/InstantiationException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** InstantiationException.cs 22 Nov 2004 03:50:03 -0000 1.4 --- InstantiationException.cs 1 Jan 2005 03:33:40 -0000 1.5 *************** *** 8,38 **** /// </summary> [Serializable] ! public class InstantiationException : HibernateException { private System.Type type; ! public InstantiationException(string message, System.Type type, Exception root) ! : base(message, root) { this.type = type; } ! public System.Type PersistentType { get { return type; } } ! public override string Message { get { return base.Message + type.FullName; } } ! public InstantiationException(string message, Exception root) : this(message, typeof(InstantiationException), root) {} ! public InstantiationException(string message) : this(message, typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {} ! public InstantiationException() : this("Exception occured", typeof(InstantiationException), new InvalidOperationException("Invalid Operation")) {} ! protected InstantiationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 8,71 ---- /// </summary> [Serializable] ! public class InstantiationException : HibernateException { private System.Type type; ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="type"></param> ! /// <param name="root"></param> ! public InstantiationException( string message, System.Type type, Exception root ) ! : base( message, root ) { this.type = type; } ! /// <summary></summary> ! public System.Type PersistentType { get { return type; } } ! /// <summary></summary> ! public override string Message { get { return base.Message + type.FullName; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public InstantiationException( string message, Exception root ) : this( message, typeof( InstantiationException ), root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public InstantiationException( string message ) : this( message, typeof( InstantiationException ), new InvalidOperationException( "Invalid Operation" ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! public InstantiationException() : this( "Exception occured", typeof( InstantiationException ), new InvalidOperationException( "Invalid Operation" ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected InstantiationException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: ISession.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ISession.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ISession.cs 29 Nov 2004 18:43:17 -0000 1.12 --- ISession.cs 1 Jan 2005 03:33:40 -0000 1.13 *************** *** 1,9 **** using System; - using System.Data; using System.Collections; ! using System.Runtime.Serialization; using NHibernate.Type; ! namespace NHibernate { /// <summary> --- 1,8 ---- using System; using System.Collections; ! using System.Data; using NHibernate.Type; ! namespace NHibernate { /// <summary> *************** *** 66,70 **** /// </para> /// </remarks> ! public interface ISession : IDisposable { /// <summary> --- 65,69 ---- /// </para> /// </remarks> ! public interface ISession : IDisposable { /// <summary> *************** *** 120,124 **** /// <remarks>This is used by applications which require long transactions</remarks> /// <param name="connection">An ADO.NET connection</param> ! void Reconnect(IDbConnection connection); /// <summary> --- 119,123 ---- /// <remarks>This is used by applications which require long transactions</remarks> /// <param name="connection">An ADO.NET connection</param> ! void Reconnect( IDbConnection connection ); /// <summary> *************** *** 151,155 **** /// <param name="obj">a persistent instance</param> /// <returns>the identifier</returns> ! object GetIdentifier(object obj); /// <summary> --- 150,154 ---- /// <param name="obj">a persistent instance</param> /// <returns>the identifier</returns> ! object GetIdentifier( object obj ); /// <summary> *************** *** 158,163 **** /// <param name="obj">an instance of a persistent class</param> /// <returns>true if the given instance is associated with this Session</returns> ! bool Contains(object obj); ! /// <summary> /// Remove this instance from the session cache. Changes to the instance will --- 157,162 ---- /// <param name="obj">an instance of a persistent class</param> /// <returns>true if the given instance is associated with this Session</returns> ! bool Contains( object obj ); ! /// <summary> /// Remove this instance from the session cache. Changes to the instance will *************** *** 165,169 **** /// </summary> /// <param name="obj">a persistent instance</param> ! void Evict(Object obj); /// <summary> --- 164,168 ---- /// </summary> /// <param name="obj">a persistent instance</param> ! void Evict( Object obj ); /// <summary> *************** *** 175,179 **** /// <param name="lockMode">The lock level</param> /// <returns>the persistent instance</returns> ! object Load(System.Type theType, object id, LockMode lockMode); /// <summary> --- 174,178 ---- /// <param name="lockMode">The lock level</param> /// <returns>the persistent instance</returns> ! object Load( System.Type theType, object id, LockMode lockMode ); /// <summary> *************** *** 183,187 **** /// <param name="id">A valid identifier of an existing persistent instance of the class</param> /// <returns>The persistent instance</returns> ! object Load(System.Type theType, object id); /// <summary> --- 182,186 ---- /// <param name="id">A valid identifier of an existing persistent instance of the class</param> /// <returns>The persistent instance</returns> ! object Load( System.Type theType, object id ); /// <summary> *************** *** 191,195 **** /// <param name="obj">An "empty" instance of the persistent class</param> /// <param name="id">A valid identifier of an existing persistent instance of the class</param> ! void Load(object obj, object id); /// <summary> --- 190,194 ---- /// <param name="obj">An "empty" instance of the persistent class</param> /// <param name="id">A valid identifier of an existing persistent instance of the class</param> ! void Load( object obj, object id ); /// <summary> *************** *** 202,206 **** /// <param name="obj">A transient instance of a persistent class</param> /// <returns>The generated identifier</returns> ! object Save(object obj); /// <summary> --- 201,205 ---- /// <param name="obj">A transient instance of a persistent class</param> /// <returns>The generated identifier</returns> ! object Save( object obj ); /// <summary> *************** *** 209,213 **** /// <param name="obj">A transient instance of a persistent class</param> /// <param name="id">An unused valid identifier</param> ! void Save(object obj, object id); /// <summary> --- 208,212 ---- /// <param name="obj">A transient instance of a persistent class</param> /// <param name="id">An unused valid identifier</param> ! void Save( object obj, object id ); /// <summary> *************** *** 220,224 **** /// </remarks> /// <param name="obj">A transient instance containing new or updated state</param> ! void SaveOrUpdate(object obj); /// <summary> --- 219,223 ---- /// </remarks> /// <param name="obj">A transient instance containing new or updated state</param> ! void SaveOrUpdate( object obj ); /// <summary> *************** *** 230,234 **** /// </remarks> /// <param name="obj">A transient instance containing updated state</param> ! void Update(object obj); /// <summary> --- 229,233 ---- /// </remarks> /// <param name="obj">A transient instance containing updated state</param> ! void Update( object obj ); /// <summary> *************** *** 241,245 **** /// <param name="obj">A transient instance containing updated state</param> /// <param name="id">Identifier of persistent instance</param> ! void Update(object obj, object id); /// <summary> --- 240,244 ---- /// <param name="obj">A transient instance containing updated state</param> /// <param name="id">Identifier of persistent instance</param> ! void Update( object obj, object id ); /// <summary> *************** *** 251,255 **** /// </remarks> /// <param name="obj">The instance to be removed</param> ! void Delete(object obj); /// <summary> --- 250,254 ---- /// </remarks> /// <param name="obj">The instance to be removed</param> ! void Delete( object obj ); /// <summary> *************** *** 259,263 **** /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find(string query); /// <summary> --- 258,262 ---- /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find( string query ); /// <summary> *************** *** 269,273 **** /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find(string query, object value, IType type); /// <summary> --- 268,272 ---- /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find( string query, object value, IType type ); /// <summary> *************** *** 279,283 **** /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find(string query, object[] values, IType[] types); /// <summary> --- 278,282 ---- /// <returns>A distinct list of instances</returns> /// <remarks>See <see cref="IQuery.List"/> for implications of <c>cache</c> usage.</remarks> ! IList Find( string query, object[] values, IType[] types ); /// <summary> *************** *** 297,301 **** /// <param name="query">The query string</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable(string query); /// <summary> --- 296,300 ---- /// <param name="query">The query string</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable( string query ); /// <summary> *************** *** 318,322 **** /// <param name="type">The hibernate type of the value</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable(string query, object value, IType type); /// <summary> --- 317,321 ---- /// <param name="type">The hibernate type of the value</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable( string query, object value, IType type ); /// <summary> *************** *** 339,343 **** /// <param name="types">A list of hibernate types of the values</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable(string query, object[] values, IType[] types); /// <summary> --- 338,342 ---- /// <param name="types">A list of hibernate types of the values</param> /// <returns>An enumerator</returns> ! IEnumerable Enumerable( string query, object[] values, IType[] types ); /// <summary> *************** *** 352,356 **** /// <param name="filter">A filter query string</param> /// <returns>The resulting collection</returns> ! ICollection Filter(object collection, string filter); /// <summary> --- 351,355 ---- /// <param name="filter">A filter query string</param> /// <returns>The resulting collection</returns> ! ICollection Filter( object collection, string filter ); /// <summary> *************** *** 367,371 **** /// <param name="type">The hibernate type of value</param> /// <returns>A collection</returns> ! ICollection Filter(object collection, string filter, object value, IType type); /// <summary> --- 366,370 ---- /// <param name="type">The hibernate type of value</param> /// <returns>A collection</returns> ! ICollection Filter( object collection, string filter, object value, IType type ); /// <summary> *************** *** 382,387 **** /// <param name="types">The hibernate types of the values</param> /// <returns>A collection</returns> ! ICollection Filter(object collection, string filter, object[] values, IType[] types); ! /// <summary> /// Delete all objects returned by the query. --- 381,386 ---- /// <param name="types">The hibernate types of the values</param> /// <returns>A collection</returns> ! ICollection Filter( object collection, string filter, object[] values, IType[] types ); ! /// <summary> /// Delete all objects returned by the query. *************** *** 389,393 **** /// <param name="query">The query string</param> /// <returns>Returns the number of objects deleted.</returns> ! int Delete(string query); /// <summary> --- 388,392 ---- /// <param name="query">The query string</param> /// <returns>Returns the number of objects deleted.</returns> ! int Delete( string query ); /// <summary> *************** *** 398,402 **** /// <param name="type">The hibernate type of value.</param> /// <returns>The number of instances deleted</returns> ! int Delete(string query, object value, IType type); /// <summary> --- 397,401 ---- /// <param name="type">The hibernate type of value.</param> /// <returns>The number of instances deleted</returns> ! int Delete( string query, object value, IType type ); /// <summary> *************** *** 407,411 **** /// <param name="types">A list of Hibernate types of the values</param> /// <returns>The number of instances deleted</returns> ! int Delete(string query, object[] values, IType[] types); /// <summary> --- 406,410 ---- /// <param name="types">A list of Hibernate types of the values</param> /// <returns>The number of instances deleted</returns> ! int Delete( string query, object[] values, IType[] types ); /// <summary> *************** *** 414,418 **** /// <param name="obj">A persistent instance</param> /// <param name="lockMode">The lock level</param> ! void Lock(object obj, LockMode lockMode); /// <summary> --- 413,417 ---- /// <param name="obj">A persistent instance</param> /// <param name="lockMode">The lock level</param> ! void Lock( object obj, LockMode lockMode ); /// <summary> *************** *** 434,438 **** /// </remarks> /// <param name="obj">A persistent instance</param> ! void Refresh(object obj); /// <summary> --- 433,437 ---- /// </remarks> /// <param name="obj">A persistent instance</param> ! void Refresh( object obj ); /// <summary> *************** *** 441,445 **** /// <param name="obj">A persistent instance</param> /// <returns>The current lock mode</returns> ! LockMode GetCurrentLockMode(object obj); /// <summary> --- 440,444 ---- /// <param name="obj">A persistent instance</param> /// <returns>The current lock mode</returns> ! LockMode GetCurrentLockMode( object obj ); /// <summary> *************** *** 462,467 **** /// instead of throwing an Exception because that would allow other methods to just do null checks instead /// of error checking... ! ITransaction Transaction {get;} ! /// <summary> /// Creates a new <c>Criteria</c> for the entity class. --- 461,466 ---- /// instead of throwing an Exception because that would allow other methods to just do null checks instead /// of error checking... ! ITransaction Transaction { get; } ! /// <summary> /// Creates a new <c>Criteria</c> for the entity class. *************** *** 469,473 **** /// <param name="persistentClass">The class to Query</param> /// <returns>An ICriteria object</returns> ! ICriteria CreateCriteria(System.Type persistentClass); /// <summary> --- 468,472 ---- /// <param name="persistentClass">The class to Query</param> /// <returns>An ICriteria object</returns> ! ICriteria CreateCriteria( System.Type persistentClass ); /// <summary> *************** *** 476,480 **** /// <param name="queryString">A hibernate query string</param> /// <returns>The query</returns> ! IQuery CreateQuery(string queryString); /// <summary> --- 475,479 ---- /// <param name="queryString">A hibernate query string</param> /// <returns>The query</returns> ! IQuery CreateQuery( string queryString ); /// <summary> *************** *** 484,488 **** /// <param name="queryString">A hibernate query</param> /// <returns>A query</returns> ! IQuery CreateFilter(object collection, string queryString); /// <summary> --- 483,487 ---- /// <param name="queryString">A hibernate query</param> /// <returns>A query</returns> ! IQuery CreateFilter( object collection, string queryString ); /// <summary> *************** *** 492,496 **** /// <param name="queryName">The name of a query defined externally</param> /// <returns>A queru</returns> ! IQuery GetNamedQuery(string queryName); } ! } --- 491,495 ---- /// <param name="queryName">The name of a query defined externally</param> /// <returns>A queru</returns> ! IQuery GetNamedQuery( string queryName ); } ! } \ No newline at end of file Index: IInterceptor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IInterceptor.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IInterceptor.cs 31 Dec 2004 15:38:09 -0000 1.4 --- IInterceptor.cs 1 Jan 2005 03:33:40 -0000 1.5 *************** *** 35,39 **** /// 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> --- 35,39 ---- /// 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> *************** *** 54,58 **** /// </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> --- 54,58 ---- /// </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> *************** *** 69,73 **** /// </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> --- 69,73 ---- /// </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> *************** *** 82,86 **** /// 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> --- 82,86 ---- /// 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> *************** *** 129,133 **** /// <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> --- 129,133 ---- /// <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> |
From: Kevin W. <kev...@us...> - 2005-01-01 03:33:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1441 Modified Files: FlushMode.cs ICompositeUserType.cs ICriteria.cs IDatabinder.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: IDatabinder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IDatabinder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IDatabinder.cs 17 Feb 2003 18:16:13 -0000 1.1 --- IDatabinder.cs 1 Jan 2005 03:32:56 -0000 1.2 *************** *** 1,8 **** - using System; using System.Collections; using System.Xml; ! ! namespace NHibernate { /// <summary> /// Provides XML marshalling for classes registered with a <c>SessionFactory</c> --- 1,7 ---- using System.Collections; using System.Xml; ! namespace NHibernate ! { /// <summary> /// Provides XML marshalling for classes registered with a <c>SessionFactory</c> *************** *** 25,30 **** /// </para> /// </remarks> ! public interface IDatabinder { ! /// <summary> /// Add an object to the output document. --- 24,29 ---- /// </para> /// </remarks> ! public interface IDatabinder ! { /// <summary> /// Add an object to the output document. *************** *** 32,36 **** /// <param name="obj">A transient or persistent instance</param> /// <returns>Databinder</returns> ! IDatabinder Bind(object obj); /// <summary> --- 31,35 ---- /// <param name="obj">A transient or persistent instance</param> /// <returns>Databinder</returns> ! IDatabinder Bind( object obj ); /// <summary> *************** *** 39,43 **** /// <param name="objs">A collection of transient or persistent instance</param> /// <returns>Databinder</returns> ! IDatabinder BindAll(ICollection objs); /// <summary> --- 38,42 ---- /// <param name="objs">A collection of transient or persistent instance</param> /// <returns>Databinder</returns> ! IDatabinder BindAll( ICollection objs ); /// <summary> *************** *** 74,76 **** bool InitializeLazy { get; set; } } ! } --- 73,75 ---- bool InitializeLazy { get; set; } } ! } \ No newline at end of file Index: ICompositeUserType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ICompositeUserType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ICompositeUserType.cs 22 Apr 2003 14:09:28 -0000 1.1 --- ICompositeUserType.cs 1 Jan 2005 03:32:56 -0000 1.2 *************** *** 1,5 **** using System; using System.Data; - using NHibernate.Engine; using NHibernate.Type; --- 1,4 ---- *************** *** 42,46 **** /// <param name="property"></param> /// <returns>the property value</returns> ! object GetPropertyValue(object component, int property); /// <summary> --- 41,45 ---- /// <param name="property"></param> /// <returns>the property value</returns> ! object GetPropertyValue( object component, int property ); /// <summary> *************** *** 50,58 **** /// <param name="property"></param> /// <param name="value">the value to set</param> ! void SetPropertyValue(object component, int property, object value); /// <summary> ! /// The class returned by NullSafeGet(). ! /// </summary> System.Type ReturnedClass { get; } --- 49,57 ---- /// <param name="property"></param> /// <param name="value">the value to set</param> ! void SetPropertyValue( object component, int property, object value ); /// <summary> ! /// The class returned by NullSafeGet(). ! /// </summary> System.Type ReturnedClass { get; } *************** *** 64,68 **** /// <param name="y"></param> /// <returns></returns> ! bool Equals(Object x, Object y); /// <summary> --- 63,67 ---- /// <param name="y"></param> /// <returns></returns> ! bool Equals( Object x, Object y ); /// <summary> *************** *** 75,79 **** /// <param name="owner">the containing entity</param> /// <returns></returns> ! object NullSafeGet(IDataReader dr, string[] names, ISessionImplementor session, object owner); /// <summary> --- 74,78 ---- /// <param name="owner">the containing entity</param> /// <returns></returns> ! object NullSafeGet( IDataReader dr, string[] names, ISessionImplementor session, object owner ); /// <summary> *************** *** 86,90 **** /// <param name="index"></param> /// <param name="session"></param> ! void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session); /// <summary> --- 85,89 ---- /// <param name="index"></param> /// <param name="session"></param> ! void NullSafeSet( IDbCommand cmd, object value, int index, ISessionImplementor session ); /// <summary> *************** *** 93,97 **** /// <param name="value">generally a collection element or entity field</param> /// <returns></returns> ! object DeepCopy(object value); /// <summary> --- 92,96 ---- /// <param name="value">generally a collection element or entity field</param> /// <returns></returns> ! object DeepCopy( object value ); /// <summary> *************** *** 108,112 **** /// <param name="session"></param> /// <returns></returns> ! object Disassemble(object value, ISessionImplementor session); /// <summary> --- 107,111 ---- /// <param name="session"></param> /// <returns></returns> ! object Disassemble( object value, ISessionImplementor session ); /// <summary> *************** *** 118,122 **** /// <param name="owner"></param> /// <returns></returns> ! object Assemble(object cached, ISessionImplementor session, object owner); } } \ No newline at end of file --- 117,121 ---- /// <param name="owner"></param> /// <returns></returns> ! object Assemble( object cached, ISessionImplementor session, object owner ); } } \ No newline at end of file Index: ICriteria.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ICriteria.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ICriteria.cs 2 Sep 2004 04:00:42 -0000 1.6 --- ICriteria.cs 1 Jan 2005 03:32:56 -0000 1.7 *************** *** 1,9 **** - using System; using System.Collections; - using NHibernate.Engine; using NHibernate.Expression; ! namespace NHibernate { ///<summary> --- 1,7 ---- using System.Collections; using NHibernate.Engine; using NHibernate.Expression; ! namespace NHibernate { ///<summary> *************** *** 31,46 **** ///This is an experimental API ///</summary> ! ! public interface ICriteria { /// <summary> /// Set a limit upon the number of objects to be retrieved /// </summary> ! ICriteria SetMaxResults(int maxResults); /// <summary> /// Set the first result to be retrieved /// </summary> ! ICriteria SetFirstResult(int firstResult); /// <summary> --- 29,45 ---- ///This is an experimental API ///</summary> ! public interface ICriteria { /// <summary> /// Set a limit upon the number of objects to be retrieved /// </summary> ! /// <param name="maxResults"></param> ! ICriteria SetMaxResults( int maxResults ); /// <summary> /// Set the first result to be retrieved /// </summary> ! /// <param name="firstResult"></param> ! ICriteria SetFirstResult( int firstResult ); /// <summary> *************** *** 49,53 **** /// <param name="timeout"></param> /// <returns></returns> ! ICriteria SetTimeout(int timeout); /// <summary> --- 48,52 ---- /// <param name="timeout"></param> /// <returns></returns> ! ICriteria SetTimeout( int timeout ); /// <summary> *************** *** 61,70 **** /// <param name="expression"></param> /// <returns></returns> ! ICriteria Add(Expression.Expression expression); /// <summary> /// An an Order to the result set /// </summary> ! ICriteria AddOrder(Order order); --- 60,70 ---- /// <param name="expression"></param> /// <returns></returns> ! ICriteria Add( Expression.Expression expression ); /// <summary> /// An an Order to the result set /// </summary> ! /// <param name="order"></param> ! ICriteria AddOrder( Order order ); *************** *** 79,83 **** /// resulting expression. /// </summary> ! Expression.Expression Expression {get;} /// <summary> --- 79,83 ---- /// resulting expression. /// </summary> ! Expression.Expression Expression { get; } /// <summary> *************** *** 87,91 **** /// <returns></returns> IEnumerator IterateExpressions(); ! /// <summary> /// Provides an Enumerator to Iterate through the Order clauses --- 87,91 ---- /// <returns></returns> IEnumerator IterateExpressions(); ! /// <summary> /// Provides an Enumerator to Iterate through the Order clauses *************** *** 94,98 **** /// <returns></returns> IEnumerator IterateOrderings(); ! /// <summary> /// The PersistentClass that is the entry point for the Criteria. --- 94,98 ---- /// <returns></returns> IEnumerator IterateOrderings(); ! /// <summary> /// The PersistentClass that is the entry point for the Criteria. *************** *** 105,109 **** /// <param name="path"></param> /// <returns></returns> ! FetchMode GetFetchMode(string path); /// <summary> --- 105,109 ---- /// <param name="path"></param> /// <returns></returns> ! FetchMode GetFetchMode( string path ); /// <summary> *************** *** 114,118 **** /// <param name="mode">The Fetch mode.</param> /// <returns></returns> ! ICriteria SetFetchMode(string associationPath, FetchMode mode); } } \ No newline at end of file --- 114,118 ---- /// <param name="mode">The Fetch mode.</param> /// <returns></returns> ! ICriteria SetFetchMode( string associationPath, FetchMode mode ); } } \ No newline at end of file Index: FlushMode.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/FlushMode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FlushMode.cs 9 Aug 2004 03:10:26 -0000 1.3 --- FlushMode.cs 1 Jan 2005 03:32:56 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 11,15 **** /// </remarks> [Serializable] ! public enum FlushMode { /// <summary> --- 11,15 ---- /// </remarks> [Serializable] ! public enum FlushMode { /// <summary> *************** *** 29,31 **** Auto = 10 } ! } --- 29,31 ---- Auto = 10 } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 03:31:43
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1277 Modified Files: ADOException.cs AssemblyInfo.cs AssertionFailure.cs CallbackException.cs FetchMode.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: CallbackException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/CallbackException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CallbackException.cs 21 Sep 2004 12:43:26 -0000 1.4 --- CallbackException.cs 1 Jan 2005 03:31:31 -0000 1.5 *************** *** 2,19 **** using System.Runtime.Serialization; ! namespace NHibernate { ! [Serializable] ! public class CallbackException : HibernateException { ! public CallbackException() : base("An exception occured in a callback") {} ! public CallbackException(Exception root) : base("An exception occured in a callback", root) {} ! public CallbackException(string message) : base(message) {} ! public CallbackException(string message, Exception e) : base(message, e) {} ! protected CallbackException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 2,49 ---- using System.Runtime.Serialization; ! namespace NHibernate { ! /// <summary></summary> ! [ Serializable ] ! public class CallbackException : HibernateException { ! /// <summary></summary> ! public CallbackException() : this( "An exception occured in a callback" ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public CallbackException( Exception root ) : this( "An exception occured in a callback", root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public CallbackException( string message ) : base( message ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="e"></param> ! public CallbackException( string message, Exception e ) : base( message, e ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected CallbackException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: AssertionFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssertionFailure.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AssertionFailure.cs 22 Nov 2004 03:50:03 -0000 1.5 --- AssertionFailure.cs 1 Jan 2005 03:31:31 -0000 1.6 *************** *** 1,29 **** using System; using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> /// Indicates failure of an assertion: a possible bug in NHibernate /// </summary> ! [Serializable] ! public class AssertionFailure : ApplicationException { ! public AssertionFailure() : base(String.Empty) { ! log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate"); } ! public AssertionFailure(string message) : base(message) { ! log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", this); } ! public AssertionFailure(string message, Exception e) : base(message, e) { ! log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", e); } ! protected AssertionFailure(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 1,47 ---- using System; using System.Runtime.Serialization; + using log4net; ! namespace NHibernate { /// <summary> /// Indicates failure of an assertion: a possible bug in NHibernate /// </summary> ! [ Serializable ] ! public class AssertionFailure : ApplicationException { ! /// <summary></summary> ! public AssertionFailure() : base( String.Empty ) { ! LogManager.GetLogger( typeof( AssertionFailure ) ).Error( "An AssertionFailure occured - this may indicate a bug in NHibernate" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public AssertionFailure( string message ) : base( message ) { ! LogManager.GetLogger( typeof( AssertionFailure ) ).Error( "An AssertionFailure occured - this may indicate a bug in NHibernate", this ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="e"></param> ! public AssertionFailure( string message, Exception e ) : base( message, e ) { ! LogManager.GetLogger( typeof( AssertionFailure ) ).Error( "An AssertionFailure occured - this may indicate a bug in NHibernate", e ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected AssertionFailure( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: FetchMode.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/FetchMode.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FetchMode.cs 9 Aug 2004 03:10:26 -0000 1.2 --- FetchMode.cs 1 Jan 2005 03:31:31 -0000 1.3 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate { /// <summary> *************** *** 13,18 **** /// </para> /// </remarks> ! [Serializable] ! public enum FetchMode { /// <summary> --- 13,18 ---- /// </para> /// </remarks> ! [ Serializable ] ! public enum FetchMode { /// <summary> Index: ADOException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ADOException.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ADOException.cs 22 Nov 2004 03:50:03 -0000 1.7 --- ADOException.cs 1 Jan 2005 03:31:31 -0000 1.8 *************** *** 2,30 **** using System.Data; using System.Runtime.Serialization; ! namespace NHibernate { /// <summary> /// Wraps an <c>DataException</c>. Indicates that an exception occurred during an ADO.NET call. /// </summary> ! [Serializable] ! public class ADOException : HibernateException { ! private Exception sqle; ! ! public ADOException() : this("DataException occured", new InvalidOperationException("Invalid Operation")) { } ! public ADOException(string message) : this(message, new InvalidOperationException("Invalid Operation")) { } ! public ADOException(DataException root) : this("DataException occurred", root) { } ! public ADOException(string message, Exception root) : base(message, root) { ! sqle = root; ! log4net.LogManager.GetLogger( typeof(ADOException) ).Error(message, root); } ! protected ADOException(SerializationInfo info, StreamingContext context) : base(info, context) { } } ! } --- 2,55 ---- using System.Data; using System.Runtime.Serialization; + using log4net; ! namespace NHibernate { /// <summary> /// Wraps an <c>DataException</c>. Indicates that an exception occurred during an ADO.NET call. /// </summary> ! [ Serializable ] ! public class ADOException : HibernateException { ! /// <summary></summary> ! public ADOException() : this( "DataException occured", new InvalidOperationException( "Invalid Operation" ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! public ADOException( string message ) : this( message, new InvalidOperationException( "Invalid Operation" ) ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="root"></param> ! public ADOException( DataException root ) : this( "DataException occurred", root ) ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public ADOException( string message, Exception root ) : base( message, root ) { ! LogManager.GetLogger( typeof( ADOException ) ).Error( message, root ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="info"></param> ! /// <param name="context"></param> ! protected ADOException( SerializationInfo info, StreamingContext context ) : base( info, context ) ! { ! } } ! } \ No newline at end of file Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssemblyInfo.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AssemblyInfo.cs 2 Dec 2004 20:49:50 -0000 1.13 --- AssemblyInfo.cs 1 Jan 2005 03:31:31 -0000 1.14 *************** *** 6,10 **** // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.573 // // Changes to this file may cause incorrect behavior and will be lost if --- 6,10 ---- // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.2032 // // Changes to this file may cause incorrect behavior and will be lost if *************** *** 22,25 **** [assembly: AssemblyInformationalVersionAttribute("0.5")] [assembly: AssemblyFileVersionAttribute("0.5.0.0")] - //[assembly: AssemblyKeyFileAttribute("..\\NHibernate.snk")] --- 22,24 ---- |
From: Kevin W. <kev...@us...> - 2005-01-01 02:40:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26090 Modified Files: StringHelper.cs StringTokenizer.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: StringTokenizer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringTokenizer.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StringTokenizer.cs 31 Dec 2004 23:57:07 -0000 1.3 --- StringTokenizer.cs 1 Jan 2005 02:40:28 -0000 1.4 *************** *** 2,17 **** using System.Collections; ! namespace NHibernate.Util { /// <summary> /// A StringTokenizer java like object /// </summary> ! public class StringTokenizer : IEnumerable { ! ! private static readonly string _defaultDelim=" \t\n\r\f"; ! string _origin; ! string _delim; ! bool _returnDelim; ! public StringTokenizer(string str) { _origin = str; _delim = _defaultDelim; --- 2,23 ---- using System.Collections; ! namespace NHibernate.Util ! { /// <summary> /// A StringTokenizer java like object /// </summary> ! public class StringTokenizer : IEnumerable ! { ! private static readonly string _defaultDelim = " \t\n\r\f"; ! private string _origin; ! private string _delim; ! private bool _returnDelim; ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! public StringTokenizer( string str ) ! { _origin = str; _delim = _defaultDelim; *************** *** 19,23 **** } ! public StringTokenizer(string str, string delim) { _origin = str; _delim = delim; --- 25,35 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! /// <param name="delim"></param> ! public StringTokenizer( string str, string delim ) ! { _origin = str; _delim = delim; *************** *** 25,29 **** } ! public StringTokenizer(string str, string delim, bool returnDelims) { _origin = str; _delim = delim; --- 37,48 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! /// <param name="delim"></param> ! /// <param name="returnDelims"></param> ! public StringTokenizer( string str, string delim, bool returnDelims ) ! { _origin = str; _delim = delim; *************** *** 31,75 **** } ! public IEnumerator GetEnumerator() { ! return new StringTokenizerEnumerator(this); } ! private class StringTokenizerEnumerator : IEnumerator { private StringTokenizer _stokenizer; private int _cursor = 0; private String _next = null; ! ! public StringTokenizerEnumerator(StringTokenizer stok) { _stokenizer = stok; } ! public bool MoveNext() { _next = GetNext(); return _next != null; } ! public void Reset() { _cursor = 0; } ! public object Current { ! get { ! return _next; ! } } ! private string GetNext() { char c; bool isDelim; ! if( _cursor >= _stokenizer._origin.Length ) return null; ! c = _stokenizer._origin[_cursor]; ! isDelim = (_stokenizer._delim.IndexOf(c) != -1); ! ! if ( isDelim ) { _cursor++; ! if ( _stokenizer._returnDelim ) { return c.ToString(); } --- 50,102 ---- } ! /// <summary></summary> ! public IEnumerator GetEnumerator() ! { ! return new StringTokenizerEnumerator( this ); } ! private class StringTokenizerEnumerator : IEnumerator ! { private StringTokenizer _stokenizer; private int _cursor = 0; private String _next = null; ! ! public StringTokenizerEnumerator( StringTokenizer stok ) ! { _stokenizer = stok; } ! public bool MoveNext() ! { _next = GetNext(); return _next != null; } ! public void Reset() ! { _cursor = 0; } ! public object Current ! { ! get { return _next; } } ! private string GetNext() ! { char c; bool isDelim; ! if( _cursor >= _stokenizer._origin.Length ) return null; ! c = _stokenizer._origin[ _cursor ]; ! isDelim = ( _stokenizer._delim.IndexOf( c ) != -1 ); ! ! if( isDelim ) ! { _cursor++; ! if( _stokenizer._returnDelim ) ! { return c.ToString(); } *************** *** 77,86 **** } ! int nextDelimPos = _stokenizer._origin.IndexOfAny(_stokenizer._delim.ToCharArray(), _cursor); ! if (nextDelimPos == -1) { nextDelimPos = _stokenizer._origin.Length; } ! string nextToken = _stokenizer._origin.Substring(_cursor, nextDelimPos - _cursor); _cursor = nextDelimPos; return nextToken; --- 104,114 ---- } ! int nextDelimPos = _stokenizer._origin.IndexOfAny( _stokenizer._delim.ToCharArray(), _cursor ); ! if( nextDelimPos == -1 ) ! { nextDelimPos = _stokenizer._origin.Length; } ! string nextToken = _stokenizer._origin.Substring( _cursor, nextDelimPos - _cursor ); _cursor = nextDelimPos; return nextToken; Index: StringHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringHelper.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** StringHelper.cs 22 Nov 2004 03:52:18 -0000 1.16 --- StringHelper.cs 1 Jan 2005 02:40:28 -0000 1.17 *************** *** 1,56 **** using System; - using System.Text; using System.Collections; ! namespace NHibernate.Util { ! ! public sealed class StringHelper { ! private StringHelper() { // not creatable } public const char Dot = '.'; public const char Underscore = '_'; public const string CommaSpace = ", "; public const string Comma = ","; public const string OpenParen = "("; public const string ClosedParen = ")"; public const string SqlParameter = "?"; ! public static string Repeat(string str, int times) { ! StringBuilder buf = new StringBuilder(str.Length * times); ! for (int i=0; i<times; i++) ! buf.Append(str); return buf.ToString(); } ! public static string Replace(string template, string placeholder, string replacement) { // sometimes a null value will get passed in here -> SqlWhereStrings are a good example ! if(template==null) return null; ! int loc = template.IndexOf(placeholder); ! if (loc<0) { return template; ! } else { ! return new StringBuilder( template.Substring(0, loc) ) ! .Append(replacement) .Append( Replace( ! template.Substring( loc + placeholder.Length ), ! placeholder, ! replacement ! ) ).ToString(); } } ! public static string ReplaceOnce(string template, string placeholder, string replacement) { ! int loc = template.IndexOf(placeholder); ! if (loc < 0) { return template; ! } else { ! return new StringBuilder( template.Substring(0, loc) ) ! .Append(replacement) .Append( template.Substring( loc + placeholder.Length ) ) .ToString(); --- 1,92 ---- using System; using System.Collections; + using System.Text; ! namespace NHibernate.Util { ! /// <summary></summary> ! public sealed class StringHelper { ! private StringHelper() { // not creatable } + /// <summary></summary> public const char Dot = '.'; + /// <summary></summary> public const char Underscore = '_'; + /// <summary></summary> public const string CommaSpace = ", "; + /// <summary></summary> public const string Comma = ","; + /// <summary></summary> public const string OpenParen = "("; + /// <summary></summary> public const string ClosedParen = ")"; + /// <summary></summary> public const string SqlParameter = "?"; ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! /// <param name="times"></param> ! /// <returns></returns> ! public static string Repeat( string str, int times ) ! { ! StringBuilder buf = new StringBuilder( str.Length*times ); ! for( int i = 0; i < times; i++ ) ! buf.Append( str ); return buf.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="template"></param> ! /// <param name="placeholder"></param> ! /// <param name="replacement"></param> ! /// <returns></returns> ! public static string Replace( string template, string placeholder, string replacement ) ! { // sometimes a null value will get passed in here -> SqlWhereStrings are a good example ! if( template == null ) return null; ! int loc = template.IndexOf( placeholder ); ! if( loc < 0 ) ! { return template; ! } ! else ! { ! return new StringBuilder( template.Substring( 0, loc ) ) ! .Append( replacement ) .Append( Replace( ! template.Substring( loc + placeholder.Length ), ! placeholder, ! replacement ! ) ).ToString(); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="template"></param> ! /// <param name="placeholder"></param> ! /// <param name="replacement"></param> ! /// <returns></returns> ! public static string ReplaceOnce( string template, string placeholder, string replacement ) ! { ! int loc = template.IndexOf( placeholder ); ! if( loc < 0 ) ! { return template; ! } ! else ! { ! return new StringBuilder( template.Substring( 0, loc ) ) ! .Append( replacement ) .Append( template.Substring( loc + placeholder.Length ) ) .ToString(); *************** *** 66,72 **** /// <param name="list">the string that will be broken into tokens</param> /// <returns></returns> ! public static string[] Split(string separators, string list) { ! return list.Split(separators.ToCharArray()); } --- 102,108 ---- /// <param name="list">the string that will be broken into tokens</param> /// <returns></returns> ! public static string[ ] Split( string separators, string list ) { ! return list.Split( separators.ToCharArray() ); } *************** *** 82,102 **** /// not including the seperators in the tokens. /// </remarks> ! public static string[] Split(string separators, string list, bool include) { ! StringTokenizer tokens = new StringTokenizer(list, separators, include); ArrayList results = new ArrayList(); ! foreach(string token in tokens) { results.Add( token ); } ! return (string[]) results.ToArray(typeof(string)); } ! public static string Unqualify(string qualifiedName) { ! return Unqualify(qualifiedName, "."); } ! public static string Unqualify(string qualifiedName, string seperator) { ! return qualifiedName.Substring( qualifiedName.LastIndexOf(seperator) + 1 ); } --- 118,151 ---- /// not including the seperators in the tokens. /// </remarks> ! public static string[ ] Split( string separators, string list, bool include ) { ! StringTokenizer tokens = new StringTokenizer( list, separators, include ); ArrayList results = new ArrayList(); ! foreach( string token in tokens ) { results.Add( token ); } ! return ( string[ ] ) results.ToArray( typeof( string ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="qualifiedName"></param> ! /// <returns></returns> ! public static string Unqualify( string qualifiedName ) ! { ! return Unqualify( qualifiedName, "." ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="qualifiedName"></param> ! /// <param name="seperator"></param> ! /// <returns></returns> ! public static string Unqualify( string qualifiedName, string seperator ) ! { ! return qualifiedName.Substring( qualifiedName.LastIndexOf( seperator ) + 1 ); } *************** *** 107,113 **** /// <param name="typeName"></param> /// <returns></returns> ! public static string GetFullClassname(string typeName) { ! return typeName.Trim().Split(' ', ',')[0]; } --- 156,162 ---- /// <param name="typeName"></param> /// <returns></returns> ! public static string GetFullClassname( string typeName ) { ! return typeName.Trim().Split( ' ', ',' )[ 0 ]; } *************** *** 118,204 **** /// <param name="typeName"></param> /// <returns></returns> ! public static string GetClassname(string typeName) { ! string[] splitClassname = GetFullClassname(typeName).Split('.'); ! ! return splitClassname[splitClassname.Length-1]; } ! public static string Qualifier(string qualifiedName) { ! int loc = qualifiedName.LastIndexOf("."); ! if ( loc< 0 ) { return String.Empty; ! } else { ! return qualifiedName.Substring(0, loc); } } ! public static string[] Suffix(string[] columns, string suffix) { ! if (suffix == null) return columns; ! string[] qualified = new string[columns.Length]; ! for ( int i=0; i<columns.Length; i++) { ! qualified[i] = Suffix(columns[i], suffix); } return qualified; } ! public static string Suffix(string name, string suffix) { ! return (suffix == null) ? name : name + suffix; } ! public static string[] Prefix(string [] columns, string prefix) { ! if (prefix == null) return columns; ! string[] qualified = new string[columns.Length]; ! for (int i=0; i<columns.Length; i++) { ! qualified[i] = prefix + columns[i]; } return qualified; } ! public static string Root(string qualifiedName) { ! int loc = qualifiedName.IndexOf("."); ! return (loc<0) ? qualifiedName ! : qualifiedName.Substring(0, loc); } ! public static bool BooleanValue(string tfString) { string trimmed = tfString.Trim().ToLower(); ! return trimmed.Equals("true") || trimmed.Equals("t"); } ! public static string ToString(object[] array) { int len = array.Length; ! // if there is no value in the array then return no string... ! if(len==0) return String.Empty; ! StringBuilder buf = new StringBuilder(len * 12); ! for (int i=0; i<len - 1; i++) { ! buf.Append( array[i] ).Append(StringHelper.CommaSpace); } ! return buf.Append( array[len-1]).ToString(); } ! public static string[] Multiply(string str, IEnumerator placeholders, IEnumerator replacements) { ! string[] result = new string[] { str }; ! while( placeholders.MoveNext() ) { replacements.MoveNext(); ! result = Multiply( result, placeholders.Current as string, replacements.Current as string[]); } return result; } ! public static string[] Multiply(string[] strings, string placeholder, string[] replacements) { ! string[] results = new string[replacements.Length * strings.Length ]; ! int n=0; ! for ( int i=0; i<replacements.Length; i++ ) { ! for (int j=0; j<strings.Length; j++) { ! results[n++] = ReplaceOnce(strings[j], placeholder, replacements[i]); } } --- 167,322 ---- /// <param name="typeName"></param> /// <returns></returns> ! public static string GetClassname( string typeName ) { ! string[ ] splitClassname = GetFullClassname( typeName ).Split( '.' ); + return splitClassname[ splitClassname.Length - 1 ]; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="qualifiedName"></param> ! /// <returns></returns> ! public static string Qualifier( string qualifiedName ) ! { ! int loc = qualifiedName.LastIndexOf( "." ); ! if( loc < 0 ) ! { return String.Empty; ! } ! else ! { ! return qualifiedName.Substring( 0, loc ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="columns"></param> ! /// <param name="suffix"></param> ! /// <returns></returns> ! public static string[ ] Suffix( string[ ] columns, string suffix ) ! { ! if( suffix == null ) return columns; ! string[ ] qualified = new string[columns.Length]; ! for( int i = 0; i < columns.Length; i++ ) ! { ! qualified[ i ] = Suffix( columns[ i ], suffix ); } return qualified; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="name"></param> ! /// <param name="suffix"></param> ! /// <returns></returns> ! public static string Suffix( string name, string suffix ) ! { ! return ( suffix == null ) ? name : name + suffix; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="columns"></param> ! /// <param name="prefix"></param> ! /// <returns></returns> ! public static string[ ] Prefix( string[ ] columns, string prefix ) ! { ! if( prefix == null ) return columns; ! string[ ] qualified = new string[columns.Length]; ! for( int i = 0; i < columns.Length; i++ ) ! { ! qualified[ i ] = prefix + columns[ i ]; } return qualified; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="qualifiedName"></param> ! /// <returns></returns> ! public static string Root( string qualifiedName ) ! { ! int loc = qualifiedName.IndexOf( "." ); ! return ( loc < 0 ) ? qualifiedName ! : qualifiedName.Substring( 0, loc ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="tfString"></param> ! /// <returns></returns> ! public static bool BooleanValue( string tfString ) ! { string trimmed = tfString.Trim().ToLower(); ! return trimmed.Equals( "true" ) || trimmed.Equals( "t" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="array"></param> ! /// <returns></returns> ! public static string ToString( object[ ] array ) ! { int len = array.Length; ! // if there is no value in the array then return no string... ! if( len == 0 ) return String.Empty; ! StringBuilder buf = new StringBuilder( len*12 ); ! for( int i = 0; i < len - 1; i++ ) ! { ! buf.Append( array[ i ] ).Append( StringHelper.CommaSpace ); } ! return buf.Append( array[ len - 1 ] ).ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! /// <param name="placeholders"></param> ! /// <param name="replacements"></param> ! /// <returns></returns> ! public static string[ ] Multiply( string str, IEnumerator placeholders, IEnumerator replacements ) ! { ! string[ ] result = new string[ ] {str}; ! while( placeholders.MoveNext() ) ! { replacements.MoveNext(); ! result = Multiply( result, placeholders.Current as string, replacements.Current as string[ ] ); } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="strings"></param> ! /// <param name="placeholder"></param> ! /// <param name="replacements"></param> ! /// <returns></returns> ! public static string[ ] Multiply( string[ ] strings, string placeholder, string[ ] replacements ) ! { ! string[ ] results = new string[replacements.Length*strings.Length]; ! int n = 0; ! for( int i = 0; i < replacements.Length; i++ ) ! { ! for( int j = 0; j < strings.Length; j++ ) ! { ! results[ n++ ] = ReplaceOnce( strings[ j ], placeholder, replacements[ i ] ); } } *************** *** 206,208 **** } } ! } --- 324,326 ---- } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 02:40:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25964 Modified Files: PropertiesHelper.cs ReflectHelper.cs SequencedHashMap.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: SequencedHashMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/SequencedHashMap.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SequencedHashMap.cs 14 Aug 2004 20:59:35 -0000 1.7 --- SequencedHashMap.cs 1 Jan 2005 02:40:02 -0000 1.8 *************** *** 1,3 **** --- 1,4 ---- #region The Apache Software License, Version 1.1 + /* This is a port from the Jakarta commons project */ *************** *** 58,68 **** * */ #endregion [...1130 lines suppressed...] } ! public object Key { get { return _pos.Key; } } ! public object Value { get { return _pos.Value; } *************** *** 675,677 **** } } ! } --- 715,717 ---- } } ! } \ No newline at end of file Index: ReflectHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ReflectHelper.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ReflectHelper.cs 4 Dec 2004 22:41:30 -0000 1.19 --- ReflectHelper.cs 1 Jan 2005 02:40:02 -0000 1.20 *************** *** 2,10 **** using System.Collections; using System.Reflection; - using NHibernate.Property; using NHibernate.Type; ! namespace NHibernate.Util { /// <summary> --- 2,9 ---- using System.Collections; using System.Reflection; using NHibernate.Property; using NHibernate.Type; ! namespace NHibernate.Util { /// <summary> *************** *** 13,24 **** public sealed class ReflectHelper { ! private ReflectHelper() { // not creatable } ! private static System.Type[] NoClasses = new System.Type[0]; ! private static System.Type[] Object = new System.Type[] { typeof(object) }; ! /// <summary> /// Determine if the specified <see cref="System.Type"/> overrides the --- 12,23 ---- public sealed class ReflectHelper { ! private ReflectHelper() { // not creatable } ! private static System.Type[ ] NoClasses = new System.Type[0]; ! // private static System.Type[ ] Object = new System.Type[ ] {typeof( object )}; // not used !?! ! /// <summary> /// Determine if the specified <see cref="System.Type"/> overrides the *************** *** 27,47 **** /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> /// <returns><c>true</c> if any type in the heirarchy overrides Equals(object).</returns> ! public static bool OverridesEquals(System.Type clazz) { ! try { ! MethodInfo equals = clazz.GetMethod("Equals", new System.Type[] { typeof(object) }); ! if( equals==null ) { return false; } ! else { // make sure that the DeclaringType is not System.Object - if that is the // declaring type then there is no override. ! return !equals.DeclaringType.Equals( typeof(object) ); } ! } ! catch( AmbiguousMatchException ) { // an ambigious match means that there is an override and it --- 26,46 ---- /// <param name="clazz">The <see cref="System.Type"/> to reflect.</param> /// <returns><c>true</c> if any type in the heirarchy overrides Equals(object).</returns> ! public static bool OverridesEquals( System.Type clazz ) { ! try { ! MethodInfo equals = clazz.GetMethod( "Equals", new System.Type[ ] {typeof( object )} ); ! if( equals == null ) { return false; } ! else { // make sure that the DeclaringType is not System.Object - if that is the // declaring type then there is no override. ! return !equals.DeclaringType.Equals( typeof( object ) ); } ! } ! catch( AmbiguousMatchException ) { // an ambigious match means that there is an override and it *************** *** 49,57 **** return true; } ! catch (Exception ) { return false; } ! } --- 48,56 ---- return true; } ! catch( Exception ) { return false; } ! } *************** *** 75,79 **** /// No Property or Field with the <c>propertyName</c> could be found. /// </exception> ! public static IGetter GetGetter(System.Type theClass, string propertyName) { IPropertyAccessor accessor = null; --- 74,78 ---- /// No Property or Field with the <c>propertyName</c> could be found. /// </exception> ! public static IGetter GetGetter( System.Type theClass, string propertyName ) { IPropertyAccessor accessor = null; *************** *** 81,100 **** // first try the basicPropertyAccessor since that will be the most likely // strategy used. ! try { ! accessor = (IPropertyAccessor)PropertyAccessorFactory.PropertyAccessors["property"]; ! return accessor.GetGetter(theClass, propertyName); } ! catch( PropertyNotFoundException pnfe ) { // the basic "property" strategy did not work so try the rest of them ! foreach( DictionaryEntry de in Property.PropertyAccessorFactory.PropertyAccessors ) { ! try { ! accessor = (IPropertyAccessor)de.Value; return accessor.GetGetter( theClass, propertyName ); } ! catch( PropertyNotFoundException ) { // ignore this exception because we want to try and move through --- 80,99 ---- // first try the basicPropertyAccessor since that will be the most likely // strategy used. ! try { ! accessor = ( IPropertyAccessor ) PropertyAccessorFactory.PropertyAccessors[ "property" ]; ! return accessor.GetGetter( theClass, propertyName ); } ! catch( PropertyNotFoundException ) { // the basic "property" strategy did not work so try the rest of them ! foreach( DictionaryEntry de in PropertyAccessorFactory.PropertyAccessors ) { ! try { ! accessor = ( IPropertyAccessor ) de.Value; return accessor.GetGetter( theClass, propertyName ); } ! catch( PropertyNotFoundException ) { // ignore this exception because we want to try and move through *************** *** 112,118 **** ! public static IType ReflectedPropertyType(System.Type theClass, string name) { ! return TypeFactory.HueristicType( GetGetter(theClass, name).ReturnType.AssemblyQualifiedName ); } --- 111,123 ---- ! /// <summary> ! /// ! /// </summary> ! /// <param name="theClass"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public static IType ReflectedPropertyType( System.Type theClass, string name ) { ! return TypeFactory.HueristicType( GetGetter( theClass, name ).ReturnType.AssemblyQualifiedName ); } *************** *** 122,128 **** /// <param name="name">The name of the class. Can be a name with the assembly included or just the name of the class.</param> /// <returns>The Type for the Class.</returns> ! public static System.Type ClassForName(string name) { ! return System.Type.GetType(name, true); } --- 127,133 ---- /// <param name="name">The name of the class. Can be a name with the assembly included or just the name of the class.</param> /// <returns>The Type for the Class.</returns> ! public static System.Type ClassForName( string name ) { ! return System.Type.GetType( name, true ); } *************** *** 133,147 **** /// <param name="fieldName">The name of the Field in the <see cref="System.Type"/>.</param> /// <returns>The value contained in that field or <c>null</c> if the Type or Field does not exist.</returns> ! public static object GetConstantValue(string typeName, string fieldName) { ! System.Type clazz = System.Type.GetType( typeName, false ); ! ! if( clazz==null ) return null; ! try { return clazz.GetField( fieldName ).GetValue( null ); ! } ! catch (Exception) { return null; --- 138,152 ---- /// <param name="fieldName">The name of the Field in the <see cref="System.Type"/>.</param> /// <returns>The value contained in that field or <c>null</c> if the Type or Field does not exist.</returns> ! public static object GetConstantValue( string typeName, string fieldName ) { ! System.Type clazz = System.Type.GetType( typeName, false ); ! if( clazz == null ) return null; ! ! try { return clazz.GetField( fieldName ).GetValue( null ); ! } ! catch( Exception ) { return null; *************** *** 149,162 **** } ! public static ConstructorInfo GetDefaultConstructor(System.Type type) { ! if (IsAbstractClass(type)) return null; ! ! try { ! ConstructorInfo contructor = type.GetConstructor(BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic, null, CallingConventions.HasThis, NoClasses, null); return contructor; ! } ! catch (Exception) { throw new PropertyNotFoundException( --- 154,172 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> ! public static ConstructorInfo GetDefaultConstructor( System.Type type ) { ! if( IsAbstractClass( type ) ) return null; ! ! try { ! ConstructorInfo contructor = type.GetConstructor( BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, CallingConventions.HasThis, NoClasses, null ); return contructor; ! } ! catch( Exception ) { throw new PropertyNotFoundException( *************** *** 166,174 **** } ! public static bool IsAbstractClass(System.Type type) { ! return (type.IsAbstract || type.IsInterface); } } ! } --- 176,189 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> ! public static bool IsAbstractClass( System.Type type ) { ! return ( type.IsAbstract || type.IsInterface ); } } ! } \ No newline at end of file Index: PropertiesHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/PropertiesHelper.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PropertiesHelper.cs 29 Oct 2004 05:54:34 -0000 1.7 --- PropertiesHelper.cs 1 Jan 2005 02:40:02 -0000 1.8 *************** *** 1,49 **** using System; - using System.Xml; using System.Collections; ! using System.Collections.Specialized; ! namespace NHibernate.Util { //Much of this code is taken from Maverick.NET ! public class PropertiesHelper { ! public static bool GetBoolean(string property, IDictionary properties, bool defaultValue) { ! return properties[ property ]==null ? defaultValue : ! bool.Parse( properties[property] as string ); } ! public static bool GetBoolean(string property, IDictionary properties) { ! return properties[property] == null ? false : ! bool.Parse(properties[property] as string); } ! ! public static int GetInt32(string property, IDictionary properties, int defaultValue) { ! string propValue = properties[property] as string; ! return (propValue==null) ? defaultValue : int.Parse(propValue); } ! ! public static string GetString(string property, IDictionary properties, string defaultValue) { ! string propValue = properties[property] as string; ! return (propValue==null) ? defaultValue : propValue; } ! ! public static IDictionary ToDictionary(string property, string delim, IDictionary properties) { IDictionary map = new Hashtable(); ! string propValue = (string) properties[ property ]; ! if (propValue!=null) { ! StringTokenizer tokens = new StringTokenizer(propValue, delim, false); IEnumerator en = tokens.GetEnumerator(); ! while ( en.MoveNext() ) { ! string key = (string) en.Current; ! ! string value = en.MoveNext() ? (string) en.Current : String.Empty; ! map[key] = value; } } --- 1,86 ---- using System; using System.Collections; ! using System.Xml; ! namespace NHibernate.Util { //Much of this code is taken from Maverick.NET ! /// <summary></summary> ! public class PropertiesHelper { ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="properties"></param> ! /// <param name="defaultValue"></param> ! /// <returns></returns> ! public static bool GetBoolean( string property, IDictionary properties, bool defaultValue ) { ! return properties[ property ] == null ? defaultValue : ! bool.Parse( properties[ property ] as string ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="properties"></param> ! /// <returns></returns> ! public static bool GetBoolean( string property, IDictionary properties ) ! { ! return properties[ property ] == null ? false : ! bool.Parse( properties[ property ] as string ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="properties"></param> ! /// <param name="defaultValue"></param> ! /// <returns></returns> ! public static int GetInt32( string property, IDictionary properties, int defaultValue ) ! { ! string propValue = properties[ property ] as string; ! return ( propValue == null ) ? defaultValue : int.Parse( propValue ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="properties"></param> ! /// <param name="defaultValue"></param> ! /// <returns></returns> ! public static string GetString( string property, IDictionary properties, string defaultValue ) ! { ! string propValue = properties[ property ] as string; ! return ( propValue == null ) ? defaultValue : propValue; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="delim"></param> ! /// <param name="properties"></param> ! /// <returns></returns> ! public static IDictionary ToDictionary( string property, string delim, IDictionary properties ) { IDictionary map = new Hashtable(); ! string propValue = ( string ) properties[ property ]; ! if( propValue != null ) { ! StringTokenizer tokens = new StringTokenizer( propValue, delim, false ); IEnumerator en = tokens.GetEnumerator(); ! while( en.MoveNext() ) { ! string key = ( string ) en.Current; ! ! string value = en.MoveNext() ? ( string ) en.Current : String.Empty; ! map[ key ] = value; } } *************** *** 51,62 **** } ! public static string[] ToStringArray(string property, string delim, IDictionary properties) { ! return ToStringArray( (string) properties[ property ], delim ); } ! public static string[] ToStringArray(string propValue, string delim) { ! if (propValue!=null) { ! return StringHelper.Split(delim, propValue); ! } else { return new string[0]; } --- 88,117 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="property"></param> ! /// <param name="delim"></param> ! /// <param name="properties"></param> ! /// <returns></returns> ! public static string[ ] ToStringArray( string property, string delim, IDictionary properties ) ! { ! return ToStringArray( ( string ) properties[ property ], delim ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="propValue"></param> ! /// <param name="delim"></param> ! /// <returns></returns> ! public static string[ ] ToStringArray( string propValue, string delim ) ! { ! if( propValue != null ) ! { ! return StringHelper.Split( delim, propValue ); ! } ! else ! { return new string[0]; } *************** *** 64,69 **** --- 119,127 ---- + /// <summary></summary> public const string TagParam = "param"; + /// <summary></summary> public const string AttrValue = "value"; + /// <summary></summary> public const string AttrName = "name"; *************** *** 74,98 **** /// <param name="node">Parent element.</param> /// <returns>null if no parameters are found</returns> ! public static IDictionary GetParams(XmlElement node) { IDictionary result = new Hashtable(); ! ! foreach( XmlElement paramNode in node.GetElementsByTagName(TagParam) ) { ! string name = GetAttribute(paramNode, AttrName); ! string val = GetAttribute(paramNode, AttrValue); ! if (val == null) ! if (paramNode.HasChildNodes) { val = paramNode.InnerText; //TODO: allow for multiple values? ! } else { val = paramNode.InnerText; } ! result.Add(name, val); } return result; } ! private static string GetAttribute(XmlElement node, string attr) { ! string result = node.GetAttribute(attr); ! if (result!=null && result.Trim().Length == 0) result = null; --- 132,162 ---- /// <param name="node">Parent element.</param> /// <returns>null if no parameters are found</returns> ! public static IDictionary GetParams( XmlElement node ) ! { IDictionary result = new Hashtable(); ! ! foreach( XmlElement paramNode in node.GetElementsByTagName( TagParam ) ) ! { ! string name = GetAttribute( paramNode, AttrName ); ! string val = GetAttribute( paramNode, AttrValue ); ! if( val == null ) ! if( paramNode.HasChildNodes ) ! { val = paramNode.InnerText; //TODO: allow for multiple values? ! } ! else ! { val = paramNode.InnerText; } ! result.Add( name, val ); } return result; } ! private static string GetAttribute( XmlElement node, string attr ) ! { ! string result = node.GetAttribute( attr ); ! if( result != null && result.Trim().Length == 0 ) result = null; *************** *** 100,102 **** } } ! } --- 164,166 ---- } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 02:38:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25743 Modified Files: ArrayHelper.cs IdentityMap.cs JoinedEnumerable.cs ObjectUtils.cs Log Message: fix xml documentation and allow ReSharper to reformat Index: JoinedEnumerable.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/JoinedEnumerable.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JoinedEnumerable.cs 5 Jul 2004 20:34:59 -0000 1.2 --- JoinedEnumerable.cs 1 Jan 2005 02:38:35 -0000 1.3 *************** *** 1,13 **** - using System; using System.Collections; ! namespace NHibernate.Util { /// <summary> /// Combines multiple objects implementing <see cref="IEnumerable"/> into one. /// </summary> ! public class JoinedEnumerable : IEnumerable, IEnumerator { ! private IEnumerator[] _enumerators; private int _current; --- 1,12 ---- using System.Collections; ! namespace NHibernate.Util { /// <summary> /// Combines multiple objects implementing <see cref="IEnumerable"/> into one. /// </summary> ! public class JoinedEnumerable : IEnumerable, IEnumerator { ! private IEnumerator[ ] _enumerators; private int _current; *************** *** 16,25 **** /// </summary> /// <param name="enumerables">The IEnumerables to join together.</param> ! public JoinedEnumerable(IEnumerable[] enumerables) { _enumerators = new IEnumerator[enumerables.Length]; ! for (int i=0; i<enumerables.Length; i++) { ! _enumerators[i] = enumerables[i].GetEnumerator(); } _current = 0; --- 15,24 ---- /// </summary> /// <param name="enumerables">The IEnumerables to join together.</param> ! public JoinedEnumerable( IEnumerable[ ] enumerables ) { _enumerators = new IEnumerator[enumerables.Length]; ! for( int i = 0; i < enumerables.Length; i++ ) { ! _enumerators[ i ] = enumerables[ i ].GetEnumerator(); } _current = 0; *************** *** 28,54 **** #region System.Collections.IEnumerator Members ! public bool MoveNext() { ! for ( ; _current < _enumerators.Length; _current++ ) { ! if ( _enumerators[_current].MoveNext() ) return true; } return false; } ! ! public void Reset() { ! for (int i=0; i<_enumerators.Length; i++) { ! _enumerators[i].Reset(); } } ! public object Current { ! get ! { ! return _enumerators[_current].Current; ! } } --- 27,53 ---- #region System.Collections.IEnumerator Members ! /// <summary></summary> ! public bool MoveNext() { ! for(; _current < _enumerators.Length; _current++ ) { ! if( _enumerators[ _current ].MoveNext() ) return true; } return false; } ! ! /// <summary></summary> ! public void Reset() { ! for( int i = 0; i < _enumerators.Length; i++ ) { ! _enumerators[ i ].Reset(); } } ! /// <summary></summary> ! public object Current { ! get { return _enumerators[ _current ].Current; } } *************** *** 57,62 **** #region System.Collections.IEnumerable Members ! ! public IEnumerator GetEnumerator() { Reset(); --- 56,61 ---- #region System.Collections.IEnumerable Members ! /// <summary></summary> ! public IEnumerator GetEnumerator() { Reset(); *************** *** 65,70 **** #endregion - - } ! } --- 64,67 ---- #endregion } ! } \ No newline at end of file Index: IdentityMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/IdentityMap.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IdentityMap.cs 4 Dec 2004 22:24:17 -0000 1.14 --- IdentityMap.cs 1 Jan 2005 02:38:35 -0000 1.15 *************** *** 1,9 **** using System; using System.Collections; ! using System.Runtime.Serialization; ! namespace NHibernate.Util { - /// <summary> /// An <see cref="IDictionary" /> where keys are compared by object identity, rather than <c>equals</c>. --- 1,9 ---- using System; using System.Collections; ! using HashCodeProvider; ! using log4net; ! namespace NHibernate.Util { /// <summary> /// An <see cref="IDictionary" /> where keys are compared by object identity, rather than <c>equals</c>. *************** *** 15,19 **** /// <para> /// Do NOT use a System.Value type as the key for this Hashtable - only classes. See ! /// the <a href="http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=bds2rm%24ruc%241%40charly.heeg.de&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSystem.Runtime.CompilerServices.RuntimeHelpers.GetHashCode%26sa%3DN%26tab%3Dwg">google thread</a> /// about why using System.Value is a bad thing. /// </para> --- 15,19 ---- /// <para> /// Do NOT use a System.Value type as the key for this Hashtable - only classes. See ! /// the <a href="http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=bds2rm%24ruc%241%40charly.heeg.de&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSystem.Runtime.CompilerServices.RuntimeHelpers.GetHashCode%26sa%3DN%26tab%3Dwg">google thread</a> /// about why using System.Value is a bad thing. /// </para> *************** *** 26,38 **** /// </para> /// </remarks> ! [Serializable] ! public sealed class IdentityMap : IDictionary { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(IdentityMap)); ! // key = IdentityKey of the passed in Key // value = object passed in ! IDictionary map; ! /// <summary> /// Create a new instance of the IdentityMap that has no --- 26,38 ---- /// </para> /// </remarks> ! [ Serializable ] ! public sealed class IdentityMap : IDictionary { ! private static readonly ILog log = LogManager.GetLogger( typeof( IdentityMap ) ); ! // key = IdentityKey of the passed in Key // value = object passed in ! private IDictionary map; ! /// <summary> /// Create a new instance of the IdentityMap that has no *************** *** 40,48 **** /// </summary> /// <returns>A new IdentityMap based on a Hashtable.</returns> ! public static IDictionary Instantiate() { ! IHashCodeProvider ihcp = new HashCodeProvider.IdentityHashCodeProvider(); ! IComparer comp = new IdentityMap.IdentityComparer(); ! return new IdentityMap(new Hashtable(ihcp, comp)); } --- 40,48 ---- /// </summary> /// <returns>A new IdentityMap based on a Hashtable.</returns> ! public static IDictionary Instantiate() { ! IHashCodeProvider ihcp = new IdentityHashCodeProvider(); ! IComparer comp = new IdentityComparer(); ! return new IdentityMap( new Hashtable( ihcp, comp ) ); } *************** *** 53,63 **** /// </summary> /// <returns>A new IdentityMap based on ListDictionary.</returns> ! public static IDictionary InstantiateSequenced() { ! IHashCodeProvider ihcp = new HashCodeProvider.IdentityHashCodeProvider(); ! IComparer comp = new IdentityMap.IdentityComparer(); ! return new IdentityMap(new SequencedHashMap(ihcp, comp)); } ! /// <summary> /// Return the Dictionary Entries (as instances of <c>DictionaryEntry</c> in a collection --- 53,63 ---- /// </summary> /// <returns>A new IdentityMap based on ListDictionary.</returns> ! public static IDictionary InstantiateSequenced() { ! IHashCodeProvider ihcp = new IdentityHashCodeProvider(); ! IComparer comp = new IdentityComparer(); ! return new IdentityMap( new SequencedHashMap( ihcp, comp ) ); } ! /// <summary> /// Return the Dictionary Entries (as instances of <c>DictionaryEntry</c> in a collection *************** *** 67,73 **** /// <param name="map">The IDictionary to get the enumeration safe list.</param> /// <returns>A Collection of DictionaryEntries</returns> ! public static ICollection ConcurrentEntries(IDictionary map) { ! return ((IdentityMap)map).EntryList; } --- 67,73 ---- /// <param name="map">The IDictionary to get the enumeration safe list.</param> /// <returns>A Collection of DictionaryEntries</returns> ! public static ICollection ConcurrentEntries( IDictionary map ) { ! return ( ( IdentityMap ) map ).EntryList; } *************** *** 78,82 **** /// </summary> /// <param name="underlyingMap">A class that implements the IDictionary for storing the objects.</param> ! private IdentityMap(IDictionary underlyingMap) { this.map = underlyingMap; --- 78,82 ---- /// </summary> /// <param name="underlyingMap">A class that implements the IDictionary for storing the objects.</param> ! private IdentityMap( IDictionary underlyingMap ) { this.map = underlyingMap; *************** *** 86,90 **** /// <see cref="ICollection.Count"/> /// </summary> ! public int Count { get { return map.Count; } --- 86,90 ---- /// <see cref="ICollection.Count"/> /// </summary> ! public int Count { get { return map.Count; } *************** *** 94,98 **** /// <see cref="ICollection.IsSynchronized"/> /// </summary> ! public bool IsSynchronized { get { return map.IsSynchronized; } --- 94,98 ---- /// <see cref="ICollection.IsSynchronized"/> /// </summary> ! public bool IsSynchronized { get { return map.IsSynchronized; } *************** *** 102,106 **** /// <see cref="ICollection.SyncRoot"/> /// </summary> ! public object SyncRoot { get { return map.SyncRoot; } --- 102,106 ---- /// <see cref="ICollection.SyncRoot"/> /// </summary> ! public object SyncRoot { get { return map.SyncRoot; } *************** *** 110,116 **** /// <see cref="IDictionary.Add"/> /// </summary> ! public void Add(object key, object val) { ! map.Add(VerifyValidKey(key), val); } --- 110,116 ---- /// <see cref="IDictionary.Add"/> /// </summary> ! public void Add( object key, object val ) { ! map.Add( VerifyValidKey( key ), val ); } *************** *** 118,122 **** /// <see cref="IDictionary.Clear"/> /// </summary> ! public void Clear() { map.Clear(); --- 118,122 ---- /// <see cref="IDictionary.Clear"/> /// </summary> ! public void Clear() { map.Clear(); *************** *** 126,139 **** /// <see cref="IDictionary.Contains"/> /// </summary> ! public bool Contains(object key) { ! if(key==null) return false; ! return map.Contains(VerifyValidKey(key)); } /// <summary> ! /// <see cref="ICollection.GetEnumerator"/> /// </summary> ! IEnumerator IEnumerable.GetEnumerator() { return map.GetEnumerator(); --- 126,139 ---- /// <see cref="IDictionary.Contains"/> /// </summary> ! public bool Contains( object key ) { ! if( key == null ) return false; ! return map.Contains( VerifyValidKey( key ) ); } /// <summary> ! /// <see cref="IEnumerable.GetEnumerator"/> /// </summary> ! IEnumerator IEnumerable.GetEnumerator() { return map.GetEnumerator(); *************** *** 143,147 **** /// <see cref="IDictionary.GetEnumerator"/> /// </summary> ! public IDictionaryEnumerator GetEnumerator() { return map.GetEnumerator(); --- 143,147 ---- /// <see cref="IDictionary.GetEnumerator"/> /// </summary> ! public IDictionaryEnumerator GetEnumerator() { return map.GetEnumerator(); *************** *** 151,155 **** /// <see cref="IDictionary.IsFixedSize"/> /// </summary> ! public bool IsFixedSize { get { return map.IsFixedSize; } --- 151,155 ---- /// <see cref="IDictionary.IsFixedSize"/> /// </summary> ! public bool IsFixedSize { get { return map.IsFixedSize; } *************** *** 159,163 **** /// <see cref="IDictionary.IsReadOnly"/> /// </summary> ! public bool IsReadOnly { get { return map.IsReadOnly; } --- 159,163 ---- /// <see cref="IDictionary.IsReadOnly"/> /// </summary> ! public bool IsReadOnly { get { return map.IsReadOnly; } *************** *** 168,177 **** /// <see cref="IDictionary.IsReadOnly"/> /// </summary> ! public ICollection Keys { ! get ! { ! return map.Keys; ! } } --- 168,174 ---- /// <see cref="IDictionary.IsReadOnly"/> /// </summary> ! public ICollection Keys { ! get { return map.Keys; } } *************** *** 179,202 **** /// <see cref="IDictionary.Remove"/> /// </summary> ! public void Remove(object key) { ! if(key==null) return; ! map.Remove(VerifyValidKey(key)); } /// <summary> ! /// <see cref="IDictionary.Item"/> /// </summary> ! public object this [object key] { ! get ! { ! if(key==null) return null; ! return map[VerifyValidKey(key)]; ! } ! set { ! map[VerifyValidKey(key)] = value; } } --- 176,196 ---- /// <see cref="IDictionary.Remove"/> /// </summary> ! public void Remove( object key ) { ! if( key == null ) return; ! map.Remove( VerifyValidKey( key ) ); } /// <summary> ! /// <see cref="IDictionary.this"/> /// </summary> ! public object this[ object key ] { ! get { ! if( key == null ) return null; ! return map[ VerifyValidKey( key ) ]; } + set { map[ VerifyValidKey( key ) ] = value; } } *************** *** 204,222 **** /// <see cref="IDictionary.Values"/> /// </summary> ! public ICollection Values { get { return map.Values; } } - /// <summary> /// <see cref="ICollection.CopyTo"/> /// </summary> ! public void CopyTo(Array array, int i) { ! map.CopyTo(array, i); } ! /// <summary> /// Provides a snapshot VIEW in the form of a List of the contents of the IdentityMap. --- 198,217 ---- /// <see cref="IDictionary.Values"/> /// </summary> ! public ICollection Values { get { return map.Values; } } /// <summary> /// <see cref="ICollection.CopyTo"/> /// </summary> ! /// <param name="array"></param> ! /// <param name="i"></param> ! public void CopyTo( Array array, int i ) { ! map.CopyTo( array, i ); } ! /// <summary> /// Provides a snapshot VIEW in the form of a List of the contents of the IdentityMap. *************** *** 226,238 **** /// Contains a copy (not that actual instance stored) of the DictionaryEntries in a List. /// </summary> ! public IList EntryList { ! get { ! IList list = new ArrayList(map.Count); ! foreach(DictionaryEntry de in map) { ! DictionaryEntry newEntry = new DictionaryEntry(de.Key, de.Value); ! list.Add(newEntry); } --- 221,233 ---- /// Contains a copy (not that actual instance stored) of the DictionaryEntries in a List. /// </summary> ! public IList EntryList { ! get { ! IList list = new ArrayList( map.Count ); ! foreach( DictionaryEntry de in map ) { ! DictionaryEntry newEntry = new DictionaryEntry( de.Key, de.Value ); ! list.Add( newEntry ); } *************** *** 247,263 **** /// <returns>An object that is safe to be a key.</returns> /// <exception cref="ArgumentException">Thrown when the obj is a System.ValueType</exception> ! private object VerifyValidKey(object obj) { ! if(obj is System.ValueType) { throw new ArgumentException( ! "There is a problem with your mappings. You are probably trying to map a System.ValueType to " + ! "a <class> which NHibernate does not allow or you are incorrectly using the " + ! "IDictionary that is mapped to a <set>. \n\n" + ! "A ValueType can not be used with IdentityKey. " + ! "The thread at google has a good description about what happens with boxing " + ! "and unboxing ValueTypes and why they can not be used as an IdentityKey: " + ! "http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=bds2rm%24ruc%241%40charly.heeg.de&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSystem.Runtime.CompilerServices.RuntimeHelpers.GetHashCode%26sa%3DN%26tab%3Dwg" ! ,"key"); } --- 242,258 ---- /// <returns>An object that is safe to be a key.</returns> /// <exception cref="ArgumentException">Thrown when the obj is a System.ValueType</exception> ! private object VerifyValidKey( object obj ) { ! if( obj is ValueType ) { throw new ArgumentException( ! "There is a problem with your mappings. You are probably trying to map a System.ValueType to " + ! "a <class> which NHibernate does not allow or you are incorrectly using the " + ! "IDictionary that is mapped to a <set>. \n\n" + ! "A ValueType can not be used with IdentityKey. " + ! "The thread at google has a good description about what happens with boxing " + ! "and unboxing ValueTypes and why they can not be used as an IdentityKey: " + ! "http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=bds2rm%24ruc%241%40charly.heeg.de&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3DSystem.Runtime.CompilerServices.RuntimeHelpers.GetHashCode%26sa%3DN%26tab%3Dwg" ! , "key" ); } *************** *** 272,276 **** /// Only for use in IdentityMap. /// </remarks> ! [Serializable] private class IdentityComparer : IComparer { --- 267,271 ---- /// Only for use in IdentityMap. /// </remarks> ! [ Serializable ] private class IdentityComparer : IComparer { *************** *** 294,314 **** /// indicate the two are not Equal. /// </returns> ! public int Compare(object x, object y) { ! if(x==null && y==null) { return 0; } ! if(x==null || y==null) { return -1; } ! if(x==y) ! { return 0; } ! else { return -1; --- 289,309 ---- /// indicate the two are not Equal. /// </returns> ! public int Compare( object x, object y ) { ! if( x == null && y == null ) { return 0; } ! if( x == null || y == null ) { return -1; } ! if( x == y ) ! { return 0; } ! else { return -1; *************** *** 320,322 **** } ! } --- 315,317 ---- } ! } \ No newline at end of file Index: ArrayHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ArrayHelper.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArrayHelper.cs 10 Feb 2004 18:42:01 -0000 1.3 --- ArrayHelper.cs 1 Jan 2005 02:38:35 -0000 1.4 *************** *** 1,13 **** using System; - using System.Data; using System.Collections; ! using NHibernate.SqlTypes; ! namespace NHibernate.Util { ! ! public sealed class ArrayHelper { ! private ArrayHelper() {} ! /// <summary> /// Compares two byte[] arrays for equality. --- 1,16 ---- using System; using System.Collections; ! using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Util ! { ! /// <summary></summary> ! public sealed class ArrayHelper ! { ! private ArrayHelper() ! { ! } ! /// <summary> /// Compares two byte[] arrays for equality. *************** *** 16,36 **** /// <param name="rhs">The byte[] array on the Right Hand Side</param> /// <returns>true if they contain the same items</returns> ! public static bool Equals(byte[] lhs, byte[] rhs) { // just for luck, check for reference equality ! if(lhs==rhs) return true; // if they don't have the same reference and one of them // is null, then they are not Equal ! if(lhs==null || rhs==null) return false; // if they don't have the same length they are not equal ! if(lhs.Length != rhs.Length) return false; // move through every object in the array and hope that it // implements the Equals method correctly ! for(int i = 0; i < lhs.Length; i++) { ! if(lhs[i].Equals(rhs[i])==false) return false; } --- 19,39 ---- /// <param name="rhs">The byte[] array on the Right Hand Side</param> /// <returns>true if they contain the same items</returns> ! public static bool Equals( byte[ ] lhs, byte[ ] rhs ) { // just for luck, check for reference equality ! if( lhs == rhs ) return true; // if they don't have the same reference and one of them // is null, then they are not Equal ! if( lhs == null || rhs == null ) return false; // if they don't have the same length they are not equal ! if( lhs.Length != rhs.Length ) return false; // move through every object in the array and hope that it // implements the Equals method correctly ! for( int i = 0; i < lhs.Length; i++ ) { ! if( lhs[ i ].Equals( rhs[ i ] ) == false ) return false; } *************** *** 48,68 **** /// correctly. /// </remarks> ! public static bool Equals(Array lhs, Array rhs) { // just for luck, check for reference equality ! if(lhs==rhs) return true; // if they don't have the same reference and one of them // is null, then they are not Equal ! if(lhs==null || rhs==null) return false; // if they don't have the same length they are not equal ! if(lhs.Length != rhs.Length) return false; // move through every object in the array and hope that it // implements the Equals method correctly ! for(int i = 0; i < lhs.Length; i++) { ! if(lhs.GetValue(i).Equals(rhs.GetValue(i))==false) return false; } --- 51,71 ---- /// correctly. /// </remarks> ! public static bool Equals( Array lhs, Array rhs ) { // just for luck, check for reference equality ! if( lhs == rhs ) return true; // if they don't have the same reference and one of them // is null, then they are not Equal ! if( lhs == null || rhs == null ) return false; // if they don't have the same length they are not equal ! if( lhs.Length != rhs.Length ) return false; // move through every object in the array and hope that it // implements the Equals method correctly ! for( int i = 0; i < lhs.Length; i++ ) { ! if( lhs.GetValue( i ).Equals( rhs.GetValue( i ) ) == false ) return false; } *************** *** 71,146 **** } ! public static string[] ToStringArray(object[] objects) { int length = objects.Length; ! string[] result = new string[length]; ! for (int i=0; i<length; i++) { ! result[i] = objects[i].ToString(); } return result; } ! public static string[] FillArray(string str, int length) { ! string[] result = new string[length]; ! for (int i=0; i<length; i++) { ! result[i] = str; } return result; } ! public static string[] ToStringArray(ICollection coll) { ! string[] result = new string[coll.Count]; ! int i=0; ! foreach(object obj in coll) { ! result[i++] = obj.ToString(); } return result; } ! public static int[] ToIntArray(ICollection coll) { ! int[] result = new int[coll.Count]; ! int i=0; ! foreach(object obj in coll) { ! result[i++] = int.Parse(obj.ToString()); } return result; } ! public static string[] Slice(string[] strings, int begin, int length) { ! string[] result = new string[length]; ! for (int i=0; i<length; i++) { ! result[i] = strings[begin+i]; } return result; } ! public static object[] Slice(object[] objects, int begin, int length) { ! object[] result = new object[length]; ! for (int i=0; i<length; i++) { ! result[i] = objects[begin+i]; } return result; } ! public static string[] Join(string[] x, string[] y) { ! string[] result = new string[x.Length + y.Length]; ! for(int i=0; i<x.Length; i++) ! result[i] = x[i]; ! for(int i=0; i<y.Length; i++) ! result[i+x.Length] = y[i]; return result; } ! public static DbType[] Join(DbType[] x, DbType[] y) { ! DbType[] result = new DbType[ x.Length + y.Length ]; ! for ( int i=0; i<x.Length; i++ ) result[i] = x[i]; ! for ( int i=0; i<y.Length; i++ ) result[i+x.Length] = y[i]; ! return result; } ! public static SqlType[] Join(SqlType[] x, SqlType[] y) { ! SqlType[] result = new SqlType[ x.Length + y.Length ]; ! for ( int i=0; i<x.Length; i++ ) result[i] = x[i]; ! for ( int i=0; i<y.Length; i++ ) result[i+x.Length] = y[i]; ! return result; } } ! } --- 74,218 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="objects"></param> ! /// <returns></returns> ! public static string[ ] ToStringArray( object[ ] objects ) ! { int length = objects.Length; ! string[ ] result = new string[length]; ! for( int i = 0; i < length; i++ ) ! { ! result[ i ] = objects[ i ].ToString(); } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="str"></param> ! /// <param name="length"></param> ! /// <returns></returns> ! public static string[ ] FillArray( string str, int length ) ! { ! string[ ] result = new string[length]; ! for( int i = 0; i < length; i++ ) ! { ! result[ i ] = str; } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="coll"></param> ! /// <returns></returns> ! public static string[ ] ToStringArray( ICollection coll ) ! { ! string[ ] result = new string[coll.Count]; ! int i = 0; ! foreach( object obj in coll ) ! { ! result[ i++ ] = obj.ToString(); } return result; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="coll"></param> ! /// <returns></returns> ! public static int[ ] ToIntArray( ICollection coll ) ! { ! int[ ] result = new int[coll.Count]; ! int i = 0; ! foreach( object obj in coll ) ! { ! result[ i++ ] = int.Parse( obj.ToString() ); } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="strings"></param> ! /// <param name="begin"></param> ! /// <param name="length"></param> ! /// <returns></returns> ! public static string[ ] Slice( string[ ] strings, int begin, int length ) ! { ! string[ ] result = new string[length]; ! for( int i = 0; i < length; i++ ) ! { ! result[ i ] = strings[ begin + i ]; } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="objects"></param> ! /// <param name="begin"></param> ! /// <param name="length"></param> ! /// <returns></returns> ! public static object[ ] Slice( object[ ] objects, int begin, int length ) ! { ! object[ ] result = new object[length]; ! for( int i = 0; i < length; i++ ) ! { ! result[ i ] = objects[ begin + i ]; } return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public static string[ ] Join( string[ ] x, string[ ] y ) ! { ! string[ ] result = new string[x.Length + y.Length]; ! for( int i = 0; i < x.Length; i++ ) ! result[ i ] = x[ i ]; ! for( int i = 0; i < y.Length; i++ ) ! result[ i + x.Length ] = y[ i ]; return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public static DbType[ ] Join( DbType[ ] x, DbType[ ] y ) ! { ! DbType[ ] result = new DbType[x.Length + y.Length]; ! for( int i = 0; i < x.Length; i++ ) result[ i ] = x[ i ]; ! for( int i = 0; i < y.Length; i++ ) result[ i + x.Length ] = y[ i ]; ! return result; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public static SqlType[ ] Join( SqlType[ ] x, SqlType[ ] y ) ! { ! SqlType[ ] result = new SqlType[x.Length + y.Length]; ! for( int i = 0; i < x.Length; i++ ) result[ i ] = x[ i ]; ! for( int i = 0; i < y.Length; i++ ) result[ i + x.Length ] = y[ i ]; ! return result; } } ! } \ No newline at end of file Index: ObjectUtils.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ObjectUtils.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectUtils.cs 22 Nov 2004 03:52:18 -0000 1.3 --- ObjectUtils.cs 1 Jan 2005 02:38:35 -0000 1.4 *************** *** 54,101 **** ! using System; ! namespace NHibernate.Util { /// <summary> /// Summary description for ObjectUtils. /// </summary> ! public sealed class ObjectUtils { ! ! private ObjectUtils() { // not creatable } ! ! public static object DefaultIfNull(object obj, object defaultVal) { ! return (obj != null ? obj : defaultVal); } ! public static new bool Equals(object obj1, object obj2) { ! if (obj1 == obj2) { return true; } ! if ( (obj1 == null) || (obj2 == null)) { return false; } ! return obj1.Equals(obj2); } ! public static string IdentityToString(object obj) { ! if (obj == null) { return null; } ! return new System.Text.StringBuilder() ! .Append(obj.GetType().FullName) ! .Append('@') ! .Append(obj.GetHashCode()) .ToString(); } - private class NullClass { } private static object theNull = new NullClass(); ! public static object Null { get { return theNull; } } } ! } --- 54,130 ---- ! using System.Text; ! namespace NHibernate.Util { /// <summary> /// Summary description for ObjectUtils. /// </summary> ! public sealed class ObjectUtils { ! private ObjectUtils() { // not creatable } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="obj"></param> ! /// <param name="defaultVal"></param> ! /// <returns></returns> ! public static object DefaultIfNull( object obj, object defaultVal ) ! { ! return ( obj != null ? obj : defaultVal ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="obj1"></param> ! /// <param name="obj2"></param> ! /// <returns></returns> ! new public static bool Equals( object obj1, object obj2 ) ! { ! if( obj1 == obj2 ) ! { return true; } ! if( ( obj1 == null ) || ( obj2 == null ) ) ! { return false; } ! return obj1.Equals( obj2 ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="obj"></param> ! /// <returns></returns> ! public static string IdentityToString( object obj ) ! { ! if( obj == null ) ! { return null; } ! return new StringBuilder() ! .Append( obj.GetType().FullName ) ! .Append( '@' ) ! .Append( obj.GetHashCode() ) .ToString(); } + private class NullClass + { + } private static object theNull = new NullClass(); ! ! /// <summary></summary> ! public static object Null ! { ! get { return theNull; } ! } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2005-01-01 02:35:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25255 Modified Files: EntityEntry.cs Log Message: fix xml documentation Index: EntityEntry.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/EntityEntry.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EntityEntry.cs 9 Dec 2004 22:08:54 -0000 1.1 --- EntityEntry.cs 1 Jan 2005 02:35:07 -0000 1.2 *************** *** 73,77 **** /// <value>The identifier of the Entity in the database if one has been assigned.</value> /// <remarks>This might be <c>null</c> when the <see cref="EntityEntry.Status"/> is ! /// <see cref="Status.Saving"/> and the database generates the id.</remarks> public object Id { --- 73,77 ---- /// <value>The identifier of the Entity in the database if one has been assigned.</value> /// <remarks>This might be <c>null</c> when the <see cref="EntityEntry.Status"/> is ! /// <see cref="Impl.Status.Saving"/> and the database generates the id.</remarks> public object Id { |
From: Kevin W. <kev...@us...> - 2005-01-01 02:35:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25146 Modified Files: CharType.cs Log Message: fix xml documentation Index: CharType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/CharType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CharType.cs 31 Dec 2004 23:51:32 -0000 1.7 --- CharType.cs 1 Jan 2005 02:34:51 -0000 1.8 *************** *** 7,11 **** /// <summary> /// Maps a <see cref="System.Char"/> Property ! /// to a <see cref="DbType.Char"/> column. /// </summary> public class CharType : ValueTypeType, IDiscriminatorType --- 7,11 ---- /// <summary> /// Maps a <see cref="System.Char"/> Property ! /// to a DbType.Char column. /// </summary> public class CharType : ValueTypeType, IDiscriminatorType |
From: Kevin W. <kev...@us...> - 2004-12-31 23:57:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25124 Modified Files: StringTokenizer.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: StringTokenizer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringTokenizer.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringTokenizer.cs 19 Mar 2003 07:14:45 -0000 1.2 --- StringTokenizer.cs 31 Dec 2004 23:57:07 -0000 1.3 *************** *** 1,5 **** using System; using System.Collections; - using System.Text; namespace NHibernate.Util { --- 1,4 ---- |
From: Kevin W. <kev...@us...> - 2004-12-31 23:56:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24948 Modified Files: ValueTypeType.cs YesNoType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: ValueTypeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ValueTypeType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ValueTypeType.cs 20 Sep 2004 03:00:29 -0000 1.1 --- ValueTypeType.cs 31 Dec 2004 23:56:25 -0000 1.2 *************** *** 1,15 **** using System; - using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Type { /// <summary> /// Superclass of <see cref="ValueType"/> types. /// </summary> ! public abstract class ValueTypeType : ImmutableType, ILiteralType { - /// <summary> /// Initialize a new instance of the ValueTypeType class using a --- 1,13 ---- using System; using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Type { /// <summary> /// Superclass of <see cref="ValueType"/> types. /// </summary> ! public abstract class ValueTypeType : ImmutableType, ILiteralType { /// <summary> /// Initialize a new instance of the ValueTypeType class using a *************** *** 17,24 **** /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected ValueTypeType(SqlType sqlType) : base(sqlType) { } ! /// <summary> /// Compare two instances of the class mapped by this --- 15,22 ---- /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected ValueTypeType( SqlType sqlType ) : base( sqlType ) { } ! /// <summary> /// Compare two instances of the class mapped by this *************** *** 28,36 **** /// <param name="y">The right hand side object.</param> /// <returns>True if the two objects contain the same values.</returns> ! public override bool Equals(object x, object y) { ! return ObjectUtils.Equals(x, y); } ! /// <summary> /// A representation of the value to be embedded in an XML element --- 26,36 ---- /// <param name="y">The right hand side object.</param> /// <returns>True if the two objects contain the same values.</returns> ! public override bool Equals( object x, object y ) { ! return ObjectUtils.Equals( x, y ); } ! ! // <see cref="PrimitiveType"/> ! /// <summary> /// A representation of the value to be embedded in an XML element *************** *** 41,45 **** /// <remarks> /// This just calls <see cref="Object.ToString"/> so if there is ! /// a possibility of this <see cref="PrimitiveType"/> having any characters /// that need to be encoded then this method should be overridden. /// --- 41,45 ---- /// <remarks> /// This just calls <see cref="Object.ToString"/> so if there is ! /// a possibility of this PrimitiveType having any characters /// that need to be encoded then this method should be overridden. /// *************** *** 47,51 **** /// done automattically. /// </remarks> ! public override string ToXML(object val) { return val.ToString(); --- 47,51 ---- /// done automattically. /// </remarks> ! public override string ToXML( object val ) { return val.ToString(); *************** *** 58,62 **** /// <param name="val">The object to convert to a string for the SQL statement.</param> /// <returns>A string that containts a well formed SQL Statement.</returns> ! public abstract string ObjectToSQLString(object val); } } \ No newline at end of file --- 58,62 ---- /// <param name="val">The object to convert to a string for the SQL statement.</param> /// <returns>A string that containts a well formed SQL Statement.</returns> ! public abstract string ObjectToSQLString( object val ); } } \ No newline at end of file Index: YesNoType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/YesNoType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** YesNoType.cs 25 Oct 2004 05:37:56 -0000 1.6 --- YesNoType.cs 31 Dec 2004 23:56:25 -0000 1.7 *************** *** 1,4 **** - using System; - using NHibernate.SqlTypes; --- 1,2 ---- *************** *** 6,10 **** { /// <summary> ! /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="DbType.AnsiStringFixedLength" /> column /// that stores a <code>'Y'/'N'</code> to indicate <code>true/false</code>. /// </summary> --- 4,8 ---- { /// <summary> ! /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column /// that stores a <code>'Y'/'N'</code> to indicate <code>true/false</code>. /// </summary> *************** *** 17,38 **** /// export to create a char(1) column. /// </remarks> ! public class YesNoType : CharBooleanType { ! ! internal YesNoType() : base( new AnsiStringFixedLengthSqlType(1) ) { } ! protected override sealed string TrueString { get { return "Y"; } } ! protected override sealed string FalseString { get { return "N"; } } ! public override string Name { get { return "YesNo"; } --- 15,39 ---- /// export to create a char(1) column. /// </remarks> ! public class YesNoType : CharBooleanType { ! /// <summary></summary> ! internal YesNoType() : base( new AnsiStringFixedLengthSqlType( 1 ) ) { } ! /// <summary></summary> ! protected override sealed string TrueString { get { return "Y"; } } ! /// <summary></summary> ! protected override sealed string FalseString { get { return "N"; } } ! /// <summary></summary> ! public override string Name { get { return "YesNo"; } |
From: Kevin W. <kev...@us...> - 2004-12-31 23:56:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24886 Modified Files: TimestampType.cs TimeType.cs TrueFalseType.cs TypeFactory.cs TypeType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TimestampType.cs 19 Oct 2004 02:24:08 -0000 1.9 --- TimestampType.cs 31 Dec 2004 23:56:09 -0000 1.10 *************** *** 1,8 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> --- 1,7 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> *************** *** 29,49 **** public class TimestampType : ValueTypeType, IVersionType, ILiteralType { ! internal TimestampType() : base( new DateTimeSqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToDateTime(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { ! get { return typeof(DateTime); } } --- 28,62 ---- public class TimestampType : ValueTypeType, IVersionType, ILiteralType { ! /// <summary></summary> ! internal TimestampType() : base( new DateTimeSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return Convert.ToDateTime( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( DateTime ); } } *************** *** 57,69 **** /// No null values will be written to the IDbCommand for this Type. /// </remarks> ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; ! if( !(value is DateTime) ) { parm.Value = DateTime.Now; } ! else { parm.Value = value; --- 70,82 ---- /// No null values will be written to the IDbCommand for this Type. /// </remarks> ! public override void Set( IDbCommand st, object value, int index ) { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! if( !( value is DateTime ) ) { parm.Value = DateTime.Now; } ! else { parm.Value = value; *************** *** 71,95 **** } ! public override string Name { get { return "Timestamp"; } } ! public override string ToXML(object val) { ! return ((DateTime)val).ToShortTimeString(); } ! public override bool Equals(object x, object y) { ! if (x==y) return true; ! if (x==null || y==null) return false; ! long xTime = ((DateTime)x).Ticks; ! long yTime = ((DateTime)y).Ticks; return xTime == yTime; //TODO: Fixup } ! public override bool HasNiceEquals { get { return true; } --- 84,127 ---- } ! /// <summary></summary> ! public override string Name { get { return "Timestamp"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="val"></param> ! /// <returns></returns> ! public override string ToXML( object val ) { ! return ( ( DateTime ) val ).ToShortTimeString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if( x == y ) ! { ! return true; ! } ! if( x == null || y == null ) ! { ! return false; ! } ! long xTime = ( ( DateTime ) x ).Ticks; ! long yTime = ( ( DateTime ) y ).Ticks; return xTime == yTime; //TODO: Fixup } ! /// <summary></summary> ! public override bool HasNiceEquals { get { return true; } *************** *** 98,107 **** #region IVersionType Members ! public object Next(object current) { return Seed; } ! ! public object Seed { get { return DateTime.Now; } --- 130,145 ---- #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public object Next( object current ) { return Seed; } ! ! /// <summary></summary> ! public object Seed { get { return DateTime.Now; } *************** *** 110,117 **** #endregion ! public override string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; } } ! } --- 148,160 ---- #endregion ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { return "'" + value.ToString() + "'"; } } ! } \ No newline at end of file Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimeType.cs 3 Nov 2004 03:37:06 -0000 1.8 --- TimeType.cs 31 Dec 2004 23:56:09 -0000 1.9 *************** *** 3,9 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { - /// <summary> /// Maps a <see cref="System.DateTime" /> Property to an DateTime column that only stores the --- 3,8 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Maps a <see cref="System.DateTime" /> Property to an DateTime column that only stores the *************** *** 25,56 **** private static DateTime BaseDateValue = new DateTime( 1753, 01, 01 ); ! internal TimeType() : base( new TimeSqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! DateTime dbValue = Convert.ToDateTime(rs[index]); ! return new DateTime(1753, 01, 01, dbValue.Hour, dbValue.Minute, dbValue.Second); } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { ! get { return typeof(DateTime); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; ! if( (DateTime)value < TimeType.BaseDateValue ) { parm.Value = DBNull.Value; } ! else { parm.Value = value; --- 24,75 ---- private static DateTime BaseDateValue = new DateTime( 1753, 01, 01 ); ! /// <summary></summary> ! internal TimeType() : base( new TimeSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! DateTime dbValue = Convert.ToDateTime( rs[ index ] ); ! return new DateTime( 1753, 01, 01, dbValue.Hour, dbValue.Minute, dbValue.Second ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( DateTime ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! if( ( DateTime ) value < TimeType.BaseDateValue ) { parm.Value = DBNull.Value; } ! else { parm.Value = value; *************** *** 58,99 **** } ! public override bool Equals(object x, object y) { ! if (x==y) return true; ! if (x==null || y==null) return false; ! DateTime date1 = (DateTime) x; ! DateTime date2 = (DateTime) y; return date1.Hour == date2.Hour ! && date1.Minute== date2.Minute && date1.Second == date2.Second; } ! public override string Name { get { return "Time"; } } ! public override string ToXML(object val) { ! return ((DateTime)val).ToShortTimeString(); } ! public override bool HasNiceEquals { get { return true; } } ! public object StringToObject(string xml) { ! return DateTime.Parse(xml); } ! public override string ObjectToSQLString(object value) { ! return "'" + ((DateTime)value).ToShortTimeString() + "'"; } } ! } ! --- 77,146 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if( x == y ) ! { ! return true; ! } ! if( x == null || y == null ) ! { ! return false; ! } ! DateTime date1 = ( DateTime ) x; ! DateTime date2 = ( DateTime ) y; return date1.Hour == date2.Hour ! && date1.Minute == date2.Minute && date1.Second == date2.Second; } ! /// <summary></summary> ! public override string Name { get { return "Time"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="val"></param> ! /// <returns></returns> ! public override string ToXML( object val ) { ! return ( ( DateTime ) val ).ToShortTimeString(); } ! /// <summary></summary> ! public override bool HasNiceEquals { get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) { ! return DateTime.Parse( xml ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { ! return "'" + ( ( DateTime ) value ).ToShortTimeString() + "'"; } } ! } \ No newline at end of file Index: TypeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TypeType.cs 25 Oct 2004 05:37:56 -0000 1.4 --- TypeType.cs 31 Dec 2004 23:56:09 -0000 1.5 *************** *** 1,18 **** using System; using System.Data; - using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Type { ! /// <summary> /// Maps the Assembly Qualified Name of a <see cref="System.Type"/> to a ! /// <see cref="DbType.Stirng" /> column. /// </summary> ! public class TypeType : ImmutableType { ! ! internal TypeType() : base( new StringSqlType() ) { } --- 1,17 ---- using System; using System.Data; using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Type ! { /// <summary> /// Maps the Assembly Qualified Name of a <see cref="System.Type"/> to a ! /// <see cref="DbType.String" /> column. /// </summary> ! public class TypeType : ImmutableType { ! /// <summary></summary> ! internal TypeType() : base( new StringSqlType() ) { } *************** *** 23,27 **** /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! internal TypeType(StringSqlType sqlType) : base(sqlType) { } --- 22,26 ---- /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! internal TypeType( StringSqlType sqlType ) : base( sqlType ) { } *************** *** 36,55 **** /// Thrown when the value in the database can not be loaded as a <see cref="System.Type"/> /// </exception> ! public override object Get(IDataReader rs, int index) { ! string str = (string) NHibernate.String.Get(rs, index); ! if (str == null) { return null; } ! else { ! try { ! return ReflectHelper.ClassForName(str); } ! catch (TypeLoadException) { ! throw new HibernateException("Class not found: " + str); } } --- 35,54 ---- /// Thrown when the value in the database can not be loaded as a <see cref="System.Type"/> /// </exception> ! public override object Get( IDataReader rs, int index ) { ! string str = ( string ) NHibernate.String.Get( rs, index ); ! if( str == null ) { return null; } ! else { ! try { ! return ReflectHelper.ClassForName( str ); } ! catch( TypeLoadException ) { ! throw new HibernateException( "Class not found: " + str ); } } *************** *** 71,77 **** /// Thrown when the value in the database can not be loaded as a <see cref="System.Type"/> /// </exception> ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } --- 70,76 ---- /// Thrown when the value in the database can not be loaded as a <see cref="System.Type"/> /// </exception> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } *************** *** 88,107 **** /// <see cref="NHibernate.String"/> object to do the work. /// </remarks> ! public override void Set(IDbCommand cmd, object value, int index) { ! NHibernate.String.Set(cmd, ( (System.Type) value ).AssemblyQualifiedName, index); } ! /// <summary> /// A representation of the value to be embedded in an XML element /// </summary> ! /// <param name="val">The <see cref="System.Type"/> that contains the values. /// </param> /// <returns>An Xml formatted string that contains the Assembly Qualified Name.</returns> ! public override string ToXML(object value) { ! return ( (System.Type) value ).AssemblyQualifiedName; } ! /// <summary> /// Gets the <see cref="System.Type"/> that will be returned --- 87,106 ---- /// <see cref="NHibernate.String"/> object to do the work. /// </remarks> ! public override void Set( IDbCommand cmd, object value, int index ) { ! NHibernate.String.Set( cmd, ( ( System.Type ) value ).AssemblyQualifiedName, index ); } ! /// <summary> /// A representation of the value to be embedded in an XML element /// </summary> ! /// <param name="value">The <see cref="System.Type"/> that contains the values. /// </param> /// <returns>An Xml formatted string that contains the Assembly Qualified Name.</returns> ! public override string ToXML( object value ) { ! return ( ( System.Type ) value ).AssemblyQualifiedName; } ! /// <summary> /// Gets the <see cref="System.Type"/> that will be returned *************** *** 111,136 **** /// A <see cref="System.Type"/> from the .NET framework. /// </value> ! public override System.Type ReturnedClass { ! get { return typeof(System.Type); } } ! ! public override bool Equals(object x, object y) { ! ! if(x==null && y==null) { return true; } ! ! if(x==null || y==null) { return false; } ! return x.Equals(y); } ! ! public override string Name { get { return "Type"; } --- 110,141 ---- /// A <see cref="System.Type"/> from the .NET framework. /// </value> ! public override System.Type ReturnedClass { ! get { return typeof( System.Type ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if( x == null && y == null ) { return true; } ! ! if( x == null || y == null ) { return false; } ! return x.Equals( y ); } ! ! /// <summary></summary> ! public override string Name { get { return "Type"; } Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** TypeFactory.cs 11 Dec 2004 20:08:20 -0000 1.40 --- TypeFactory.cs 31 Dec 2004 23:56:09 -0000 1.41 *************** *** 2,16 **** using System.Collections; using System.Globalization; - - using NHibernate; - using NHibernate.Collection; using NHibernate.Engine; using NHibernate.SqlTypes; - using NHibernate.Type; using NHibernate.Util; [...1587 lines suppressed...] ! { ! results = new int[types.Length]; ! } ! results[ count++ ] = i; } } ! if( count == 0 ) { return null; } ! else { ! int[ ] trimmed = new int[count]; ! System.Array.Copy( results, 0, trimmed, 0, count ); return trimmed; } } ! /* /// <summary> Index: TrueFalseType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TrueFalseType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TrueFalseType.cs 25 Oct 2004 05:37:56 -0000 1.5 --- TrueFalseType.cs 31 Dec 2004 23:56:09 -0000 1.6 *************** *** 1,4 **** - using System; - using NHibernate.SqlTypes; --- 1,2 ---- *************** *** 6,10 **** { /// <summary> ! /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="DbType.AnsiStringFixedLength" /> column /// that stores a <code>'T'/'F'</code> to indicate <code>true/false</code>. /// </summary> --- 4,8 ---- { /// <summary> ! /// Maps a <see cref="System.Boolean" /> to a 1 char <see cref="System.Data.DbType.AnsiStringFixedLength" /> column /// that stores a <code>'T'/'F'</code> to indicate <code>true/false</code>. /// </summary> *************** *** 17,35 **** /// export to create a char(1) column. /// </remarks> ! public class TrueFalseType: CharBooleanType { ! internal TrueFalseType() : base( new AnsiStringFixedLengthSqlType(1) ) { } ! protected override sealed string TrueString { get { return "T"; } } ! protected override sealed string FalseString { get { return "F"; } } ! public override string Name { get { return "TrueFalse"; } } --- 15,40 ---- /// export to create a char(1) column. /// </remarks> ! public class TrueFalseType : CharBooleanType { ! /// <summary></summary> ! internal TrueFalseType() : base( new AnsiStringFixedLengthSqlType( 1 ) ) { } ! /// <summary></summary> ! protected override sealed string TrueString ! { get { return "T"; } } ! /// <summary></summary> ! protected override sealed string FalseString ! { get { return "F"; } } ! /// <summary></summary> ! public override string Name ! { get { return "TrueFalse"; } } |
From: Kevin W. <kev...@us...> - 2004-12-31 23:56:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24797 Modified Files: SortedSetType.cs StringClobType.cs StringType.cs TicksType.cs TimeSpanType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimeSpanType.cs 20 Dec 2004 04:49:03 -0000 1.8 --- TimeSpanType.cs 31 Dec 2004 23:55:53 -0000 1.9 *************** *** 1,10 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { - /// <summary> /// Maps a <see cref="System.TimeSpan" /> Property to an <see cref="DbType.Int64" /> column --- 1,8 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Maps a <see cref="System.TimeSpan" /> Property to an <see cref="DbType.Int64" /> column *************** *** 12,61 **** public class TimeSpanType : ValueTypeType, IVersionType, ILiteralType { ! internal TimeSpanType() : base( new Int64SqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return new TimeSpan( Convert.ToInt64(rs[index]) ); } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { ! get { return typeof(TimeSpan); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; ! parm.Value = ((TimeSpan)value).Ticks; } ! public override string Name { get { return "TimeSpan"; } } ! public override string ToXML(object val) { ! return ((TimeSpan)val).Ticks.ToString(); } ! public override bool Equals(object x, object y) { ! if (x==y) return true; ! if (x==null || y==null) return false; ! long xTime = ((TimeSpan)x).Ticks; ! long yTime = ((TimeSpan)y).Ticks; ! return xTime == yTime; } ! public override bool HasNiceEquals { get { return true; } --- 10,98 ---- public class TimeSpanType : ValueTypeType, IVersionType, ILiteralType { ! /// <summary></summary> ! internal TimeSpanType() : base( new Int64SqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return new TimeSpan( Convert.ToInt64( rs[ index ] ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( TimeSpan ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! parm.Value = ( ( TimeSpan ) value ).Ticks; } ! /// <summary></summary> ! public override string Name { get { return "TimeSpan"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="val"></param> ! /// <returns></returns> ! public override string ToXML( object val ) { ! return ( ( TimeSpan ) val ).Ticks.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if( x == y ) ! { ! return true; ! } ! if( x == null || y == null ) ! { ! return false; ! } ! long xTime = ( ( TimeSpan ) x ).Ticks; ! long yTime = ( ( TimeSpan ) y ).Ticks; ! return xTime == yTime; } ! /// <summary></summary> ! public override bool HasNiceEquals { get { return true; } *************** *** 64,73 **** #region IVersionType Members ! public object Next(object current) { return Seed; } ! ! public object Seed { get { return new TimeSpan( DateTime.Now.Ticks ); } --- 101,116 ---- #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public object Next( object current ) { return Seed; } ! ! /// <summary></summary> ! public object Seed { get { return new TimeSpan( DateTime.Now.Ticks ); } *************** *** 76,84 **** #endregion ! public override string ObjectToSQLString(object value) { ! return "'" + ((TimeSpan)value).Ticks.ToString() + "'"; } } ! } ! --- 119,131 ---- #endregion ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { ! return "'" + ( ( TimeSpan ) value ).Ticks.ToString() + "'"; } } ! } \ No newline at end of file Index: StringType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/StringType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StringType.cs 25 Oct 2004 05:37:56 -0000 1.6 --- StringType.cs 31 Dec 2004 23:55:53 -0000 1.7 *************** *** 1,55 **** using System; using System.Data; - using NHibernate.SqlTypes; using NHibernate.Util; ! ! namespace NHibernate.Type { ! /// <summary> /// Maps a <see cref="System.String" /> to a <see cref="DbType.String" /> column. /// </summary> ! public class StringType : ImmutableType, IDiscriminatorType { ! ! internal StringType() : base( new StringSqlType() ) { } ! internal StringType(StringSqlType sqlType) : base(sqlType) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToString(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToString(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(string); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "String"; } } ! public string ObjectToSQLString(object value) { ! return "'" + (string) value + "'"; } ! public object StringToObject(string xml) { return xml; } ! public override bool Equals(object x, object y) { ! return ObjectUtils.Equals(x, y); } ! public override string ToXML(object value) { ! return (string) value; } } ! } --- 1,113 ---- using System; using System.Data; using NHibernate.SqlTypes; using NHibernate.Util; ! namespace NHibernate.Type ! { /// <summary> /// Maps a <see cref="System.String" /> to a <see cref="DbType.String" /> column. /// </summary> ! public class StringType : ImmutableType, IDiscriminatorType ! { ! /// <summary></summary> ! internal StringType() : base( new StringSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sqlType"></param> ! internal StringType( StringSqlType sqlType ) : base( sqlType ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) ! { ! return Convert.ToString( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) ! { ! return Convert.ToString( rs[ name ] ); } ! ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( string ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) ! { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name ! { get { return "String"; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public string ObjectToSQLString( object value ) ! { ! return "'" + ( string ) value + "'"; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) ! { return xml; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) ! { ! return ObjectUtils.Equals( x, y ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ToXML( object value ) ! { ! return ( string ) value; } } ! } \ No newline at end of file Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TicksType.cs 25 Oct 2004 05:37:56 -0000 1.7 --- TicksType.cs 31 Dec 2004 23:55:53 -0000 1.8 *************** *** 1,10 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { - /// <summary> /// Maps a <see cref="System.DateTime" /> Property to an <see cref="DbType.Int64" /> column --- 1,8 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Maps a <see cref="System.DateTime" /> Property to an <see cref="DbType.Int64" /> column *************** *** 17,66 **** public class TicksType : ValueTypeType, IVersionType, ILiteralType { ! internal TicksType() : base( new Int64SqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return new DateTime( Convert.ToInt64(rs[index]) ); } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { ! get { return typeof(DateTime); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; ! parm.Value = ((DateTime)value).Ticks; } ! public override string Name { get { return "Ticks"; } } ! public override string ToXML(object val) { ! return ((DateTime)val).Ticks.ToString(); } ! public override bool Equals(object x, object y) { ! if (x==y) return true; ! if (x==null || y==null) return false; ! long xTime = ((DateTime)x).Ticks; ! long yTime = ((DateTime)y).Ticks; ! return xTime == yTime; } ! public override bool HasNiceEquals { get { return true; } --- 15,109 ---- public class TicksType : ValueTypeType, IVersionType, ILiteralType { ! /// <summary></summary> ! internal TicksType() : base( new Int64SqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return new DateTime( Convert.ToInt64( rs[ index ] ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( DateTime ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; ! parm.Value = ( ( DateTime ) value ).Ticks; } ! /// <summary></summary> ! public override string Name { get { return "Ticks"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="val"></param> ! /// <returns></returns> ! public override string ToXML( object val ) { ! return ( ( DateTime ) val ).Ticks.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! if( x == y ) ! { ! return true; ! } ! if( x == null || y == null ) ! { ! return false; ! } ! long xTime = ( ( DateTime ) x ).Ticks; ! long yTime = ( ( DateTime ) y ).Ticks; ! return xTime == yTime; } ! /// <summary></summary> ! public override int GetHashCode() ! { ! return base.GetHashCode(); ! } ! ! /// <summary></summary> ! public override bool HasNiceEquals { get { return true; } *************** *** 69,78 **** #region IVersionType Members ! public object Next(object current) { return Seed; } ! ! public object Seed { get { return DateTime.Now; } --- 112,127 ---- #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public object Next( object current ) { return Seed; } ! ! /// <summary></summary> ! public object Seed { get { return DateTime.Now; } *************** *** 81,89 **** #endregion ! public override string ObjectToSQLString(object value) { ! return "'" + ((DateTime)value).Ticks.ToString() + "'"; } } ! } ! --- 130,142 ---- #endregion ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { ! return "'" + ( ( DateTime ) value ).Ticks.ToString() + "'"; } } ! } \ No newline at end of file Index: StringClobType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/StringClobType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringClobType.cs 25 Oct 2004 05:37:56 -0000 1.2 --- StringClobType.cs 31 Dec 2004 23:55:53 -0000 1.3 *************** *** 1,4 **** - using System; - using NHibernate.SqlTypes; --- 1,2 ---- *************** *** 16,31 **** public class StringClobType : StringType { ! internal StringClobType() : base( new StringClobSqlType() ) { } ! internal StringClobType(StringSqlType sqlType) : base(sqlType) { } public override string Name { ! get {return "StringClob"; } } } ! } --- 14,35 ---- public class StringClobType : StringType { ! /// <summary></summary> ! internal StringClobType() : base( new StringClobSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sqlType"></param> ! internal StringClobType( StringSqlType sqlType ) : base( sqlType ) { } + /// <summary></summary> public override string Name { ! get { return "StringClob"; } } } ! } \ No newline at end of file Index: SortedSetType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SortedSetType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SortedSetType.cs 18 Nov 2004 02:44:10 -0000 1.5 --- SortedSetType.cs 31 Dec 2004 23:55:53 -0000 1.6 *************** *** 1,7 **** - using System; using System.Collections; ! using NHibernate.Collection; using NHibernate.Engine; namespace NHibernate.Type --- 1,7 ---- using System.Collections; ! using Iesi.Collections; using NHibernate.Collection; using NHibernate.Engine; + using SortedSet = NHibernate.Collection.SortedSet; namespace NHibernate.Type *************** *** 10,25 **** /// Extends the SetType to provide Sorting. /// </summary> ! public class SortedSetType : SetType { private IComparer comparer; ! public SortedSetType(string role, IComparer comparer) : base(role) { this.comparer = comparer; } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! SortedSet sortedSet = new SortedSet(session, comparer); return sortedSet; } --- 10,36 ---- /// Extends the SetType to provide Sorting. /// </summary> ! public class SortedSetType : SetType { private IComparer comparer; ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! /// <param name="comparer"></param> ! public SortedSetType( string role, IComparer comparer ) : base( role ) { this.comparer = comparer; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) { ! SortedSet sortedSet = new SortedSet( session, comparer ); return sortedSet; } *************** *** 29,43 **** // doesn't have that I don't need to override it. ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new SortedSet(session, (Iesi.Collections.ISet)collection, comparer); ! } ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { ! return new SortedSet(session, persister, comparer, disassembled, owner); } ! } ! } --- 40,68 ---- // doesn't have that I don't need to override it. ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) { ! return new SortedSet( session, ( ISet ) collection, comparer ); ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) { ! return new SortedSet( session, persister, comparer, disassembled, owner ); } ! } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 23:55:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24740 Modified Files: SerializableType.cs SerializationException.cs SetType.cs SingleType.cs SortedMapType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: SortedMapType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SortedMapType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SortedMapType.cs 27 Apr 2004 15:49:22 -0000 1.2 --- SortedMapType.cs 31 Dec 2004 23:55:34 -0000 1.3 *************** *** 1,5 **** - using System; using System.Collections; - using NHibernate.Collection; using NHibernate.Engine; --- 1,3 ---- *************** *** 14,25 **** private IComparer comparer; ! public SortedMapType(string role, IComparer comparer) : base(role) { this.comparer = comparer; } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! SortedMap sortedMap = new SortedMap(session, comparer); return sortedMap; } --- 12,34 ---- private IComparer comparer; ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! /// <param name="comparer"></param> ! public SortedMapType( string role, IComparer comparer ) : base( role ) { this.comparer = comparer; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) { ! SortedMap sortedMap = new SortedMap( session, comparer ); return sortedMap; } *************** *** 29,41 **** // doesn't have that I don't need to override it. ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new SortedMap(session, (IDictionary)collection, comparer); } ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { ! return new SortedMap(session, persister, comparer, disassembled, owner); } } ! } --- 38,64 ---- // doesn't have that I don't need to override it. ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) { ! return new SortedMap( session, ( IDictionary ) collection, comparer ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) { ! return new SortedMap( session, persister, comparer, disassembled, owner ); } } ! } \ No newline at end of file Index: SetType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SetType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SetType.cs 18 Nov 2004 02:44:10 -0000 1.4 --- SetType.cs 31 Dec 2004 23:55:34 -0000 1.5 *************** *** 1,16 **** - using System; using System.Collections; ! using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type { ! /// <summary> /// Summary description for SetType. /// </summary> ! public class SetType : PersistentCollectionType { ! ! public SetType(string role) : base(role){ } --- 1,21 ---- using System.Collections; ! using Iesi.Collections; using NHibernate.Collection; using NHibernate.Engine; + using Set = NHibernate.Collection.Set; ! namespace NHibernate.Type ! { /// <summary> /// Summary description for SetType. /// </summary> ! public class SetType : PersistentCollectionType ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! public SetType( string role ) : base( role ) ! { } *************** *** 18,23 **** /// <see cref="PersistentCollectionType.Instantiate"/> /// </summary> ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new Set(session); } --- 23,31 ---- /// <see cref="PersistentCollectionType.Instantiate"/> /// </summary> ! /// <param name="persister"></param> ! /// <param name="session"></param> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) ! { ! return new Set( session ); } *************** *** 25,30 **** /// <see cref="AbstractType.ReturnedClass"/> /// </summary> ! public override System.Type ReturnedClass { ! get {return typeof(Iesi.Collections.ISet);} } --- 33,39 ---- /// <see cref="AbstractType.ReturnedClass"/> /// </summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( ISet ); } } *************** *** 32,37 **** /// <see cref="PersistentCollectionType.Wrap"/> /// </summary> ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new Set(session, (Iesi.Collections.ISet)collection); } --- 41,49 ---- /// <see cref="PersistentCollectionType.Wrap"/> /// </summary> ! /// <param name="collection"></param> ! /// <param name="session"></param> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) ! { ! return new Set( session, ( ISet ) collection ); } *************** *** 39,53 **** /// <see cref="PersistentCollectionType.AssembleCachedCollection"/> /// </summary> ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { ! return new Set(session, persister, disassembled, owner); } ! public override ICollection GetElementsCollection(object collection) { ! return (ICollection)collection; } - } ! } --- 51,75 ---- /// <see cref="PersistentCollectionType.AssembleCachedCollection"/> /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) ! { ! return new Set( session, persister, disassembled, owner ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override ICollection GetElementsCollection( object collection ) { ! return ( ICollection ) collection; } } ! } \ No newline at end of file Index: SerializableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SerializableType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SerializableType.cs 25 Oct 2004 05:37:56 -0000 1.6 --- SerializableType.cs 31 Dec 2004 23:55:34 -0000 1.7 *************** *** 3,12 **** using System.IO; using System.Runtime.Serialization.Formatters.Binary; - using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// Maps an instance of a <see cref="System.Object" /> that has the <see cref="System.SerializableAttribute" /> --- 3,11 ---- using System.IO; using System.Runtime.Serialization.Formatters.Binary; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// Maps an instance of a <see cref="System.Object" /> that has the <see cref="System.SerializableAttribute" /> *************** *** 24,28 **** /// </para> /// </remarks> ! public class SerializableType : MutableType { private System.Type serializableClass; --- 23,27 ---- /// </para> /// </remarks> ! public class SerializableType : MutableType { private System.Type serializableClass; *************** *** 30,110 **** private BinaryType binaryType; ! internal SerializableType() : this( typeof(Object) ) { } ! internal SerializableType(System.Type serializableClass) : base( new BinarySqlType() ) { this.serializableClass = serializableClass; ! this.binaryType = (BinaryType)NHibernate.Binary; ! } ! ! internal SerializableType(System.Type serializableClass, BinarySqlType sqlType) : base(sqlType) { this.serializableClass = serializableClass; ! binaryType = (BinaryType)TypeFactory.GetBinaryType(sqlType.Length); } ! public override void Set(IDbCommand st, object value, int index) { ! binaryType.Set(st, ToBytes(value), index); } ! public override object Get(IDataReader rs, int index) { ! byte[] bytes = (byte[]) binaryType.Get(rs, index); ! if ( bytes == null ) { return null; ! } else { ! return FromBytes(bytes); } } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override System.Type ReturnedClass { get { return serializableClass; } } ! public override bool Equals(object x, object y) { ! if (x==y) return true; ! if (x==null || y==null) return false; ! return binaryType.Equals(ToBytes(x), ToBytes(y)); } ! public override string ToXML(object value) { ! return (value==null) ? null : binaryType.ToXML( ToBytes(value) ); } ! public override string Name { get { return "serializable - " + serializableClass.FullName; } } ! public override object DeepCopyNotNull(object value) { ! return FromBytes( ToBytes(value) ); } ! private byte[] ToBytes(object obj) { ! try { BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); ! bf.Serialize(stream, obj); return stream.ToArray(); ! } catch (Exception e) { ! throw new SerializationException("Could not serialize a serializable property: ", e); } } ! public object FromBytes(byte[] bytes) { ! try { BinaryFormatter bf = new BinaryFormatter(); ! return bf.Deserialize(new MemoryStream(bytes)); ! } catch (Exception e) { ! throw new SerializationException("Could not deserialize a serializable property: ", e); } } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { ! return (cached==null) ? null : FromBytes( (byte[]) cached ); } ! public override object Disassemble(object value, ISessionImplementor session) { ! return (value==null) ? null : ToBytes(value); } } ! } --- 29,215 ---- private BinaryType binaryType; ! /// <summary></summary> ! internal SerializableType() : this( typeof( Object ) ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="serializableClass"></param> ! internal SerializableType( System.Type serializableClass ) : base( new BinarySqlType() ) { this.serializableClass = serializableClass; ! this.binaryType = ( BinaryType ) NHibernate.Binary; ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="serializableClass"></param> ! /// <param name="sqlType"></param> ! internal SerializableType( System.Type serializableClass, BinarySqlType sqlType ) : base( sqlType ) ! { this.serializableClass = serializableClass; ! binaryType = ( BinaryType ) TypeFactory.GetBinaryType( sqlType.Length ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) ! { ! binaryType.Set( st, ToBytes( value ), index ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) ! { ! byte[ ] bytes = ( byte[ ] ) binaryType.Get( rs, index ); ! if( bytes == null ) ! { return null; ! } ! else ! { ! return FromBytes( bytes ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) ! { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary> ! /// ! /// </summary> ! public override System.Type ReturnedClass ! { get { return serializableClass; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) ! { ! if( x == y ) ! { ! return true; ! } ! if( x == null || y == null ) ! { ! return false; ! } ! return binaryType.Equals( ToBytes( x ), ToBytes( y ) ); } ! ! /// <summary></summary> ! public override int GetHashCode() ! { ! return base.GetHashCode(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ToXML( object value ) ! { ! return ( value == null ) ? null : binaryType.ToXML( ToBytes( value ) ); ! } ! ! /// <summary></summary> ! public override string Name ! { get { return "serializable - " + serializableClass.FullName; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override object DeepCopyNotNull( object value ) ! { ! return FromBytes( ToBytes( value ) ); } ! ! private byte[ ] ToBytes( object obj ) ! { ! try ! { BinaryFormatter bf = new BinaryFormatter(); MemoryStream stream = new MemoryStream(); ! bf.Serialize( stream, obj ); return stream.ToArray(); ! } ! catch( Exception e ) ! { ! throw new SerializationException( "Could not serialize a serializable property: ", e ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="bytes"></param> ! /// <returns></returns> ! public object FromBytes( byte[ ] bytes ) ! { ! try ! { BinaryFormatter bf = new BinaryFormatter(); ! return bf.Deserialize( new MemoryStream( bytes ) ); ! } ! catch( Exception e ) ! { ! throw new SerializationException( "Could not deserialize a serializable property: ", e ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cached"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Assemble( object cached, ISessionImplementor session, object owner ) ! { ! return ( cached == null ) ? null : FromBytes( ( byte[ ] ) cached ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override object Disassemble( object value, ISessionImplementor session ) ! { ! return ( value == null ) ? null : ToBytes( value ); } } ! } \ No newline at end of file Index: SerializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SerializationException.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SerializationException.cs 22 Nov 2004 03:50:04 -0000 1.4 --- SerializationException.cs 31 Dec 2004 23:55:34 -0000 1.5 *************** *** 1,5 **** using System; ! namespace NHibernate.Type { /// <summary> --- 1,5 ---- using System; ! namespace NHibernate.Type { /// <summary> *************** *** 7,13 **** /// </summary> [Serializable] ! public class SerializationException : HibernateException { ! public SerializationException(string message, Exception root) : base(message, root) { } } ! } --- 7,20 ---- /// </summary> [Serializable] ! public class SerializationException : HibernateException { ! /// <summary> ! /// ! /// </summary> ! /// <param name="message"></param> ! /// <param name="root"></param> ! public SerializationException( string message, Exception root ) : base( message, root ) ! { ! } } ! } \ No newline at end of file Index: SingleType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SingleType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SingleType.cs 25 Oct 2004 05:37:56 -0000 1.6 --- SingleType.cs 31 Dec 2004 23:55:34 -0000 1.7 *************** *** 1,10 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { - /// <summary> /// Maps a <see cref="System.Single" /> Property to an --- 1,8 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Maps a <see cref="System.Single" /> Property to an *************** *** 15,54 **** /// matches up with the capabilities of <see cref="System.Single" /> /// </remarks> ! public class SingleType : ValueTypeType { ! internal SingleType() : base( new SingleSqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToSingle(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToSingle(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(System.Single); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "Single"; } } ! public override string ObjectToSQLString(object value) { return value.ToString(); } } ! } --- 13,78 ---- /// matches up with the capabilities of <see cref="System.Single" /> /// </remarks> ! public class SingleType : ValueTypeType { ! /// <summary></summary> ! internal SingleType() : base( new SingleSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return Convert.ToSingle( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Convert.ToSingle( rs[ name ] ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( Single ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name { get { return "Single"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { return value.ToString(); } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 23:55:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24613 Modified Files: ObjectType.cs OneToOneType.cs PersistentCollectionType.cs PersistentEnumType.cs SByteType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: PersistentCollectionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentCollectionType.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersistentCollectionType.cs 22 Nov 2004 03:56:08 -0000 1.16 --- PersistentCollectionType.cs 31 Dec 2004 23:54:56 -0000 1.17 *************** *** 1,106 **** - using System; using System.Collections; using System.Data; - using NHibernate.Collection; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// PersistentCollectionType. /// </summary> ! public abstract class PersistentCollectionType : AbstractType, IAssociationType { - private readonly string role; ! private static readonly SqlType[] NoSqlTypes = {}; ! protected PersistentCollectionType(string role) { this.role = role; } ! public virtual string Role { get { return role; } } ! public override bool IsPersistentCollectionType { get { return true; } } ! public override sealed bool Equals(object x, object y) { ! // proxies? - comment in h2.0.3 also ! return x==y; } ! public abstract PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister); ! public override object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) { ! throw new AssertionFailure("bug in PersistentCollectionType"); } ! ! public override object NullSafeGet(IDataReader rs, string[] name, ISessionImplementor session, object owner) { ! return ResolveIdentifier( Hydrate(rs, name, session, owner), session, owner ); } ! public override void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) { } ! public virtual object GetCollection(object id, object owner, ISessionImplementor session) { // added the owner PersistentCollection collection = session.GetLoadingCollection( role, id ); ! if(collection!=null) return collection.GetCachedValue(); //TODO: yuck... call another method - H2.0.3comment ! CollectionPersister persister = session.Factory.GetCollectionPersister(role); ! collection = persister.GetCachedCollection(id, owner, session); ! if(collection!=null) { ! session.AddInitializedCollection(collection, persister, id); return collection.GetCachedValue(); } ! else { ! collection = Instantiate(session, persister); ! session.AddUninitializedCollection(collection, persister, id); ! return collection.GetInitialValue(persister.IsLazy); } } ! public override SqlType[] SqlTypes(IMapping session) { return NoSqlTypes; } ! ! public override int GetColumnSpan(IMapping session) { return 0; ! } ! ! public override string ToXML(object value, ISessionFactoryImplementor factory) { ! return (value==null) ? null : value.ToString(); } ! ! public override object DeepCopy(object value) { return value; } ! ! public override string Name { get { return ReturnedClass.Name; } } ! /// <summary> /// Returns a reference to the elements in the collection. --- 1,176 ---- using System.Collections; using System.Data; using NHibernate.Collection; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// PersistentCollectionType. /// </summary> ! public abstract class PersistentCollectionType : AbstractType, IAssociationType { private readonly string role; ! private static readonly SqlType[ ] NoSqlTypes = {}; ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! protected PersistentCollectionType( string role ) { this.role = role; } ! /// <summary></summary> ! public virtual string Role { get { return role; } } ! /// <summary></summary> ! public override bool IsPersistentCollectionType { get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override sealed bool Equals( object x, object y ) { ! // proxies? - comment in h2.0.3 also ! return x == y; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public abstract PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ); ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, object owner ) { ! throw new AssertionFailure( "bug in PersistentCollectionType" ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet( IDataReader rs, string[ ] name, ISessionImplementor session, object owner ) { ! return ResolveIdentifier( Hydrate( rs, name, session, owner ), session, owner ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! /// <param name="session"></param> ! public override void NullSafeSet( IDbCommand cmd, object value, int index, ISessionImplementor session ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="id"></param> ! /// <param name="owner"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public virtual object GetCollection( object id, object owner, ISessionImplementor session ) { // added the owner PersistentCollection collection = session.GetLoadingCollection( role, id ); ! if( collection != null ) ! { ! return collection.GetCachedValue(); ! } //TODO: yuck... call another method - H2.0.3comment ! CollectionPersister persister = session.Factory.GetCollectionPersister( role ); ! collection = persister.GetCachedCollection( id, owner, session ); ! if( collection != null ) { ! session.AddInitializedCollection( collection, persister, id ); return collection.GetCachedValue(); } ! else { ! collection = Instantiate( session, persister ); ! session.AddUninitializedCollection( collection, persister, id ); ! return collection.GetInitialValue( persister.IsLazy ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override SqlType[ ] SqlTypes( IMapping session ) { return NoSqlTypes; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override int GetColumnSpan( IMapping session ) { return 0; ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="factory"></param> ! /// <returns></returns> ! public override string ToXML( object value, ISessionFactoryImplementor factory ) { ! return ( value == null ) ? null : value.ToString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override object DeepCopy( object value ) { return value; } ! ! /// <summary></summary> ! public override string Name { get { return ReturnedClass.Name; } } ! /// <summary> /// Returns a reference to the elements in the collection. *************** *** 113,211 **** /// DictionaryEntry. /// </remarks> ! public virtual ICollection GetElementsCollection(object collection) { ! return ( (ICollection)collection ); } ! ! public override bool IsMutable { get { return false; } } ! ! public override object Disassemble(object value, ISessionImplementor session) { return null; // commented out in h2.0.3 also ! // if (value==null) { ! // return null; ! // } ! // else { ! // object id = session.GetLoadedCollectionKey( (PersistentCollection) value ); ! // if (id==null) ! // throw new AssertionFailure("Null collection id"); ! // return id; ! // } } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { ! object id = session.GetEntityIdentifier(owner); ! if(id==null) { ! throw new AssertionFailure("bug re-assembling collection reference"); } ! return ResolveIdentifier(id, session, owner); } ! ! public override bool IsDirty(object old, object current, ISessionImplementor session) ! { ! System.Type ownerClass = session.Factory.GetCollectionPersister(role).OwnerClass; ! ! if ( !session.Factory.GetPersister(ownerClass).IsVersioned ) { // collections don't dirty an unversioned parent entity return false; } ! else { ! return base.IsDirty(old, current, session); } } ! public override bool HasNiceEquals { get { return false; } } ! ! public abstract PersistentCollection Wrap(ISessionImplementor session, object collection); ! /** * Note: return true because this type is castable to IAssociationType. Not because * all collections are associations. */ ! public override bool IsAssociationType { get { return true; } } ! ! public virtual ForeignKeyType ForeignKeyType { ! get { return ForeignKeyType.ForeignKeyToParent; } } ! ! public override object Hydrate(IDataReader rs, string[] name, ISessionImplementor session, object owner) { ! return session.GetEntityIdentifier(owner); } ! ! public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) { ! if (value==null) { return null; } ! else { // h2.1 changed this to use sesion.GetCollection( role, value, owner ) and // move the impl of GetCollection from this class to the ISession. ! return GetCollection( value, owner, session); } } ! ! public virtual bool IsArrayType { get { return false; } } ! ! public abstract PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner); } } \ No newline at end of file --- 183,337 ---- /// DictionaryEntry. /// </remarks> ! public virtual ICollection GetElementsCollection( object collection ) { ! return ( ( ICollection ) collection ); } ! ! /// <summary></summary> ! public override bool IsMutable { get { return false; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override object Disassemble( object value, ISessionImplementor session ) ! { return null; // commented out in h2.0.3 also ! // if (value==null) { ! // return null; ! // } ! // else { ! // object id = session.GetLoadedCollectionKey( (PersistentCollection) value ); ! // if (id==null) ! // throw new AssertionFailure("Null collection id"); ! // return id; ! // } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cached"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Assemble( object cached, ISessionImplementor session, object owner ) { ! object id = session.GetEntityIdentifier( owner ); ! if( id == null ) { ! throw new AssertionFailure( "bug re-assembling collection reference" ); } ! return ResolveIdentifier( id, session, owner ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="old"></param> ! /// <param name="current"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override bool IsDirty( object old, object current, ISessionImplementor session ) ! { ! System.Type ownerClass = session.Factory.GetCollectionPersister( role ).OwnerClass; ! ! if( !session.Factory.GetPersister( ownerClass ).IsVersioned ) { // collections don't dirty an unversioned parent entity return false; } ! else { ! return base.IsDirty( old, current, session ); } } ! /// <summary></summary> ! public override bool HasNiceEquals { get { return false; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public abstract PersistentCollection Wrap( ISessionImplementor session, object collection ); ! /** * Note: return true because this type is castable to IAssociationType. Not because * all collections are associations. */ ! ! /// <summary></summary> ! public override bool IsAssociationType { get { return true; } } ! ! /// <summary></summary> ! public virtual ForeignKeyType ForeignKeyType { ! get { return ForeignKeyType.ForeignKeyToParent; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Hydrate( IDataReader rs, string[ ] name, ISessionImplementor session, object owner ) { ! return session.GetEntityIdentifier( owner ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object ResolveIdentifier( object value, ISessionImplementor session, object owner ) { ! if( value == null ) { return null; } ! else { // h2.1 changed this to use sesion.GetCollection( role, value, owner ) and // move the impl of GetCollection from this class to the ISession. ! return GetCollection( value, owner, session ); } } ! ! /// <summary></summary> ! public virtual bool IsArrayType { get { return false; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public abstract PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ); } } \ No newline at end of file Index: SByteType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SByteType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SByteType.cs 11 Dec 2004 20:08:20 -0000 1.1 --- SByteType.cs 31 Dec 2004 23:54:56 -0000 1.2 *************** *** 1,9 **** using System; using System.Data; - - using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> --- 1,7 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> *************** *** 11,55 **** /// to a <see cref="DbType.SByte"/> column. /// </summary> ! public class SByteType : ValueTypeType, IDiscriminatorType { ! ! internal SByteType() : base( new SByteSqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToSByte(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToSByte(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(SByte); } } ! ! public override void Set(IDbCommand cmd, object value, int index) { ! ( (IDataParameter)cmd.Parameters[index] ).Value = (SByte) value; } ! public override string Name { get { return "SByte"; } } ! public override string ObjectToSQLString(object value) { return value.ToString(); } ! public virtual object StringToObject(string xml) { ! return SByte.Parse(xml); } } ! } --- 9,83 ---- /// to a <see cref="DbType.SByte"/> column. /// </summary> ! public class SByteType : ValueTypeType, IDiscriminatorType { ! /// <summary></summary> ! internal SByteType() : base( new SByteSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return Convert.ToSByte( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Convert.ToSByte( rs[ name ] ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( SByte ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand cmd, object value, int index ) { ! ( ( IDataParameter ) cmd.Parameters[ index ] ).Value = ( SByte ) value; } ! /// <summary></summary> ! public override string Name { get { return "SByte"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { return value.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public virtual object StringToObject( string xml ) { ! return SByte.Parse( xml ); } } ! } \ No newline at end of file Index: OneToOneType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/OneToOneType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OneToOneType.cs 20 Aug 2004 17:39:01 -0000 1.7 --- OneToOneType.cs 31 Dec 2004 23:54:56 -0000 1.8 *************** *** 1,67 **** using System; using System.Data; - - using NHibernate.SqlTypes; using NHibernate.Engine; ! using NHibernate.Type; ! ! ! namespace NHibernate.Type { /// <summary> /// A one-to-one association to an entity /// </summary> ! public class OneToOneType : EntityType, IAssociationType { ! ! private static readonly SqlType[] NoSqlTypes = new SqlType[0]; private readonly ForeignKeyType foreignKeyType; ! ! public override int GetColumnSpan(IMapping session) { return 0; } ! public override SqlType[] SqlTypes(IMapping session) { return NoSqlTypes; } ! ! public OneToOneType(System.Type persistentClass, ForeignKeyType foreignKeyType) : base(persistentClass) { this.foreignKeyType = foreignKeyType; } ! ! public override void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) { //nothing to do } ! ! public override bool IsOneToOne { get { return true; } } ! ! public override bool IsDirty(object old, object current, ISessionImplementor session) { return false; } ! ! public virtual ForeignKeyType ForeignKeyType { get { return foreignKeyType; } } ! ! public override object Hydrate(IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! return session.GetEntityIdentifier(owner); } ! ! public override object ResolveIdentifier(object value, ISessionImplementor session, Object owner) { ! if (value==null) return null; ! System.Type clazz = PersistentClass; ! return IsNullable ? ! session.InternalLoadOneToOne(clazz, value) : ! session.InternalLoad(clazz, value); } ! ! public virtual bool IsNullable { ! get { return foreignKeyType==ForeignKeyType.ForeignKeyToParent; } } ! } ! } --- 1,124 ---- using System; using System.Data; using NHibernate.Engine; ! using NHibernate.SqlTypes; + namespace NHibernate.Type + { /// <summary> /// A one-to-one association to an entity /// </summary> ! public class OneToOneType : EntityType, IAssociationType ! { ! private static readonly SqlType[ ] NoSqlTypes = new SqlType[0]; private readonly ForeignKeyType foreignKeyType; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override int GetColumnSpan( IMapping session ) ! { return 0; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override SqlType[ ] SqlTypes( IMapping session ) ! { return NoSqlTypes; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentClass"></param> ! /// <param name="foreignKeyType"></param> ! public OneToOneType( System.Type persistentClass, ForeignKeyType foreignKeyType ) : base( persistentClass ) ! { this.foreignKeyType = foreignKeyType; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! /// <param name="session"></param> ! public override void NullSafeSet( IDbCommand cmd, object value, int index, ISessionImplementor session ) ! { //nothing to do } ! ! /// <summary></summary> ! public override bool IsOneToOne ! { get { return true; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="old"></param> ! /// <param name="current"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override bool IsDirty( object old, object current, ISessionImplementor session ) ! { return false; } ! ! /// <summary></summary> ! public virtual ForeignKeyType ForeignKeyType ! { get { return foreignKeyType; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="names"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Hydrate( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) ! { ! return session.GetEntityIdentifier( owner ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object ResolveIdentifier( object value, ISessionImplementor session, Object owner ) ! { ! if( value == null ) ! { ! return null; ! } ! System.Type clazz = PersistentClass; ! return IsNullable ? ! session.InternalLoadOneToOne( clazz, value ) : ! session.InternalLoad( clazz, value ); } ! ! /// <summary></summary> ! public virtual bool IsNullable ! { ! get { return foreignKeyType == ForeignKeyType.ForeignKeyToParent; } } ! } ! } \ No newline at end of file Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PersistentEnumType.cs 20 Sep 2004 03:00:29 -0000 1.8 --- PersistentEnumType.cs 31 Dec 2004 23:54:56 -0000 1.9 *************** *** 1,27 **** using System; - using System.Collections; using System.Data; - using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ValueTypeType, ILiteralType { private readonly System.Type enumClass; ! ! public PersistentEnumType(System.Type enumClass) : base(GetUnderlyingSqlType(enumClass)) { ! if(enumClass.IsEnum) { this.enumClass = enumClass; } ! else { ! throw new MappingException(enumClass.Name + " did not inherit from System.Enum" ); } } --- 1,29 ---- using System; using System.Data; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// PersistentEnumType /// </summary> ! public class PersistentEnumType : ValueTypeType, ILiteralType { private readonly System.Type enumClass; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="enumClass"></param> ! public PersistentEnumType( System.Type enumClass ) : base( GetUnderlyingSqlType( enumClass ) ) { ! if( enumClass.IsEnum ) { this.enumClass = enumClass; } ! else { ! throw new MappingException( enumClass.Name + " did not inherit from System.Enum" ); } } *************** *** 33,42 **** /// <param name="enumClass">The Enumeration class to get the values from.</param> /// <returns>The SqlType for this EnumClass</returns> ! public static SqlType GetUnderlyingSqlType (System.Type enumClass) ! { ! switch( Enum.GetUnderlyingType(enumClass).FullName ) { case "System.Byte": ! return SqlTypeFactory.GetByte();// DbType.Byte; case "System.Int16": return SqlTypeFactory.GetInt16(); // DbType.Int16; --- 35,44 ---- /// <param name="enumClass">The Enumeration class to get the values from.</param> /// <returns>The SqlType for this EnumClass</returns> ! public static SqlType GetUnderlyingSqlType( System.Type enumClass ) ! { ! switch( Enum.GetUnderlyingType( enumClass ).FullName ) { case "System.Byte": ! return SqlTypeFactory.GetByte(); // DbType.Byte; case "System.Int16": return SqlTypeFactory.GetInt16(); // DbType.Int16; *************** *** 54,60 **** return SqlTypeFactory.GetInt64(); //DbType.UInt64; default: ! throw new HibernateException( "Unknown UnderlyingDbType for Enum"); //Impossible exception } ! } --- 56,62 ---- return SqlTypeFactory.GetInt64(); //DbType.UInt64; default: ! throw new HibernateException( "Unknown UnderlyingDbType for Enum" ); //Impossible exception } ! } *************** *** 66,76 **** /// An instance of the Enum set to the <c>code</c> value. /// </returns> ! public virtual object GetInstance(object code) { ! try { ! return Enum.ToObject( enumClass, GetValue(code) ); } ! catch (ArgumentException ae) { throw new HibernateException( "ArgumentException occurred inside Enum.ToObject()", ae ); --- 68,78 ---- /// An instance of the Enum set to the <c>code</c> value. /// </returns> ! public virtual object GetInstance( object code ) { ! try { ! return Enum.ToObject( enumClass, GetValue( code ) ); } ! catch( ArgumentException ae ) { throw new HibernateException( "ArgumentException occurred inside Enum.ToObject()", ae ); *************** *** 88,92 **** /// convert it to the correct type. /// </remarks> ! public virtual object GetValue(object code) { // code is an enum instance. --- 90,94 ---- /// convert it to the correct type. /// </remarks> ! public virtual object GetValue( object code ) { // code is an enum instance. *************** *** 95,99 **** // type and I don't know why ! switch( Enum.GetUnderlyingType(enumClass).FullName ) { case "System.Byte": --- 97,101 ---- // type and I don't know why ! switch( Enum.GetUnderlyingType( enumClass ).FullName ) { case "System.Byte": *************** *** 114,139 **** return Convert.ToUInt64( code ); default: ! throw new HibernateException( "Unknown UnderlyingType for Enum"); //Impossible exception } } ! ! public override bool Equals(object x, object y) { ! return (x==y) || ( x!=null && y!=null && x.Equals(y) ) ; } ! ! public override System.Type ReturnedClass { get { return enumClass.GetType(); } } ! ! public override void Set(IDbCommand cmd, object value, int index) { ! IDataParameter par = (IDataParameter) cmd.Parameters[index]; ! if (value==null) { par.Value = DBNull.Value; } ! else { par.Value = value; --- 116,160 ---- return Convert.ToUInt64( code ); default: ! throw new HibernateException( "Unknown UnderlyingType for Enum" ); //Impossible exception } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) { ! return ( x == y ) || ( x != null && y != null && x.Equals( y ) ); } ! ! /// <summary></summary> ! public override int GetHashCode() ! { ! return base.GetHashCode (); ! } ! ! /// <summary></summary> ! public override System.Type ReturnedClass { get { return enumClass.GetType(); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand cmd, object value, int index ) { ! IDataParameter par = ( IDataParameter ) cmd.Parameters[ index ]; ! if( value == null ) { par.Value = DBNull.Value; } ! else { par.Value = value; *************** *** 141,192 **** } ! public override object Get(IDataReader rs, int index) { ! object code = rs[index]; ! if ( code==DBNull.Value || code==null) { return null; } ! else { ! return GetInstance(code); } } ! public override object Get(IDataReader rs, string name) { ! return Get(rs, rs.GetOrdinal(name)); } ! public override string Name { get { return enumClass.Name; } } ! ! public override string ToXML(object value) { ! return (value==null) ? null : GetValue(value).ToString(); } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { ! if (cached==null) { return null; } ! else { ! return GetInstance(cached);; } } ! ! public override object Disassemble(object value, ISessionImplementor session) { ! return (value==null) ? null : GetValue(value); } ! ! public override string ObjectToSQLString(object value) { ! return GetValue(value).ToString(); } } --- 162,250 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! object code = rs[ index ]; ! if( code == DBNull.Value || code == null ) { return null; } ! else { ! return GetInstance( code ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return Get( rs, rs.GetOrdinal( name ) ); } ! /// <summary></summary> ! public override string Name { get { return enumClass.Name; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ToXML( object value ) { ! return ( value == null ) ? null : GetValue( value ).ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cached"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Assemble( object cached, ISessionImplementor session, object owner ) { ! if( cached == null ) { return null; } ! else { ! return GetInstance( cached ); ! ; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override object Disassemble( object value, ISessionImplementor session ) { ! return ( value == null ) ? null : GetValue( value ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { ! return GetValue( value ).ToString(); } } Index: ObjectType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ObjectType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ObjectType.cs 20 Sep 2004 03:00:29 -0000 1.8 --- ObjectType.cs 31 Dec 2004 23:54:56 -0000 1.9 *************** *** 1,13 **** using System; using System.Data; - using NHibernate.Engine; - using NHibernate.Util; using NHibernate.Loader; using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! ! ///<summary> /// Handles "any" mappings and the old deprecated "object" type. --- 1,11 ---- using System; using System.Data; using NHibernate.Engine; using NHibernate.Loader; using NHibernate.SqlTypes; + using NHibernate.Util; ! namespace NHibernate.Type ! { ///<summary> /// Handles "any" mappings and the old deprecated "object" type. *************** *** 38,139 **** /// ///</remarks> ! public class ObjectType : AbstractType, IAbstractComponentType, IAssociationType { ! private readonly IType identifierType; private readonly IType metaType; ! internal ObjectType(IType metaType, IType identifierType) { this.identifierType = identifierType; this.metaType = metaType; } ! ! internal ObjectType() : this(NHibernate.Class, NHibernate.Serializable) { } ! ! public override object DeepCopy(object value) { return value; } ! public override bool Equals(object x, object y) { return x == y; } ! public override int GetColumnSpan(IMapping session) { /* * This is set at 2 in Hibernate to support the old depreciated * version of using type="object". We are removing that support so * I don't know if we need to keep this in. ! */ return 2; } ! public override string Name { get { return "Object"; } } ! public override bool HasNiceEquals { get { return false; } } ! public override bool IsMutable { get { return false; } } ! public override object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) { ! throw new NotSupportedException("object is a multicolumn type"); } ! public override object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner) { //if ( names.length!=2 ) throw new HibernateException("object type mapping must specify exactly two columns"); ! ! System.Type clazz = (System.Type) metaType.NullSafeGet(rs, names[0], session, owner); ! object id = identifierType.NullSafeGet(rs, names[1], session, owner); ! if (clazz==null || id==null) { return null; } ! else { ! return session.Load(clazz, id); } } ! public override void NullSafeSet(IDbCommand st, object value, int index, ISessionImplementor session) { object id; System.Type clazz; ! if (value == null) { id = null; clazz = null; ! } ! else { ! id = session.GetEntityIdentifierIfNotUnsaved(value); clazz = value.GetType(); } ! metaType.NullSafeSet(st, clazz, index, session); ! identifierType.NullSafeSet(st, id, index+1, session); // metaType must be single-column type } ! public override System.Type ReturnedClass { ! get { return typeof(object); } } ! ! public override SqlType[] SqlTypes(IMapping mapping) { return ArrayHelper.Join( ! metaType.SqlTypes(mapping), ! identifierType.SqlTypes(mapping)); ! } ! public override string ToXML(object value, ISessionFactoryImplementor factory) { ! return NHibernate.Entity( value.GetType() ).ToXML(value, factory); } [Serializable] ! public sealed class ObjectTypeCacheEntry { public System.Type clazz; public object id; ! public ObjectTypeCacheEntry(System.Type clazz, object id) { this.clazz = clazz; --- 36,221 ---- /// ///</remarks> ! public class ObjectType : AbstractType, IAbstractComponentType, IAssociationType ! { private readonly IType identifierType; private readonly IType metaType; ! /// <summary> ! /// ! /// </summary> ! /// <param name="metaType"></param> ! /// <param name="identifierType"></param> ! internal ObjectType( IType metaType, IType identifierType ) ! { this.identifierType = identifierType; this.metaType = metaType; } ! ! /// <summary></summary> ! internal ObjectType() : this( NHibernate.Class, NHibernate.Serializable ) { } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override object DeepCopy( object value ) ! { return value; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override bool Equals( object x, object y ) ! { return x == y; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override int GetColumnSpan( IMapping session ) ! { /* * This is set at 2 in Hibernate to support the old depreciated * version of using type="object". We are removing that support so * I don't know if we need to keep this in. ! */ return 2; } ! /// <summary></summary> ! public override string Name ! { get { return "Object"; } } ! /// <summary></summary> ! public override bool HasNiceEquals ! { get { return false; } } ! /// <summary></summary> ! public override bool IsMutable ! { get { return false; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, object owner ) ! { ! throw new NotSupportedException( "object is a multicolumn type" ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="names"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) ! { //if ( names.length!=2 ) throw new HibernateException("object type mapping must specify exactly two columns"); ! ! System.Type clazz = ( System.Type ) metaType.NullSafeGet( rs, names[ 0 ], session, owner ); ! object id = identifierType.NullSafeGet( rs, names[ 1 ], session, owner ); ! if( clazz == null || id == null ) ! { return null; } ! else ! { ! return session.Load( clazz, id ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! /// <param name="session"></param> ! public override void NullSafeSet( IDbCommand st, object value, int index, ISessionImplementor session ) ! { object id; System.Type clazz; ! if( value == null ) ! { id = null; clazz = null; ! } ! else ! { ! id = session.GetEntityIdentifierIfNotUnsaved( value ); clazz = value.GetType(); } ! metaType.NullSafeSet( st, clazz, index, session ); ! identifierType.NullSafeSet( st, id, index + 1, session ); // metaType must be single-column type } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( object ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="mapping"></param> ! /// <returns></returns> ! public override SqlType[ ] SqlTypes( IMapping mapping ) ! { return ArrayHelper.Join( ! metaType.SqlTypes( mapping ), ! identifierType.SqlTypes( mapping ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="factory"></param> ! /// <returns></returns> ! public override string ToXML( object value, ISessionFactoryImplementor factory ) ! { ! return NHibernate.Entity( value.GetType() ).ToXML( value, factory ); } + /// <summary></summary> [Serializable] ! public sealed class ObjectTypeCacheEntry { + /// <summary></summary> public System.Type clazz; + /// <summary></summary> public object id; ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="clazz"></param> ! /// <param name="id"></param> ! public ObjectTypeCacheEntry( System.Type clazz, object id ) { this.clazz = clazz; *************** *** 142,223 **** } ! public override object Assemble(object cached, ISessionImplementor session, object owner) { ! ObjectTypeCacheEntry e = (ObjectTypeCacheEntry) cached; ! return (cached==null) ? null : session.Load(e.clazz, e.id); } ! public override object Disassemble(object value, ISessionImplementor session) { ! return (value==null) ? null : new ObjectTypeCacheEntry( value.GetType(), session.GetEntityIdentifier(value) ); } ! public override bool IsObjectType { get { return true; } } ! public Cascades.CascadeStyle Cascade(int i) { ! return Cascades.CascadeStyle.StyleNone; ! } ! ! public OuterJoinLoaderType EnableJoinedFetch(int i) { ! return OuterJoinLoaderType.Lazy; ! } ! ! private static readonly string[] PROPERTY_NAMES = new string[] { "class", "id" }; ! ! public string[] PropertyNames { ! get { ! return ObjectType.PROPERTY_NAMES; ! } } ! public object GetPropertyValue(Object component, int i, ISessionImplementor session) { ! return (i==0) ? ! component.GetType() : ! Id(component, session); ! } ! ! public object[] GetPropertyValues(Object component, ISessionImplementor session) { ! return new object[] { component.GetType(), Id(component, session) }; ! } ! ! private object Id(object component, ISessionImplementor session) { ! try { ! return session.GetEntityIdentifierIfNotUnsaved(component); ! } ! catch (TransientObjectException) { ! return null; ! } ! } ! ! public IType[] Subtypes { ! get { ! return new IType[] { metaType, identifierType }; } ! } ! ! public void SetPropertyValues(object component, object[] values) { ! throw new NotSupportedException(); ! } ! ! public override bool IsComponentType { ! get { ! return true; } } ! public ForeignKeyType ForeignKeyType { ! get { //return AssociationType.FOREIGN_KEY_TO_PARENT; //TODO: this is better but causes a transient object exception... ! return ForeignKeyType.ForeignKeyFromParent; } ! } ! public override bool IsAssociationType { ! get { ! return true; ! } } } ! } --- 224,365 ---- } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cached"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Assemble( object cached, ISessionImplementor session, object owner ) { ! ObjectTypeCacheEntry e = ( ObjectTypeCacheEntry ) cached; ! return ( cached == null ) ? null : session.Load( e.clazz, e.id ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override object Disassemble( object value, ISessionImplementor session ) { ! return ( value == null ) ? null : new ObjectTypeCacheEntry( value.GetType(), session.GetEntityIdentifier( value ) ); } ! /// <summary></summary> ! public override bool IsObjectType ! { get { return true; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public Cascades.CascadeStyle Cascade( int i ) ! { ! return Cascades.CascadeStyle.StyleNone; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="i"></param> ! /// <returns></returns> ! public OuterJoinLoaderType EnableJoinedFetch( int i ) ! { ! return OuterJoinLoaderType.Lazy; ! } ! ! private static readonly string[ ] PROPERTY_NAMES = new string[ ] {"class", "id"}; ! ! /// <summary></summary> ! public string[ ] PropertyNames ! { ! get { return ObjectType.PROPERTY_NAMES; } ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="i"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public object GetPropertyValue( Object component, int i, ISessionImplementor session ) ! { ! return ( i == 0 ) ? ! component.GetType() : ! Id( component, session ); ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public object[ ] GetPropertyValues( Object component, ISessionImplementor session ) ! { ! return new object[ ] {component.GetType(), Id( component, session )}; ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! private object Id( object component, ISessionImplementor session ) ! { ! try ! { ! return session.GetEntityIdentifierIfNotUnsaved( component ); } ! catch( TransientObjectException ) ! { ! return null; } } ! /// <summary></summary> ! public IType[ ] Subtypes ! { ! get { return new IType[ ] {metaType, identifierType}; } ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="component"></param> ! /// <param name="values"></param> ! public void SetPropertyValues( object component, object[ ] values ) ! { ! throw new NotSupportedException(); ! } ! ! /// <summary></summary> ! public override bool IsComponentType ! { ! get { return true; } ! } ! ! /// <summary></summary> ! public ForeignKeyType ForeignKeyType ! { ! get ! { //return AssociationType.FOREIGN_KEY_TO_PARENT; //TODO: this is better but causes a transient object exception... ! return ForeignKeyType.ForeignKeyFromParent; } ! } ! /// <summary></summary> ! public override bool IsAssociationType ! { ! get { return true; } } } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 23:54:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24573 Modified Files: ListType.cs ManyToOneType.cs MapType.cs MutableType.cs NullableType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: MutableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/MutableType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MutableType.cs 14 Oct 2004 04:33:15 -0000 1.5 --- MutableType.cs 31 Dec 2004 23:54:40 -0000 1.6 *************** *** 1,4 **** - using System; - using NHibernate.SqlTypes; --- 1,2 ---- *************** *** 8,12 **** /// Superclass for mutable nullable types. /// </summary> ! public abstract class MutableType : NullableType { /// <summary> --- 6,10 ---- /// Superclass for mutable nullable types. /// </summary> ! public abstract class MutableType : NullableType { /// <summary> *************** *** 15,19 **** /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected MutableType(SqlType sqlType) : base(sqlType) { } --- 13,17 ---- /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected MutableType( SqlType sqlType ) : base( sqlType ) { } *************** *** 27,35 **** /// the type is immutable then they should inherit from <see cref="ImmutableType"/>. /// </remarks> ! public override sealed bool IsMutable { get { return true; } } ! /// <summary> --- 25,33 ---- /// the type is immutable then they should inherit from <see cref="ImmutableType"/>. /// </remarks> ! public override sealed bool IsMutable { get { return true; } } ! /// <summary> *************** *** 46,50 **** /// the <c>Equals()</c> then set this to <c>true</c>. /// </remarks> ! public override bool HasNiceEquals { get { return false; } //default ... may be overridden } --- 44,49 ---- /// the <c>Equals()</c> then set this to <c>true</c>. /// </remarks> ! public override bool HasNiceEquals ! { get { return false; } //default ... may be overridden } Index: MapType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/MapType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MapType.cs 1 Jun 2004 01:36:11 -0000 1.4 --- MapType.cs 31 Dec 2004 23:54:40 -0000 1.5 *************** *** 1,41 **** - using System; - using System.Data; using System.Collections; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type { ! ! public class MapType : PersistentCollectionType { ! ! public MapType(string role) : base(role) { } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new Map(session); } ! public override System.Type ReturnedClass { ! get { return typeof(IDictionary); } } ! public override ICollection GetElementsCollection(object collection) { ! return ((IDictionary) collection).Values; } ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new Map( session, (IDictionary) collection ); } public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, ! object owner) { ! ! return new Map(session, persister, disassembled, owner); } } ! } --- 1,73 ---- using System.Collections; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type ! { ! /// <summary></summary> ! public class MapType : PersistentCollectionType ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! public MapType( string role ) : base( role ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) ! { ! return new Map( session ); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( IDictionary ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override ICollection GetElementsCollection( object collection ) { ! return ( ( IDictionary ) collection ).Values; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) { ! return new Map( session, ( IDictionary ) collection ); } + /// <summary> + /// + /// </summary> + /// <param name="session"></param> + /// <param name="persister"></param> + /// <param name="disassembled"></param> + /// <param name="owner"></param> + /// <returns></returns> public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, ! object owner ) ! { ! return new Map( session, persister, disassembled, owner ); } } ! } \ No newline at end of file Index: NullableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/NullableType.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NullableType.cs 21 Nov 2004 22:56:31 -0000 1.12 --- NullableType.cs 31 Dec 2004 23:54:40 -0000 1.13 *************** *** 1,8 **** using System; using System.Data; ! ! using NHibernate.SqlTypes; using NHibernate.Engine; ! using NHibernate.Util; namespace NHibernate.Type --- 1,7 ---- using System; using System.Data; ! using log4net; using NHibernate.Engine; ! using NHibernate.SqlTypes; namespace NHibernate.Type *************** *** 16,22 **** /// the Struct will be written to the column - not <c>null</c>. /// </remarks> ! public abstract class NullableType : AbstractType { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(NullableType) ); private SqlType _sqlType; --- 15,21 ---- /// the Struct will be written to the column - not <c>null</c>. /// </remarks> ! public abstract class NullableType : AbstractType { ! private static readonly ILog log = LogManager.GetLogger( typeof( NullableType ) ); private SqlType _sqlType; *************** *** 28,32 **** /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> /// <remarks>This is used when the Property is mapped to a single column.</remarks> ! protected NullableType(SqlType sqlType) { _sqlType = sqlType; --- 27,31 ---- /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> /// <remarks>This is used when the Property is mapped to a single column.</remarks> ! protected NullableType( SqlType sqlType ) { _sqlType = sqlType; *************** *** 45,49 **** /// it has checked for nulls. /// </remarks> ! public abstract void Set(IDbCommand cmd, object value, int index); /// <summary> --- 44,48 ---- /// it has checked for nulls. /// </remarks> ! public abstract void Set( IDbCommand cmd, object value, int index ); /// <summary> *************** *** 54,59 **** /// <param name="index">The index of the field to get the value from.</param> /// <returns>An object with the value from the database.</returns> ! public abstract object Get(IDataReader rs, int index); ! /// <summary> /// When implemented by a class, gets the object in the --- 53,58 ---- /// <param name="index">The index of the field to get the value from.</param> /// <returns>An object with the value from the database.</returns> ! public abstract object Get( IDataReader rs, int index ); ! /// <summary> /// When implemented by a class, gets the object in the *************** *** 64,73 **** /// <returns>An object with the value from the database.</returns> /// <remarks> ! /// Most implementors just call the <see cref="Get(IDataReader, Int32)"/> /// overload of this method. /// </remarks> ! public abstract object Get(IDataReader rs, string name); - /// <summary> /// A representation of the value to be embedded in an XML element --- 63,72 ---- /// <returns>An object with the value from the database.</returns> /// <remarks> ! /// Most implementors just call the <see cref="Get(IDataReader, int)"/> /// overload of this method. /// </remarks> ! public abstract object Get( IDataReader rs, string name ); ! /// <summary> /// A representation of the value to be embedded in an XML element *************** *** 76,80 **** /// </param> /// <returns>An Xml formatted string.</returns> ! public abstract string ToXML(object val); /// <include file='IType.cs.xmldoc' --- 75,79 ---- /// </param> /// <returns>An Xml formatted string.</returns> ! public abstract string ToXML( object val ); /// <include file='IType.cs.xmldoc' *************** *** 83,87 **** /// <remarks> /// <para> ! /// This implemenation forwards the call to <see cref="ToXML(Object)"/> if the parameter /// value is not null. /// </para> --- 82,86 ---- /// <remarks> /// <para> ! /// This implemenation forwards the call to <see cref="ToXML(object)"/> if the parameter /// value is not null. /// </para> *************** *** 89,100 **** /// It has been "sealed" because the Types inheriting from <see cref="NullableType"/> /// do not need and should not override this method. All of their implementation ! /// should be in <see cref="ToXML(Object)"/>. /// </para> /// </remarks> ! public override sealed string ToXML(object value, ISessionFactoryImplementor pc) { ! return (value==null) ? null : ToXML(value); } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' --- 88,99 ---- /// It has been "sealed" because the Types inheriting from <see cref="NullableType"/> /// do not need and should not override this method. All of their implementation ! /// should be in <see cref="ToXML(object)"/>. /// </para> /// </remarks> ! public override sealed string ToXML( object value, ISessionFactoryImplementor factory ) { ! return ( value == null ) ? null : ToXML( value ); } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' *************** *** 102,116 **** /// <remarks> /// <para> ! /// This implemenation forwards the call to <see cref="NullSafeSet(IDbCommand, Object, Int32)" />. /// </para> /// <para> /// It has been "sealed" because the Types inheriting from <see cref="NullableType"/> /// do not need to and should not override this method. All of their implementation ! /// should be in <see cref="NullSafeSet(IDbCommand, Object, Int32)" />. /// </para> /// </remarks> ! public override sealed void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) { ! NullSafeSet(cmd, value, index); } --- 101,115 ---- /// <remarks> /// <para> ! /// This implemenation forwards the call to <see cref="NullSafeSet(IDbCommand, object, int)" />. /// </para> /// <para> /// It has been "sealed" because the Types inheriting from <see cref="NullableType"/> /// do not need to and should not override this method. All of their implementation ! /// should be in <see cref="NullSafeSet(IDbCommand, object, int)" />. /// </para> /// </remarks> ! public override sealed void NullSafeSet( IDbCommand st, object value, int index, ISessionImplementor session ) { ! NullSafeSet( st, value, index ); } *************** *** 127,160 **** /// </para> /// <para> ! /// If the value is not null, then the method <see cref="Set(IDbCommand, Object, Int32)"/> /// is called and that method is responsible for setting the value. /// </para> /// </remarks> ! public void NullSafeSet(IDbCommand cmd, object value, int index) { ! if (value==null) { ! if ( log.IsDebugEnabled ) { ! log.Debug("binding null to parameter: " + index.ToString()); } ! //Do we check IsNullable? // TODO: find out why a certain Parameter would not take a null value... // From reading the .NET SDK the default is to NOT accept a null value. ! // I definitely need to look into this more... ! ( (IDataParameter)cmd.Parameters[index]).Value = DBNull.Value; } ! else { ! if ( log.IsDebugEnabled ) { ! log.Debug("binding '" + ToXML(value) + "' to parameter: " + index); } ! ! Set(cmd, value, index); } } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String[], ISessionImplementor, Object)"]/*' --- 126,159 ---- /// </para> /// <para> ! /// If the value is not null, then the method <see cref="Set(IDbCommand, object, int)"/> /// is called and that method is responsible for setting the value. /// </para> /// </remarks> ! public void NullSafeSet( IDbCommand cmd, object value, int index ) { ! if( value == null ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "binding null to parameter: " + index.ToString() ); } ! //Do we check IsNullable? // TODO: find out why a certain Parameter would not take a null value... // From reading the .NET SDK the default is to NOT accept a null value. ! // I definitely need to look into this more... ! ( ( IDataParameter ) cmd.Parameters[ index ] ).Value = DBNull.Value; } ! else { ! if( log.IsDebugEnabled ) { ! log.Debug( "binding '" + ToXML( value ) + "' to parameter: " + index ); } ! ! Set( cmd, value, index ); } } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String[], ISessionImplementor, Object)"]/*' *************** *** 166,172 **** /// safe thing to do because a Nullable Type only has one field. /// </remarks> ! public override sealed object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! return NullSafeGet(rs, names[0]); } --- 165,171 ---- /// safe thing to do because a Nullable Type only has one field. /// </remarks> ! public override sealed object NullSafeGet( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) { ! return NullSafeGet( rs, names[ 0 ] ); } *************** *** 186,192 **** /// TODO: determine if this is needed /// </remarks> ! public virtual object NullSafeGet(IDataReader rs, string[] names) { ! return NullSafeGet(rs, names[0]); } --- 185,191 ---- /// TODO: determine if this is needed /// </remarks> ! public virtual object NullSafeGet( IDataReader rs, string[ ] names ) { ! return NullSafeGet( rs, names[ 0 ] ); } *************** *** 207,219 **** /// </para> /// </remarks> ! public virtual object NullSafeGet(IDataReader rs, string name) { ! int index = rs.GetOrdinal(name); ! if( rs.IsDBNull(index) ) { ! if ( log.IsDebugEnabled ) { ! log.Debug("returning null as column: " + name); } // TODO: add a method to NullableType.GetNullValue - if we want to --- 206,218 ---- /// </para> /// </remarks> ! public virtual object NullSafeGet( IDataReader rs, string name ) { ! int index = rs.GetOrdinal( name ); ! if( rs.IsDBNull( index ) ) { ! if( log.IsDebugEnabled ) { ! log.Debug( "returning null as column: " + name ); } // TODO: add a method to NullableType.GetNullValue - if we want to *************** *** 221,243 **** return null; } ! else ! { object val = null; ! try { ! val = Get(rs, index); } ! catch(System.InvalidCastException ice) { throw new ADOException( ! "Could not cast the value in field " + name + " to the Type " + this.GetType().Name + ! ". Please check to make sure that the mapping is correct and that your DataProvider supports this Data Type.", ice); } ! ! if ( log.IsDebugEnabled ) { ! log.Debug("returning '" + ToXML(val) + "' as column: " + name); } ! return val; } --- 220,242 ---- return null; } ! else ! { object val = null; ! try { ! val = Get( rs, index ); } ! catch( InvalidCastException ice ) { throw new ADOException( ! "Could not cast the value in field " + name + " to the Type " + this.GetType().Name + ! ". Please check to make sure that the mapping is correct and that your DataProvider supports this Data Type.", ice ); } ! ! if( log.IsDebugEnabled ) { ! log.Debug( "returning '" + ToXML( val ) + "' as column: " + name ); } ! return val; } *************** *** 258,266 **** /// </para> /// </remarks> ! public override sealed object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) { ! return NullSafeGet(rs, name); } ! /// <summary> /// Gets the underlying <see cref="SqlType" /> for --- 257,265 ---- /// </para> /// </remarks> ! public override sealed object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, object owner ) { ! return NullSafeGet( rs, name ); } ! /// <summary> /// Gets the underlying <see cref="SqlType" /> for *************** *** 273,279 **** /// that override this Property. /// </remarks> ! public virtual SqlType SqlType { ! get {return _sqlType;} } --- 272,278 ---- /// that override this Property. /// </remarks> ! public virtual SqlType SqlType { ! get { return _sqlType; } } *************** *** 291,297 **** /// </para> /// </remarks> ! public override sealed SqlType[] SqlTypes(IMapping session) { ! return new SqlType[] {SqlType}; } --- 290,296 ---- /// </para> /// </remarks> ! public override sealed SqlType[ ] SqlTypes( IMapping mapping ) { ! return new SqlType[ ] {SqlType}; } *************** *** 304,313 **** /// a NullableType can only map to one column in a table. /// </remarks> ! public override sealed int GetColumnSpan(IMapping session) { return 1; } ! /// <summary> /// When implemented by a class, returns a deep copy of the persistent state. --- 303,313 ---- /// a NullableType can only map to one column in a table. /// </remarks> ! public override sealed int GetColumnSpan( IMapping session ) { return 1; } ! ! /* <see cref="NullableTypes"/> */ /// <summary> /// When implemented by a class, returns a deep copy of the persistent state. *************** *** 316,324 **** /// <returns>A deep copy of the object.</returns> /// <remarks> ! /// Most of the built in <see cref="NullableTypes"/> will just return the same object /// passed into it. /// </remarks> ! public abstract object DeepCopyNotNull(object val); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' --- 316,324 ---- /// <returns>A deep copy of the object.</returns> /// <remarks> ! /// Most of the built in NullableTypes will just return the same object /// passed into it. /// </remarks> ! public abstract object DeepCopyNotNull( object val ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' *************** *** 335,344 **** /// </para> /// </remarks> ! public override sealed object DeepCopy(object val) { ! return (val==null) ? null : DeepCopyNotNull(val); } - #region override of System.Object Members --- 335,343 ---- /// </para> /// </remarks> ! public override sealed object DeepCopy( object val ) { ! return ( val == null ) ? null : DeepCopyNotNull( val ); } #region override of System.Object Members *************** *** 349,353 **** /// <param name="obj">The <see cref="Object"/> to compare with this NullableType.</param> /// <returns>true if the SqlType and Name properties are the same.</returns> ! public override bool Equals(object obj) { /* * Step 1: Perform an == test --- 348,353 ---- /// <param name="obj">The <see cref="Object"/> to compare with this NullableType.</param> /// <returns>true if the SqlType and Name properties are the same.</returns> ! public override bool Equals( object obj ) ! { /* * Step 1: Perform an == test *************** *** 357,374 **** * Step 5: Go back to equals()'s contract and ask yourself if the equals() * method is reflexive, symmetric, and transitive ! */ ! if(this==obj) return true; NullableType rhsType = obj as NullableType; ! if(rhsType==null) return false; ! if(this.Name.Equals(rhsType.Name) ! && this.SqlType.Equals(rhsType.SqlType)) return true; return false; } ! /// <summary> /// Serves as a hash function for the <see cref="NullableType"/>, --- 357,383 ---- * Step 5: Go back to equals()'s contract and ask yourself if the equals() * method is reflexive, symmetric, and transitive ! */ ! if( this == obj ) ! { ! return true; ! } NullableType rhsType = obj as NullableType; ! if( rhsType == null ) ! { ! return false; ! } ! if( this.Name.Equals( rhsType.Name ) ! && this.SqlType.Equals( rhsType.SqlType ) ) ! { ! return true; ! } return false; } ! /// <summary> /// Serves as a hash function for the <see cref="NullableType"/>, *************** *** 377,389 **** /// <returns> /// A hash code that is based on the <see cref="NullableType.SqlType"/>'s ! /// hash code and the <see cref="NullableType.Name"/>'s hash code.</returns> ! public override int GetHashCode() { ! ! return (SqlType.GetHashCode() / 2) + (Name.GetHashCode() / 2); } #endregion - } } \ No newline at end of file --- 386,397 ---- /// <returns> /// A hash code that is based on the <see cref="NullableType.SqlType"/>'s ! /// hash code and the <see cref="AbstractType.Name"/>'s hash code.</returns> ! public override int GetHashCode() ! { ! return ( SqlType.GetHashCode()/2 ) + ( Name.GetHashCode()/2 ); } #endregion } } \ No newline at end of file Index: ListType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ListType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ListType.cs 10 Feb 2004 18:41:42 -0000 1.4 --- ListType.cs 31 Dec 2004 23:54:40 -0000 1.5 *************** *** 1,34 **** - using System; using System.Collections; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type { ! ! public class ListType : PersistentCollectionType { ! ! public ListType(string role) : base(role) { } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new List(session); } ! public override System.Type ReturnedClass { ! get { return typeof(IList); } } ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new List( session, (IList) collection ); } public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, ! object owner) { ! ! return new List(session, persister, disassembled, owner); } } ! } --- 1,63 ---- using System.Collections; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type ! { ! /// <summary></summary> ! public class ListType : PersistentCollectionType ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! public ListType( string role ) : base( role ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) ! { ! return new List( session ); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( IList ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) ! { ! return new List( session, ( IList ) collection ); } + /// <summary> + /// + /// </summary> + /// <param name="session"></param> + /// <param name="persister"></param> + /// <param name="disassembled"></param> + /// <param name="owner"></param> + /// <returns></returns> public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, ! object owner ) ! { ! return new List( session, persister, disassembled, owner ); } } ! } \ No newline at end of file Index: ManyToOneType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ManyToOneType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ManyToOneType.cs 29 Nov 2004 18:43:24 -0000 1.8 --- ManyToOneType.cs 31 Dec 2004 23:54:40 -0000 1.9 *************** *** 1,37 **** - using System; using System.Data; - - using NHibernate.Mapping; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// A many-to-one association to an entity /// </summary> ! public class ManyToOneType : EntityType, IAssociationType { ! ! public override int GetColumnSpan(IMapping session) { ! return session.GetIdentifierType( PersistentClass ).GetColumnSpan(session); } ! public override SqlType[] SqlTypes(IMapping session) { ! return session.GetIdentifierType( PersistentClass ).SqlTypes(session); } ! ! public ManyToOneType(System.Type persistentClass) : base(persistentClass) { } ! public override void NullSafeSet(IDbCommand cmd, object value, int index, ISessionImplementor session) { session.Factory.GetIdentifierType( PersistentClass ) ! .NullSafeSet(cmd, GetIdentifier(value, session), index, session); } ! ! public override bool IsOneToOne { get { return false; } } ! public virtual ForeignKeyType ForeignKeyType { get { return ForeignKeyType.ForeignKeyFromParent; } } --- 1,63 ---- using System.Data; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// A many-to-one association to an entity /// </summary> ! public class ManyToOneType : EntityType, IAssociationType ! { ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override int GetColumnSpan( IMapping session ) ! { ! return session.GetIdentifierType( PersistentClass ).GetColumnSpan( session ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! public override SqlType[ ] SqlTypes( IMapping session ) ! { ! return session.GetIdentifierType( PersistentClass ).SqlTypes( session ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentClass"></param> ! public ManyToOneType( System.Type persistentClass ) : base( persistentClass ) ! { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! /// <param name="session"></param> ! public override void NullSafeSet( IDbCommand cmd, object value, int index, ISessionImplementor session ) ! { session.Factory.GetIdentifierType( PersistentClass ) ! .NullSafeSet( cmd, GetIdentifier( value, session ), index, session ); } ! ! /// <summary></summary> ! public override bool IsOneToOne ! { get { return false; } } ! /// <summary></summary> ! public virtual ForeignKeyType ForeignKeyType ! { get { return ForeignKeyType.ForeignKeyFromParent; } } *************** *** 47,54 **** /// An instantiated object that used as the identifier of the type. /// </returns> ! public override object Hydrate(IDataReader rs, string[] names, ISessionImplementor session, object owner) { return session.Factory.GetIdentifierType( PersistentClass ) ! .NullSafeGet(rs, names, session, owner); } --- 73,80 ---- /// An instantiated object that used as the identifier of the type. /// </returns> ! public override object Hydrate( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) { return session.Factory.GetIdentifierType( PersistentClass ) ! .NullSafeGet( rs, names, session, owner ); } *************** *** 63,72 **** /// <c>value</c> is also <c>null</c>. /// </returns> ! public override object ResolveIdentifier(object value, ISessionImplementor session, object owner) { ! if (value==null) { return null; ! } ! else { return session.InternalLoad( PersistentClass, value ); --- 89,99 ---- /// <c>value</c> is also <c>null</c>. /// </returns> ! public override object ResolveIdentifier( object value, ISessionImplementor session, object owner ) ! { ! if( value == null ) { return null; ! } ! else { return session.InternalLoad( PersistentClass, value ); |
From: Kevin W. <kev...@us...> - 2004-12-31 23:53:49
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24417 Modified Files: Int32Type.cs Int64Type.cs IType.cs IType.cs.xmldoc IVersionType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: Int32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int32Type.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Int32Type.cs 25 Oct 2004 05:37:56 -0000 1.7 --- Int32Type.cs 31 Dec 2004 23:53:39 -0000 1.8 *************** *** 1,62 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// Maps a <see cref="System.Int32"/> Property /// to a <see cref="DbType.Int32"/> column. /// </summary> ! public class Int32Type : ValueTypeType, IDiscriminatorType, IVersionType { ! ! internal Int32Type() : base( new Int32SqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToInt32(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToInt32(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(System.Int32); } } ! ! public override void Set(IDbCommand cmd, object value, int index) { ! IDataParameter parm = cmd.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "Int32"; } } ! public override string ObjectToSQLString(object value) { return value.ToString(); } ! public object StringToObject(string xml) { ! return int.Parse(xml); } #region IVersionType Members ! public virtual object Next(object current) { ! return ((int) current) + 1; } ! public virtual object Seed { ! get { return 0; } } #endregion - } } \ No newline at end of file --- 1,104 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// Maps a <see cref="System.Int32"/> Property /// to a <see cref="DbType.Int32"/> column. /// </summary> ! public class Int32Type : ValueTypeType, IDiscriminatorType, IVersionType { ! /// <summary></summary> ! internal Int32Type() : base( new Int32SqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) ! { ! return Convert.ToInt32( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) ! { ! return Convert.ToInt32( rs[ name ] ); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( Int32 ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand cmd, object value, int index ) ! { ! IDataParameter parm = cmd.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name ! { get { return "Int32"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) ! { return value.ToString(); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) ! { ! return int.Parse( xml ); } #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public virtual object Next( object current ) { ! return ( ( int ) current ) + 1; } ! /// <summary></summary> ! public virtual object Seed ! { ! get { return 0; } } #endregion } } \ No newline at end of file Index: IVersionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IVersionType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IVersionType.cs 19 Oct 2004 02:24:08 -0000 1.5 --- IVersionType.cs 31 Dec 2004 23:53:39 -0000 1.6 *************** *** 1,11 **** ! using System; ! ! namespace NHibernate.Type { - /// <summary> /// An <see cref="IType"/> that may be used to version data. /// </summary> ! public interface IVersionType : IType { /// <summary> --- 1,8 ---- ! namespace NHibernate.Type { /// <summary> /// An <see cref="IType"/> that may be used to version data. /// </summary> ! public interface IVersionType : IType { /// <summary> *************** *** 14,18 **** /// <param name="current">The current version</param> /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> ! object Next(object current); /// <summary> --- 11,15 ---- /// <param name="current">The current version</param> /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> ! object Next( object current ); /// <summary> *************** *** 22,26 **** object Seed { get; } ! } ! } --- 19,23 ---- object Seed { get; } ! } ! } \ No newline at end of file Index: IType.cs.xmldoc =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IType.cs.xmldoc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IType.cs.xmldoc 10 Feb 2004 19:05:41 -0000 1.1 --- IType.cs.xmldoc 31 Dec 2004 23:53:39 -0000 1.2 *************** *** 179,183 **** state, stopping at entities and at collections. </summary> ! <param name="value">A Collection element or Entity field</param> <returns>A deep copy of the object.</returns> </member> --- 179,183 ---- state, stopping at entities and at collections. </summary> ! <param name="val">A Collection element or Entity field</param> <returns>A deep copy of the object.</returns> </member> Index: Int64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int64Type.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Int64Type.cs 20 Nov 2004 21:13:03 -0000 1.7 --- Int64Type.cs 31 Dec 2004 23:53:39 -0000 1.8 *************** *** 1,63 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// Maps a <see cref="System.Int64"/> Property /// to a <see cref="DbType.Int64"/> column. /// </summary> ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType { ! ! internal Int64Type() : base( new Int64SqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToInt64(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToInt64(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(System.Int64); } } ! public override void Set(IDbCommand st, object value, int index) { ! IDataParameter parm = st.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "Int64"; } } ! public object StringToObject(string xml) { ! return long.Parse(xml); } #region IVersionType Members ! public object Next(object current) { ! return ((long)current) + 1; } ! public object Seed { ! get { return (long)0; } } #endregion ! public override string ObjectToSQLString(object value) { return value.ToString(); } } ! } --- 1,104 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// Maps a <see cref="System.Int64"/> Property /// to a <see cref="DbType.Int64"/> column. /// </summary> ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType { ! /// <summary></summary> ! internal Int64Type() : base( new Int64SqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) ! { ! return Convert.ToInt64( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) ! { ! return Convert.ToInt64( rs[ name ] ); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( Int64 ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="st"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand st, object value, int index ) ! { ! IDataParameter parm = st.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name ! { get { return "Int64"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) ! { ! return long.Parse( xml ); } #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public object Next( object current ) { ! return ( ( long ) current ) + 1; } ! /// <summary></summary> ! public object Seed { ! get { return ( long ) 0; } } #endregion ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { return value.ToString(); } } ! } \ No newline at end of file Index: IType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IType.cs 20 Aug 2004 17:39:01 -0000 1.10 --- IType.cs 31 Dec 2004 23:53:39 -0000 1.11 *************** *** 1,22 **** using System; using System.Data; - - using NHibernate.SqlTypes; using NHibernate.Engine; ! namespace NHibernate.Type { /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="T:IType"]/*' ! /// /> ! public interface IType { // QUESTION: // How do we implement Serializable interface? Standard .NET pattern or other? ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsAssociationType"]/*' /// /> bool IsAssociationType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsPersistentCollectionType"]/*' --- 1,23 ---- using System; using System.Data; using NHibernate.Engine; + using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="T:IType"]/*' ! /// /> ! public interface IType { // QUESTION: // How do we implement Serializable interface? Standard .NET pattern or other? ! // Can we mark this interface with the Serializable attribute? ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsAssociationType"]/*' /// /> bool IsAssociationType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsPersistentCollectionType"]/*' *************** *** 28,101 **** /// /> bool IsComponentType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsEntityType"]/*' /// /> bool IsEntityType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsObjectType"]/*' /// /> bool IsObjectType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.SqlTypes"]/*' /// /> ! SqlType[] SqlTypes(IMapping mapping); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.GetColumnSpan"]/*' /// /> ! int GetColumnSpan(IMapping mapping); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.ReturnedClass"]/*' /// /> System.Type ReturnedClass { get; } ! ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Equals"]/*' /// /> ! bool Equals(object x, object y); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.IsDirty"]/*' /// /> ! bool IsDirty(object old, object current, ISessionImplementor session); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String[], ISessionImplementor, Object)"]/*' /// /> ! object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String, ISessionImplementor, Object)"]/*' /// /> ! object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, Object owner); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' /// /> ! void NullSafeSet(IDbCommand st, object value, int index, ISessionImplementor session); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.ToXML"]/*' /// /> ! string ToXML(object value, ISessionFactoryImplementor factory); - /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.Name"]/*' /// /> string Name { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' /// /> ! object DeepCopy(object val); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsMutable"]/*' --- 29,102 ---- /// /> bool IsComponentType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsEntityType"]/*' /// /> bool IsEntityType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsObjectType"]/*' /// /> bool IsObjectType { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.SqlTypes"]/*' /// /> ! SqlType[ ] SqlTypes( IMapping mapping ); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.GetColumnSpan"]/*' /// /> ! int GetColumnSpan( IMapping mapping ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.ReturnedClass"]/*' /// /> System.Type ReturnedClass { get; } ! ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Equals"]/*' /// /> ! bool Equals( object x, object y ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.IsDirty"]/*' /// /> ! bool IsDirty( object old, object current, ISessionImplementor session ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String[], ISessionImplementor, Object)"]/*' /// /> ! object NullSafeGet( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, String, ISessionImplementor, Object)"]/*' /// /> ! object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, Object owner ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' /// /> ! void NullSafeSet( IDbCommand st, object value, int index, ISessionImplementor session ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.ToXML"]/*' /// /> ! string ToXML( object value, ISessionFactoryImplementor factory ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.Name"]/*' /// /> string Name { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' /// /> ! object DeepCopy( object val ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsMutable"]/*' *************** *** 106,115 **** /// path='//members[@type="IType"]/member[@name=M:IType.Disassemble"]/*' /// /> ! object Disassemble(object value, ISessionImplementor session); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Assemble"]/*' /// /> ! object Assemble(object cached, ISessionImplementor session, object owner); /// <include file='IType.cs.xmldoc' --- 107,116 ---- /// path='//members[@type="IType"]/member[@name=M:IType.Disassemble"]/*' /// /> ! object Disassemble( object value, ISessionImplementor session ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Assemble"]/*' /// /> ! object Assemble( object cached, ISessionImplementor session, object owner ); /// <include file='IType.cs.xmldoc' *************** *** 117,131 **** /// /> bool HasNiceEquals { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Hydrate"]/*' /// /> ! object Hydrate(IDataReader rs, string[] names, ISessionImplementor session, object owner); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.ResolveIdentifier"]/*' /// /> ! object ResolveIdentifier(object value, ISessionImplementor session, object owner); } ! } --- 118,132 ---- /// /> bool HasNiceEquals { get; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Hydrate"]/*' /// /> ! object Hydrate( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.ResolveIdentifier"]/*' /// /> ! object ResolveIdentifier( object value, ISessionImplementor session, object owner ); } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 23:53:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24342 Modified Files: IDiscriminatorType.cs IIdentifierType.cs ILiteralType.cs ImmutableType.cs Int16Type.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IDiscriminatorType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IDiscriminatorType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IDiscriminatorType.cs 10 Feb 2004 18:41:42 -0000 1.2 --- IDiscriminatorType.cs 31 Dec 2004 23:53:08 -0000 1.3 *************** *** 1,5 **** ! using System; ! ! namespace NHibernate.Type { /// <summary> /// An IType that may be used for a discriminator column. --- 1,4 ---- ! namespace NHibernate.Type ! { /// <summary> /// An IType that may be used for a discriminator column. *************** *** 10,14 **** /// both the <see cref="IIdentifierType"/> and <see cref="ILiteralType"/> interfaces. /// </remarks> ! public interface IDiscriminatorType : IIdentifierType, ILiteralType { } ! } --- 9,14 ---- /// both the <see cref="IIdentifierType"/> and <see cref="ILiteralType"/> interfaces. /// </remarks> ! public interface IDiscriminatorType : IIdentifierType, ILiteralType ! { } ! } \ No newline at end of file Index: ILiteralType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ILiteralType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ILiteralType.cs 10 Feb 2004 18:41:42 -0000 1.2 --- ILiteralType.cs 31 Dec 2004 23:53:08 -0000 1.3 *************** *** 1,17 **** ! using System; ! ! namespace NHibernate.Type { /// <summary> /// An <see cref="IType"/> that may appear as an SQL literal /// </summary> ! public interface ILiteralType { ! /// <summary> ! /// When implemented by a class, return a <see cref="String"/> representation /// of the value, suitable for embedding in an SQL statement /// </summary> /// <param name="value">The object to convert to a string for the SQL statement.</param> /// <returns>A string that containts a well formed SQL Statement.</returns> ! string ObjectToSQLString(object value); } ! } --- 1,16 ---- ! namespace NHibernate.Type ! { /// <summary> /// An <see cref="IType"/> that may appear as an SQL literal /// </summary> ! public interface ILiteralType ! { /// <summary> ! /// When implemented by a class, return a <see cref="string"/> representation /// of the value, suitable for embedding in an SQL statement /// </summary> /// <param name="value">The object to convert to a string for the SQL statement.</param> /// <returns>A string that containts a well formed SQL Statement.</returns> ! string ObjectToSQLString( object value ); } ! } \ No newline at end of file Index: Int16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int16Type.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Int16Type.cs 20 Nov 2004 21:13:03 -0000 1.7 --- Int16Type.cs 31 Dec 2004 23:53:08 -0000 1.8 *************** *** 1,61 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! /// <summary> /// Maps a <see cref="System.Int16"/> Property /// to a <see cref="DbType.Int16"/> column. /// </summary> ! public class Int16Type : ValueTypeType, IDiscriminatorType, IVersionType { ! ! internal Int16Type() : base( new Int16SqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return Convert.ToInt16(rs[index]); } ! public override object Get(IDataReader rs, string name) { ! return Convert.ToInt16(rs[name]); } ! public override System.Type ReturnedClass { ! get { return typeof(System.Int16); } } ! public override void Set(IDbCommand rs, object value, int index) { ! IDataParameter parm = rs.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "Int16"; } } ! public override string ObjectToSQLString(object value) { return value.ToString(); } ! public object StringToObject(string xml) { ! return short.Parse(xml); } #region IVersionType Members ! public object Next(object current) { ! return (short)( (short)current + 1 ); } ! ! public object Seed { ! get { return (short)0; } } #endregion - } ! } --- 1,104 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { /// <summary> /// Maps a <see cref="System.Int16"/> Property /// to a <see cref="DbType.Int16"/> column. /// </summary> ! public class Int16Type : ValueTypeType, IDiscriminatorType, IVersionType { ! /// <summary></summary> ! internal Int16Type() : base( new Int16SqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) ! { ! return Convert.ToInt16( rs[ index ] ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) ! { ! return Convert.ToInt16( rs[ name ] ); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { ! get { return typeof( Int16 ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand rs, object value, int index ) ! { ! IDataParameter parm = rs.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name ! { get { return "Int16"; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) ! { return value.ToString(); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) ! { ! return short.Parse( xml ); } #region IVersionType Members ! /// <summary> ! /// ! /// </summary> ! /// <param name="current"></param> ! /// <returns></returns> ! public object Next( object current ) { ! return ( short ) ( ( short ) current + 1 ); } ! ! /// <summary></summary> ! public object Seed { ! get { return ( short ) 0; } } #endregion } ! } \ No newline at end of file Index: ImmutableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ImmutableType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImmutableType.cs 20 Sep 2004 03:00:29 -0000 1.6 --- ImmutableType.cs 31 Dec 2004 23:53:08 -0000 1.7 *************** *** 1,12 **** using System; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Superclass of nullable immutable types. /// </summary> ! public abstract class ImmutableType : NullableType { /// <summary> --- 1,11 ---- using System; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> /// Superclass of nullable immutable types. /// </summary> ! public abstract class ImmutableType : NullableType { /// <summary> *************** *** 15,19 **** /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected ImmutableType(SqlType sqlType) : base(sqlType) { } --- 14,18 ---- /// </summary> /// <param name="sqlType">The underlying <see cref="SqlType"/>.</param> ! protected ImmutableType( SqlType sqlType ) : base( sqlType ) { } *************** *** 30,34 **** /// then reboxed. /// </remarks> ! public override sealed object DeepCopyNotNull(object val) { return val; --- 29,33 ---- /// then reboxed. /// </remarks> ! public override sealed object DeepCopyNotNull( object val ) { return val; *************** *** 43,47 **** /// the type is mutable then they should inherit from <see cref="MutableType"/>. /// </remarks> ! public override sealed bool IsMutable { get { return false; } --- 42,46 ---- /// the type is mutable then they should inherit from <see cref="MutableType"/>. /// </remarks> ! public override sealed bool IsMutable { get { return false; } *************** *** 61,69 **** /// not implement the <c>Equals()</c> then set this to <c>false</c>. /// </remarks> ! public override bool HasNiceEquals { get { return true; } } ! } } \ No newline at end of file --- 60,68 ---- /// not implement the <c>Equals()</c> then set this to <c>false</c>. /// </remarks> ! public override bool HasNiceEquals { get { return true; } } ! } } \ No newline at end of file Index: IIdentifierType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IIdentifierType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IIdentifierType.cs 10 Feb 2004 18:41:42 -0000 1.3 --- IIdentifierType.cs 31 Dec 2004 23:53:08 -0000 1.4 *************** *** 1,11 **** ! using System; ! ! namespace NHibernate.Type { ! /// <summary> /// An <see cref="IType"/> that may be used as an identifier. /// </summary> ! public interface IIdentifierType : IType { ! /// <summary> /// When implemented by a class, converts the xml string from the --- 1,9 ---- ! namespace NHibernate.Type ! { /// <summary> /// An <see cref="IType"/> that may be used as an identifier. /// </summary> ! public interface IIdentifierType : IType ! { /// <summary> /// When implemented by a class, converts the xml string from the *************** *** 19,23 **** /// for the System.Type. /// </remarks> ! object StringToObject(string xml); } ! } --- 17,21 ---- /// for the System.Type. /// </remarks> ! object StringToObject( string xml ); } ! } \ No newline at end of file |
From: Kevin W. <kev...@us...> - 2004-12-31 23:53:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24292 Modified Files: EntityType.cs GuidType.cs IAbstractComponentType.cs IAssociationType.cs IdentifierBagType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IAssociationType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IAssociationType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IAssociationType.cs 10 Feb 2004 18:41:42 -0000 1.5 --- IAssociationType.cs 31 Dec 2004 23:52:52 -0000 1.6 *************** *** 1,22 **** - using System; - using NHibernate.Engine; ! namespace NHibernate.Type { ! /// <summary> /// Represents directionality of the foreign key constraint /// </summary> ! public abstract class ForeignKeyType { ! protected ForeignKeyType() { } ! private class ForeignKeyToParentClass : ForeignKeyType { ! public override bool CascadeNow(CascadePoint cascadePoint) { return cascadePoint != CascadePoint.CascadeBeforeInsertAfterDelete; } } ! private class ForeignKeyFromParentClass : ForeignKeyType { ! public override bool CascadeNow(CascadePoint cascadePoint) { return cascadePoint != CascadePoint.CascadeAfterInsertBeforeDelete; } --- 1,28 ---- using NHibernate.Engine; ! namespace NHibernate.Type ! { /// <summary> /// Represents directionality of the foreign key constraint /// </summary> ! public abstract class ForeignKeyType ! { ! /// <summary></summary> ! protected ForeignKeyType() ! { ! } ! private class ForeignKeyToParentClass : ForeignKeyType ! { ! public override bool CascadeNow( CascadePoint cascadePoint ) ! { return cascadePoint != CascadePoint.CascadeBeforeInsertAfterDelete; } } ! private class ForeignKeyFromParentClass : ForeignKeyType ! { ! public override bool CascadeNow( CascadePoint cascadePoint ) ! { return cascadePoint != CascadePoint.CascadeAfterInsertBeforeDelete; } *************** *** 26,30 **** /// Should we cascade at this cascade point? /// </summary> ! public abstract bool CascadeNow(CascadePoint cascadePoint); /// <summary> --- 32,36 ---- /// Should we cascade at this cascade point? /// </summary> ! public abstract bool CascadeNow( CascadePoint cascadePoint ); /// <summary> *************** *** 43,48 **** /// An <see cref="IType"/> that represents some kind of association between entities. /// </summary> ! public interface IAssociationType { ! /// <summary> /// When implemented by a class, gets the type of foreign key directionality --- 49,54 ---- /// An <see cref="IType"/> that represents some kind of association between entities. /// </summary> ! public interface IAssociationType ! { /// <summary> /// When implemented by a class, gets the type of foreign key directionality Index: EntityType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/EntityType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EntityType.cs 29 Nov 2004 18:43:23 -0000 1.6 --- EntityType.cs 31 Dec 2004 23:52:52 -0000 1.7 *************** *** 1,8 **** - using System; using System.Data; - - using NHibernate.Util; using NHibernate.Engine; using NHibernate.Persister; namespace NHibernate.Type --- 1,6 ---- using System.Data; using NHibernate.Engine; using NHibernate.Persister; + using NHibernate.Util; namespace NHibernate.Type *************** *** 16,38 **** private readonly bool niceEquals; ! public override sealed bool IsEntityType { get { return true; } ! } ! ! public System.Type PersistentClass { get { return persistentClass; } ! } ! public override sealed bool Equals(object x, object y) { ! return x==y; } ! protected EntityType(System.Type persistentClass) { this.persistentClass = persistentClass; ! this.niceEquals = !ReflectHelper.OverridesEquals(persistentClass); } ! ! public override object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, object owner) { ! return NullSafeGet( rs, new string[] {name}, session, owner ); } --- 14,61 ---- private readonly bool niceEquals; ! /// <summary></summary> ! public override sealed bool IsEntityType ! { get { return true; } ! } ! ! /// <summary></summary> ! public System.Type PersistentClass ! { get { return persistentClass; } ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="x"></param> ! /// <param name="y"></param> ! /// <returns></returns> ! public override sealed bool Equals( object x, object y ) ! { ! return x == y; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="persistentClass"></param> ! protected EntityType( System.Type persistentClass ) ! { this.persistentClass = persistentClass; ! this.niceEquals = !ReflectHelper.OverridesEquals( persistentClass ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, object owner ) ! { ! return NullSafeGet( rs, new string[ ] {name}, session, owner ); } *************** *** 41,94 **** * it should return the proxy class, but it doesn't. */ ! public override sealed System.Type ReturnedClass { get { return persistentClass; } - } - - protected object GetIdentifier(object value, ISessionImplementor session) { - return session.GetEntityIdentifierIfNotUnsaved(value); } ! ! public override string ToXML(object value, ISessionFactoryImplementor factory) { ! IClassPersister persister = factory.GetPersister(persistentClass); ! return ( value==null ) ? null : persister.IdentifierType.ToXML( persister.GetIdentifier(value), factory ); } ! public override string Name { get { return persistentClass.Name; } } ! ! public override object DeepCopy(object value) { return value; //special case ... this is the leaf of the containment graph, even though not immutable } ! ! public override bool IsMutable { get { return false; } } public abstract bool IsOneToOne { get; } ! ! public override object Disassemble(object value, ISessionImplementor session) { ! if (value==null) { return null; } ! else { ! object id = session.GetIdentifier(value); ! if (id==null) { ! throw new AssertionFailure("cannot cache a reference to an object with a null id"); } return GetIdentifierType( session ).Disassemble( id, session ); } } ! ! protected IType GetIdentifierType(ISessionImplementor session) { return session.Factory.GetIdentifierType( persistentClass ); } ! ! public override object Assemble(object oid, ISessionImplementor session, object owner) { object assembledId = GetIdentifierType( session ).Assemble( oid, session, owner ); --- 64,163 ---- * it should return the proxy class, but it doesn't. */ ! ! /// <summary></summary> ! public override sealed System.Type ReturnedClass ! { get { return persistentClass; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! protected object GetIdentifier( object value, ISessionImplementor session ) ! { ! return session.GetEntityIdentifierIfNotUnsaved( value ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="factory"></param> ! /// <returns></returns> ! public override string ToXML( object value, ISessionFactoryImplementor factory ) ! { ! IClassPersister persister = factory.GetPersister( persistentClass ); ! return ( value == null ) ? null : persister.IdentifierType.ToXML( persister.GetIdentifier( value ), factory ); ! } ! ! /// <summary></summary> ! public override string Name ! { get { return persistentClass.Name; } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override object DeepCopy( object value ) ! { return value; //special case ... this is the leaf of the containment graph, even though not immutable } ! ! /// <summary></summary> ! public override bool IsMutable ! { get { return false; } } + /// <summary></summary> public abstract bool IsOneToOne { get; } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override object Disassemble( object value, ISessionImplementor session ) { ! if( value == null ) { return null; } ! else { ! object id = session.GetIdentifier( value ); ! if( id == null ) { ! throw new AssertionFailure( "cannot cache a reference to an object with a null id" ); } return GetIdentifierType( session ).Disassemble( id, session ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <returns></returns> ! protected IType GetIdentifierType( ISessionImplementor session ) { return session.Factory.GetIdentifierType( persistentClass ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="oid"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override object Assemble( object oid, ISessionImplementor session, object owner ) { object assembledId = GetIdentifierType( session ).Assemble( oid, session, owner ); *************** *** 97,108 **** } ! public override bool HasNiceEquals { get { return niceEquals; } } ! ! public override bool IsAssociationType { get { return true; } } ! /// <summary> /// Converts the id contained in the <see cref="IDataReader"/> to an object. --- 166,181 ---- } ! /// <summary></summary> ! public override bool HasNiceEquals ! { get { return niceEquals; } } ! ! /// <summary></summary> ! public override bool IsAssociationType ! { get { return true; } } ! /// <summary> /// Converts the id contained in the <see cref="IDataReader"/> to an object. *************** *** 115,132 **** /// An instance of the object or <c>null</c> if the identifer was null. /// </returns> ! public override sealed object NullSafeGet(IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! return ResolveIdentifier( Hydrate(rs, names, session, owner), session, owner ); } ! ! public override abstract object Hydrate(IDataReader rs, string[] names, ISessionImplementor session, object owner); ! ! public override bool IsDirty(object old, object current, ISessionImplementor session) { ! if ( Equals(old, current) ) return false; ! ! object oldid = GetIdentifier(old, session); ! object newid = GetIdentifier(current, session); ! return !GetIdentifierType(session).Equals(oldid, newid); } } --- 188,223 ---- /// An instance of the object or <c>null</c> if the identifer was null. /// </returns> ! public override sealed object NullSafeGet( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) { ! return ResolveIdentifier( Hydrate( rs, names, session, owner ), session, owner ); } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="names"></param> ! /// <param name="session"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public abstract override object Hydrate( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ); ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="old"></param> ! /// <param name="current"></param> ! /// <param name="session"></param> ! /// <returns></returns> ! public override bool IsDirty( object old, object current, ISessionImplementor session ) { ! if( Equals( old, current ) ) ! { ! return false; ! } ! ! object oldid = GetIdentifier( old, session ); ! object newid = GetIdentifier( current, session ); ! return !GetIdentifierType( session ).Equals( oldid, newid ); } } Index: IdentifierBagType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IdentifierBagType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdentifierBagType.cs 3 May 2004 04:56:44 -0000 1.1 --- IdentifierBagType.cs 31 Dec 2004 23:52:52 -0000 1.2 *************** *** 1,5 **** - using System; using System.Collections; - using NHibernate.Collection; using NHibernate.Engine; --- 1,3 ---- *************** *** 12,41 **** public class IdentifierBagType : PersistentCollectionType { ! public IdentifierBagType(string role) : base(role) { } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new IdentifierBag(session); } ! public override System.Type ReturnedClass { ! get { return typeof(ICollection); } } ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new IdentifierBag(session, (ICollection)collection); } ! ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { ! return new IdentifierBag(session, persister, disassembled, owner); } } ! } --- 10,63 ---- public class IdentifierBagType : PersistentCollectionType { ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! public IdentifierBagType( string role ) : base( role ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) { ! return new IdentifierBag( session ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( ICollection ); } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object collection ) { ! return new IdentifierBag( session, ( ICollection ) collection ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <param name="disassembled"></param> ! /// <param name="owner"></param> ! /// <returns></returns> ! public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, CollectionPersister persister, object disassembled, object owner ) { ! return new IdentifierBag( session, persister, disassembled, owner ); } } ! } \ No newline at end of file Index: IAbstractComponentType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IAbstractComponentType.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IAbstractComponentType.cs 10 Feb 2004 18:41:42 -0000 1.7 --- IAbstractComponentType.cs 31 Dec 2004 23:52:52 -0000 1.8 *************** *** 1,26 **** - using System; - - using NHibernate.Loader; using NHibernate.Engine; ! namespace NHibernate.Type { ! /// <summary> /// Enables other Component-like types to hold collections and have cascades, etc. /// </summary> ! public interface IAbstractComponentType : IType { ! ! /// <summary> ! /// ! /// </summary> ! /// <value></value> ! IType[] Subtypes {get;} - /// <summary> - /// - /// </summary> - /// <value></value> - string[] PropertyNames {get;} - /// <summary> /// --- 1,18 ---- using NHibernate.Engine; + using NHibernate.Loader; ! namespace NHibernate.Type ! { /// <summary> /// Enables other Component-like types to hold collections and have cascades, etc. /// </summary> ! public interface IAbstractComponentType : IType ! { ! /// <summary></summary> ! IType[ ] Subtypes { get; } ! ! /// <summary></summary> ! string[ ] PropertyNames { get; } /// <summary> /// *************** *** 29,34 **** /// <param name="session"></param> /// <returns></returns> ! object[] GetPropertyValues(object component, ISessionImplementor session); ! /// <summary> /// --- 21,26 ---- /// <param name="session"></param> /// <returns></returns> ! object[ ] GetPropertyValues( object component, ISessionImplementor session ); ! /// <summary> /// *************** *** 36,41 **** /// <param name="component"></param> /// <param name="values"></param> ! void SetPropertyValues(object component, object[] values); ! /// <summary> /// --- 28,33 ---- /// <param name="component"></param> /// <param name="values"></param> ! void SetPropertyValues( object component, object[ ] values ); ! /// <summary> /// *************** *** 45,50 **** /// <param name="session"></param> /// <returns></returns> ! object GetPropertyValue(object component, int i, ISessionImplementor session); ! /// <summary> /// --- 37,42 ---- /// <param name="session"></param> /// <returns></returns> ! object GetPropertyValue( object component, int i, ISessionImplementor session ); ! /// <summary> /// *************** *** 52,57 **** /// <param name="i"></param> /// <returns></returns> ! Cascades.CascadeStyle Cascade(int i); ! /// <summary> /// --- 44,49 ---- /// <param name="i"></param> /// <returns></returns> ! Cascades.CascadeStyle Cascade( int i ); ! /// <summary> /// *************** *** 59,63 **** /// <param name="i"></param> /// <returns></returns> ! OuterJoinLoaderType EnableJoinedFetch(int i); } } \ No newline at end of file --- 51,55 ---- /// <param name="i"></param> /// <returns></returns> ! OuterJoinLoaderType EnableJoinedFetch( int i ); } } \ No newline at end of file Index: GuidType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/GuidType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GuidType.cs 8 Nov 2004 18:33:57 -0000 1.6 --- GuidType.cs 31 Dec 2004 23:52:52 -0000 1.7 *************** *** 1,8 **** using System; using System.Data; - using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> --- 1,7 ---- using System; using System.Data; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> *************** *** 10,56 **** /// to a <see cref="DbType.Guid"/> column. /// </summary> ! public class GuidType : ValueTypeType, IDiscriminatorType { ! ! internal GuidType() : base( new GuidSqlType() ) { } ! public override object Get(IDataReader rs, int index) { ! return new Guid( Convert.ToString(rs[index]) ); } ! public override object Get(IDataReader rs, string name) { ! return new Guid( Convert.ToString(rs[name]) ); } ! public override System.Type ReturnedClass { ! get { return typeof(System.Guid); } } ! ! public override void Set(IDbCommand cmd, object value, int index) { ! IDataParameter parm = cmd.Parameters[index] as IDataParameter; parm.Value = value; } ! public override string Name { get { return "Guid"; } } ! public override string ObjectToSQLString(object value) { return "'" + value.ToString() + "'"; } ! public object StringToObject(string xml) { ! return new Guid(xml); } } ! } --- 9,85 ---- /// to a <see cref="DbType.Guid"/> column. /// </summary> ! public class GuidType : ValueTypeType, IDiscriminatorType { ! /// <summary></summary> ! internal GuidType() : base( new GuidSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="index"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, int index ) { ! return new Guid( Convert.ToString( rs[ index ] ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="rs"></param> ! /// <param name="name"></param> ! /// <returns></returns> ! public override object Get( IDataReader rs, string name ) { ! return new Guid( Convert.ToString( rs[ name ] ) ); } ! /// <summary></summary> ! public override System.Type ReturnedClass { ! get { return typeof( Guid ); } } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="cmd"></param> ! /// <param name="value"></param> ! /// <param name="index"></param> ! public override void Set( IDbCommand cmd, object value, int index ) { ! IDataParameter parm = cmd.Parameters[ index ] as IDataParameter; parm.Value = value; } ! /// <summary></summary> ! public override string Name { get { return "Guid"; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="value"></param> ! /// <returns></returns> ! public override string ObjectToSQLString( object value ) { return "'" + value.ToString() + "'"; } ! /// <summary> ! /// ! /// </summary> ! /// <param name="xml"></param> ! /// <returns></returns> ! public object StringToObject( string xml ) { ! return new Guid( xml ); } } ! } \ No newline at end of file |