Hi Jacob,

Every relation is defined. But in the report queries I can only specify
the columns in String[] {}, I wish I could specify the queries as well
and pass it in Object[] {}, just like it is done for Criteria methods.
F.e :

Query qB = QueryFactory.newReportQuery(B.class); // SELECT COUNT(*) FROM
B
Query qC = QueryFactory.newReportQuery(C.class); // SELECT AVG(C.FF)
FROM C
Query qD = QueryFactory.newReportQuery(D.class); // SELECT MAX(D.FFF)
FROM D

ReportQueryByCriteria q = QueryFactory.newReportQuery(A.class);

q.setAttributes(
new Object[] {
        "F",
        qB,
        qC,
        qD
}
)

Is this functionality is planned in the roadmap of OJB?

-Sergey







-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 31, 2006 3:53 PM
To: OJB Users List
Subject: Re: solution for subqueries returning values

hi sergey,

this looks like a report query to me. do you have relationships defined 
between A, B, C, D ?

jakob

Manukyan, Sergey schrieb:
> Folks,
> 
> Could you please advice an OJB solution for this SQL query:
> 
> SELECT
>       A.F,
>       (SELECT COUNT(*) FROM B INNER JOIN A ON A.F = B.F),
>       (SELECT AVG(C.FF) FROM C INNER JOIN A ON A.F = C.F),
>       (SELECT MAX(D.FFF) FROM D INNER JOIN A ON A.F = D.F)
> FROM
> 
>       A
> 
> 
> The OJB subqueries mechanism doesn't work in this case or... am I
> missing anything?
> 
> 
> -Sergey
> 
> 
> 
> 
> **********************
> ** LEGAL DISCLAIMER **
> **********************
> 
> This E-mail message and any attachments may contain
> 
> legally privileged, confidential or proprietary
> 
> information. If you are not the intended recipient(s),
> or the employee or agent responsible for delivery of
> 
> this message to the intended recipient(s), you are
> 
> hereby notified that any dissemination, distribution
> 
> or copying of this E-mail message is strictly
> 
> prohibited. If you have received this message in
> 
> error, please immediately notify the sender and
> 
> delete this E-mail message from your computer.
> 
> ---------------------------------------------------------------------
> 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