I did some fixes yesterday for subclasses, you might want to try updating to
the latest binaries and see if they have any effect.
There shouldn't be any reason you can't mix-and-match the two styles. I
wouldn't recommend it, but it should still work. I'll investigate why this
is.

On Wed, Aug 26, 2009 at 9:26 PM, Jason Dentler <[email protected]>wrote:

>
> I ran in to two issues when upgrading from an older version of FNH to
> v1 RC. I'm hoping by advertising them here, I can save a few people
> from the same headaches.
>
> First, the new deprecated JoinedSubClass ignores an empty subclasses.
> I had two entities that inherit from the same base type. They don't
> have properties of their own, only a few overridden methods. These
> weren't included in the mapping until I switched to SubclassMap.
>
> Second, you will get an incomplete configuration exception with a
> NullReferenceException inside when you have a mix of SubclassMap and
> JoinedSubClass. It's an all-or-nothing upgrade. I rolled back my code
> changes a few times thinking I was using SubclassMap incorrectly,
> before I finally just went for it. Evidently, JoinedSubClass messes up
> some internal state used by SubclassMap.
>
> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
>  ---> System.NullReferenceException: Object reference not set to an
> instance of an object.
>   at FluentNHibernate.SeparateSubclassVisitor.SortByDistanceFrom(Type
> parentType, IEnumerable`1 providers)
>   at FluentNHibernate.SeparateSubclassVisitor.FindClosestSubclasses
> (Type type)
>   at FluentNHibernate.SeparateSubclassVisitor.ProcessJoinedSubclass
> (JoinedSubclassMapping mapping)
>   at
>
> FluentNHibernate.MappingModel.ClassBased.JoinedSubclassMapping.AcceptVisitor
> (IMappingModelVisitor visitor)
>   at FluentNHibernate.MappingModel.DefaultMappingModelVisitor.Visit
> (ISubclassMapping subclassMapping)
>   at
> FluentNHibernate.MappingModel.ClassBased.ClassMappingBase.AcceptVisitor
> (IMappingModelVisitor visitor)
>   at
> FluentNHibernate.MappingModel.ClassBased.ClassMapping.AcceptVisitor
> (IMappingModelVisitor visitor)
>   at FluentNHibernate.MappingModel.DefaultMappingModelVisitor.Visit
> (ClassMapping classMapping)
>   at FluentNHibernate.MappingModel.HibernateMapping.AcceptVisitor
> (IMappingModelVisitor visitor)
>   at FluentNHibernate.PersistenceModel.ApplyVisitors(IEnumerable`1
> mappings)
>   at FluentNHibernate.PersistenceModel.BuildMappings()
>   at FluentNHibernate.PersistenceModel.EnsureMappingsBuilt()
>   at FluentNHibernate.PersistenceModel.WriteMappingsTo(String folder)
>   at FluentNHibernate.Cfg.FluentMappingsContainer.Apply(Configuration
> cfg)
>   at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration
> cfg)
>   at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
>   --- End of inner exception stack trace ---
>   at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
>   at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
>
>
>   --- End of inner exception stack trace ---
>   at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
>
>
> Thanks,
> Jason
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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