Hi,

This is related to my last post, but not the same...

I have something like this...  A user entity with an address
component.

At the moment I am mapping both the entity and the component in one
place like this:


public UserMapping()
        {
            Table("Users");
            Id(c => c.Id).GeneratedBy.HiLo("100");
            Map(c => c.UserName).Not.Nullable().Length(64);
            Map(c => c.Email).Not.Nullable().Length(128);
            Map(c => c.Password).Not.Nullable().Length(256);
            Map(c => c.Roles).Length(64);
            Map(c => c.FirstName).Not.Nullable().Length(64);
            Map(c => c.LastName).Not.Nullable().Length(64);
            Map(c => c.BirthDate).Not.Nullable();
            //Address
            Component(x => x.Address, m =>
            {
                m.Map(x => x.AddressLine1).Not.Nullable();
                m.Map(x => x.AddressLine2);
                m.Map(x => x.City).Not.Nullable();
                m.Map(x => x.Region);
                m.Map(x => x.PostalCode).Not.Nullable();
            });
        }


I was wondering if it might be possible to define the component
(Address) column mapping in a seperate mapping file (just for the
Address value object), so that other entities could just make use of
this without mapping the columns explicity (of course in each case
address would be mapped to the entities table).  Is something like
this possible?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to