From: Kevin W. <kev...@us...> - 2004-12-31 23:51:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23974 Modified Files: AbstractType.cs AnsiStringType.cs ArrayType.cs BagType.cs BinaryBlobType.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: BagType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BagType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BagType.cs 3 May 2004 04:52:11 -0000 1.3 --- BagType.cs 31 Dec 2004 23:50:57 -0000 1.4 *************** *** 1,5 **** - using System; using System.Collections; - using NHibernate.Collection; using NHibernate.Engine; --- 1,3 ---- *************** *** 7,38 **** namespace NHibernate.Type { ! /// <summary> ! /// ! /// </summary> public class BagType : PersistentCollectionType { ! public BagType(string role) : base(role) { } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new Bag(session); } ! public override System.Type ReturnedClass { ! get { return typeof(ICollection); } } ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { ! return new Bag(session, (ICollection)collection); } ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { ! return new Bag(session, persister, disassembled, owner); } --- 5,59 ---- namespace NHibernate.Type { ! /// <summary></summary> public class BagType : PersistentCollectionType { ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! public BagType( 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 Bag( 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 Bag( 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 Bag( session, persister, disassembled, owner ); } Index: ArrayType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ArrayType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ArrayType.cs 1 Jun 2004 01:36:11 -0000 1.6 --- ArrayType.cs 31 Dec 2004 23:50:57 -0000 1.7 *************** *** 1,54 **** - using System; - using System.Data; using System.Collections; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type { ! ! public class ArrayType : PersistentCollectionType { //private System.Type elementClass; private System.Type arrayClass; ! public ArrayType(string role, System.Type elementClass) : base(role) { //this.elementClass = elementClass; ! arrayClass = Array.CreateInstance(elementClass,0).GetType(); } ! public override System.Type ReturnedClass { get { return arrayClass; } } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! return new ArrayHolder(session, persister); } ! public override void NullSafeSet(IDbCommand st, object value, int index, ISessionImplementor session) { ! base.NullSafeSet(st, session.GetArrayHolder(value), index, session); } ! public override ICollection GetElementsCollection(object collection) { ! return ((object[])collection); } ! public override object Disassemble(object value, ISessionImplementor session) { ! if (value==null) return null; ! return session.GetLoadedCollectionKey( session.GetArrayHolder(value) ); } ! public override PersistentCollection Wrap(ISessionImplementor session, object array) { ! return new ArrayHolder(session, array); } ! public override bool IsArrayType { get { return true; } } ! public override PersistentCollection AssembleCachedCollection( ISessionImplementor session, ! CollectionPersister persister, ! object disassembled, ! object owner ) { ! return new ArrayHolder(session, persister, disassembled, owner); } } ! } --- 1,112 ---- using System.Collections; + using System.Data; using NHibernate.Collection; using NHibernate.Engine; ! namespace NHibernate.Type ! { ! /// <summary></summary> ! public class ArrayType : PersistentCollectionType ! { //private System.Type elementClass; private System.Type arrayClass; ! /// <summary> ! /// ! /// </summary> ! /// <param name="role"></param> ! /// <param name="elementClass"></param> ! public ArrayType( string role, System.Type elementClass ) : base( role ) ! { //this.elementClass = elementClass; ! arrayClass = System.Array.CreateInstance( elementClass, 0 ).GetType(); } ! /// <summary></summary> ! public override System.Type ReturnedClass ! { get { return arrayClass; } } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="persister"></param> ! /// <returns></returns> ! public override PersistentCollection Instantiate( ISessionImplementor session, CollectionPersister persister ) ! { ! return new ArrayHolder( session, persister ); } ! /// <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 ) ! { ! base.NullSafeSet( st, session.GetArrayHolder( value ), index, session ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="collection"></param> ! /// <returns></returns> ! public override ICollection GetElementsCollection( object collection ) ! { ! return ( ( object[ ] ) collection ); } ! /// <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; ! } ! return session.GetLoadedCollectionKey( session.GetArrayHolder( value ) ); } ! /// <summary> ! /// ! /// </summary> ! /// <param name="session"></param> ! /// <param name="array"></param> ! /// <returns></returns> ! public override PersistentCollection Wrap( ISessionImplementor session, object array ) ! { ! return new ArrayHolder( session, array ); } ! /// <summary></summary> ! public override bool IsArrayType ! { get { return true; } } ! /// <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 ArrayHolder( session, persister, disassembled, owner ); } } ! } \ No newline at end of file Index: AnsiStringType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/AnsiStringType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AnsiStringType.cs 21 Aug 2004 16:37:32 -0000 1.3 --- AnsiStringType.cs 31 Dec 2004 23:50:57 -0000 1.4 *************** *** 10,63 **** /// to a <see cref="DbType.AnsiString"/> column. /// </summary> ! public class AnsiStringType : ImmutableType, IDiscriminatorType { ! internal AnsiStringType() : base( new AnsiStringSqlType() ) { } - internal AnsiStringType(AnsiStringSqlType 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 "AnsiString"; } } ! 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; } - } - } --- 10,121 ---- /// to a <see cref="DbType.AnsiString"/> column. /// </summary> ! public class AnsiStringType : ImmutableType, IDiscriminatorType { ! /// <summary></summary> ! internal AnsiStringType() : base( new AnsiStringSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sqlType"></param> ! internal AnsiStringType( AnsiStringSqlType 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 "AnsiString"; } } ! ! /// <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> ! public override int GetHashCode() { ! return base.GetHashCode(); } + /// <summary> + /// + /// </summary> + /// <param name="value"></param> + /// <returns></returns> + public override string ToXML( object value ) + { + return ( string ) value; + } + } + } \ No newline at end of file Index: AbstractType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/AbstractType.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AbstractType.cs 20 Aug 2004 17:39:01 -0000 1.9 --- AbstractType.cs 31 Dec 2004 23:50:57 -0000 1.10 *************** *** 1,10 **** using System; using System.Data; - using NHibernate.Engine; using NHibernate.SqlTypes; ! ! namespace NHibernate.Type { /// <summary> --- 1,8 ---- using System; using System.Data; using NHibernate.Engine; using NHibernate.SqlTypes; ! namespace NHibernate.Type { /// <summary> *************** *** 13,17 **** /// </summary> [Serializable] ! public abstract class AbstractType : IType { /// <summary> --- 11,15 ---- /// </summary> [Serializable] ! public abstract class AbstractType : IType { /// <summary> *************** *** 19,49 **** /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not an <see cref="IAssociationType"/>.</value> ! public virtual bool IsAssociationType { ! get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is a <see cref="PersistentCollectionType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a <see cref="PersistentCollectionType"/>.</value> ! public virtual bool IsPersistentCollectionType { get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is an <see cref="IAbstractComponentType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not an <see cref="IAbstractComponentType"/>.</value> ! public virtual bool IsComponentType { ! get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is a <see cref="EntityType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a <see cref="EntityType"/>.</value> ! public virtual bool IsEntityType { get { return false; } --- 17,48 ---- /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not an <see cref="IAssociationType"/>.</value> ! public virtual bool IsAssociationType ! { ! get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is a <see cref="PersistentCollectionType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a <see cref="PersistentCollectionType"/>.</value> ! public virtual bool IsPersistentCollectionType { get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is an <see cref="IAbstractComponentType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not an <see cref="IAbstractComponentType"/>.</value> ! public virtual bool IsComponentType { ! get { return false; } } ! /// <summary> /// Gets a value indicating if the <see cref="AbstractType"/> is a <see cref="EntityType"/>. /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a <see cref="EntityType"/>.</value> ! public virtual bool IsEntityType { get { return false; } *************** *** 54,64 **** /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a "object" type.</value> ! public virtual bool IsObjectType { ! get ! { ! return false; ! } } /// <summary> /// Disassembles the object into a cacheable representation. --- 53,61 ---- /// </summary> /// <value>false - by default an <see cref="AbstractType"/> is not a "object" type.</value> ! public virtual bool IsObjectType { ! get { return false; } } + /// <summary> /// Disassembles the object into a cacheable representation. *************** *** 70,83 **** /// This method calls DeepCopy if the value is not null. /// </remarks> ! public virtual object Disassemble(object value, ISessionImplementor session) { ! if (value==null) { return null; } ! else { ! return DeepCopy(value); } } ! /// <summary> /// Reconstructs the object from its cached "disassembled" state. --- 67,82 ---- /// This method calls DeepCopy if the value is not null. /// </remarks> ! public virtual object Disassemble( object value, ISessionImplementor session ) { ! if( value == null ) ! { return null; } ! else ! { ! return DeepCopy( value ); } } ! /// <summary> /// Reconstructs the object from its cached "disassembled" state. *************** *** 90,104 **** /// This method calls DeepCopy if the value is not null. /// </remarks> ! public virtual object Assemble(object cached, ISessionImplementor session, object owner) { ! if ( cached==null ) { return null; } ! else { ! return DeepCopy(cached); } } ! ! /// <summary> /// Should the parent be considered dirty, given both the old and current --- 89,105 ---- /// This method calls DeepCopy if the value is not null. /// </remarks> ! public virtual object Assemble( object cached, ISessionImplementor session, object owner ) { ! if( cached == null ) ! { return null; } ! else ! { ! return DeepCopy( cached ); } } ! ! /// <summary> /// Should the parent be considered dirty, given both the old and current *************** *** 110,118 **** /// <returns>true if the field is dirty</returns> /// <remarks>This method uses <c>IType.Equals(object, object)</c> to determine the value of IsDirty.</remarks> ! public virtual bool IsDirty(object old, object current, ISessionImplementor session) { ! return !Equals(old, current); } ! /// <summary> --- 111,119 ---- /// <returns>true if the field is dirty</returns> /// <remarks>This method uses <c>IType.Equals(object, object)</c> to determine the value of IsDirty.</remarks> ! public virtual bool IsDirty( object old, object current, ISessionImplementor session ) { ! return !Equals( old, current ); } ! /// <summary> *************** *** 132,140 **** /// to Hydrate this <see cref="AbstractType"/>. /// </remarks> ! public virtual object Hydrate(IDataReader rs, string[] names, ISessionImplementor session, object owner) { ! return NullSafeGet(rs, names, session, owner); } ! /// <summary> /// Maps identifiers to Entities or Collections. --- 133,141 ---- /// to Hydrate this <see cref="AbstractType"/>. /// </remarks> ! public virtual object Hydrate( IDataReader rs, string[ ] names, ISessionImplementor session, object owner ) { ! return NullSafeGet( rs, names, session, owner ); } ! /// <summary> /// Maps identifiers to Entities or Collections. *************** *** 147,179 **** /// There is nothing done in this method other than return the value parameter passed in. /// </remarks> ! public virtual object ResolveIdentifier(object value, ISessionImplementor session, object owner) { return value; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' /// /> ! public abstract object DeepCopy(object val); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.SqlTypes"]/*' /// /> ! public abstract SqlType[] SqlTypes(IMapping mapping); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.GetColumnSpan"]/*' /// /> ! public abstract int GetColumnSpan(IMapping mapping); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Equals"]/*' /// /> ! public abstract new bool Equals(object x, object y); //We need "new" because object.Equal is not marked as virtual. Is it correct? /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsMutable"]/*' /// /> ! public abstract bool IsMutable {get;} /// <include file='IType.cs.xmldoc' --- 148,180 ---- /// There is nothing done in this method other than return the value parameter passed in. /// </remarks> ! public virtual object ResolveIdentifier( object value, ISessionImplementor session, object owner ) { return value; } ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.DeepCopy"]/*' /// /> ! public abstract object DeepCopy( object val ); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.SqlTypes"]/*' /// /> ! public abstract SqlType[ ] SqlTypes( IMapping mapping ); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.GetColumnSpan"]/*' /// /> ! public abstract int GetColumnSpan( IMapping mapping ); /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.Equals"]/*' /// /> ! new public abstract bool Equals( object x, object y ); //We need "new" because object.Equal is not marked as virtual. Is it correct? Or because this is *abstract* so we're not really overriding it? /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="P:IType.IsMutable"]/*' /// /> ! public abstract bool IsMutable { get; } /// <include file='IType.cs.xmldoc' *************** *** 190,204 **** /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, string[], ISessionImplementor, object)"]/*' /// /> ! public abstract 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)"]/*' /// /> ! public abstract object NullSafeGet(IDataReader rs, string name, ISessionImplementor session, Object owner); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' /// /> ! public abstract void NullSafeSet(IDbCommand st, object value, int index, ISessionImplementor session); /// <include file='IType.cs.xmldoc' --- 191,205 ---- /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeGet(IDataReader, string[], ISessionImplementor, object)"]/*' /// /> ! public abstract 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)"]/*' /// /> ! public abstract object NullSafeGet( IDataReader rs, string name, ISessionImplementor session, Object owner ); ! /// <include file='IType.cs.xmldoc' /// path='//members[@type="IType"]/member[@name="M:IType.NullSafeSet"]/*' /// /> ! public abstract void NullSafeSet( IDbCommand st, object value, int index, ISessionImplementor session ); /// <include file='IType.cs.xmldoc' *************** *** 210,214 **** /// path='//members[@type="IType"]/member[@name="M:IType.ToXML"]/*' /// /> ! public abstract string ToXML(object value, ISessionFactoryImplementor factory); } } \ No newline at end of file --- 211,215 ---- /// path='//members[@type="IType"]/member[@name="M:IType.ToXML"]/*' /// /> ! public abstract string ToXML( object value, ISessionFactoryImplementor factory ); } } \ No newline at end of file Index: BinaryBlobType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BinaryBlobType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BinaryBlobType.cs 25 Aug 2004 03:52:21 -0000 1.1 --- BinaryBlobType.cs 31 Dec 2004 23:50:57 -0000 1.2 *************** *** 1,5 **** - using System; - using System.Data; - using NHibernate.SqlTypes; --- 1,2 ---- *************** *** 16,32 **** public class BinaryBlobType : BinaryType { ! internal BinaryBlobType() : base( new BinaryBlobSqlType() ) { } ! internal BinaryBlobType(BinarySqlType sqlType) : base(sqlType) { } public override string Name { ! get {return "BinaryBlob"; } } } ! } --- 13,35 ---- public class BinaryBlobType : BinaryType { ! /// <summary></summary> ! internal BinaryBlobType() : base( new BinaryBlobSqlType() ) { } ! /// <summary> ! /// ! /// </summary> ! /// <param name="sqlType"></param> ! internal BinaryBlobType( BinarySqlType sqlType ) : base( sqlType ) { } + /// <summary></summary> public override string Name { ! get { return "BinaryBlob"; } } } ! } \ No newline at end of file |