Hallo Alex,

Alex Hepp wrote:
what i want now is this:
SELECT * FROM movii_user where (FIRST_NAME LIKE "%hello%" or LAST_NAME LIKE "%hello%" OR EMAIL LIKE "%hello%" or LOGIN_NAME="%hello%") AND IS_DELETED=0;


************************
**CODE
************************
Criteria crit = new Criteria();
crit.add(MoviiUser.IS_DELETED,0);

                [...]

Criteria.crit.add( a1.or( a2.or(a3.or(a4)) ));
************************
**CODE END
************************

is this really the right way, or am i completely wrong? ItÂs working

This is exactly it. Particularly when using the same column in more than one condition you *have to* use Criterions and "or" or "and" them together. Criteria is based on a HashMap with the column name as the key. If you Criteria.add'ed a column condition it would overwrite the previously added condition (for the same column).


--

Regards/GruÃ,

Tarlika Elisabeth Schmitz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to