Yes, I did and it works, but when I exclude one of the hbm files and
include fluent class, it complains that that class has not been
mapped:
"An association from the table dnnSphere_Package refers to an unmapped
class: dnnSphere.Meta.Model.MetaProject"
where MetaProject is class mapped using Fluent.

like this

 public class MetaProjectMap : ClassMap<MetaProject>
    {
        public MetaProjectMap()
        {
            DefaultAccess.AsCamelCaseField(Prefix.Underscore);
            Id(x => x.ID).Access.AsLowerCaseField(Prefix.Underscore);
            Map(x => x.name).ColumnName("Name").Unique().Not.Nullable
().WithLengthOf(50);
            Map(x => x.description).ColumnName
("Description").WithLengthOf(50);
            HasMany<MetaPackage>(x => x.metaPackages).WithTableName
("dnnSphere_Package").WithKeyColumn("Project_ID")
                .Inverse().LazyLoad().Cascade.AllDeleteOrphan()
                .SetAttribute("collection-type",
"dnnSphere.NHibernate.Collections.PersistentBagType`1
[[dnnSphere.Meta.Model.MetaPackage, dnnSphere.Meta]],
dnnSphere.NHibernate.Collections");
        }
    }

On Mar 1, 11:31 am, James Gregory <[email protected]> wrote:
> That should work. Have you tested your config without Fluent?
>
> On 3/1/09, epitka <[email protected]> wrote:
>
>
>
> > Ok I can do it like this
>
> >   Configuration cfg = LoadDefaultConfiguration();
> >                 _sessionFactory = Fluently.Configure
> > (cfg).BuildSessionFactory();
>
> > but how do I add mapping assembly. Any ideas? nhibernate.config has
> > mapping tag but is does not seem to work.
>
> > On Mar 1, 8:38 am, epitka <[email protected]> wrote:
> >> hi,
> >> Is there a way to load nhibernate.config directly through fluent? I
> >> have a common assembly that I use for all NH project that deals with
> >> sessions, config etc. Now I would like to be able to map entities
> >> using Fluent but configure using normal nhibernate.config. Why? Well
> >> for one in this line for example I don't know the assembly name, it is
> >> specified in nhibernate.config.
> >> .Mappings(m =>
> >>       m.FluentMappings.AddFromAssemblyOf<Program>())
--~--~---------~--~----~------------~-------~--~----~
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