db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Gedin <frederic.ge...@Jaluna.COM>
Subject Criteria quizz
Date Fri, 14 Mar 2003 11:03:55 GMT
Hello


I am faced with a query problem:

To simplify the problem, I have three OM classes Task Worker, 
Assignment) which are generated from the following XML

  <table name="XP_TASK" javaName="Task">
    <column name       = "TASK_ID"
            primaryKey = "true"
            required   = "true"
            javaName   = "Id"
            type       = "INTEGER"/>
    <column name       = "TK_REFERENCE"
            javaName   = "Reference"
            required   = "true"
            type       = "VARCHAR"
            size       = "32" />
    <unique>
      <unique-column name="TK_REFERENCE" />
    </unique>
  </table>

  <table name="XP_WORKER" javaName="Worker">
    <column name       = "WORKER_ID"
            primaryKey = "true"
            required   = "true"
            javaName   = "Id"
            type       = "INTEGER"/>
    <column name       = "WK_FIRST_NAME"
            javaName   = "FirstName"
            required   = "true"
            type       = "VARCHAR"
            size       = "32" />
    <column name       = "WK_LAST_NAME"
            javaName   = "LastName"
            required   = "true"
            type       = "VARCHAR"
            size       = "32" />
    <column name       = "WK_INITIALS"
            javaName   = "Initials"
            required   = "true"
            type       = "VARCHAR"
            size       = "3" />
    <unique>
      <unique-column name="WK_FIRST_NAME" />
      <unique-column name="WK_LAST_NAME" />
    </unique>
    <unique>
      <unique-column name="WK_INITIALS" />
    </unique>
  </table>

  <table name="XP_ASSIGNMENT" javaName="Assignment">
    <column name       = "ASSIGNMENT_ID"
            primaryKey = "true"
            required   = "true"
            javaName   = "Id"
            type       = "INTEGER"/>
    <column name       = "TASK_ID"
            required   = "true"
            type       = "INTEGER"/>
    <column name       = "WORKER_ID"
            required   = "true"
            type       = "INTEGER"/>

    <foreign-key foreignTable="XP_TASK">
      <reference local="TASK_ID" foreign="TASK_ID"/>
    </foreign-key>
    <foreign-key foreignTable="XP_WORKER">
      <reference local="WORKER_ID" foreign="WORKER_ID"/>
    </foreign-key>
    <unique>
      <unique-column name="TASK_ID" />
      <unique-column name="WORKER_ID" />
    </unique>
   
  </table>


Now I would like to find all the tasks with no assigned worker.

How to do it?

Thank you for your help

Frederic



Mime
View raw message