From: Michael D. <mik...@us...> - 2005-01-03 03:46:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16646/NHibernate/Mapping Modified Files: PersistentClass.cs RootClass.cs Subclass.cs Log Message: Added more xml comments. Removed the set property for Polymorphicto be part of the IsPolymorphic property. Index: PersistentClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PersistentClass.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersistentClass.cs 2 Jan 2005 22:03:39 -0000 1.16 --- PersistentClass.cs 3 Jan 2005 03:46:48 -0000 1.17 *************** *** 203,214 **** /// <summary> /// When implemented by a class, gets or set a boolean indicating ! /// if the PersistentClass has properties that can be changed. /// </summary> /// <value><c>true</c> if the object is mutable.</value> public abstract bool IsMutable { get; set; } /// <summary> /// When implemented by a class, gets a boolean indicating ! /// if the PersistentClass has a Property for the <c>id</c>. /// </summary> /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> --- 203,217 ---- /// <summary> /// When implemented by a class, gets or set a boolean indicating ! /// if the mapped class has properties that can be changed. /// </summary> /// <value><c>true</c> if the object is mutable.</value> + /// <remarks> + /// The value of this is set by the <c>mutable</c> attribute. + /// </remarks> public abstract bool IsMutable { get; set; } /// <summary> /// When implemented by a class, gets a boolean indicating ! /// if the mapped class has a Property for the <c>id</c>. /// </summary> /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> *************** *** 216,220 **** /// <summary> ! /// When implemented by a class, gets the <see cref="Property"/> /// that is used as the <c>id</c>. /// </summary> --- 219,223 ---- /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Property"/> /// that is used as the <c>id</c>. /// </summary> *************** *** 245,277 **** public abstract Value Discriminator { get; set; } ! /// <summary></summary> public abstract bool IsInherited { get; } ! // see the comment in RootClass about why the polymorphic setter is commented out ! /// <summary></summary> ! public abstract bool IsPolymorphic { get; } ! /// <summary></summary> public abstract bool IsVersioned { get; } ! /// <summary></summary> public abstract ICacheConcurrencyStrategy Cache { get; set; } ! /// <summary></summary> public abstract PersistentClass Superclass { get; set; } ! /// <summary></summary> public abstract bool IsExplicitPolymorphism { get; set; } ! /// <summary></summary> public abstract ICollection PropertyClosureCollection { get; } ! /// <summary></summary> public abstract ICollection TableClosureCollection { get; } /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public virtual void AddSubclassProperty( Property p ) { --- 248,338 ---- public abstract Value Discriminator { get; set; } ! /// <summary> ! /// When implemented by a class, gets a boolean indicating if this ! /// mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>true</c> if this class is a <c>subclass</c> or <c>joined-subclass</c> ! /// that inherited from another <c>class</c>. ! /// </value> public abstract bool IsInherited { get; } ! /// <summary> ! /// When implemented by a class, gets or sets if the mapped class has subclasses or is ! /// a subclass. ! /// </summary> ! /// <value> ! /// <c>true</c> if the mapped class has subclasses or is a subclass. ! /// </value> ! public abstract bool IsPolymorphic { get; set; } ! /// <summary> ! /// When implemented by a class, gets a boolean indicating if the mapped class ! /// has a version property. ! /// </summary> ! /// <value><c>true</c> if there is a <c><version></c> property.</value> public abstract bool IsVersioned { get; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> used with the Cache.</value> public abstract ICacheConcurrencyStrategy Cache { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="PersistentClass"/> ! /// that this mapped class is extending. ! /// </summary> ! /// <value> ! /// The <see cref="PersistentClass"/> that this mapped class is extending. ! /// </value> public abstract PersistentClass Superclass { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets a boolean indicating if ! /// explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// <c>true</c> if only classes queried on should be returned, <c>false</c> ! /// if any class in the heirarchy should implicitly be returned.</value> ! /// <remarks> ! /// The value of this is set by the <c>polymorphism</c> attribute. ! /// </remarks> public abstract bool IsExplicitPolymorphism { get; set; } ! /// <summary> ! /// When implemented by a class, gets an <see cref="ICollection"/> ! /// of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> ! /// <remarks> ! /// This is all of the properties of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public abstract ICollection PropertyClosureCollection { get; } ! /// <summary> ! /// When implemented by a class, gets an <see cref="ICollection"/> ! /// of <see cref="Table"/> objects that this mapped class reads from ! /// and writes to. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Table"/> objects that ! /// this mapped class reads from and writes to. ! /// </value> ! /// <remarks> ! /// This is all of the tables of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public abstract ICollection TableClosureCollection { get; } /// <summary> ! /// Adds a <see cref="Property"/> that is implemented by a subclass. /// </summary> ! /// <param name="p">The <see cref="Property"/> implemented by a subclass.</param> public virtual void AddSubclassProperty( Property p ) { *************** *** 280,286 **** /// <summary> ! /// /// </summary> ! /// <param name="table"></param> public virtual void AddSubclassTable( Table table ) { --- 341,347 ---- /// <summary> ! /// Adds a <see cref="Table"/> that a subclass is stored in. /// </summary> ! /// <param name="table">The <see cref="Table"/> the subclass is stored in.</param> public virtual void AddSubclassTable( Table table ) { *************** *** 288,292 **** } ! /// <summary></summary> public virtual ICollection SubclassPropertyClosureCollection { --- 349,360 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains and that all of its subclasses contain. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains and that all of its subclasses contain. ! /// </value> public virtual ICollection SubclassPropertyClosureCollection { *************** *** 301,307 **** /// <summary> ! /// Returns an ICollection of all of the Tables that the subclass finds its information ! /// in. /// </summary> /// <remarks>It adds the TableClosureCollection and the subclassTables into the ICollection.</remarks> public virtual ICollection SubclassTableClosureCollection --- 369,376 ---- /// <summary> ! /// Gets an <see cref="ICollection"/> of all of the <see cref="Table"/> objects that the ! /// subclass finds its information in. /// </summary> + /// <value>An <see cref="ICollection"/> of <see cref="Table"/> objects.</value> /// <remarks>It adds the TableClosureCollection and the subclassTables into the ICollection.</remarks> public virtual ICollection SubclassTableClosureCollection *************** *** 316,320 **** } ! /// <summary></summary> public virtual System.Type ProxyInterface { --- 385,395 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> to use as a Proxy. ! /// </summary> ! /// <value>The <see cref="System.Type"/> to use as a Proxy.</value> ! /// <remarks> ! /// The value of this is set by the <c>proxy</c> attribute. ! /// </remarks> public virtual System.Type ProxyInterface { *************** *** 323,327 **** } ! /// <summary></summary> public virtual bool IsForceDiscriminator { --- 398,409 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if only values in the discriminator column that ! /// are mapped will be included in the sql. ! /// </summary> ! /// <value><c>true</c> if the mapped discriminator values should be forced.</value> ! /// <remarks> ! /// The value of this is set by the <c>force</c> attribute on the <c>discriminator</c> element. ! /// </remarks> public virtual bool IsForceDiscriminator { *************** *** 330,352 **** } ! /// <summary></summary> public abstract bool HasEmbeddedIdentifier { get; set; } ! /// <summary></summary> public abstract System.Type Persister { get; set; } ! /// <summary></summary> public abstract Table RootTable { get; } ! /// <summary></summary> public abstract RootClass RootClazz { get; } ! /// <summary></summary> public abstract Value Key { get; set; } /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> public virtual void CreatePrimaryKey( Dialect.Dialect dialect ) { --- 412,465 ---- } ! /// <summary> ! /// When implemented by a class, gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the class identifies itself.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public abstract bool HasEmbeddedIdentifier { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="System.Type"/> of ! /// the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister.</value> ! /// <remarks>The value of this is set by the <c>persister</c> attribute.</remarks> public abstract System.Type Persister { get; set; } ! /// <summary> ! /// When implemented by a class, gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the class that is mapped in the <c>class</c> element. ! /// </value> public abstract Table RootTable { get; } ! /// <summary> ! /// When implemented by a class, gets the <see cref="RootClass"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </value> public abstract RootClass RootClazz { get; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Value"/> ! /// that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public abstract Value Key { get; set; } /// <summary> ! /// Creates the <see cref="PrimaryKey"/> for the <see cref="Table"/> ! /// this type is persisted in. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> that is used to Alias columns.</param> public virtual void CreatePrimaryKey( Dialect.Dialect dialect ) { *************** *** 362,366 **** } ! /// <summary></summary> public abstract string Where { get; set; } --- 475,488 ---- } ! /// <summary> ! /// When implemented by a class, gets or sets the sql string that should ! /// be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> ! /// <remarks> ! /// The value of this is set by the <c>where</c> attribute. ! /// </remarks> public abstract string Where { get; set; } Index: RootClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/RootClass.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RootClass.cs 31 Dec 2004 21:27:54 -0000 1.11 --- RootClass.cs 3 Jan 2005 03:46:48 -0000 1.12 *************** *** 8,95 **** { /// <summary> ! /// Declaration of a System.Type by using the <c><class></c> element. /// </summary> - /// <remarks> - /// <p>The <c><class></c> element has the following attributes available:</p> - /// <list type="table"> - /// <listheader> - /// <term>Attribute</term> - /// <description>Possible Values</description> - /// </listheader> - /// <item> - /// <term>name</term> - /// <description>The fully qualified TypeName so it can be loaded by Reflection</description> - /// </item> - /// <item> - /// <term>table</term> - /// <description>The name of its database table.</description> - /// </item> - /// <item> - /// <term>discriminator-value</term> - /// <description> - /// (optional - defaults to the FullClassName) A value that distinguishes individual - /// subclasses, used for polymorphic behavior. - /// </description> - /// </item> - /// <item> - /// <term>mutable</term> - /// <description> - /// (optional - defaults to <c>true</c>) Specifies that instances of the class - /// are (not) mutable. - /// </description> - /// </item> - /// <item> - /// <term>schema</term> - /// <description>(optional) Override the schema name specified by the root <c><hibernate-mapping></c> element.</description> - /// </item> - /// <item> - /// <term>proxy</term> - /// <description> - /// (optional) Specifies an interface to use for lazy initializing proxies. - /// You may specify the name of the class itself. - /// (TODO: update once Proxies are implemented) - /// </description> - /// </item> - /// <item> - /// <term>dynamic-update</term> - /// <description> - /// (optional - defaults to <c>false</c>) Specifies the <c>UPDATE</c> SQL should - /// be generated at runtime and contain only those columns whose values have changed. - /// </description> - /// </item> - /// <item> - /// <term>dynamic-insert</term> - /// <description> - /// (optional - defaults to <c>false</c>) Specifies the <c>INSERT</c> SQL should - /// be generated at runtime and contain only those columns whose values are not null. - /// </description> - /// </item> - /// <item> - /// <term>polymorphism</term> - /// <description> - /// (optional, defaults to <c>implicit</c>) Determines whether implicit or explicit - /// query polymorphism is used. - /// </description> - /// </item> - /// <item> - /// <term>where</term> - /// <description> - /// (optional) Specify an arbitrary SQL <c>WHERE</c> condition to be used - /// when retrieving objects of this class. - /// </description> - /// </item> - /// <item> - /// <term>persister</term> - /// <description>(optional) Specifies a custom <see cref="IClassPersister"/>.</description> - /// </item> - /// </list> - /// </remarks> public class RootClass : PersistentClass { private static readonly ILog log = LogManager.GetLogger( typeof( RootClass ) ); ! /// <summary></summary> public const string DefaultIdentifierColumnName = "id"; ! /// <summary></summary> public const string DefaultDiscriminatorColumnName = "class"; --- 8,27 ---- { /// <summary> ! /// Declaration of a System.Type mapped with the <c><class></c> element. /// </summary> public class RootClass : PersistentClass { private static readonly ILog log = LogManager.GetLogger( typeof( RootClass ) ); ! /// <summary> ! /// The default name of the column for the Identifier ! /// </summary> ! /// <value><c>id</c> is the default column name for the Identifier.</value> public const string DefaultIdentifierColumnName = "id"; ! ! /// <summary> ! /// The default name of the column for the Discriminator ! /// </summary> ! /// <value><c>class</c> is the default column name for the Discriminator.</value> public const string DefaultDiscriminatorColumnName = "class"; *************** *** 107,117 **** private string where; ! /// <summary></summary> ! public bool Polymorphic ! { ! set { polymorphic = value; } ! } ! ! /// <summary></summary> public override Property IdentifierProperty { --- 39,48 ---- private string where; ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the <c>id</c>. ! /// </summary> ! /// <value> ! /// The <see cref="Property"/> that is used as the <c>id</c>. ! /// </value> public override Property IdentifierProperty { *************** *** 120,124 **** } ! /// <summary></summary> public override Value Identifier { --- 51,58 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the identifier. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the identifier.</value> public override Value Identifier { *************** *** 127,131 **** } ! /// <summary></summary> public override bool HasIdentifierProperty { --- 61,68 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a Property for the <c>id</c>. ! /// </summary> ! /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> public override bool HasIdentifierProperty { *************** *** 133,137 **** } ! /// <summary></summary> public override Value Discriminator { --- 70,77 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the discriminator. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the discriminator.</value> public override Value Discriminator { *************** *** 140,144 **** } ! /// <summary></summary> public override bool IsInherited { --- 80,89 ---- } ! /// <summary> ! /// Gets a boolean indicating if this mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>false</c> because this is the root mapped class. ! /// </value> public override bool IsInherited { *************** *** 147,162 **** /// <summary> ! /// Indicates if the object has subclasses /// </summary> ! /// <remarks> ! /// This value is set to True when a subclass is added and should not be set ! /// through any other method - so no setter is declared for this property. ! /// </remarks> public override bool IsPolymorphic { get { return polymorphic; } } ! /// <summary></summary> public override RootClass RootClazz { --- 92,112 ---- /// <summary> ! /// Gets or sets if the mapped class has subclasses. /// </summary> ! /// <value> ! /// <c>true</c> if the mapped class has subclasses. ! /// </value> public override bool IsPolymorphic { get { return polymorphic; } + set { polymorphic = value; } } ! /// <summary> ! /// Gets the <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// <c>this</c> since this is the root mapped class. ! /// </value> public override RootClass RootClazz { *************** *** 164,168 **** } ! /// <summary></summary> public override ICollection PropertyClosureCollection { --- 114,124 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> public override ICollection PropertyClosureCollection { *************** *** 171,178 **** /// <summary> ! /// Returns all of the Tables the Root class covers. /// </summary> /// <remarks> ! /// The RootClass should only have one item in the Collection - the Table that it comes from. /// </remarks> public override ICollection TableClosureCollection --- 127,140 ---- /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Table"/> objects that this ! /// mapped class reads from and writes to. /// </summary> + /// <value> + /// An <see cref="ICollection"/> of <see cref="Table"/> objects that + /// this mapped class reads from and writes to. + /// </value> /// <remarks> ! /// There is only one <see cref="Table"/> in the <see cref="ICollection"/> since ! /// this is the root class. /// </remarks> public override ICollection TableClosureCollection *************** *** 187,193 **** /// <summary> ! /// /// </summary> ! /// <param name="subclass"></param> public override void AddSubclass( Subclass subclass ) { --- 149,159 ---- /// <summary> ! /// Adds a <see cref="Subclass"/> to the class hierarchy. /// </summary> ! /// <param name="subclass">The <see cref="Subclass"/> to add to the hierarchy.</param> ! /// <remarks> ! /// When a <see cref="Subclass"/> is added this mapped class has the property <see cref="IsPolymorphic"/> ! /// set to <c>true</c>. ! /// </remarks> public override void AddSubclass( Subclass subclass ) { *************** *** 196,200 **** } ! /// <summary></summary> public override bool IsExplicitPolymorphism { --- 162,172 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// <c>true</c> if only classes queried on should be returned, <c>false</c> ! /// if any class in the heirarchy should implicitly be returned. ! /// </value> public override bool IsExplicitPolymorphism { *************** *** 204,242 **** /// <summary> ! /// Gets or Sets the <see cref="Property"/> to use as the Version Property /// </summary> ! /// <value>The <see cref="Property"/> to use for Versioning.</value> ! /// <remarks> ! /// <para> ! /// The <version> element is optional and indicates that the table contains versioned data. ! /// This is particularly useful if you plan to use long transactions (see below). ! /// </para> ! /// <para> ! /// <list type="table"> ! /// <listheader> ! /// <term>Attribute</term> ! /// <description>Possible Values</description> ! /// </listheader> ! /// <item> ! /// <term>column</term> ! /// <description> ! /// The name of the <c>column</c> holding the version number. ! /// Defaults to the Property name. ! /// </description> ! /// </item> ! /// <item> ! /// <term>name</term> ! /// <description>The name of the Property in the Persistent Class.</description> ! /// </item> ! /// <item> ! /// <term>type</term> ! /// <description> ! /// The <see cref="Type.IType"/> of the Property. Defaults to an <see cref="Type.Int32Type"/>. It ! /// be any <see cref="Type.IVersionType"/>. ! /// </description> ! /// </item> ! /// </list> ! /// </para> ! /// </remarks> public override Property Version { --- 176,182 ---- /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the version. /// </summary> ! /// <value>The <see cref="Property"/> that is used as the version.</value> public override Property Version { *************** *** 246,253 **** /// <summary> ! /// Gets a value indicating if the <see cref="PersistentClass" /> is versioned ! /// by NHibernate. /// </summary> ! /// <value><c>true</c> if there is a version property.</value> public override bool IsVersioned { --- 186,192 ---- /// <summary> ! /// Gets a boolean indicating if the mapped class has a version property. /// </summary> ! /// <value><c>true</c> if there is a Property for a <c>version</c>.</value> public override bool IsVersioned { *************** *** 255,259 **** } ! /// <summary></summary> public override ICacheConcurrencyStrategy Cache { --- 194,202 ---- } ! /// <summary> ! /// Gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> used with the Cache.</value> public override ICacheConcurrencyStrategy Cache { *************** *** 262,266 **** } ! /// <summary></summary> public override bool IsMutable { --- 205,212 ---- } ! /// <summary> ! /// Gets or set a boolean indicating if the mapped class has properties that can be changed. ! /// </summary> ! /// <value><c>true</c> if the object is mutable.</value> public override bool IsMutable { *************** *** 269,273 **** } ! /// <summary></summary> public override bool HasEmbeddedIdentifier { --- 215,228 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the class identifies itself.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public override bool HasEmbeddedIdentifier { *************** *** 276,280 **** } ! /// <summary></summary> public override System.Type Persister { --- 231,238 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> of the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister.</value> public override System.Type Persister { *************** *** 283,287 **** } ! /// <summary></summary> public override Table RootTable { --- 241,251 ---- } ! /// <summary> ! /// Gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the class this mapped class. ! /// </value> public override Table RootTable { *************** *** 289,293 **** } ! /// <summary></summary> public override PersistentClass Superclass { --- 253,266 ---- } ! /// <summary> ! /// Gets or sets the <see cref="PersistentClass"/> that this mapped class is extending. ! /// </summary> ! /// <value> ! /// <c>null</c> since this is the root class. ! /// </value> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when the setter is called. The Superclass can not be set on the ! /// RootClass, only the Subclass can have a Superclass set. ! /// </exception> public override PersistentClass Superclass { *************** *** 296,300 **** } ! /// <summary></summary> public override Value Key { --- 269,276 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public override Value Key { *************** *** 303,307 **** } ! /// <summary></summary> public override bool IsForceDiscriminator { --- 279,287 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if only values in the discriminator column that ! /// are mapped will be included in the sql. ! /// </summary> ! /// <value><c>true</c> if the mapped discriminator values should be forced.</value> public override bool IsForceDiscriminator { *************** *** 310,314 **** } ! /// <summary></summary> public override string Where { --- 290,299 ---- } ! /// <summary> ! /// Gets or sets the sql string that should be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> public override string Where { Index: Subclass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Subclass.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Subclass.cs 31 Dec 2004 21:27:54 -0000 1.6 --- Subclass.cs 3 Jan 2005 03:46:48 -0000 1.7 *************** *** 5,9 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Subclass : PersistentClass { --- 5,12 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Declaration of a System.Type mapped with the <c><subclass></c> or ! /// <c><joined-subclass></c> element. ! /// </summary> public class Subclass : PersistentClass { *************** *** 12,18 **** /// <summary> ! /// /// </summary> ! /// <param name="superclass"></param> public Subclass( PersistentClass superclass ) { --- 15,21 ---- /// <summary> ! /// Initializes a new instance of the <see cref="Subclass"/> class. /// </summary> ! /// <param name="superclass">The <see cref="PersistentClass"/> that is the superclass.</param> public Subclass( PersistentClass superclass ) { *************** *** 20,24 **** } ! /// <summary></summary> public override ICacheConcurrencyStrategy Cache { --- 23,31 ---- } ! /// <summary> ! /// Gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> that the Superclass uses with the Cache.</value> public override ICacheConcurrencyStrategy Cache { *************** *** 27,31 **** } ! /// <summary></summary> public override RootClass RootClazz { --- 34,43 ---- } ! /// <summary> ! /// Gets the <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="RootClass"/> of the Superclass that is mapped in the <c>class</c> element. ! /// </value> public override RootClass RootClazz { *************** *** 33,37 **** } ! /// <summary></summary> public override PersistentClass Superclass { --- 45,54 ---- } ! /// <summary> ! /// Gets or sets the <see cref="PersistentClass"/> that this mapped class is extending. ! /// </summary> ! /// <value> ! /// The <see cref="PersistentClass"/> that this mapped class is extending. ! /// </value> public override PersistentClass Superclass { *************** *** 40,44 **** } ! /// <summary></summary> public override Property IdentifierProperty { --- 57,66 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the <c>id</c>. ! /// </summary> ! /// <value> ! /// The <see cref="Property"/> from the Superclass that is used as the <c>id</c>. ! /// </value> public override Property IdentifierProperty { *************** *** 47,51 **** } ! /// <summary></summary> public override Value Identifier { --- 69,76 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the identifier. ! /// </summary> ! /// <value>The <see cref="Value"/> from the Superclass that contains information about the identifier.</value> public override Value Identifier { *************** *** 54,58 **** } ! /// <summary></summary> public override bool HasIdentifierProperty { --- 79,86 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a Property for the <c>id</c>. ! /// </summary> ! /// <value><c>true</c> if in the Superclass there is a Property for the <c>id</c>.</value> public override bool HasIdentifierProperty { *************** *** 60,64 **** } ! /// <summary></summary> public override Value Discriminator { --- 88,95 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the discriminator. ! /// </summary> ! /// <value>The <see cref="Value"/> from the Superclass that contains information about the discriminator.</value> public override Value Discriminator { *************** *** 67,71 **** } ! /// <summary></summary> public override bool IsMutable { --- 98,105 ---- } ! /// <summary> ! /// Gets or set a boolean indicating if the mapped class has properties that can be changed. ! /// </summary> ! /// <value><c>true</c> if the Superclass is mutable.</value> public override bool IsMutable { *************** *** 74,78 **** } ! /// <summary></summary> public override bool IsInherited { --- 108,117 ---- } ! /// <summary> ! /// Gets a boolean indicating if this mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>true</c> because this is a Subclass. ! /// </value> public override bool IsInherited { *************** *** 80,93 **** } ! /// <summary></summary> public override bool IsPolymorphic { get { return true; } } /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public override void AddProperty( Property p ) { --- 119,151 ---- } ! /// <summary> ! /// Gets or sets if the mapped class is a subclass. ! /// </summary> ! /// <value> ! /// <c>true</c> since this mapped class is a subclass. ! /// </value> ! /// <remarks> ! /// The setter should not be used to set the value to anything but <c>true</c>. ! /// </remarks> public override bool IsPolymorphic { get { return true; } + set + { + if( value!=true ) + { + throw new AssertionFailure( "IsPolymorphic has to be true for subclasses. There is a bug in NHibernate somewhere." ); + } + } } /// <summary> ! /// Add the <see cref="Property"/> to this PersistentClass. /// </summary> ! /// <param name="p">The <see cref="Property"/> to add.</param> ! /// <remarks> ! /// This also adds the <see cref="Property"/> to the Superclass' collection ! /// of Subclass Properties. ! /// </remarks> public override void AddProperty( Property p ) { *************** *** 96,100 **** } ! /// <summary></summary> public override Table Table { --- 154,165 ---- } ! /// <summary> ! /// Gets or Sets the <see cref="Table"/> that this class is stored in. ! /// </summary> ! /// <value>The <see cref="Table"/> this class is stored in.</value> ! /// <remarks> ! /// This also adds the <see cref="Table"/> to the Superclass' collection ! /// of Subclass Tables. ! /// </remarks> public override Table Table { *************** *** 107,111 **** } ! /// <summary></summary> public override ICollection PropertyClosureCollection { --- 172,186 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> ! /// <remarks> ! /// This is all of the properties of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public override ICollection PropertyClosureCollection { *************** *** 119,123 **** } ! /// <summary></summary> public override ICollection TableClosureCollection { --- 194,209 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Table"/> objects that this ! /// mapped class reads from and writes to. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Table"/> objects that ! /// this mapped class reads from and writes to. ! /// </value> ! /// <remarks> ! /// This is all of the tables of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public override ICollection TableClosureCollection { *************** *** 132,138 **** /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public override void AddSubclassProperty( Property p ) { --- 218,228 ---- /// <summary> ! /// Adds a <see cref="Property"/> that is implemented by a subclass. /// </summary> ! /// <param name="p">The <see cref="Property"/> implemented by a subclass.</param> ! /// <remarks> ! /// This also adds the <see cref="Property"/> to the Superclass' collection ! /// of Subclass Properties. ! /// </remarks> public override void AddSubclassProperty( Property p ) { *************** *** 142,148 **** /// <summary> ! /// /// </summary> ! /// <param name="table"></param> public override void AddSubclassTable( Table table ) { --- 232,242 ---- /// <summary> ! /// Adds a <see cref="Table"/> that a subclass is stored in. /// </summary> ! /// <param name="table">The <see cref="Table"/> the subclass is stored in.</param> ! /// <remarks> ! /// This also adds the <see cref="Table"/> to the Superclass' collection ! /// of Subclass Tables. ! /// </remarks> public override void AddSubclassTable( Table table ) { *************** *** 151,155 **** } ! /// <summary></summary> public override bool IsVersioned { --- 245,252 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a version property. ! /// </summary> ! /// <value><c>true</c> if for the Superclass there is a Property for a <c>version</c>.</value> public override bool IsVersioned { *************** *** 157,161 **** } ! /// <summary></summary> public override Property Version { --- 254,261 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the version. ! /// </summary> ! /// <value>The <see cref="Property"/> from the Superclass that is used as the version.</value> public override Property Version { *************** *** 164,168 **** } ! /// <summary></summary> public override bool HasEmbeddedIdentifier { --- 264,277 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the Superclass has an embedded identifier.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public override bool HasEmbeddedIdentifier { *************** *** 171,175 **** } ! /// <summary></summary> public override System.Type Persister { --- 280,287 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> of the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister for the Superclass.</value> public override System.Type Persister { *************** *** 178,182 **** } ! /// <summary></summary> public override Table RootTable { --- 290,300 ---- } ! /// <summary> ! /// Gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the Superclass that is mapped in the <c>class</c> element. ! /// </value> public override Table RootTable { *************** *** 184,188 **** } ! /// <summary></summary> public override Value Key { --- 302,309 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public override Value Key { *************** *** 201,205 **** } ! /// <summary></summary> public override bool IsExplicitPolymorphism { --- 322,331 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// The value of the Superclasses <c>IsExplicitPolymorphism</c> property. ! /// </value> public override bool IsExplicitPolymorphism { *************** *** 208,216 **** } ! /// <summary></summary> public override string Where { get { return Superclass.Where; } ! set { throw new NotImplementedException( "The Where string can not be set on the Subclass - use the RootClass instead." ); } } --- 334,351 ---- } ! /// <summary> ! /// Gets the sql string that should be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when the setter is called. The where clause can not be set on the ! /// Subclass, only the RootClass. ! /// </exception> public override string Where { get { return Superclass.Where; } ! set { throw new InvalidOperationException( "The Where string can not be set on the Subclass - use the RootClass instead." ); } } |