您的位置:首页 > 编程语言 > Java开发

Spring JPA getJpaTemplate find 多个参数 的设置

2011-09-25 17:16 621 查看
在Spring和 JPA的结合中,对数据库的操作时,SQL的书写形式 和 Hibernate 的不一样。

Hibernate中的形式为:

select user from User user where user.userName=? and user.userPassword=?

而 JPA 中的形式为:

select user from User user where user.userName=?1 and user.userPassword=?2

即在 问号(?)后面 加上 参数的位置,数字是从1开始的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: