|
From: <fab...@us...> - 2010-01-05 22:09:34
|
Revision: 4899
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4899&view=rev
Author: fabiomaulo
Date: 2010-01-05 22:09:23 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
Removed the usage of System.Xml from binders.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCollectionId.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmElement.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndex.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToAny.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToMany.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKey.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToAny.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToMany.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKey.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKeyManyToMany.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassIdBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/CollectionBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/FiltersBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/JoinedSubclassBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/MappingRootBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/PropertiesBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/RootClassBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/SubclassBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/UnionSubclassBinder.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ValuePropertyBinder.cs
trunk/nhibernate/src/NHibernate/NHibernate.csproj
trunk/nhibernate/src/NHibernate.Test/FilterTest/defs.hbm.xml
Added Paths:
-----------
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeElement.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeIndex.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeMapKey.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToMany.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IAnyMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertiesMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionSqlsMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IComponentMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IIndexedCollectionMapping.cs
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IRelationship.cs
trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/IdGeneratorBinder.cs
Removed Paths:
-------------
trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertyMapping.cs
Modified: trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/Configuration.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -965,11 +965,15 @@
if (FilterDefinitions.Count > 0)
{
filterNames.Clear();
- var filterables = new JoinedEnumerable(ClassMappings, CollectionMappings);
- foreach (IFilterable filterable in filterables)
+ foreach (var persistentClass in ClassMappings)
{
- filterNames.AddAll(filterable.FilterMap.Keys);
+ filterNames.AddAll(persistentClass.FilterMap.Keys);
}
+ foreach (var collectionMapping in CollectionMappings)
+ {
+ filterNames.AddAll(collectionMapping.FilterMap.Keys);
+ filterNames.AddAll(collectionMapping.ManyToManyFilterMap.Keys);
+ }
foreach (var filterName in FilterDefinitions.Keys)
{
if (!filterNames.Contains(filterName))
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmAny.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -3,7 +3,7 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmAny : AbstractDecoratable, IEntityPropertyMapping, IColumnsMapping
+ public partial class HbmAny : AbstractDecoratable, IEntityPropertyMapping, IColumnsMapping, IAnyMapping
{
#region Implementation of IEntityPropertyMapping
@@ -17,7 +17,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -57,5 +57,22 @@
};
}
}
+
+ #region Implementation of IAnyMapping
+
+ public string MetaType
+ {
+ get { return metatype; }
+ }
+
+ public ICollection<HbmMetaValue> MetaValues
+ {
+ get
+ {
+ return metavalue ?? new HbmMetaValue[0];
+ }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmArray.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,8 +1,8 @@
-using System;
+using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmArray : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmArray : AbstractDecoratable, ICollectionPropertiesMapping, IIndexedCollectionMapping
{
#region Implementation of IEntityPropertyMapping
@@ -16,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -41,5 +41,151 @@
#endregion
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertyMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return null; }
+ }
+
+ public string Where
+ {
+ get { return @where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize : (int?)null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? (HbmCollectionFetchMode?) fetch : null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? (HbmOuterJoinStrategy?) outerjoin : null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item1; }
+ }
+
+ public string Sort
+ {
+ get { return null; }
+ }
+
+ public bool? Generic
+ {
+ get { return null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { yield break; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
+
+ #region Implementation of IIndexedCollection
+
+ public HbmListIndex ListIndex
+ {
+ get { return Item as HbmListIndex; }
+ }
+
+ public HbmIndex Index
+ {
+ get { return Item as HbmIndex; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmBag.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,9 @@
+using System;
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmBag : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmBag : AbstractDecoratable, ICollectionPropertiesMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +17,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -38,5 +41,138 @@
}
#endregion
+
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertiesMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return orderby; }
+ }
+
+ public string Where
+ {
+ get { return where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize: (int?) null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? fetch: (HbmCollectionFetchMode?) null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? outerjoin:(HbmOuterJoinStrategy?) null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmCollectionLazy?)null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item; }
+ }
+
+ public string Sort
+ {
+ get { return null; }
+ }
+
+ public bool? Generic
+ {
+ get { return genericSpecified ? generic: (bool?) null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { return filter ?? new HbmFilter[0]; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCollectionId.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCollectionId.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCollectionId.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -2,7 +2,7 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmCollectionId: IColumnsMapping
+ public partial class HbmCollectionId : IColumnsMapping, ITypeMapping
{
#region Implementation of IColumnsMapping
@@ -28,5 +28,14 @@
};
}
}
+
+ #region Implementation of ITypeMapping
+
+ public HbmType Type
+ {
+ get { return !string.IsNullOrEmpty(type) ? new HbmType { name = type } : null; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmComponent.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -4,10 +4,25 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmComponent : AbstractDecoratable, IEntityPropertyMapping, IPropertiesContainerMapping
+ public partial class HbmComponent : AbstractDecoratable, IEntityPropertyMapping, IComponentMapping
{
#region Implementation of IEntityPropertyMapping
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return parent; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return node; }
+ }
+
public string Name
{
get { return name; }
@@ -18,7 +33,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeElement.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeElement.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeElement.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public partial class HbmCompositeElement : AbstractDecoratable, IComponentMapping
+ {
+ #region Implementation of IComponentMapping
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return parent; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return node;}
+ }
+
+ public string Name
+ {
+ get { return null; }
+ }
+
+ #endregion
+
+ #region Overrides of AbstractDecoratable
+
+ protected override HbmMeta[] Metadatas
+ {
+ get { return meta ?? new HbmMeta[0]; }
+ }
+
+ #endregion
+
+ #region Implementation of IPropertiesContainerMapping
+
+ public IEnumerable<IEntityPropertyMapping> Properties
+ {
+ get { return Items != null ? Items.Cast<IEntityPropertyMapping>() : new IEntityPropertyMapping[0]; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeIndex.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeIndex.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeIndex.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public partial class HbmCompositeIndex: IComponentMapping
+ {
+ #region Implementation of IPropertiesContainerMapping
+
+ public IEnumerable<IEntityPropertyMapping> Properties
+ {
+ get { return Items != null ? Items.Cast<IEntityPropertyMapping>() : new IEntityPropertyMapping[0]; }
+ }
+
+ #endregion
+
+ #region Implementation of IComponentMapping
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return null; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return null; }
+ }
+
+ public string Name
+ {
+ get { return null; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeMapKey.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeMapKey.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmCompositeMapKey.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public partial class HbmCompositeMapKey: IComponentMapping
+ {
+ #region Implementation of IPropertiesContainerMapping
+
+ public IEnumerable<IEntityPropertyMapping> Properties
+ {
+ get { return Items != null ? Items.Cast<IEntityPropertyMapping>() : new IEntityPropertyMapping[0]; }
+ }
+
+ #endregion
+
+ #region Implementation of IComponentMapping
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return null; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return null; }
+ }
+
+ public string Name
+ {
+ get { return null; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmDynamicComponent.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -3,8 +4,23 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmDynamicComponent: AbstractDecoratable, IEntityPropertyMapping, IPropertiesContainerMapping
+ public partial class HbmDynamicComponent: AbstractDecoratable, IEntityPropertyMapping, IComponentMapping
{
#region Implementation of IEntityPropertyMapping
+ public string Class
+ {
+ get { return null; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return null; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return node; }
+ }
+
public string Name
{
@@ -17,7 +33,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmElement.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmElement.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmElement.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -23,16 +23,18 @@
}
else
{
- yield return new HbmColumn
- {
- name = column,
- length = length,
- scale = scale,
- precision = precision,
- notnull = notnull,
- unique = unique,
- uniqueSpecified = true,
- };
+ yield return
+ new HbmColumn
+ {
+ name = column,
+ length = length,
+ scale = scale,
+ precision = precision,
+ notnull = notnull,
+ notnullSpecified = true,
+ unique = unique,
+ uniqueSpecified = true,
+ };
}
}
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIdbag.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,8 @@
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmIdbag : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmIdbag : AbstractDecoratable, ICollectionPropertiesMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -38,5 +40,139 @@
}
#endregion
+
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertiesMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return orderby; }
+ }
+
+ public string Where
+ {
+ get { return where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize : (int?)null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? fetch : (HbmCollectionFetchMode?)null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? outerjoin : (HbmOuterJoinStrategy?)null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmCollectionLazy?)null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item; }
+ }
+
+ public string Sort
+ {
+ get { return null; }
+ }
+
+ public bool? Generic
+ {
+ get { return genericSpecified ? generic : (bool?)null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { return filter ?? new HbmFilter[0]; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
+
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndex.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndex.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndex.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
@@ -2,3 +3,3 @@
{
- public partial class HbmIndex: IColumnsMapping
+ public partial class HbmIndex: IColumnsMapping, ITypeMapping
{
@@ -28,5 +29,14 @@
};
}
}
+
+ #region Implementation of ITypeMapping
+
+ public HbmType Type
+ {
+ get { return string.IsNullOrEmpty(type) ? null : new HbmType {name = type}; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToAny.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToAny.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToAny.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
@@ -2,3 +3,3 @@
{
- public partial class HbmIndexManyToAny: IColumnsMapping
+ public partial class HbmIndexManyToAny: IColumnsMapping, IAnyMapping
{
@@ -27,5 +28,19 @@
};
}
}
+
+ #region Implementation of IAnyMapping
+
+ public string MetaType
+ {
+ get { return metatype; }
+ }
+
+ public ICollection<HbmMetaValue> MetaValues
+ {
+ get { return new HbmMetaValue[0]; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToMany.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToMany.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmIndexManyToMany.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -2,7 +2,7 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmIndexManyToMany: IColumnsMapping
+ public partial class HbmIndexManyToMany: IColumnsMapping, IRelationship
{
#region Implementation of IColumnsMapping
@@ -27,5 +27,24 @@
};
}
}
+
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return HbmNotFoundMode.Exception; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKey.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKey.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKey.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -31,5 +31,15 @@
};
}
}
+
+ public bool? IsNullable
+ {
+ get { return notnullSpecified ? !notnull : (bool?)null; }
+ }
+
+ public bool? IsUpdatable
+ {
+ get { return updateSpecified ? update : (bool?)null; }
+ }
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyManyToOne.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
@@ -2,3 +3,3 @@
{
- public partial class HbmKeyManyToOne: IColumnsMapping
+ public partial class HbmKeyManyToOne : AbstractDecoratable, IColumnsMapping, IRelationship, IEntityPropertyMapping
{
@@ -28,5 +29,57 @@
};
}
}
+
+ #region Overrides of AbstractDecoratable
+
+ protected override HbmMeta[] Metadatas
+ {
+ get { return meta ?? new HbmMeta[0]; }
+ }
+
+ #endregion
+
+ public HbmRestrictedLaziness? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmRestrictedLaziness?)null; }
+ }
+
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return notfound; }
+ }
+
+ #endregion
+
+ #region Implementation of IEntityPropertyMapping
+
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public string Access
+ {
+ get { return access; }
+ }
+
+ public bool OptimisticLock
+ {
+ get { return false; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmKeyProperty.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
@@ -2,3 +3,3 @@
{
- public partial class HbmKeyProperty: IColumnsMapping, ITypeMapping
+ public partial class HbmKeyProperty : AbstractDecoratable, IColumnsMapping, ITypeMapping, IEntityPropertyMapping
{
@@ -38,5 +39,33 @@
}
#endregion
+
+ #region Overrides of AbstractDecoratable
+
+ protected override HbmMeta[] Metadatas
+ {
+ get { return meta ?? new HbmMeta[0]; }
+ }
+
+ #endregion
+
+ #region Implementation of IEntityPropertyMapping
+
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public string Access
+ {
+ get { return access; }
+ }
+
+ public bool OptimisticLock
+ {
+ get { return false; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmList.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,8 @@
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmList : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmList : AbstractDecoratable, ICollectionPropertiesMapping, IIndexedCollectionMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -39,5 +41,151 @@
#endregion
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of IIndexedCollection
+
+ public HbmListIndex ListIndex
+ {
+ get { return Item as HbmListIndex; }
+ }
+
+ public HbmIndex Index
+ {
+ get { return Item as HbmIndex; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertiesMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return orderby; }
+ }
+
+ public string Where
+ {
+ get { return where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize : (int?)null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? fetch : (HbmCollectionFetchMode?)null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? outerjoin : (HbmOuterJoinStrategy?)null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmCollectionLazy?)null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item1; }
+ }
+
+ public string Sort
+ {
+ get { return null; }
+ }
+
+ public bool? Generic
+ {
+ get { return genericSpecified ? generic : (bool?)null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { return filter ?? new HbmFilter[0]; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToAny.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToAny.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToAny.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
namespace NHibernate.Cfg.MappingSchema
@@ -2,3 +3,3 @@
{
- public partial class HbmManyToAny: IColumnsMapping
+ public partial class HbmManyToAny : IColumnsMapping, IAnyMapping
{
@@ -28,5 +29,22 @@
};
}
}
+
+ #region Implementation of IAnyMapping
+
+ public string MetaType
+ {
+ get { return metatype; }
+ }
+
+ public ICollection<HbmMetaValue> MetaValues
+ {
+ get
+ {
+ return metavalue ?? new HbmMetaValue[0];
+ }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToMany.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToMany.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToMany.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -3,7 +4,6 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmManyToMany: IColumnsMapping
+ public partial class HbmManyToMany : IColumnsMapping, IFormulasMapping, IRelationship
{
-
#region Implementation of IColumnsMapping
@@ -26,8 +26,50 @@
yield return new HbmColumn
{
name = column,
+ unique = unique,
+ uniqueSpecified = true
};
}
}
+
+ #region Implementation of IFormulasMapping
+
+ public IEnumerable<HbmFormula> Formulas
+ {
+ get { return Items != null ? Items.OfType<HbmFormula>() : AsFormulas(); }
+ }
+
+ private IEnumerable<HbmFormula> AsFormulas()
+ {
+ if (string.IsNullOrEmpty(formula))
+ {
+ yield break;
+ }
+ else
+ {
+ yield return new HbmFormula { Text = new[] { formula } };
+ }
+ }
+
+ #endregion
+
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return notfound; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmManyToOne.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -4,7 +4,7 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmManyToOne : AbstractDecoratable, IEntityPropertyMapping, IColumnsMapping, IFormulasMapping
+ public partial class HbmManyToOne : AbstractDecoratable, IEntityPropertyMapping, IColumnsMapping, IFormulasMapping, IRelationship
{
#region Implementation of IEntityPropertyMapping
@@ -18,7 +18,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -84,5 +84,29 @@
}
#endregion
+
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return notfound; }
+ }
+
+ #endregion
+
+ public HbmLaziness? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmLaziness?) null;}
+ }
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMap.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,8 @@
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmMap : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmMap : AbstractDecoratable, ICollectionPropertiesMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -39,5 +41,137 @@
#endregion
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertiesMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return orderby; }
+ }
+
+ public string Where
+ {
+ get { return where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize : (int?)null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? fetch : (HbmCollectionFetchMode?)null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? outerjoin : (HbmOuterJoinStrategy?)null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmCollectionLazy?)null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item1; }
+ }
+
+ public string Sort
+ {
+ get { return sort; }
+ }
+
+ public bool? Generic
+ {
+ get { return genericSpecified ? generic : (bool?)null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { return filter ?? new HbmFilter[0]; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKey.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKey.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKey.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -3,5 +4,5 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmMapKey: IColumnsMapping
+ public partial class HbmMapKey: IColumnsMapping, ITypeMapping
{
@@ -51,5 +52,14 @@
}
#endregion
+
+ #region Implementation of ITypeMapping
+
+ public HbmType Type
+ {
+ get { return string.IsNullOrEmpty(type) ? null : new HbmType { name = type }; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKeyManyToMany.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKeyManyToMany.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmMapKeyManyToMany.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
@@ -3,5 +4,5 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmMapKeyManyToMany: IColumnsMapping, IFormulasMapping
+ public partial class HbmMapKeyManyToMany: IColumnsMapping, IFormulasMapping, IRelationship
{
@@ -50,5 +51,24 @@
}
#endregion
+
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return HbmNotFoundMode.Exception; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmNestedCompositeElement.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,60 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public partial class HbmNestedCompositeElement : AbstractDecoratable, IEntityPropertyMapping, IComponentMapping
+ {
+ #region Implementation of IPropertiesContainerMapping
+
+ public IEnumerable<IEntityPropertyMapping> Properties
+ {
+ get { return Items != null ? Items.Cast<IEntityPropertyMapping>() : new IEntityPropertyMapping[0]; }
+ }
+
+ #endregion
+
+ #region Implementation of IComponentMapping
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmParent Parent
+ {
+ get { return parent; }
+ }
+
+ public string EmbeddedNode
+ {
+ get { return node; }
+ }
+
+ public string Name
+ {
+ get { return name; }
+ }
+
+ public string Access
+ {
+ get { return access; }
+ }
+
+ public bool OptimisticLock
+ {
+ get { return true; }
+ }
+
+ #endregion
+
+ #region Overrides of AbstractDecoratable
+
+ protected override HbmMeta[] Metadatas
+ {
+ get { return new HbmMeta[0];}
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToMany.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToMany.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToMany.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,26 @@
+using System;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public partial class HbmOneToMany: IRelationship
+ {
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return notfound; }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmOneToOne.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -2,7 +2,7 @@
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmOneToOne : AbstractDecoratable, IEntityPropertyMapping, IFormulasMapping
+ public partial class HbmOneToOne : AbstractDecoratable, IEntityPropertyMapping, IFormulasMapping, IRelationship
{
#region Implementation of IEntityPropertyMapping
@@ -16,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return true; }
}
@@ -53,5 +53,28 @@
#endregion
+ #region Implementation of IRelationship
+
+ public string EntityName
+ {
+ get { return entityname; }
+ }
+
+ public string Class
+ {
+ get { return @class; }
+ }
+
+ public HbmNotFoundMode NotFoundMode
+ {
+ get { return HbmNotFoundMode.Exception; }
+ }
+
+ #endregion
+
+ public HbmLaziness? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmLaziness?)null; }
+ }
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmPrimitiveArray.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,8 @@
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmPrimitiveArray : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmPrimitiveArray : AbstractDecoratable, ICollectionPropertiesMapping, IIndexedCollectionMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +16,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -39,5 +41,151 @@
#endregion
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertyMapping
+
+ public bool Inverse
+ {
+ get { return false; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return null; }
+ }
+
+ public string Where
+ {
+ get { return @where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return null; } // TODO NH: change schema following the same schema of others collections
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? (HbmCollectionFetchMode?)fetch : null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? (HbmOuterJoinStrategy?)outerjoin : null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return element; }
+ }
+
+ public string Sort
+ {
+ get { return null; }
+ }
+
+ public bool? Generic
+ {
+ get { return null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { yield break; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
+
+ #region Implementation of IIndexedCollection
+
+ public HbmListIndex ListIndex
+ {
+ get { return Item as HbmListIndex; }
+ }
+
+ public HbmIndex Index
+ {
+ get { return Item as HbmIndex; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmProperty.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -18,7 +18,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/HbmSet.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,6 +1,9 @@
+using System;
+using System.Collections.Generic;
+
namespace NHibernate.Cfg.MappingSchema
{
- public partial class HbmSet : AbstractDecoratable, ICollectionPropertyMapping
+ public partial class HbmSet : AbstractDecoratable, ICollectionPropertiesMapping
{
#region Implementation of IEntityPropertyMapping
@@ -14,7 +17,7 @@
get { return access; }
}
- public bool OptimisticKock
+ public bool OptimisticLock
{
get { return optimisticlock; }
}
@@ -39,5 +42,137 @@
#endregion
+ #region Implementation of ICollectionSqlsMapping
+
+ public HbmLoader SqlLoader
+ {
+ get { return loader; }
+ }
+
+ public HbmCustomSQL SqlInsert
+ {
+ get { return sqlinsert; }
+ }
+
+ public HbmCustomSQL SqlUpdate
+ {
+ get { return sqlupdate; }
+ }
+
+ public HbmCustomSQL SqlDelete
+ {
+ get { return sqldelete; }
+ }
+
+ public HbmCustomSQL SqlDeleteAll
+ {
+ get { return sqldeleteall; }
+ }
+
+ #endregion
+
+ #region Implementation of ICollectionPropertiesMapping
+
+ public bool Inverse
+ {
+ get { return inverse; }
+ }
+
+ public bool Mutable
+ {
+ get { return mutable; }
+ }
+
+ public string OrderBy
+ {
+ get { return orderby; }
+ }
+
+ public string Where
+ {
+ get { return where; }
+ }
+
+ public int? BatchSize
+ {
+ get { return batchsizeSpecified ? batchsize : (int?)null; }
+ }
+
+ public string PersisterQualifiedName
+ {
+ get { return persister; }
+ }
+
+ public string CollectionType
+ {
+ get { return collectiontype; }
+ }
+
+ public HbmCollectionFetchMode? FetchMode
+ {
+ get { return fetchSpecified ? fetch : (HbmCollectionFetchMode?)null; }
+ }
+
+ public HbmOuterJoinStrategy? OuterJoin
+ {
+ get { return outerjoinSpecified ? outerjoin : (HbmOuterJoinStrategy?)null; }
+ }
+
+ public HbmCollectionLazy? Lazy
+ {
+ get { return lazySpecified ? lazy : (HbmCollectionLazy?)null; }
+ }
+
+ public string Table
+ {
+ get { return table; }
+ }
+
+ public string Schema
+ {
+ get { return schema; }
+ }
+
+ public string Catalog
+ {
+ get { return catalog; }
+ }
+
+ public string Check
+ {
+ get { return check; }
+ }
+
+ public object ElementRelationship
+ {
+ get { return Item; }
+ }
+
+ public string Sort
+ {
+ get { return sort; }
+ }
+
+ public bool? Generic
+ {
+ get { return genericSpecified ? generic : (bool?)null; }
+ }
+
+ public IEnumerable<HbmFilter> Filters
+ {
+ get { return filter ?? new HbmFilter[0]; }
+ }
+
+ public HbmKey Key
+ {
+ get { return key; }
+ }
+
+ public HbmCache Cache
+ {
+ get { return cache; }
+ }
+
+ #endregion
}
}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IAnyMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IAnyMapping.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IAnyMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,10 @@
+using System.Collections.Generic;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface IAnyMapping
+ {
+ string MetaType { get; }
+ ICollection<HbmMetaValue> MetaValues { get; }
+ }
+}
\ No newline at end of file
Copied: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertiesMapping.cs (from rev 4894, trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertyMapping.cs)
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertiesMapping.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertiesMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface ICollectionPropertiesMapping : IEntityPropertyMapping, IReferencePropertyMapping, ICollectionSqlsMapping
+ {
+ bool Inverse { get; }
+ bool Mutable { get; }
+ string OrderBy { get; }
+ string Where { get; }
+ int? BatchSize { get; }
+ string PersisterQualifiedName { get; }
+ string CollectionType { get; }
+ HbmCollectionFetchMode? FetchMode { get; }
+ HbmOuterJoinStrategy? OuterJoin { get; }
+ HbmCollectionLazy? Lazy { get; }
+ string Table { get; }
+ string Schema { get; }
+ string Catalog { get; }
+ string Check { get; }
+
+ /// <summary>
+ /// The relation of the element of the collection.
+ /// </summary>
+ /// <remarks>
+ /// Can be one of: HbmCompositeElement, HbmElement, HbmManyToAny, HbmManyToMany, HbmOneToMany...
+ /// according to the type of the collection.
+ /// </remarks>
+ object ElementRelationship { get; }
+ string Sort { get; }
+ bool? Generic { get; }
+ IEnumerable<HbmFilter> Filters { get; }
+ HbmKey Key { get; }
+ HbmCache Cache { get; }
+ }
+}
\ No newline at end of file
Deleted: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertyMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertyMapping.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionPropertyMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,7 +0,0 @@
-namespace NHibernate.Cfg.MappingSchema
-{
- public interface ICollectionPropertyMapping : IEntityPropertyMapping, IReferencePropertyMapping
- {
-
- }
-}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionSqlsMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionSqlsMapping.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/ICollectionSqlsMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,11 @@
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface ICollectionSqlsMapping
+ {
+ HbmLoader SqlLoader { get; }
+ HbmCustomSQL SqlInsert { get; }
+ HbmCustomSQL SqlUpdate { get; }
+ HbmCustomSQL SqlDelete { get; }
+ HbmCustomSQL SqlDeleteAll { get; }
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IComponentMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IComponentMapping.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IComponentMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,10 @@
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface IComponentMapping : IPropertiesContainerMapping
+ {
+ string Class { get; }
+ HbmParent Parent { get; }
+ string EmbeddedNode { get; }
+ string Name { get; }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IEntityPropertyMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -4,6 +4,6 @@
{
string Name { get; }
string Access { get; }
- bool OptimisticKock { get; }
+ bool OptimisticLock { get; }
}
}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IIndexedCollectionMapping.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IIndexedCollectionMapping.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IIndexedCollectionMapping.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,8 @@
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface IIndexedCollectionMapping
+ {
+ HbmListIndex ListIndex { get; }
+ HbmIndex Index { get; }
+ }
+}
\ No newline at end of file
Added: trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IRelationship.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IRelationship.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate/Cfg/MappingSchema/IRelationship.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -0,0 +1,9 @@
+namespace NHibernate.Cfg.MappingSchema
+{
+ public interface IRelationship
+ {
+ string EntityName { get; }
+ string Class { get; }
+ HbmNotFoundMode NotFoundMode { get; }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/Binder.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -289,5 +289,15 @@
return map;
}
+ protected XmlNamespaceManager GetNamespaceManager(XmlNode parentNode)
+ {
+ // note that the prefix has absolutely nothing to do with what the user
+ // selects as their prefix in the document. It is the prefix we use to
+ // build the XPath and the nsmgr takes care of translating our prefix into
+ // the user defined prefix...
+ var namespaceManager = new XmlNamespaceManager(parentNode.OwnerDocument.NameTable);
+ namespaceManager.AddNamespace(HbmConstants.nsPrefix, MappingSchemaXMLNS);
+ return namespaceManager;
+ }
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2010-01-04 15:35:10 UTC (rev 4898)
+++ trunk/nhibernate/src/NHibernate/Cfg/XmlHbmBinding/ClassBinder.cs 2010-01-05 22:09:23 UTC (rev 4899)
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Xml;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Engine;
using NHibernate.Mapping;
@@ -13,27 +12,19 @@
public abstract class ClassBinder : Binder
{
protected readonly Dialect.Dialect dialect;
- private readonly XmlNamespaceManager namespaceManager;
- protected ClassBinder(Mappings mappings, XmlNamespaceManager namespaceManager, Dialect.Dialect dialect)
+ protected ClassBinder(Mappings mappings, Dialect.Dialect dialect)
: base(mappings)
{
this.dialect = dialect;
- this.namespaceManager = namespaceManager;
}
protected ClassBinder(ClassBinder parent)
: base(parent.Mappings)
{
dialect = parent.dialect;
- namespaceManager = parent.NamespaceManager;
}
- public XmlNamespaceManager NamespaceManager
- {
- get { return namespaceManager; }
- }
-
protected void BindClass(IEntityMapping classMapping, PersistentClass model, IDictionary<string, MetaAttribute> inheritedMetas)
{
// handle the lazy attribute
@@ -211,13 +202,13 @@
SimpleValue key = new DependantValue(table, persistentClass.Identifier);
join.Key = key;
key.IsCascadeDeleteEnabled = joinMapping.key.ondelete == HbmOndelete.Cascade;
- BindSimpleValue(Serialize(joinMapping.key), key, false, persistentClass.EntityName);
+ new ValuePropertyBinder(key, Mappings).BindSimpleValue(joinMapping.key, persistentClass.EntityName, false);
join.CreatePrimaryKey(dialect);
join.CreateForeignKey();
// PROPERTIES
- new PropertiesBinder(Mappings, persistentClass, NamespaceManager, dialect).Bind(joinMapping.Properties, join.Table,
+ new PropertiesBinder(Mappings, persistentClass, dialect).Bind(joinMapping.Properties, join.Table,
...
[truncated message content] |