db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amine Bousta" <abou...@lxsolutions.com>
Subject RE: Simple select in Torque gets difficult???
Date Wed, 12 Nov 2003 10:09:34 GMT
I do agree with you. I'm not satisfied with Criteria and Criterion objects
as well.
I think SQL is more easy to read and fix and I always use "executeQuery"
instead of "doSelect".
That's more simple for parenthisis issues for exemple.

But I think Torque is a very good tool. If you want to encourage your
collegues to use Torque I think you shouldn't say that it's used to avoid
writing SQL. But it is usefull to generate automatically beans and bean
Peers from a schema.
Since I use Torque I've gained a lot of time by avoiding writing beans.
I'm very satisfied by Torque because beans manage very well foreign keys.
When you generate Base beans then you just have to focus on specific methods
and you don't manage database connections.
These are for me the most interesting points.

Doing a doSelect with Criteria and Criterion is a nightmare for me as well,
but doing updates with set and save is really easy, and results (coming from
an executeQuery or from a doSelect it's the same) are easy to explore as

So Torque is a great database management tool but I'm always wondering what
is the real use of Criteria and Criterion whereas you can do sql queries
that are easiest to read, write and fix. I see a lot of people using
Criteria.CUSTOM beacause they can't do their queries with normal Criterias.
But using Criteria.CUSTOM is mostly like writing directly in sql...

In my opinion Criteria and Criterion are like an "SQL Builder" for people
who doesn't know/like the SQL language.
But I don't see yet the real advantages.

If anybody can list me the advantages of Criteria/Criterion vs SQL I'll be
very interested


-----Message d'origine-----
De : Javier.Olcina@uv.es [mailto:Javier.Olcina@uv.es]
Envoyé : mercredi 12 novembre 2003 10:31
À : torque-user@db.apache.org
Objet : Simple select in Torque gets difficult???

Another simple question.How can I do something like this?

select * from author where (firs_name='Frank' AND last_name='Black') OR
(firs_name='Michael' AND last_name='White')

- I there is a bug in OR as It was said in other messages
- Criteria as far as I know does not allow to do that: differents
comparisons to a column. ??
- I think that I have to use Criterion to do that select, but then
something so simple like this in SQL become 10 code lines long. That's
something difficult to justify to my project collegues in order to
encourage them to use Torque.

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

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

View raw message