如何访问JPA Select语句中的类字段?

时间:2012-10-06 03:00:43

标签: java jpa

我正在尝试按Geospatial Queries with Google App Engine

中所述构建JPA查询
    Query query = em.createQuery("SELECT id, ( 6371 * acos( cos( radians(:lat_t/1E6)) ) * cos( radians( x.m_Latitude/1E6) ) ) * cos( radians( x.m_Longitude/1E6) ) - radians(:lng_t/1E6)) )  + sin( radians(:lat_t/1E6)) ) * sin( radians( x.m_Latitude/1E6) ) ) ) ) AS distance " +
            "FROM ProfileEntity x" +
            "HAVING distance < 10", ProfileEntity.class);

但我明白了:

Cannot find type of (part of) x.m_Latitude since symbol has no type; implicit variable?
org.datanucleus.exceptions.NucleusUserException: Cannot find type of (part of) x.m_Latitude since symbol has no type; implicit variable?

我想我没有正确访问作为ProfileEntity中字段的m_Latitude。

我该怎么做?

我也不确定什么是“id”perpeas,任何想法?

0 个答案:

没有答案