Also, is there a way to have the JoinedSubClass not be included in the query? Especially, when I am not asking for the sub class entities.
Bryan On Mar 2, 1:05 am, James Gregory <[email protected]> wrote: > Your design seems a little strange, why are you mapping everything as > joined-subclasses under DomainEntity? It's more sensible to map everything > individually. > > > > On Mon, Mar 2, 2009 at 7:38 AM, BringerOD <[email protected]> wrote: > > > Here is my mappings. > > > When I select a DomainEntity it tries to retrieve all data. > > > All I want tis the DomainEntity. > > > Any suggestions? > > > public DomainEntityMap() > > { > > WithTable("DomainEntity"); > > > Id(x => x.Id, "EntityID") > > .WithUnsavedValue(0) > > .GeneratedBy.Identity(); > > > Map(x => x.CreatedDate); > > Map(x => x.ModifiedDate); > > > References(x => x.Company); > > References(x => x.CreatedBy); > > References(x => x.ModifiedBy); > > > JoinedSubClass("EntityID", PersonMap()); > > JoinedSubClass("EntityID", FileMap()); > > JoinedSubClass("EntityID", CompanyMap()); > > } > > > private static Action<AutoJoinedSubClassPart<Person>> PersonMap > > () > > { > > return (js => > > { > > js.Component(cm => cm.Name, NameMap()); > > js.Component(cm => cm.HomeEmail, EmailMap > > ("HomeEmail")); > > js.Component(cm => cm.WorkEmail, EmailMap > > ("WorkEmail")); > > js.Component(cm => cm.HomePhone, PhoneMap > > ("HomePhone")); > > js.Component(cm => cm.WorkPhone, PhoneMap > > ("WorkPhone")); > > > js.JoinedSubClass("EntityID", UserMap()); > > }); > > } > > > private static Action<AutoJoinedSubClassPart<Company>> > > CompanyMap() > > { > > return (js => > > { > > js.Map(x => x.Name); > > > }); > > } > > > private static Action<AutoJoinedSubClassPart<File>> FileMap() > > { > > return (js => > > { > > js.WithTableName("FileData"); > > js.Map(x => x.FileName); > > js.Map(x => x.FileData); > > js.Map(x => x.ContentType); > > > }); > > } > > > private static Action<AutoJoinedSubClassPart<User>> UserMap() > > { > > return (js => > > { > > js.WithTableName("UserData"); > > js.Map(x => x.UserName); > > js.Map(x => x.Password); > > }); > > } > > > private static Action<ComponentPart<Name>> NameMap() > > { > > return c => > > { > > c.Map(x => x.FirstName); > > c.Map(x => x.MiddleName); > > c.Map(x => x.LastName); > > c.Map(x => x.Salutation); > > c.Map(x => x.Suffix); > > c.Map(x => x.Title); > > }; > > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
