db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: Torque 4 next steps
Date Mon, 30 May 2011 18:14:23 GMT
Hi Thomas,

sorry again for not acting earlier. As always: time constraints.

On 09.05.11 22:02, Thomas Fox wrote:
> If we remove the inheritance from Hashtable, we might want to consider the
> semantics of the Criteria.add() methods. Currently, if one adds a column
> twice, the first assignment is overwritten by the second. For example:
> Criteria criteria = new Criteria();
> criteria.add(AuthorPeer.AUTHOR_ID, 100, Criteria.GREATER_THAN);
> criteria.add(AuthorPeer.AUTHOR_ID, 200, Criteria.LESS_THAN);
> ends up in the SQL
> select ... from author where author.author_id < 200;
> which is not at all what one would expect by reading the code
> (I would expect select ... from author where author.author_id > 100 and
> author.author_id < 200).

If you write something like

criteria.add(AuthorPeer.AUTHOR_ID, 100, Criteria.GREATER_THAN);
criteria.or(AuthorPeer.NAME, "Hemingway");

you end up with a "select ... where author.author_id > 100 *and*
autor.name='Hemingway'"

> 2) change the semantics such that add() does not override existing keys
>    (i.e. they would do the same as the and() methods)
>   2a) as 2) but additionally deprecating the add() methods
+1 for 2a

However how to handle my example in the general case. I have no good
idea how to solve this.

Bye, Thomas.

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


Mime
View raw message