ibatis isNotEmpty with multiple variables
Posted
by hibernate
on Stack Overflow
See other posts from Stack Overflow
or by hibernate
Published on 2010-05-21T16:25:34Z
Indexed on
2010/05/21
16:40 UTC
Read the original article
Hit count: 782
Suppose I have a massive table called inactiveUsers and a search form. I want to conditionally join the inactiveUsers table if any user related characteristic is chosen (address, name, phoneNumber, etc...). Is there any way to do this without the following:
<isNotEmpty property="address">JOIN inactiveUsers</isNotEmpty>
<isNotEmpty property="phoneNumber">JOIN inactiveUsers</isNotEmpty>
<isNotEmpty property="name">JOIN inactiveUsers</isNotEmpty>
and so on for another 10-20 isNotEmpty clauses. I would like to do something like:
<isAnyNotEmpty properties="address, phoneNumber, name, ....">JOIN inactiveUsers</isNotEmpty>
Is this possible with ibatis? If so, how?
© Stack Overflow or respective owner