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开始的。
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开始的。
相关文章推荐
- getHibernateTemplate().find 接收多个参数
- spring-data-jpa中findOne与getOne的区别 getOne没数据 findOne有数据
- Spring学习-25:Spring中的JDBC Template(JDBC模板):设置参数到属性文件
- 对spring管理的hibernate的getHibernateTemplate的find方法整理
- getHibernateTemplate().find(hql) 用法 和参数为sql的用法
- getHibernateTemplate.find 有多个参数的用法
- 【web】Spring RestTemplate提交时设置POST请求参数
- getHibernateTemplate()(Spring中常用的hql查询方法)
- Spring中常用的hql查询方法(getHibernateTemplate())
- gethibernatetemplate find条件查询方法
- Spring中常用的hql查询方法 (getHibernateTemplate())
- spring整合hibernate使用getHibernateTemplate().save()方法不能输入数据库
- ssh中的dao层this.getHibernateTemplate().find()方法
- spring有办法在getBean的时候传入构造函数的参数吗?
- Spring Boot中通过RabbitTemplate主动pull(get)消息的例子
- JPA+Spring下,applicationContext.xml中的entityManagerFactory中的class设置问题
- getHibernateTemplate().find方法详解
- jpa 里查询参数设置
- 在 Spring.NET 中使用 PropertyPlaceholderConfigurer 设置配置参数
- Spring中常用的hql查询方法(getHibernateTemplate())