Java JPA-加载实体的一对多关系时获取MySQL语法错误

Java JPA-加载实体的一对多关系时获取MySQL语法错误,java,mysql,eclipse,jpa,Java,Mysql,Eclipse,Jpa,我在这些实体之间有一个双向的一对多关系,所有这些都是由Netbeans的JPA向导创建的 车辆(车辆) 我需要通过id获取一个“Vehiculo”,因此我将NamedQuery称为“Vehiculo.findById” 我得到一个例外: Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the man

我在这些实体之间有一个双向的一对多关系,所有这些都是由Netbeans的JPA向导创建的

车辆(车辆)

我需要通过id获取一个“Vehiculo”,因此我将NamedQuery称为“Vehiculo.findById”

我得到一个例外:

Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision, tiempo, velocidad, id_vehiculo FROM punto_trayecto WHERE (id_vehiculo' at line 1
这就是试图调用的查询

Call: SELECT id, latitud, longitud, precision, tiempo, velocidad, id_vehiculo FROM punto_trayecto WHERE (id_vehiculo = ?)

它对应于另一个实体“puntotrayetro”,我猜这个SELECT查询是用来填充“Vehiculo”的列表puntotrayetro,如果我使用JPA控制器,也会发生同样的情况。出什么问题了?

问题可能是由列的
精度造成的。这是一个保留字()。您可以检查解决方法

我也有同样的问题。列名被称为“order”,这是一个保留字。谢谢你的回答
    Query query = em.createNamedQuery("Vehiculo.findById");
    query.setParameter("id", 1);
    Object o = query.getSingleResult();
    Vehiculo vehiculo = (Vehiculo)o;
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'precision, tiempo, velocidad, id_vehiculo FROM punto_trayecto WHERE (id_vehiculo' at line 1
Call: SELECT id, latitud, longitud, precision, tiempo, velocidad, id_vehiculo FROM punto_trayecto WHERE (id_vehiculo = ?)