Is this possible...
MessageMap()
{
Id(x => x.Id);
HasMany(x => x.Folders)
.Component(c =>
{
c.Map(x => x.Name);
c.References(x => x.User);
})
.Cascade.AllDeleteOrphan()
.Access.AsCamelCaseField(Prefix.Underscore);
}
public class Message
{
public virtual int Id {get; protected set;}
public virtual ICollection<Folder> Folders{get; protected set;}
}
public class Folder
{
public virtual string Name{get;set;}
public virtual User User{get;set;}
}
With the above mapping I get the following exception...
System.IndexOutOfRangeException: Index was outside the bounds of the array.
[IndexOutOfRangeException: Index was outside the bounds of the array.]
NHibernate.Mapping.Column.set_Name(String value) +80
NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumns(XmlNode node, SimpleValue model, Boolean isNullable, Boolean autoColumn, String propertyPath) +626
NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindManyToOne(XmlNode node, ManyToOne model, String defaultColumnName, Boolean isNullable) +33
NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindComponent(XmlNode node, Component model, Type reflectedClass, String className, String path, Boolean isNullable) +987
NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass(XmlNode node, Collection model, IDictionary`2 persistentClasses) +1659
NHibernate.Cfg.XmlHbmBinding.<>c__DisplayClassd.<AddCollectionSecondPass>b__c(IDictionary`2 persistentClasses) +33
NHibernate.Cfg.Configuration.SecondPassCompile() +118
NHibernate.Cfg.Configuration.GenerateDropSchemaScript(Dialect dialect) +44
NHibernate.Tool.hbm2ddl.SchemaExport..ctor(Configuration cfg, IDictionary`2 connectionProperties) +53
NHibernate.Tool.hbm2ddl.SchemaExport..ctor(Configuration cfg) +9