hibernate执行sql语句步骤
2016-09-11 20:34
295 查看
要先用hibernate执行sql语句,必须先配置好Session。下面看下配置Session的方式。1.初始化hibernate的配置管理类Configuration。2.通过Configuration类来创建sessionFactory。3.通过sessionfactory生成session实例。整个步骤大概为
Configuration config=new Configuration().configure(); SessionFactorysessionFactory=config.buldSessionFactory(); Session session=sessionFactory.openSession(); //hql查询 Query query=session.createQuery(“fromtable where id=1”); //sql查询 Query query=session.createSQLQuery(“select * from table where id=1”);先简略的讲一下,以后再补详细- -
相关文章推荐
- T-SQL查询语句的执行步骤
- java---j2ee---hibernate执行原生Sql语句的方法
- 在Hibernate里执行Sql语句
- hibernate执行sql语句的总结
- sql语句的执行步骤
- hibernate执行sql语句的总结
- T-SQL查询语句的执行步骤
- 记录Hibernate 增删改 执行的SQL语句
- hibernate中执行sql语句出错
- 关于No Dialect mapping for JDBC type :-9 hibernate执行原生sql语句问题
- hibernate执行sql语句的总结
- sql语句的执行步骤——zhuan
- Hibernate 执行SQL语句查询实体
- 一个SQL语句在数据库引擎中的执行步骤
- 使用Hibernate的session执行任意SQL语句以及整个事务
- Hibernate----sql语句执行时间
- Hibernate直接执行sql语句,查询记录的个数
- oracle SQL语句执行步骤
- Oracle SQL语句执行步骤
- T-SQL查询语句的执行步骤