title: Unable to access MetaModel entity attributes
body: <p>I have tried to access the MetaModel entity attributes/variables using the code below:</p>
  
  <pre><code>CriteriaQuery&lt;User&gt; criteria = builder.createQuery(User.class);
           Metamodel m = entityManager.getMetamodel();
           EntityType&lt;User&gt; User_ = m.entity(User.class);
          Root&lt;User&gt; userRoot = criteria.from(User.class);
          criteria.where(builder.equal(userRoot.get(User_.email)), user.getEmail());
  </code></pre>
  
  <p>but email cannot be resolved or is not a field.
  Is it mandatory to create StaticMetaModel class for User class. i.e., "User_" ???</p>
  
  <p>If YES, please see the link <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gkjbq.html" rel="nofollow">http://docs.oracle.com/javaee/6/tutorial/doc/gkjbq.html</a>
  here, you can find the below code:</p>
  
  <pre><code>CriteriaQuery&lt;Pet&gt; cq = cb.createQuery(Pet.class);
  Metamodel m = em.getMetamodel();
  EntityType&lt;Pet&gt; Pet_ = m.entity(Pet.class);
  Root&lt;Pet&gt; pet = cq.from(Pet.class);
  cq.where(cb.equal(pet.get(Pet_.name), "Fido"));
  </code></pre>
  
  <p>Please help me here.</p>