I have concluded that the missing feature here is an OQL-style cast (to downcast the C to a D). In your opinion, would adding this feature involve a major refactoring or could it be a straightforward addition to the PB-api?
Thanks,
Phil
Philip Warrick wrote:
Hi again,
A small clarification, the query that I'd like to do is a little more complicated: find all A's with aAttribute = "foo" and having a D with dAttribute = "bar" and a C with cAttribute = "foobar".
My original query could be achieved efficiently by searching for the D's with the two criteria: d.b.a.aAttribute = "foo" AND d.dAttribute = "bar"
and then navigating to the A object(s) which should be cached.
Phil
> Hi Jakob,
>
> Thanks for this writeup.
>
> Here's an example of a query that I'd like to perform:
>
> A-1------M-B-1------M-C
> |
> /\
> --
> |
> D
>
> i.e. A has a 1-M association with B, B has a 1-M association with C and
> D is one subclass of C
>
> I'd like to query for all A's with aAttribute = "foo" having a D with
> dAttribute = "bar".
>
> Obviously I cannot use a criteria like "a.b.c.dAttribute".
>
> I can query for all the D's first, then iterate through the
> corresponding A's and check for the aAttribute, but I'd like to do this
> in one query (and let the dbms do most of the work).
>
> Sounds like a job for a subquery, but I am not sure if I can do this
> with PB queries and subqueries. Can anyone help?
>
> Phil
>
>
> Jakob Braeuchi wrote:
> > hi phil,
> >
> > i added a small docu to query.xml
> >
> > jakob
> >
> > Phil Warrick wrote:
> >
> > > Hi again,
> > >
> > > I came across some discussions with Jakob from last Sept. about
> allowing
> > > references to parents in subqueries. Did anything come of this?
> > >
> > > The reason I'm asking is that after six months of using OJB in
> > > production to get data into the system (ojb has been rock solid!)
> it's
> > > time for many, many complex queries to get data out (similar to
> Oliver
> > > Matz's queries:
> > >
> >
> http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213 <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213>
> <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213 <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213>>
>
> >
> <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213
> <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213 <http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1005213>>>).
>
> >
> > > I'm a bit concerned that I'm going to have to resort to raw SQL.
> > >
> > > Thanks,
> > >
> > > Phil
> > >
> > > Phil Warrick wrote:
> > >
> > >> Hi all,
> > >>
> > >> I was wondering if someone could write up something to explain
> the use
> > >> of subqueries. I'm deciphering the relevant PB test cases at the
> > >> moment and can probably figure it out, but it looks like an
> important
> > >> gap in the documentation.
> > >>
> > >> Thanks,
> > >>
> > >> Phil
> > >>
> > >>
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
