You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by michael shek sia lim <mi...@eigentechnology.com> on 2002/11/26 07:07:42 UTC

multiple tables ...

Hi,

The example given in TDK has one table in it. Does one have to write
complete new code if one has more than one to work with? Given the Java
code coming out of "ant compile" works with one table at a time only...

/org/mycompany/eigen/modules/screens/Form.java


public void doBuildTemplate( RunData data, Context context )
{
 try
    {
     int entry_id = data.getParameters().getInt("id");
     Criteria criteria = new Criteria();
     criteria.add(InvoiceitemPeer.ID, entry_id);
     Invoiceitem invoiceitem =
(Invoiceitem)InvoiceitemPeer.doSelect(criteria).elementAt(0);
     Invoice invoice =
(Invoice)InvoicePeer.doSelect(criteria).elementAt(0);
     context.put("entry", invoiceitem);
     }
 catch (Exception e)
    {
     // log something ?
 }
}

best wishes
michael lim













--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: multiple tables ...

Posted by michael shek sia lim <mi...@eigentechnology.com>.
I think I have got it working ...

thanks for any potential help
michael



> Hi,
>
> The example given in TDK has one table in it. Does one have to write
> complete new code if one has more than one to work with? Given the Java
> code coming out of "ant compile" works with one table at a time only...
>
> /org/mycompany/eigen/modules/screens/Form.java
>
>
> public void doBuildTemplate( RunData data, Context context )
> {
>  try
>     {
>      int entry_id = data.getParameters().getInt("id");
>      Criteria criteria = new Criteria();
>      criteria.add(InvoiceitemPeer.ID, entry_id);
>      Invoiceitem invoiceitem =
> (Invoiceitem)InvoiceitemPeer.doSelect(criteria).elementAt(0);
>      Invoice invoice =
> (Invoice)InvoicePeer.doSelect(criteria).elementAt(0);
>      context.put("entry", invoiceitem);
>      }
>  catch (Exception e)
>     {
>      // log something ?
>  }
> }
>
> best wishes
> michael lim




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>