AW: query problem

From: Michael Schuldt (m..scensys.de)
Date: Fri Mar 12 2004 - 17:52:57 EST

  • Next message: Andrus Adamchik: "Re: AW: query problem"

    Sorry, but I can't find a method like "fromString"? Where can I find it?

    > -----Ursprüngliche Nachricht-----
    > Von: Eric Schneider [mailto:eri..entralparksoftware.com]
    > Gesendet: Freitag, 12. März 2004 16:02
    > An: cayenne-use..bjectstyle.org
    > Betreff: Re: query problem
    >
    >
    > Michael,
    >
    > I would think you could use the string expression API.
    >
    > Expression.fromString("status = $param1 and current_stock <
    > (least_decrease
    > * capacitySU)").
    >
    > Hope that helps,
    > Eric
    >
    > ----- Original Message -----
    > From: "Michael Schuldt" <m..scensys.de>
    > To: <cayenne-use..bjectstyle.org>
    > Sent: Friday, March 12, 2004 9:46 AM
    > Subject: query problem
    >
    >
    > > Hi,
    > >
    > > situation as follwos:
    > >
    > > I've got a table "tb_offer" with the follwoing fields:
    > > - id (int)
    > > - name (varchar)
    > > - status (varchar)
    > > - current_stock (double)
    > > - least_decrease (double)
    > > - capacitySU (int)
    > >
    > > Now I want to create the following SQL-Statement:
    > > SELECT * FROM tb_offer WHERE status = 'on' AND current_stock <
    > > (least_decrease * capacitySU);
    > >
    > > You see, in SQL this isn't a problem. But if I want to create this
    > > Expression with Cayenne, I have to give up.
    > >
    > > A solution would be to use raw-sql but I have to use the
    > resulting Objects
    > > (TbOffer) for update. By using raw-sql I have to reread the
    > Objects after
    > > the first query.
    > >
    > > Any suggestions?
    > >
    > > Thx
    >



    This archive was generated by hypermail 2.0.0 : Fri Mar 12 2004 - 17:52:44 EST