thank you.
regarding the frist question: yes,it is an mysql. i basically began
developing on a local winXP system and then uploaded the application. i
used phpMyAdmin to get a database-dump and created the exact same state on
the server. but on the server, i could only delete and change records
Seems to work perfectly. Thanks.
> -Original Message-
> From: Amit Rana [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 10, 2003 10:18 PM
> To: 'Apache Torque Users List'
> Subject: RE: How to update multiple rows
>
> Peer classes have doUpdate methods check the javadocs for more
deta
k
So, you mean there's no way a bulk update can happen if the primary key is not
included using doUpdate(Criteria) ?
-Original Message-
From: Bill Leng [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 4:05 PM
To: Apache Torque Users List
Subject: Re: How to update multiple rows
To add more to the confusion, JavaDocs for BasePeer.doUpdate(Criteria
updateValues) says:
"Convenience method used to update rows in the DB. Checks if a single
int primary key is specified in the Criteria object and uses it to
perform the udpate. If no primary key is specified an Exception will be
I like the version of doUpdate(Criteria, Criteria) that Amit suggested.
I've tested it and it works. But I'd really like to understand Bill's
suggestion. I still don't understand why BasePeer.doUpdate is called
and not BookPeer.doUpdate...
> -Original Message-
> From: Tulsi Das [mailto:[
I use Amit's suggestion and it works fine. Bill's suggestion seem work
if the WHERE criteria refers to primary key... right Bill?
> -Original Message-
> From: Cloves Carneiro Jr. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 12:59 PM
> To: Apache Torque Users List
> Subject
Without a primary key, I guess, you can not use the example to update.
If the primary key contains multiple columns, you need to specify all of
them. Hope this helps.
Ramesh Sabeti wrote:
I understand that. I can't explain how the example works. Looking at
it, I'd say that both c.add(...) cal
If I´m not mistaken (haven´t used update much), the clauses that go in
the WHERE part are those that take a SqlEnum argument
so in your example, the code generates:
UPDATE PRICE = 0, AUTHOR = 'ME' WHERE ID>100
please correct me if I´m wrong
Tulsi
--- "Cloves Carneiro Jr." <[EMAIL PROTECTED]>
Ah, I see... what if the the selection criteria is not by book_id?
E.g.
Update book set book_price = 10 where book_price < 10
> -Original Message-
> From: Bill Leng [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 12:55 PM
> To: Apache Torque Users List
> Subject: Re: How to
I understand that. I can't explain how the example works. Looking at
it, I'd say that both c.add(...) calls add the criteria to the WHERE
clause. How do you interpret it?
Criteria c = new Criteria();
c.add(BookPeer.BOOK_PRICE, 0);
c.add(BookPeer.BOOK_ID, 100, Criteria.LESS_THAN);
BasePeer.doUp
Hey
I am also new to Torque and have a simple question. From what you described, using the
book example, would the criteria objects for those two UPDATE statements be the same?
UPDATE PRICE = 0, AUTHOR = 'ME' WHERE ID>100
and
UPDATE PRICE = 0 WHERE AUTHOR = 'ME' AND ID > 100
Criteria c = new Cr
that example assumes BOOK_ID is the primary key.
Ramesh Sabeti wrote:
I meant in the example provided by Bill. If you set the criteria as
suggested, Torque would use it in the WHERE clause and not in the SET
clause, right?
-Original Message-
From: Tulsi Das [mailto:[EMAIL PROTECTED]
S
The criteria is just a hashtable extension to store all the mappings,
later on, when calling the methods, the SQL generator knows where to
insert them ( if you are lucky ;) )
tulsi
--- Ramesh Sabeti <[EMAIL PROTECTED]> escribió:
> I meant in the example provided by Bill. If you set the criteri
I meant in the example provided by Bill. If you set the criteria as
suggested, Torque would use it in the WHERE clause and not in the SET
clause, right?
> -Original Message-
> From: Tulsi Das [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 12:45 PM
> To: Apache Torque Users L
It doesn´t know untill you call
doSelect()
or
doUpdate()
or even
doDelete() methods
that´s why it´s only called "Criteria"
regards
Tulsi
--- Ramesh Sabeti <[EMAIL PROTECTED]> escribió:
> How does torque know that c.add(BookPeer.BOOK_PRICE, 0) is to SET a
> value and not for comparison purpos
How does torque know that c.add(BookPeer.BOOK_PRICE, 0) is to SET a
value and not for comparison purposes?
> -Original Message-
> From: Bill Leng [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 6:18 AM
> To: Apache Torque Users List
> Subject: Re: How to update multiple rows
>
Nice... I ended up doing a search/replace (which is not a good way of
doing it). You solution is much cleaner... Thanks
> -Original Message-
> From: Howard Lin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 8:36 AM
> To: Apache Torque Users List
> Subject: RE: doSelect vs.
What I did is:
This seems working.
Howard Lin
> -Original Message-
> From: Ramesh Sabeti [mailto:[EMAIL PROTECTED]
> Sent: Sunday, November 09, 2003 10:02 PM
> To: 'Apache Torque Users List'
> Subject: doSelect vs. doPSSelect
>
>
> I've been having a problem with Oracl
Thanks. Torque's Java docs is rather brief... it defenitly has room
for improvement.
> -Original Message-
> From: Amit Rana [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 10, 2003 10:18 PM
> To: 'Apache Torque Users List'
> Subject: RE: How to update multiple rows
>
> Peer classes
That does it. Thanks a lot...
> -Original Message-
> From: Bill Leng [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 11, 2003 6:18 AM
> To: Apache Torque Users List
> Subject: Re: How to update multiple rows
>
> You can do something like this
> Criteria c = new Criteria();
> c.add(
You can do something like this
Criteria c = new Criteria();
c.add(BookPeer.BOOK_PRICE, 0);
c.add(BookPeer.BOOK_ID, 100, Criteria.LESS_THAN);
BasePeer.doUpdate(c);
Ramesh Sabeti wrote:
I have a very simple question: How do you do something like this with
Torque?
Update book set book_price = 0 wher
21 matches
Mail list logo