I have two objects
Person(long id, String name, PersonInfo info)
and
PersonInfo(long id, String email, String lastname, in age)
now I try to create a javax.persistence.Query
i try to create select to person where personinfo.email="somemail"
i try
String queryString="select Person from Person p where p.PersonInfo._email='somemail'";
Query query=emf.createQuery(queryString);
List resultList = query.getResultList();
but i get this exception:
java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: PersonInfo of: Entities.Person [select Person from Entities.Person p where p.PersonInfo._email='somemail'] [Ljava.lang.StackTraceElement;@748e6591
what i’m dong wrong?
What about the following query string: