I think I've spotted a bug. Could you show me your entities so I can try to
reproduce it? Your mappings look fine, I just need to know how the entities
tie together.

On Tue, Aug 25, 2009 at 9:56 PM, Everett Muniz <[email protected]>wrote:

> Hey James
>
> I've updated to the most recent binaries (#576).  Using the most recent
> binaries and the mapping below, my unit tests pass.
>     public class ColorSourceMapping : ClassMap<ColorSource>
>     {
>         public ColorSourceMapping()
>         {
>             Table("ColorSource");
>             Id(typeof(Guid), "ID");
>             Not.LazyLoad();
>             JoinedSubClass<ConstantColorSource>("ID", s =>
>             {
>                 s.Table("ConstantColorSource");
>                 s.Map(x => x.Alpha);
>                 s.Map(x => x.Blue);
>                 s.Map(x => x.Green);
>                 s.Map(x => x.Red);
>             });
>             JoinedSubClass<SubstringColorSource>("ID", s =>
>             {
>                 s.Table("SubstringColorSource");
>                 s.Map(x => x.Length);
>                 s.Map(x => x.Start);
>                 s.References(x => x.RecordAccessor)
>                     .Column("RecordAccessorID")
>                     .Cascade.All();
>                 s.References(x => x.ColorMap)
>                     .Column("ColorMapID");
>             });
>         }
>     }
>
> Using the exact same binaries referenced above and the mappings shown below
> I get an exception.  The text of the error follows after the mapping.
>
>     public class SubstringColorSourceMapping :
> FluentNHibernate.Mapping.SubclassMap<SubstringColorSource>
>     {
>         public SubstringColorSourceMapping()
>         {
>             Table("SubstringColorSource");
>             KeyColumn("ID");
>             Map(x => x.Length);
>             Map(x => x.Start);
>             References(x => x.RecordAccessor)
>                 .Column("RecordAccessorID")
>                 .Cascade.All();
>             References(x => x.ColorMap)
>                 .Column("ColorMapID");
>         }
>     }
>
>     public class ConstantColorSourceMapping :
> FluentNHibernate.Mapping.SubclassMap<ConstantColorSource>
>     {
>         public ConstantColorSourceMapping()
>         {
>             Table("ConstantColorSource");
>             KeyColumn("ID");
>             Map(x => x.Alpha);
>             Map(x => x.Blue);
>             Map(x => x.Green);
>             Map(x => x.Red);
>         }
>     }
>
>     public class ColorSourceMapping : ClassMap<ColorSource>
>     {
>         public ColorSourceMapping()
>         {
>             Table("ColorSource");
>             Id(typeof(Guid), "ID");
>             Not.LazyLoad();
>         }
>     }
>
> The error I'm getting is:
>
> TestCase 'should_not_delete_ColorMap_when_deleted'
> failed: 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.
> TearDown : System.Reflection.TargetInvocationException : Exception has been
> thrown by the target of an invocation.
>   ----> System.NullReferenceException : Object reference not set to an
> instance of an object.
> d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs(119,0):
> at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
>  C:\Documents and
> Settings\developer\Desktop\VersiLabel\source\Testing\nhibernate_fixture.cs(101,0):
> at GBS.VersiLabel.Testing.nhibernate_fixture.buildConfiguration()
>  C:\Documents and
> Settings\developer\Desktop\VersiLabel\source\Testing\nhibernate_fixture.cs(79,0):
> at GBS.VersiLabel.Testing.nhibernate_fixture.Test_Setup()
>  --NullReferenceException
> d:\Builds\FluentNH\src\FluentNHibernate\SeparateSubclassVisitor.cs(103,0):
> at FluentNHibernate.SeparateSubclassVisitor.SortByDistanceFrom(Type
> parentType, IEnumerable`1 providers)
>  d:\Builds\FluentNH\src\FluentNHibernate\SeparateSubclassVisitor.cs(32,0):
> at FluentNHibernate.SeparateSubclassVisitor.FindClosestSubclasses(Type type)
>  d:\Builds\FluentNH\src\FluentNHibernate\SeparateSubclassVisitor.cs(54,0):
> at
> FluentNHibernate.SeparateSubclassVisitor.ProcessJoinedSubclass(JoinedSubclassMapping
> mapping)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\ClassBased\JoinedSubclassMapping.cs(22,0):
> at
> FluentNHibernate.MappingModel.ClassBased.JoinedSubclassMapping.AcceptVisitor(IMappingModelVisitor
> visitor)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\DefaultMappingModelVisitor.cs(147,0):
> at
> FluentNHibernate.MappingModel.DefaultMappingModelVisitor.Visit(ISubclassMapping
> subclassMapping)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\ClassBased\ClassMappingBase.cs(26,0):
> at
> FluentNHibernate.MappingModel.ClassBased.ClassMappingBase.AcceptVisitor(IMappingModelVisitor
> visitor)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\ClassBased\ClassMapping.cs(72,0):
> at
> FluentNHibernate.MappingModel.ClassBased.ClassMapping.AcceptVisitor(IMappingModelVisitor
> visitor)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\DefaultMappingModelVisitor.cs(102,0):
> at
> FluentNHibernate.MappingModel.DefaultMappingModelVisitor.Visit(ClassMapping
> classMapping)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\MappingModel\HibernateMapping.cs(38,0):
> at
> FluentNHibernate.MappingModel.HibernateMapping.AcceptVisitor(IMappingModelVisitor
> visitor)
>  d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs(149,0): at
> FluentNHibernate.PersistenceModel.ApplyVisitors(IEnumerable`1 mappings)
> d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs(115,0): at
> FluentNHibernate.PersistenceModel.BuildMappings()
>  d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs(154,0): at
> FluentNHibernate.PersistenceModel.EnsureMappingsBuilt()
> d:\Builds\FluentNH\src\FluentNHibernate\PersistenceModel.cs(166,0): at
> FluentNHibernate.PersistenceModel.WriteMappingsTo(String folder)
>  
> d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentMappingsContainer.cs(116,0):
> at FluentNHibernate.Cfg.FluentMappingsContainer.Apply(Configuration cfg)
>  d:\Builds\FluentNH\src\FluentNHibernate\Cfg\MappingConfiguration.cs(56,0):
> at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg)
>  d:\Builds\FluentNH\src\FluentNHibernate\Cfg\FluentConfiguration.cs(110,0):
> at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
> --TearDown
>  at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
> arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
> RuntimeTypeHandle typeOwner)
>  at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
> arguments, Signature sig, MethodAttributes methodAttributes,
> RuntimeTypeHandle typeOwner)
>  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
> skipVisibilityChecks)
>  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
> invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> at NUnit.Core.TestMethod.doTearDown(TestResult testResult)
>  --NullReferenceException
> C:\Documents and
> Settings\developer\Desktop\VersiLabel\source\Testing\nhibernate_fixture.cs(89,0):
> at GBS.VersiLabel.Testing.nhibernate_fixture.Test_Tear_Down()
>
>
> Am I doing something wrong or do you think the problem could be elsewhere?
>
>
> >
>

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