hibernate查询sql简记
2014-08-19 08:46
183 查看
public List<IEnterpriseFinancing> queryIEnterpriseFinancingList1( IEnterpriseFinancing enterpriseFinancing,String succ) throws Exception { String sql = "select * from I_ENTERPRISE_FINANCING where 1=1 and ISVALID='1' and DC_FINANCING_TYPE = "+enterpriseFinancing.getDcFinancingType() +" and rownum<"+5+" order by CREATETIME"; if(succ!=null&&"".equals("succ")){ sql = "select * from I_ENTERPRISE_FINANCING where 1=1 and ISVALID='1' and DC_FINANCING_TYPE = "+enterpriseFinancing.getDcFinancingType() +" and rownum<"+5+" and proStatus = 1 order by CREATETIME";; } SQLQuery query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(sql); query.addEntity(IEnterpriseFinancing.class); List<IEnterpriseFinancing> list = query.list(); return list; }
相关文章推荐
- hibernate 多条件组合查询 之 sql 拼接
- Hibernate 高级查询技巧——本地SQL查询
- Hibernate的createSQLQuery查询的问题
- hibernate sql命名查询
- 使用HIBERNATE的SQL查询并将结果集自动转换成POJO
- hibernate原生sql查询(2.1.6)
- Hibernate学习31 -- Hibernate查询语言(HQL)5 -- 直接使用sql进行查询
- hibernate 多条件组合查询 之 sql 拼接
- Hibernate原生SQL查询多表关联,SQL语句要注意的问题
- Hibernate 本地SQL查询SQLQuery
- 关于Hibernate中SQL查询结果的数据结构
- hibernate sql多表查询
- hibernate的对象查询与sql语句的对应
- hibernate参考手册之---原生SQL查询
- 简单修改Hibernate源码,增加使用原生SQL查询时动态addEntity和addScalar功能
- Hibernate的SQL查询
- Hibernate的HQL查询语句对比Sql语句学习
- Hibernate 原生查询 createSQLQuery 详解
- 在配置文件中获取数据源,然后在hibernate中用sql语句进行查询操作
- Hibernate的createSQLQuery查询的小技巧