首页 > 编程语言 > 详细

spring—hibernate查询

时间:2015-11-12 18:15:39      阅读:251      评论:0      收藏:0      [点我收藏+]
		
		Spring管理hibernate查询方法
		
				
		HQL语句查询
		this.getHibernateTemplate().getSessionFactory().getCurrentSession()
				.createQuery("").uniqueResult();//null或者一个对象
	        Criteria查询
		this.getHibernateTemplate().getSessionFactory().getCurrentSession()
				.createCriteria("").uniqueResult();//null或者一个对象
                SQL查询
		this.getHibernateTemplate().getSessionFactory().getCurrentSession()
				.createSQLQuery(s);//list
	        HQL语句查询
		this.getHibernateTemplate().find(queryString);


spring—hibernate查询

原文:http://yjm199.blog.51cto.com/4408395/1712267

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!