|
From: <fab...@us...> - 2010-07-21 14:33:52
|
Revision: 5030
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5030&view=rev
Author: fabiomaulo
Date: 2010-07-21 14:33:45 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
Revert of mapping-schema breaking change introduced in r5017 (not needed to fix NH-2117)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs
trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs 2010-07-21 13:06:48 UTC (rev 5029)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/Hbm.generated.cs 2010-07-21 14:33:45 UTC (rev 5030)
@@ -649,14 +649,11 @@
public HbmMeta[] meta;
/// <remarks/>
- [System.Xml.Serialization.XmlElementAttribute("column")]
- public HbmColumn[] column;
+ [System.Xml.Serialization.XmlElementAttribute("column", typeof(HbmColumn))]
+ [System.Xml.Serialization.XmlElementAttribute("formula", typeof(HbmFormula))]
+ public object[] Items;
/// <remarks/>
- [System.Xml.Serialization.XmlElementAttribute("formula")]
- public HbmFormula[] formula;
-
- /// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string name;
@@ -673,8 +670,8 @@
public string entityname;
/// <remarks/>
- [System.Xml.Serialization.XmlAttributeAttribute("column")]
- public string column1;
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string column;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("not-null")]
@@ -741,8 +738,8 @@
public string propertyref;
/// <remarks/>
- [System.Xml.Serialization.XmlAttributeAttribute("formula")]
- public string formula1;
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string formula;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-07-21 13:06:48 UTC (rev 5029)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-07-21 14:33:45 UTC (rev 5030)
@@ -43,14 +43,14 @@
public IEnumerable<HbmColumn> Columns
{
- get { return column != null ? column.OfType<HbmColumn>() : AsColumns(); }
+ get { return Items != null ? Items.OfType<HbmColumn>() : AsColumns(); }
}
#endregion
private IEnumerable<HbmColumn> AsColumns()
{
- if (string.IsNullOrEmpty(column1))
+ if (string.IsNullOrEmpty(column))
{
yield break;
}
@@ -58,7 +58,7 @@
{
yield return new HbmColumn
{
- name = column1,
+ name = column,
notnull = notnull,
notnullSpecified = notnullSpecified,
unique = unique,
@@ -73,18 +73,18 @@
public IEnumerable<HbmFormula> Formulas
{
- get { return formula != null ? formula.OfType<HbmFormula>() : AsFormulas(); }
+ get { return Items != null ? Items.OfType<HbmFormula>() : AsFormulas(); }
}
private IEnumerable<HbmFormula> AsFormulas()
{
- if (string.IsNullOrEmpty(formula1))
+ if (string.IsNullOrEmpty(formula))
{
yield break;
}
else
{
- yield return new HbmFormula { Text = new[] { formula1 } };
+ yield return new HbmFormula { Text = new[] { formula } };
}
}
@@ -114,7 +114,11 @@
/// </summary>
public IEnumerable<object> ColumnsAndFormulas
{
- get { return Columns.Cast<object>().Concat(Formulas.Cast<object>()); }
+ // when Items is empty the column attribute AND formula attribute will be used
+ // and it may cause an issue (breaking change)
+ // On the other hand it work properly when a mixing between <formula> and <column> tags are used
+ // respecting the order used in the mapping to map multi-columns id.
+ get { return Items ?? Columns.Cast<object>().Concat(Formulas.Cast<object>()); }
}
public HbmLaziness? Lazy
Modified: trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd
===================================================================
--- trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd 2010-07-21 13:06:48 UTC (rev 5029)
+++ trunk/nhibernate/src/NHibernate/nhibernate-mapping.xsd 2010-07-21 14:33:45 UTC (rev 5030)
@@ -865,9 +865,11 @@
<xs:complexType>
<xs:sequence>
<xs:element ref="meta" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="column" minOccurs="0" maxOccurs="unbounded" />
- <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="column" />
+ <xs:element ref="formula" />
+ </xs:choice>
+ </xs:sequence>
<xs:attribute name="name" use="required" type="xs:string" />
<xs:attribute name="access" type="xs:string" />
<xs:attribute name="class" type="xs:string" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|