I'd call it a bug mostly because the child classes do implement a
"discriminator" option, the only real problem I see, is that the
discriminator isn't being added on the query when it goes through.

Thanks for the workaround Markus, I've registered this bug in Donjon
(AR-ISSUE-260).

Cheers,
Thiago

On Jun 4, 11:39 am, DaveG <[email protected]> wrote:
> I was about to reply with the same fix using "Where" when I saw you'd
> already done it.
>
> I'm not sure it can be called a bug because I don't know if there is
> any foolproof way of working out which objects should be in which list
> if they are all in the same table. I suppose there could be a default
> behaviour that checks the type before adding it to a collection but
> the desired behaviour could vary depending on whether there were other
> types deriving from photo and map which needed to be included, and
> this could get confused if for example map derived from photo. I guess
> in these cases we could say use a single collection and sort it out
> yourself :-)
>
> Dave.
>
> On Jun 4, 1:15 pm, Markus Zywitza <[email protected]> wrote:
>
> > Out of my head, I cannot say whether it is an AR or NH bug. Usage
> > seems ok. Workaround is using the Where-property as shown below.
>
> > Please open a Donjon-issue on this.
>
> > -Markus
>
> >        [HasMany(typeof(Photo), Table="Image", ColumnKey="CountryId",
> > Inverse=true,
> >            Cascade=ManyRelationCascadeEnum.AllDeleteOrphan,
> > Where="ImageType='Photo'"
> > )]
> >        public IList<Photo> PhotoList
> >        {
> >            get { return m_photoList; }
> >            set { m_photoList = value; }
> >        }
>
> >        [HasMany(typeof(Map), Table="Image", ColumnKey="CountryId",
> > Inverse=true,
> >            Cascade=ManyRelationCascadeEnum.AllDeleteOrphan,
> > Where="ImageType='Map'"
> > )]
> >        public IList<Map> MapList
> >        {
> >            get { return m_mapList; }
> >            set { m_mapList = value; }
> >        }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to