Hi James

Yeah you can use the joined subclass as shown below: Automapping just wont
yet magically map inheritence you have to do it manually.

 AutoPersistenceModel.MapEntitiesFromAssemblyOf<Company>()
>
                .Where(t => (t.Namespace == typeof(Company).Namespace)
>
                                .ForTypesThatDeriveFrom<Address>(map =>
>
                                                    {
>

>
>  map.JoinedSubClass<SiteAddress>("AddressId",a =>
>
{
>
a.Map(s=> s.Address1);
>
a.References(s => s.Site);
>
});
>

>  map.JoinedSubClass<ContactAddress>("AddressId",a
> =>a.ReferencesOne<Contact>(s => s.Contact,c => c.Address);
>
}).Configure(this.configuration);
>

Automapping sit's ontop of the dsl so anything you can do in the dsl you can
do using automapping. I think the question from Julian was if we supported
the mapping types he mentions, I'm not sure that we do at the moment? If we
do how would you implement them in the normal way, and I can translate to
the automap syntax for you.

Cheers

Andy

On Thu, Nov 13, 2008 at 10:37 AM, James Gregory <[EMAIL PROTECTED]>wrote:

> There is a JoinedSubClass method on the ClassMap you can use for this
> purpose, but it sounds like it isn't supported through the auto mapping yet.
>
> On Thu, Nov 13, 2008 at 9:09 AM, Andrew Stewart <
> [EMAIL PROTECTED]> wrote:
>
>> Hi Julian
>> What your talking about is actually part of the normal fluent nhibernate
>> mapping, Automap just generates the majority of the boring parts.
>>
>> Personally I just used the table per class route, as I couldn't find any
>> other way of doing it - and I wasn't that bothered about it's exact
>> implementation. I'm sure Jeremy or Chad will know the answer to whether
>> fluent nhibernate supports these other options.
>>
>> Cheers
>>
>> Andy
>>
>> On Wed, Nov 12, 2008 at 9:40 PM, Julian Birch <[EMAIL PROTECTED]>wrote:
>>
>>> Hi, I haven't posted here before, but I've been experimenting with Fluent
>>> NHibernate.  I find the auto-mapping feature very interesting, and managed
>>> to figure out how to get it to generate a schema.  (One of the best ways for
>>> me to understand what it's doing.)  It looks pretty solid, except for the
>>> scenario where classes inherit from one another.  It seems to default to
>>> table per concrete class.
>>> Some questions:
>>>
>>>    - It does not appear that there is a table per subclass or table per
>>>    class hierarchy option at the moment.  Am I correct in this?
>>>    - If so, is this something someone is working on, or should I look
>>>    into implementing it myself?
>>>
>>> Thanks in advance,
>>>
>>> Julian Birch.
>>>
>>>
>>>
>>
>>
>> --
>> =================
>> I-nnovate Software - Bespoke Software Development, uk wirral.
>> http://www.i-nnovate.net
>>
>>
>>
>
> >
>


-- 
=================
I-nnovate Software - Bespoke Software Development, uk wirral.
http://www.i-nnovate.net

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