I want to use criteria to make the following query. I have an Entity with EmbeddedId defined:
@Entity
@Table(name=\"TB_IN
Try to copy and paste the metamodel classes into the same folder where your entities are saved (in NetBeans 8.2 they are automatically generated and have the same name of your entity but with an underscore at the end. Should be something like Interfase_ and InterfaseId_).
Force the import of the metamodel classes Interfase_ and InterfaseId_ and refer to the desired field.
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery criteria = builder.createQuery(Interfase.class);
Root interfaseRoot = criteria.from(Interfase.class);
criteria.select(interfaseRoot);
criteria.where(builder.equal(interfaseRoot.get(Interfase_.id).get(InterfaseId_.clase),"Referencia 111"));
List interfases = em.createQuery(criteria).getResultList();