Thank you Alessandro Colantoni.
   
  I looked in to ReportQueryByCriteria
  If I have a repository.xml as below, using report query how can I return only 
the ActualObject
   
  <class-descriptor 
  class="package1.LinkObject" 
  table="Table1">
  
  <field-descriptor 
  name="fld1" 
  column="FLD1" 
  jdbc-type="INTEGER" 
  primarykey="true" 
  />
  
  <field-descriptor 
  name="fld2" 
  column="FLD2" 
  jdbc-type="INTEGER" 
  primarykey="true" 
  />   
<reference-descriptor
  name="ActualObject"
  class-ref="Package1.ActualObject"
  > 
  <foreignkey field-ref="fld1"/>
  <foreignkey field-ref="fld2"/>
  </reference-descriptor> 
  </class-descriptor> 
   
  When I use the reportQueryByCriteria how I can return only the ActualObject 
in the collection.
   
  Thanks,
  Krupa
  

Alessandro Colantoni <[EMAIL PROTECTED]> wrote:
  Hi Krupa,

If you want to have returned fields of more than one table, you have to use
the

ReportQueryByCriteria

have a look here:
http://db.apache.org/ojb/docu/guides/query.html#Report+Queries

To specify the joins the only way I use is to specify the relationship in
the repository.xml.

Anyway in the class ReportQueryByCriteria there is a method *
setJoinAttributes*
(java.lang.String[] joinAttributes)

I Hope this helps


On 11/13/07, k jee wrote:
>
> Hi All,
>
> How can I write the following query in OJB?
>
> SELECT * FROM Table1 AS t1JOIN table2 AS t2 ON t1.fld1 = t2.fld1 AND
> t1.fld2= t2.fld2 AND t1.fld3= 1
>
> Thanks,
> Krupa
>
>
> ---------------------------------
> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
> how.


       
---------------------------------
Get easy, one-click access to your favorites.  Make Yahoo! your homepage.

Reply via email to