title: Syntax where clause in consultation with criteria
body: <p>I need to put a where clause in my query, but I'm not hitting the correct syntax.</p>
  
  <pre><code>       /*
          * Support listing and POSTing back Origem entities (e.g. from inside an
          * HtmlSelectOneMenu)
          */
  
           public List&lt;Origem&gt; getAll()
     {
  
        CriteriaBuilder cb = this.entityManager.getCriteriaBuilder();
          CriteriaQuery&lt;Origem&gt; criteria = cb.createQuery(Origem.class);
          Root&lt;Origem&gt; root = criteria.from(Origem.class);
          return this.entityManager.createQuery(
                  criteria.select(root).where())
                  .getResultList();
     }
  </code></pre>
  
  <p>In my where clause want to bring all "origem" with id equal to the logged in user. 
  Something like this:</p>
  
  <p>Ex: <code>select * from origin where origem.id = loginBean.origem.getId</code></p>