I was reading the "Dynamic, typesafe queries in JPA 2.0" article and stumbled upon this example:
EntityManager em = ...
CriteriaBuilder qb = em.getCriteriaBuilder();
CriteriaQuery<Person> c = qb.createQuery(Person.class);
Root<Person> p = c.from(Person.class);
Predicate condition = qb.gt(p.get(Person_.age), 20);
// ^^ --- this one
c.where(condition);
TypedQuery<Person> q = em.createQuery(c);
List<Person> result = q.getResultList();
I was wondering, what exactly does the underscore here mean?
Since an underscore it is a valid part of a classname I don't understand why this can be used in JPA.
I checked this with an existing entity in my code and of course my class couldn't be resolved as ClassName_