Cesar --
The join is taken care of for you by ojb:
Criteria criteria = new Criteria()
criteria.addEqualTo("referenceToBClass","YourValueGoesHere");
Query query = new QueryByCriteria(MyClass,criteria);
PersistenceBroker broker = getPersistenceBroker();
Object object = broker.getObjectByQuery(query);
This example assumes that the class-descriptor for 'MyClass' includes a
reference-descriptor whose name is 'referenceToBClass'
Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]
>
> From: "Cesar" <[EMAIL PROTECTED]>
> Date: 2003/07/28 Mon PM 04:55:28 EDT
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Subject: Re: Query
>
> And How i use the join?( where a.idt=b.idt and)
>
> [ ]�s
> ----- Original Message -----
> From: "Leandro Rodrigo Saad Cruz" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Monday, July 28, 2003 5:03 PM
> Subject: Re: Query
>
>
> Using QueryByCriteria !
>
> On Mon, 2003-07-28 at 16:51, Cesar wrote:
> > People
> > I have one query
> >
> > SQL = select a.idt, a.desc from table1 a, table2 b where a.idt=b.idt and
> > b.idUser=?
> >
> > I need execute this query to recover one object, but i can�t set the bind
> > variable using the code below
> >
> > Query query = QueryFactory.newQuery(MyClass,Queries.SQL);
> > PersistenceBroker broker = getPersistenceBroker();
> > Object object = broker.getObjectByQuery(query);
> > broker.close();
> > return object;
> >
> > How I make to set the "bind" variable?
> >
> > [ ]�s
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> --
> Leandro Rodrigo Saad Cruz
> IT - Inter Business Tecnologia e Servicos (IB)
> http://www.ibnetwork.com.br
> http://db.apache.org/ojb
> http://xingu.sourceforge.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]