This is my class public class ContentItem { public virtual IDictionary<string,ContentDetail> Details { get; private set; } protected ContentItem() { Details = new Dictionary<string, ContentDetail>(); } } My mappings
return AutoMap.Assemblies(new StormbreakerAutomappingConfiguration(), new[] { Assembly.Load("IOUDough.Core"), }) .IncludeBase(typeof(ContentItem)) .IncludeBase(typeof(ContentDetail)) .Override<ContentItem>(map => map.Id(x => x.Id).GeneratedBy.Identity()) .Override<ContentDetail>(map => map.Id(x => x.Id).GeneratedBy.Identity()) .Override<ContentItem>(map => map.HasMany(x => x.Details).DictionaryKey("Name")) .Conventions.Add(new CascadeConvention()); And this is my stacktrace Server Error in '/' Application. Invalid object name 'ContentItemDetails'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'ContentItemDetails'. Source Error: Line 14: <p>- <%=Model.Parent.Name %> - </p> Line 15: <% Line 16: foreach (var contentDetail in Model.Details) Line 17: { Line 18: Response.Write(contentDetail.Value); Source File: d:\Projects\SVN\IOUDough\src\IOUDough.Web\IOUDough.Web \Views\Home\Index.aspx Line: 16 Stack Trace: [SqlException (0x80131904): Invalid object name 'ContentItemDetails'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33 System.Data.SqlClient.SqlDataReader.get_MetaData() +86 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +311 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12 NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) +278 NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session) +264 NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +186 NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) +70 NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type) +226 [GenericADOException: could not initialize a collection: [Stormbreaker.Core.Entities.ContentItem.Details#142][SQL: SELECT details0_.ContentItem_id as ContentI1_1_, details0_.ContentDetail_id as ContentD2_1_, details0_.Name as Name1_, contentdet1_.Id as Id2_0_, contentdet1_.Name as Name2_0_, contentdet1_.StringValue as StringVa4_2_0_, contentdet1_.BoolValue as BoolValue2_0_, contentdet1_.Type as Type2_0_ FROM ContentItemDetails details0_ left outer join [ContentDetail] contentdet1_ on details0_.ContentDetail_id=contentdet1_.Id WHERE details0_.ContentItem_id=?]] NHibernate.Loader.Loader.LoadCollection(ISessionImplementor session, Object id, IType type) +345 NHibernate.Loader.Collection.CollectionLoader.Initialize(Object id, ISessionImplementor session) +27 NHibernate.Persister.Collection.AbstractCollectionPersister.Initialize(Object key, ISessionImplementor session) +29 NHibernate.Event.Default.DefaultInitializeCollectionEventListener.OnInitializeCollection(InitializeCollectionEvent event) +349 NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection collection, Boolean writing) +431 NHibernate.Collection.AbstractPersistentCollection.Initialize(Boolean writing) +47 NHibernate.Collection.Generic.PersistentGenericMap`2.System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>.GetEnumerator() +16 ASP.views_home_index_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\Projects\SVN\IOUDough\src \IOUDough.Web\IOUDough.Web\Views\Home\Index.aspx:16 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +56 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 On Sep 15, 11:55 pm, James Gregory <jagregory....@gmail.com> wrote: > Stacktrace? Where are these errors coming from? What's ContentItemsDetail? > > On 15 Sep 2010, at 22:48, marcus <mar...@meridium.se> wrote: > > > > > Yes, I downloaded the latest build but I can't get it to work. > > When I use this code .Override<ContentItem>(map => map.HasMany(x => > > x.Details)) I get Incorrect syntax near the keyword 'Key'. > > When I add .DictionaryKey("Name") I get Invalid object name > > 'ContentItemDetails' and then I'm out of ideas? > > > On Sep 15, 11:42 pm, James Gregory <jagregory....@gmail.com> wrote: > >> Have you tried? > > >> On Wed, Sep 15, 2010 at 10:06 PM, marcus <mar...@meridium.se> wrote: > > >>>http://groups.google.com/group/fluent-nhibernate/browse_thread/thread... > > >>> -- > >>> You received this message because you are subscribed to the Google Groups > >>> "Fluent NHibernate" group. > >>> To post to this group, send email to fluent-nhibern...@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2Bunsubscr > >>> i...@googlegroups.com> > >>> . > >>> For more options, visit this group at > >>>http://groups.google.com/group/fluent-nhibernate?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Fluent NHibernate" group. > > To post to this group, send email to fluent-nhibern...@googlegroups.com. > > To unsubscribe from this group, send email to > > fluent-nhibernate+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/fluent-nhibernate?hl=en. -- You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibern...@googlegroups.com. To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.