As far as I've been able to to tell my mapping is correct.
I can also map each of those columns separately.

Here is the full error that I'm getting:

FluentNHibernate.Cfg.FluentConfigurationException occurred
  Message="An invalid or incomplete configuration was used while
creating a SessionFactory. Check PotentialReasons collection, and
InnerException for more detail.\r\n\r\n  * Database was not configured
through Database method.\r\n"
  Source="FluentNHibernate"
  StackTrace:
       at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory
()
       at SharpArch.Data.NHibernate.NHibernateSession.Init
(ISessionStorage storage, String[] mappingAssemblies,
AutoPersistenceModel autoPersistenceModel, String cfgFile,
IDictionary`2 cfgProperties, String validatorCfgFile)
       at SharpArch.Data.NHibernate.NHibernateSession.Init
(ISessionStorage storage, String[] mappingAssemblies,
AutoPersistenceModel autoPersistenceModel, String cfgFile)
       at Edc2SharpDemo.Tests.Data.NHibernateMaps.DatabaseTests.SetUp
() in C:\code\Edc2SharpDemo\tests\Edc2SharpDemo.Tests
\Edc2SharpDemo.Data\NHibernateMaps\DatabaseTests.cs:line 19
  InnerException: System.Collections.Generic.KeyNotFoundException
       Message="The given key was not present in the dictionary."
       Source="mscorlib"
       StackTrace:
            at System.ThrowHelper.ThrowKeyNotFoundException()
            at System.Collections.Generic.Dictionary`2.get_Item(TKey
key)
            at NHibernate.Cfg.Configuration.Mapping.GetPersistentClass
(String className)
            at NHibernate.Cfg.Configuration.Mapping.GetIdentifierType
(String className)
            at NHibernate.Type.EntityType.GetIdentifierType(IMapping
factory)
            at NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType
(IMapping factory)
            at NHibernate.Type.ManyToOneType.GetColumnSpan(IMapping
mapping)
            at NHibernate.Type.CompositeCustomType.GetColumnSpan
(IMapping mapping)
            at NHibernate.Mapping.SimpleValue.IsValid(IMapping
mapping)
            at NHibernate.Mapping.Property.IsValid(IMapping mapping)
            at NHibernate.Mapping.PersistentClass.Validate(IMapping
mapping)
            at NHibernate.Mapping.SingleTableSubclass.Validate
(IMapping mapping)
            at NHibernate.Cfg.Configuration.Validate()
            at NHibernate.Cfg.Configuration.BuildSessionFactory()
            at
FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
       InnerException:


On Jun 15, 9:58 am, George Mauer <[email protected]> wrote:
> Sorry again, but I just can't seem to find a good example of this
> anywhere.
> I created a QuantityUserType : ICompositeUserType and am trying to map
> it and am running into problems knowing which columns to use.
>
> My thought from an exploration of the interface is that it would be
> something like this:
>
> var quatityType = s.Map(x =>
> x.TargetQuantity).CustomTypeIs<QuantityType>();
> quatityType.ColumnNames.Add("TARGET_QTY", "UOM_ID");
>
> but this is giving me a .KeyNotFoundException during session factory
> configuration.  How am I supposed to do this mapping?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to