hi sergey,
what do the criteria look like ? do you use or-criteria ?
ojb provides a method to force an outer join, but currently there's no
way to prevent the usage of the outer join.
please post your classes, the report-query and if possible the
ddl-statements so i can try to reproduce this behaviour.
in case you want to help us to fix this bug the constructor of
SqlQueryStatement#Join is the right place to set a conditional
breakpoint (isOuter == true).
thanks
jakob
Manukyan, Sergey schrieb:
Hi Jacob,
Well, see yourself if it is a clever behavior:
Here is a simplified repository data:
<class-descriptor class="Supplier" table="SUPPLIER">
<field-descriptor name="pkField" primarykey="true" />
<field-descriptor name="fkField" />
<collection-descriptor name="allChildren"
element-class-ref="Supplier">
<inverse-foreignkey field-ref="fkField">
</collection-descriptor>
<!-- here are types I am interested to reytrieve per parent -->
<collection-descriptor name="allTypes"
element-class-ref="Type">
<inverse-foreignkey field-ref="pkField">
</collection-descriptor>
...
</class-descriptor>
And using a ReportQuery with fields:
{"pkField","allChildren.allTypes.typeDescription"}
It generates SQL:
SELECT ... FROM SUPPLIER A0 LEFT OUTER JOIN (SUPPLIER A1 INNER JOIN
TYPES A2 ON ...) ON ...
Again I am not specifying it to do LEFT OUTER JOIN for "allChildren"
relationship or any other relationship.
It does that way when:
- there are present two relations together. In case I am retrieving just
{"pkField","allChildren.pkField"} it workes correctly.
- and both sides of relationship represent same class. When children are
located in other class it also workes correctly.
To me it is an unexpected cleverness without "legal" way to disable or
control it which is kind of frustrating...
-Sergey
-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 11, 2006 1:06 PM
To: OJB Users List
Subject: Re: uses OUTER JOIN by default... --> BUG or FUNCTIONALITY ?
hi sergey,
ojb just tries to be clever ;) outer joins are created when there are
extents etc.
could you please post the relevant parts of your mapping file and the
generated sql.
jakob
Manukyan, Sergey schrieb:
After some tests found out that OJB generates LEFT OUTER JOIN instead
of
INNER JOIN in a 1:N relationship if both ends are same class.
Is that a planned functionality or a bug?
In my case I need 1:N relationship to be made from MyClass to
Collection
of MyClasses... How can I force then OJB to generate INNER JOIN in
that
case?
-Sergey
-----Original Message-----
From: Manukyan, Sergey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 10, 2006 9:00 AM
To: OJB Users List
Subject: uses OUTER JOIN by default...
Hi,
I just moved to OJB 1.0.4. One thing I noticed is that it started
generating OUTER JOIN although I didn't specify it to do so. In my
case
with ReportQuery with following columns:
String[] queryColumns = new String[] {
"allChildren.addressLine1",
"allChildren.addressLine2",
"allChildren.addressLine4",
"allChildren.addressLine5",
"allChildren.allRequisitionTypesOfSupplier.reqType"
};
It generates OUTER JOIN for "allChildren" and INNER JOIN for
"allRequisitionTypesOfSupplier" when I need only INNER JOINS.
Please advice, is it a bug or should I somehow specifically tell OJB
to
use INNER JOIN?
Thank you,
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]
---------------------------------------------------------------------
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]