我有两个对象
Person(long id, String name, PersonInfo info)
和
PersonInfo(long id, String email, String lastname, in age)
现在我尝试创建一个javax.persistence.Query
我尝试创造select to person where personinfo.email="somemail"
我试试
String queryString="select Person from Person p where p.PersonInfo._email='somemail'";
Query query=emf.createQuery(queryString);
List resultList = query.getResultList();
但我得到了这个例外:
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
我错了什么?