title: Why the compiler doesn't recognize the metamodel attributes?
body: <p>Is the criteria api of eclipselink jpa2 supported for java se 6 projects? If not, that's my problem.
  Do I need to specify anything special to the criteria api in the persistence.xml?</p>
  
  <p>This is my criteria query:</p>
  
  <pre><code> final EntityType&lt;Meaning&gt; Meaning_ = em.getMetamodel().entity(Meaning.class);
      final CriteriaBuilder cb = em.getCriteriaBuilder();
      CriteriaQuery&lt;Integer&gt; cq = cb.createQuery(Integer.class);
      final Root&lt;Meaning&gt; meng = cq.from(Meaning.class);
      cq.where(meng.get(Meaning_.lastPublishedDate)); //this attributes are not recognized/found
      cq.select(meng.get(Meaning_.objId));            // "                "                   
      TypedQuery&lt;Integer&gt; q = em.createQuery(cq); 
      return q.getResultList();
  </code></pre>
  
  <p>And here is my Meaning entity:</p>
  
  <pre><code>@Entity
  public class Meaning implements Serializable{
  private static final long serialVersionUID = 1L;
  
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private int objId;
  
  public int getObjId() {
      return objId;
  }
  
  @Temporal(javax.persistence.TemporalType.DATE)
  private Date lastPublishedDate = null;//never
  
  public Date getLastPublishedDate(){
          return lastPublishedDate;
      }
  }
  </code></pre>