db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gedin Frederic <frederic.ge...@jaluna.com>
Subject Re: How to do when i want to query like "select * from book where book.name like 'TCP' "?
Date Wed, 30 Jul 2003 18:43:27 GMT
sailorhero a écrit:

>I think I find  a bug.
>I used the torque 3.0.2.
>when I used the second method ,but the result of query is wrong.
>I open the log4j in debug mode.
>I find the SQL query is wrong .
>code:
>   Criteria crit2 = new Criteria();
>   crit2.add("BOOK.TITLE", (Object)"TCP", Criteria.LIKE);
>   
>   List results = BookPeer.doSelect(crit2);
>   printBooklist(results);
>The log4j is like this.
>DEBUG [main] util.BasePeer (createQueryString:994) - SELECT book.BOOK_ID, book.TITLE,
book.ISBN, book.TIME, book.PUBLISHER_ID, book.AUTHOR_ID FROM book, BOOK WHERE BOOK.TITLE =
'TCP'
>DEBUG [main] util.BasePeer (executeQuery:1532) - Elapsed time=0 ms
>  
>
Is this really a bug?
My understanding is that, if you use like, you should also give a real 
searching criteria and not a constant string. For me this is an 
optimization.
Try using "TCP%" instead.

Frederic


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message