I have two classes, Person and Adress.

  <class-descriptor class="Person"  table="PERSON_TABLE">
      <field-descriptor id="1" name="firstname" column="FIRSTNAME_TXT"
jdbc-type="VARCHAR" primarykey="true"  nullable="false" />
      <field-descriptor id="2" name="name" column="NAME_TXT" jdbc-type
="VARCHAR" primarykey="true" nullable="false"/>
      <collection-descriptor name="adresses" element-class-ref="Adress"
auto-delete="true">
        <inverse-foreignkey field-id-ref="2"/>
        <inverse-foreignkey field-id-ref="3"/>
      </collection-descriptor>
  </class-descriptor>

  <class-descriptor class="Adress" table="ADRESS_TABLE">
      <field-descriptor id="1" name="street" column="STREET_TXT" jdbc-type
="VARCHAR" primarykey="true" nullable="false"/>
      <field-descriptor id="2" name="person_vname" column
="PERSON_FIRSTNAME" jdbc-type="VARCHAR" />
      <field-descriptor id="3" name="person_nname" column="PERSON_NAME"
jdbc-type="VARCHAR"/>
  </class-descriptor>


I want to query all persons without a adress and get following
SQL-Statement:

SELECT DISTINCT A0.FIRSTNAME_TXT,A0.NAME_TXT,A0 FROM PERSON_TABLE A0 WHERE
adresses IS NULL

This isn't correct, in the table PERSON_TABLE is no column adresses.

Criteria criteria = new Criteria();
criteria.addIsNull("adresses");
Collection ret = pb.getCollectionByQuery(new QueryByCriteria(Person.class,
criteria, false));

How could I fix this problem?
Thanks
Andy


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to