You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Jim Moore <ji...@veritas.com> on 2003/08/01 02:27:26 UTC

Outer joins

In OJB 1.0RC4 I can't figure out how to get outer joins to work.
 
Below the rest of my email I've included a simplified version of my XML:
 
In other words, I have a Task that has a status and may-or-may-not have a
resolution (ie, nullable="true").
 
When I construct a ReportQuery where the return columns are ["taskName",
"aTaskStatus.desc", "aTaskResolution.desc"] and a criteria of ("taskId",
123) it does an inner join with the TASK_STATUS table (as it should, since
neither side can be null), but it also does an inner join with the
TASK_RESOLUTION table (which it shouldn't do since taskResolutionId for the
Task can be null).
 
I've searched through the documentation, the mailing list archives, Google,
everything I can think of, but can't find anything telling me how to get it
to work right.  I even tried forcing the issue with the setPathOuterJoin
method, which obviously I shouldn't have to do since there's plenty of
information for the engine to know that in the declaration, but even that's
not working.  I checked the docs and the DTD, but there isn't even something
I can put in the reference-descriptor to tell it "This needs an outer join."
 
Help!
 
-Jim Moore
 
---
 
<class-descriptor class="Task" table="TASK">
  <field-descriptor
    name="taskId"
    column="TASK_ID"
    jdbc-type="BIGINT"
    indexed="true"
    nullable="false"
    primarykey="true"/>
  <field-descriptor
    name="taskName"
    column="TASK_NAME"
    nullable="false"
    jdbc-type="VARCHAR"/>
  <field-descriptor
    name="taskResolutionId"
    column="TASK_RESOLUTION_ID"
    nullable="true"
    jdbc-type="BIGINT"/>
  <field-descriptor
    name="caseTaskStatusId"
    indexed="true"
    nullable="false"
    column="CASE_TASK_STATUS_ID"
    jdbc-type="BIGINT"/>
  <reference-descriptor
    name="aTaskResolution"
    class-ref="TaskResolution">
    <foreignkey field-ref="taskResolutionId"/>
  </reference-descriptor>
  <reference-descriptor
    name="aTaskStatus"
    class-ref="TaskStatus">
    <foreignkey field-ref="caseTaskStatusId"/>
  </reference-descriptor>
</class-descriptor>
 
<class-descriptor class="TaskResolution" table="TASK_RESOLUTION">
  <field-descriptor
    name="taskResolutionId"
    column="TASK_RESOLUTION_ID"
    jdbc-type="BIGINT"
    nullable="false"
    primarykey="true"/>
  <field-descriptor
    name="desc"
    column="TASK_RESOLUTION_DESC"
    nullable="false"
    jdbc-type="VARCHAR"/>
  <collection-descriptor
    name="collTask"
    element-class-ref="Task">
    <inverse-foreignkey field-ref="taskResolutionId"/>
  </collection-descriptor>
</class-descriptor>
 
<class-descriptor class="TaskStatus" table="TASK_STATUS">
  <field-descriptor
    name="taskStatusId"
    column="TASK_STATUS_ID"
    jdbc-type="BIGINT"
    nullable="false"
    primarykey="true"/>
  <field-descriptor
    name="desc"
    column="TASK_STATUS_DESC"
    nullable="false"
    jdbc-type="VARCHAR"/>
  <collection-descriptor
    name="collTask"
    element-class-ref="Task">
    <inverse-foreignkey field-ref="taskStatusId"/>
  </collection-descriptor>
</class-descriptor>