quality@glassfish.java.net

JPA2 Metamodel class . Does this feature work ?

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Mon, 15 Mar 2010 07:52:07 +0200

Hello.

I am trying to get MetaModel classes working.
But I keep on getting syntax errors on the last line
(Name can't be resolved)

Is this an issue ?
Or is it not implemented ?

I tried NetBeans 6.8 and Eclipse 3.5

I know I can use pet.get("name") instead.

thanks
Richard.

CriteriaQuery<String> cq = cb.createQuery(String.class);
Metamodel m = em.getMetamodel();
EntityType<Pet> Pet_ = m.entity(Pet.class);

Root<Pet> pet = cq.from(Pet.class);
cq.select(pet.get(Pet_.name));