WARNING: This server is unstable and will be retired in the next days.
If you want to keep this forum available, please request immediately a migration
on the
Nabble Support forum.
Forums that don't receive any migration request will be deleted forever.
Criteria.or not working?
Hi!
I have done some testing during development of a project here and it seems
that criteria.and([parameters]), criteria.add([parameters]) and
criteria.or([parameters]) all generate the same query to the database.
E.g these three code snippets:
Criteria criteria = new Criteria();
criteria.and("user.first_name", "John");
criteria.and("user.last_name", "Doe");
UserPeer.doSelect(criteria);
Criteria criteria = new Criteria();
criteria.add("user.first_name", "John");
criteria.add("user.last_name", "Doe");
UserPeer.doSelect(criteria);
Criteria criteria = new Criteria();
criteria.or("user.first_name", "John");
criteria.or("user.last_name", "Doe");
UserPeer.doSelect(criteria);
. would all generate the Sql query
SELECT * FROM USER WHERE first_name = "John" AND last_name = "Doe";
How can this be?
/Ludwig