当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Hibernate: parameter does not exist as a named parameter on Wildfly

问题描述:

I have the following code snippet working with hibernate 4.2.2:

Query query = session.getNamedQuery("Usuario.findById");

query.setLong("id", identificadorUsuario);

This is the query:

SELECT user FROM scsg.model.Usuario user WHERE user.idUsuario=:id

And it Works locally. But when I deploy to the server it launches following exception:

java.lang.IllegalArgumentException: Parameter id does not exist as a named parameter in [SELECT user FROM scsg.model.Usuario user WHERE user.idUsuario=:id]

Server is a Wildfly server. All POJO clases have their getters and setters. Any help?

分享给朋友:
您可能感兴趣的文章:
随机阅读: