From: Kevin W. <kev...@us...> - 2004-12-31 21:27:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31915 Modified Files: ForeignKey.cs Formula.cs IdentifierBag.cs IdentifierCollection.cs Log Message: fixing xml comments and letting ReSharper do reformatting Index: IdentifierCollection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/IdentifierCollection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierCollection.cs 22 Nov 2004 03:56:00 -0000 1.2 --- IdentifierCollection.cs 31 Dec 2004 21:26:49 -0000 1.3 *************** *** 1,5 **** - using System; - using System.Collections; - namespace NHibernate.Mapping { --- 1,2 ---- *************** *** 9,20 **** public abstract class IdentifierCollection : Collection { public static readonly string DefaultIdentifierColumnName = "id"; private Value identifier; ! protected IdentifierCollection(PersistentClass owner) : base(owner) { } ! public Value Identifier { get { return identifier; } --- 6,23 ---- public abstract class IdentifierCollection : Collection { + /// <summary></summary> public static readonly string DefaultIdentifierColumnName = "id"; private Value identifier; ! /// <summary> ! /// ! /// </summary> ! /// <param name="owner"></param> ! protected IdentifierCollection( PersistentClass owner ) : base( owner ) { } ! /// <summary></summary> ! public Value Identifier { get { return identifier; } *************** *** 22,25 **** --- 25,29 ---- } + /// <summary></summary> public override bool IsIdentified { *************** *** 27,36 **** } ! public void CreatePrimaryKey() { PrimaryKey pk = new PrimaryKey(); ! foreach(Column col in Identifier.ColumnCollection) { ! pk.AddColumn(col); } --- 31,41 ---- } ! /// <summary></summary> ! public void CreatePrimaryKey() { PrimaryKey pk = new PrimaryKey(); ! foreach( Column col in Identifier.ColumnCollection ) { ! pk.AddColumn( col ); } *************** *** 39,41 **** } ! } --- 44,46 ---- } ! } \ No newline at end of file Index: Formula.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Formula.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Formula.cs 23 Jun 2004 21:03:34 -0000 1.3 --- Formula.cs 31 Dec 2004 21:26:49 -0000 1.4 *************** *** 1,22 **** using System; - using System.Collections; - using NHibernate.Dialect; using NHibernate.SqlCommand; using NHibernate.Util; ! namespace NHibernate.Mapping { ! public class Formula ! { private static int formulaUniqueInteger=0; ! private string formula; ! private int uniqueInteger; ! public Formula() ! { uniqueInteger = formulaUniqueInteger++; } ! public String GetTemplate(Dialect.Dialect dialect) ! { return Template.RenderWhereStringTemplate(formula, dialect); } public String Alias ! { get ! { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } } public string FormulaString { ! get { return formula; } set { this.formula = value; } } } } \ No newline at end of file --- 1,45 ---- using System; using NHibernate.SqlCommand; using NHibernate.Util; ! namespace NHibernate.Mapping { ! /// <summary></summary> ! public class Formula ! { ! private static int formulaUniqueInteger = 0; ! ! private string formula; ! ! private int uniqueInteger; ! ! /// <summary></summary> ! public Formula() ! { ! uniqueInteger = formulaUniqueInteger++; ! } ! ! /// <summary> ! /// ! /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> ! public String GetTemplate( Dialect.Dialect dialect ) ! { ! return Template.RenderWhereStringTemplate( formula, dialect ); ! } ! ! /// <summary></summary> public String Alias ! { ! get { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } ! } ! ! /// <summary></summary> public string FormulaString { ! get { return formula; } ! set { this.formula = value; } ! } ! } ! } \ No newline at end of file Index: ForeignKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/ForeignKey.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ForeignKey.cs 13 Apr 2004 02:06:54 -0000 1.5 --- ForeignKey.cs 31 Dec 2004 21:26:49 -0000 1.6 *************** *** 1,51 **** - using System; using System.Collections; - using NHibernate.Dialect; ! namespace NHibernate.Mapping ! { ! public class ForeignKey : Constraint { private Table referencedTable; private System.Type referencedClass; ! public ForeignKey() { } ! public override string SqlConstraintString(Dialect.Dialect d, string constraintName) { ! string[] cols = new string[ ColumnSpan ]; ! string[] refcols = new string[ ColumnSpan ]; ! int i=0; ! ! foreach(Column col in referencedTable.PrimaryKey.ColumnCollection) { ! refcols[i] = col.GetQuotedName(d); i++; } ! i=0; ! foreach(Column col in ColumnCollection) { ! cols[i] = col.GetQuotedName(d); i++; } ! return d.GetAddForeignKeyConstraintString(constraintName, cols, referencedTable.GetQualifiedName(d), refcols); } ! public Table ReferencedTable { get { return referencedTable; } ! set { ! if (value.PrimaryKey.ColumnSpan != ColumnSpan) ! throw new MappingException("Foreign key must have same number of columns as referenced primary key"); IEnumerator fkCols = ColumnCollection.GetEnumerator(); IEnumerator pkCols = value.PrimaryKey.ColumnCollection.GetEnumerator(); ! while( fkCols.MoveNext() && pkCols.MoveNext() ) { ! ((Column)fkCols.Current).Length = ((Column)pkCols.Current).Length; } --- 1,62 ---- using System.Collections; ! namespace NHibernate.Mapping ! { ! /// <summary></summary> ! public class ForeignKey : Constraint { private Table referencedTable; private System.Type referencedClass; ! /// <summary></summary> ! public ForeignKey() ! { ! } ! /// <summary> ! /// ! /// </summary> ! /// <param name="d"></param> ! /// <param name="constraintName"></param> ! /// <returns></returns> ! public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { ! string[ ] cols = new string[ColumnSpan]; ! string[ ] refcols = new string[ColumnSpan]; ! int i = 0; ! ! foreach( Column col in referencedTable.PrimaryKey.ColumnCollection ) { ! refcols[ i ] = col.GetQuotedName( d ); i++; } ! i = 0; ! foreach( Column col in ColumnCollection ) { ! cols[ i ] = col.GetQuotedName( d ); i++; } ! return d.GetAddForeignKeyConstraintString( constraintName, cols, referencedTable.GetQualifiedName( d ), refcols ); } ! /// <summary></summary> ! public Table ReferencedTable { get { return referencedTable; } ! set { ! if( value.PrimaryKey.ColumnSpan != ColumnSpan ) ! { ! throw new MappingException( "Foreign key must have same number of columns as referenced primary key" ); ! } IEnumerator fkCols = ColumnCollection.GetEnumerator(); IEnumerator pkCols = value.PrimaryKey.ColumnCollection.GetEnumerator(); ! while( fkCols.MoveNext() && pkCols.MoveNext() ) { ! ( ( Column ) fkCols.Current ).Length = ( ( Column ) pkCols.Current ).Length; } *************** *** 54,58 **** } ! public System.Type ReferencedClass { get { return referencedClass; } --- 65,70 ---- } ! /// <summary></summary> ! public System.Type ReferencedClass { get { return referencedClass; } *************** *** 60,62 **** } } ! } --- 72,74 ---- } } ! } \ No newline at end of file Index: IdentifierBag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/IdentifierBag.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierBag.cs 3 May 2004 04:56:43 -0000 1.2 --- IdentifierBag.cs 31 Dec 2004 21:26:49 -0000 1.3 *************** *** 1,6 **** - using System; - - using NHCollection = NHibernate.Collection; using NHibernate.Type; namespace NHibernate.Mapping --- 1,5 ---- using NHibernate.Type; + using Collection_IdentifierBag = NHibernate.Collection.IdentifierBag; + using NHCollection = NHibernate.Collection; namespace NHibernate.Mapping *************** *** 12,35 **** public class IdentifierBag : IdentifierCollection { ! public IdentifierBag(PersistentClass owner) : base(owner) { } ! public override PersistentCollectionType Type { ! get ! { ! return TypeFactory.IdBag(Role); ! } } ! ! public override System.Type WrapperClass { ! get ! { ! return typeof(NHCollection.IdentifierBag) ; ! } } ! } ! } --- 11,34 ---- public class IdentifierBag : IdentifierCollection { ! /// <summary> ! /// ! /// </summary> ! /// <param name="owner"></param> ! public IdentifierBag( PersistentClass owner ) : base( owner ) { } ! /// <summary></summary> ! public override PersistentCollectionType Type { ! get { return TypeFactory.IdBag( Role ); } } ! ! /// <summary></summary> ! public override System.Type WrapperClass { ! get { return typeof( Collection_IdentifierBag ); } } ! } ! } \ No newline at end of file |