Esteban,

I didn't know about the #isVoyageRoot difference based on where was the
method defined.

I mean... if I define
Member class>>#isVoyageRoot
    ^true

why sould SingleMember answer false?

Do I have to redefine it to answer false in each of Member subclasses?

Regards!





Esteban A. Maringolo


2013/9/10 Esteban Lorenzano <[email protected]>

> Hi,
>
> what happens is that if you declare a "kind", you forces all elements to
> be of that specific class.
> Solution is just not add that property:
>
> <mongoDescription>
>         ^VOMongoToManyDescription new
>                 attributeName: 'members';
>                 accessor: #members;
>                 "kind: Member; "
>      "<-- NO!"
>                 beLazy;
>                 yourself.
>
> And same happens in the <mongoContainer> description in the top of your
> hierarchy... you must NOT declare a kind.
> Also, if you want all members to go in just one collection. #isVoyageRoot
> has to be implemented in the top of the hierarchy and not in the subclasses
>
> Member
>      "<-- #isVoyageRoot = true here!"
>         SingleMember
>         ComplexMember
>
> what happens then is that voyage will create a collection and for each
> document it stores in it will also store the attribute '#instanceOf', which
> will be used to retrieve the correct object.
>
> Esteban
>
>
> what happens then is that
>
> On Aug 31, 2013, at 12:53 AM, Esteban A. Maringolo <[email protected]>
> wrote:
>
> > More or less, I have this working.
> >
> > In the Group class I have a description named:
> > descriptionMembers
> > <mongoDescription>
> > ^VOMongoToManyDescription new
> > attributeName: 'members';
> > accessor: #members;
> > kind: Member;
> > beLazy;
> > yourself
> >
> >
> > And in the Member class I have
> > descriptionGroups
> > <mongoDescription>
> > ^VOMongoToManyDescription new
> >      attributeName: 'groups';
> >      accessor: #groups;
> >      kind: Group;
> >      beLazy;
> >      yourself
> >
> >
> >
> > But what if Member is an abstract class and the elements can be any of
> > SingleMember or ComplexMember?, each one is stored in a separate
> > collection in Mongo.
> >
> > If I do specify #kind: Member in my #descriptionMembers it won't work.
> >
> > Any ideas?
> >
> > Regards,
> >
> >
> > Esteban A. Maringolo
> >
> >
> > 2013/8/30 Esteban A. Maringolo <[email protected]>:
> >> 2013/8/30 James Foster <[email protected]>:
> >>> It seems that I mistook the question for something easy enough for me
> to answer! Unfortunately, I don't have any knowledge of Voyage+MongoDB so
> can't really give the proper answer.
> >>
> >> Thanks anyway, it is a problem you'll never find in GemStone/S ;-)
> >
>
>
>

Reply via email to