hi phil,

you select from A so ojb will return A:

>> select a.b.c from " + A.class.getName()

if you're interested in C you'l have to modify your query and adapt the criteria:

select from C where b.f.d.e = 'foo' (what a join !)

or you read your A and the navigate to C.

hth
jakob


Phil Warrick wrote:

Matthew,

A quick-and-dirty class diagram:

C 1<----->M B 1<----->M F M----->1 D
|
| (inheritance)
|
A

The arrows indicate navagability; multiplicity indicated by 1 or M. A inherits from F. e is a String attribute of D.

Don't have the mapping handy, but can send later.

Perhaps this could be translated into the equivalent using test case classes for easier discussion?

Phil


Matthew Baird wrote:

so, just so I'm clear on this...
are C and A related? is one the extent of the other? How are they mapped?
in the select a.b.c, are those attributes, or what?
need more information

-----Original Message----- From: Phil Warrick [mailto:[EMAIL PROTECTED]] Sent: Thu 2/6/2003 4:44 AM To: OJB Users List Cc: Subject: Re: OQL query help: need PB api?

Hi Matthew et al.,
It seems that this returns class A objects, not the class C objects I'm
after. Is there something else to do? Can this be done with the PB api?
Thanks,
Phil
Matthew Baird wrote:
> you can do this.
> > try binding your parameters, however
> > select ... where a.d.e =$1
> > then
> > query.bind("foo");
>
> -----Original Message-----
> From: Phil Warrick [mailto:[EMAIL PROTECTED]]
> Sent: Tue 2/4/2003 7:20 PM
> To: OJB Users List
> Cc:
> Subject: OQL query help: need PB api?
> > >
> Hi,
> > I've been able to do all my queries with OQL so far, but I think I need
> to drop down to the PB API for the following (valid OQL) query:
> > "select a.b.c from " + A.class.getName() +
> + " where a.d.e = \"foo\" "
> > (i.e. I want to return objects of the same class as the c reference:
> let's call them class C objects.)
> > Firstly, am I right that I can't do this with OJB's OQL? Second, can I
> do this with the PB? Could someone take a crack at what it would look like?
> > 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]




------------------------------------------------------------------------

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

Reply via email to