<p>I'm trying to do a basic "OR" on three fields using a hibernate criteria query.</p>

<p>Example</p>

<pre><code>class Whatever{
 string name;
 string address;
 string phoneNumber;
}
</code></pre>

<p>I'd like to build a criteria query where my search string could match "name" or "address" or "phoneNumber".</p>

You want to use
```
Restrictions.disjuntion()
```
. Like so
```
```
session.createCriteria(Whatever.class)
    .add(Restrictions.disjunction()
        .add(Restrictions.eq("name", queryString))
        .add(Restrictions.eq("address", queryString))
        .add(Restrictions.eq("phoneNumber", queryString))
    );
```
```
See the Hibernate doc
here
.