I second the above - I have exactly the same issue and if the patch
could be applied this would be great.
Many thanks

On Apr 8, 1:06 am, James <james.freiwi...@gmail.com> wrote:
> James: Please could you apply Martin's patch to the trunk. Thanks!
>
> On Mar 27, 11:24 am, James Gregory <jagregory....@gmail.com> wrote:
>
>
>
> > Ah! Great catch. That interface was retrospectively added to the standard
> > JoinedSubClassPart when I added the conventions (before that there wasn't an
> > interface at all), so I obviously completely forgot about the automapping
> > side.
>
> > On Fri, Mar 27, 2009 at 10:19 AM, Martin Hornagold <
>
> > martin.hornag...@marstangroup.com> wrote:
> > >  James,
>
> > > Followed the mapping through the debugger today.
>
> > > As I am using automapping, my joinedsubclassis an AutoJoinedSubClassPart.
>
> > > This only implements IMappingPart and not IJoinedSubclass currently which
> > > means theconventionis not applied.
>
> > > Here is a patch to fix. Would be grateful if you could apply it to the
> > > trunk
>
> > > Martin
>
> > > *From:* fluent-nhibernate@googlegroups.com [mailto:
> > > fluent-nhibern...@googlegroups.com] *On Behalf Of *Martin Hornagold
> > > *Sent:* 25 March 2009 12:55
>
> > > *To:* fluent-nhibernate@googlegroups.com
> > > *Subject:* [fluent-nhib] Re: IJoinedSubClassConvention never called
>
> > > Person is a class as I have set my IsBaseType to be either
> > > BaseEntityWithTypedId <> or BsaeEntity
>
> > > Author should be a JoinedSubClass.
>
> > > The AutoMapper correctly maps Person as a class and Author as a
> > > JoinedSubclass when I output the mappings.
>
> > > *From:* fluent-nhibernate@googlegroups.com [mailto:
> > > fluent-nhibern...@googlegroups.com] *On Behalf Of *James Gregory
> > > *Sent:* 25 March 2009 12:11
> > > *To:* fluent-nhibernate@googlegroups.com
> > > *Subject:* [fluent-nhib] Re: IJoinedSubClassConvention never called
>
> > > Hmm, are these definitely joined-subclasses and not regular subclasses?
>
> > > On Wed, Mar 25, 2009 at 12:04 PM, Martin Hornagold <
> > > martin.hornag...@marstangroup.com> wrote:
>
> > > James,
>
> > > The only other thing of note is that my initial description of the
> > > inheritance hierarchy is slightly lacking.
>
> > >  I have my own Base classes which inherit from EntityWithTypedId from 
> > > S#arp
> > > so the actual inheritance hierarchy is as follows:
>
> > > SharpArch.Core.EntityWithTypedId<T>
>
> > >     |
>
> > > BaseEntityWithTypedId<T>
>
> > >     |
>
> > > BaseEntity : BaseEntityWithTypedId<int>
>
> > >     |
>
> > > Person
>
> > >     |
>
> > > Author
>
> > > Martin
>
> > > *From:* fluent-nhibernate@googlegroups.com [mailto:
> > > fluent-nhibern...@googlegroups.com] *On Behalf Of *Martin Hornagold
> > > *Sent:* 25 March 2009 11:58
>
> > > *To:* fluent-nhibernate@googlegroups.com
> > > *Subject:* [fluent-nhib] Re: IJoinedSubClassConvention never called
>
> > > James,
>
> > > Just tried adding theconventionexplicitly to rule out a discovery problem
> > > and it still never gets called.
>
> > > Martin
>
> > > *From:* fluent-nhibernate@googlegroups.com [mailto:
> > > fluent-nhibern...@googlegroups.com] *On Behalf Of *James Gregory
> > > *Sent:* 25 March 2009 11:25
> > > *To:* fluent-nhibernate@googlegroups.com
> > > *Subject:* [fluent-nhib] Re: IJoinedSubClassConvention never called
>
> > > Hey Martin,
>
> > > Could you show me yourconventioncode, and how you're adding them?
>
> > > I've just written a test that verifies that joinedsubclassconventions do
> > > get applied, so I think you've either got it setup wrong, or you've hit a
> > > bug I haven't been able to replicate.
>
> > > My test is this:
>
> > > [Test]
>
> > > public void ShouldApplyJoinedSubclasses()
>
> > > {
>
> > >     new MappingTester<ExampleClass>()
>
> > >         .Conventions(x => x.Add<ExampleJoinedSubclassConvention>())
>
> > >         .ForMapping(m => m.JoinedSubClass<ExampleInheritedClass>("test", 
> > > m2
> > > => { }))
>
> > >         .Element("class/joined-subclass").HasAttribute("test", "true");
>
> > > }
>
> > > private class ExampleJoinedSubclassConvention : IJoinedSubclassConvention
>
> > > {
>
> > >     public bool Accept(IJoinedSubclass target)
>
> > >     {
>
> > >         return true;
>
> > >     }
>
> > >     public void Apply(IJoinedSubclass target)
>
> > >     {
>
> > >         target.SetAttribute("test", "true");
>
> > >     }
>
> > > }
>
> > > On Tue, Mar 24, 2009 at 10:28 AM, Martin Hornagold <
> > > martin.hornag...@marstangroup.com> wrote:
>
> > > FYI, I just tried removing the override and it still never gets called.
>
> > > -----Original Message-----
> > > From: fluent-nhibernate@googlegroups.com
> > > [mailto:fluent-nhibern...@googlegroups.com] On Behalf Of Martin
> > > Sent: 24 March 2009 10:15
> > > To: Fluent NHibernate
> > > Subject: [fluent-nhib] IJoinedSubClassConvention never called
>
> > > Hi,
>
> > > I have the following class structure:
>
> > > BaseEntity
> > >      |
> > > Person
> > >      |
> > > Author
>
> > > The mapping all works out perfectly, Person is mapped as a class with
> > > the Id inherited from the base class, and Author is set as a
> > > JoinedSubClass.
> > > The problem is that my project has aconventionof pluralised table
> > > names.
> > > My classconventionis called to pluralise Person, but my
> > > JoinedSubClassconventionnever gets called when running through the
> > > debugger.
> > > I have an override class for person to set a component, but this
> > > shouldn't affect the JoinedSubClassconventionshould it?
> > > Has anyone else successfully used IJoinedSubClassConvention?- Hide quoted 
> > > text -
>
> - Show quoted text -

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