You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Cesar <ce...@uol.com.br> on 2003/07/28 21:51:42 UTC
Query
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Query
Posted by Cesar <ce...@uol.com.br>.
And How i use the join?( where a.idt=b.idt and)
[ ]´s
----- Original Message -----
From: "Leandro Rodrigo Saad Cruz" <le...@ibnetwork.com.br>
To: "OJB Users List" <oj...@db.apache.org>
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
--
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Query
Posted by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br>.
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
--
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org