Fluent mappings not picked up when mixing mapping types

MylesRip's Avatar

MylesRip

16 Apr, 2010 06:03 PM via web

When I try mixing different types of mappings, the "FluentMappings" are not picked up. Not only are the mappings not reflected in the database that I generate from the mappings, but the fluent mappings don't get exported. (Note that I export the fluent mappings to a different directory from the auto mappings.) I'm using version 1.0.0.636. Am I doing something wrong or is this a bug?

        return Fluently.Configure() 
            .Database(persistenceConfigurer) 
            .Mappings(m => 
                {
                    m.HbmMappings.AddFromAssemblyOf<PropertyMappingOverride>();

                    m.FluentMappings.AddFromAssemblyOf<PropertyMappingOverride>().ExportTo("C:\\Temp\\hbm\\fluent");

                    m.AutoMappings.Add(
                               model.AddEntityAssembly(typeof(EntityBase).Assembly)
                               .IgnoreBase<EntityBase>()
                               .IncludeBase<AssessedItem>()
                               .Where(t => t.Namespace.EndsWith("DomainModel.Entities"))
                               .Conventions.Add<MyIdConvention>()
                               .Conventions.Add<ReferenceForeignKeyConstraintConvention>()
                               .Conventions.Add<HasManyForeignKeyConstraintConvention>()
                               .Conventions.Add(ForeignKey.EndsWith("ID"), PrimaryKey.Name.Is(x => "ID"))
                               .Conventions.Add(DefaultCascade.All())
                               .UseOverridesFromAssemblyOf<PropertyMappingOverride>()
                               ).ExportTo("C:\\Temp\\hbm\\auto");

                }) 
            .ExposeConfiguration(BuildSchema) 
            .BuildSessionFactory();
  1. Support Staff 2 Posted by James Gregory on 16 May, 2010 05:37 PM

    James Gregory's Avatar

    Are your ClassMap classes public?

  2. 3 Posted by MylesRip on 18 May, 2010 04:30 PM

    MylesRip's Avatar

    No, they weren't. Thanks!

  3. James Gregory closed this discussion on 18 May, 2010 04:38 PM.

Comments are currently closed for this discussion. You can start a new one.