hibernate
帅气的东哥
这个作者很懒,什么都没留下…
展开
-
HQL
本文转载自http://blog.csdn.net/aixiangtouzhu/article/details/1351888 使用HQL查询最简单的例子,就是查询指定类别对应表格的所有数据,例如: Session session = sessionFactory.openSession(); Query query = session.createQuery("from Use转载 2013-03-19 23:47:08 · 1384 阅读 · 0 评论 -
hibernate的环境搭建
本文以hibernate来操纵mysql数据库,所以在此之前必须确保mysql数据库已经正确安装好。。。 1、导hibernate包的核心jar包。。。 2、导hbm.xml文件 3、导hibernate.cfg.xml文件 以上三个文件为hibernate环境搭建的基础材料...其可以到hibernate的官网去下载.....在这里我为大家准备好了我自己常用的版本http://d原创 2013-11-21 01:48:23 · 3677 阅读 · 1 评论 -
HIbernate常见异常
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste原创 2013-05-06 20:36:36 · 3046 阅读 · 1 评论 -
Hibernate自动建表
我们要想hibernate自动为我们建表,则可以在hibernate.cfg.xml中加上以下配置: update 这时,hibernate便会自动为我们建表。 否则则需要我们手动建表··············原创 2013-05-06 20:55:59 · 1785 阅读 · 0 评论 -
使用spring整合hibernate、struts后的删除功能
spring整合hibernate以后,对于删除功能,只提供了delete(entity),而没有提供类似于get(entity.class,id)这样的API,这时,要想实现根据id来删除某一个对象,可以参考一下两种方法 1、不使用spring对hibernate的支持 String hql = "delete from Item where orderId = ?"; Sessi原创 2013-04-14 12:52:32 · 2201 阅读 · 0 评论 -
使用spring整合hibernate、struts
以下是使用spring整合hibernate和struts时的基本配置: 1、applicationContext-ssh.xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://w原创 2013-04-13 22:01:11 · 1392 阅读 · 0 评论 -
ssh中事务处理
ssh中职务处理主要配置以下内容 1、applicationContext.xml原创 2013-04-14 21:03:50 · 1825 阅读 · 0 评论 -
ssh中常见的异常(一)
1、 Invalid property 'orderDAO' of bean class [com.tarena.action.OrderDeleteAction]: Bean property 'orderDAO' is not writable or has an invalid setter method. Does the parameter type of the setter matc原创 2013-04-14 17:33:41 · 1818 阅读 · 0 评论 -
Hibernate常见异常
1. org/hibernate/criterion/Criterion 工程布署的时候没有加入hibernate3的jar包,这个jar不是默认加入的,要在myeclipse -> add hibernate capabilities... ->选择copy checked libraries to project folder and add to build-path否则工程布署转载 2013-04-22 22:25:04 · 1652 阅读 · 0 评论 -
hql(已更新)
HQL语句。(已更新)(本文转载自http://hi.baidu.com/comasp/item/64359e091db605e1fe240d7a) HQL(Hibernate Query Language):是面向对象的查询语句,它的语法和SQL语句有些相像,在运行时才得以解析.HQL并不像SQL那样是数据操作语言,它用来取得对象,而不是进行update,delete和insert转载 2013-03-24 15:22:12 · 1287 阅读 · 0 评论 -
hql
本文转载自http://www.blogjava.net/focusJ/archive/2011/04/22/367245.html HQL实例: 1. 查询表中的所有记录:from Category 2. 带有where子句的条件查询:from Category c where c.name > 'c5' 3. 结果根据某一字段排序:from Category c ord转载 2013-03-19 23:49:24 · 1356 阅读 · 0 评论 -
hql
本文转载自http://www.cnblogs.com/bobomail/archive/2005/09/20/240352.html Hibernate配备了一种非常强大的查询语言,这种语言看上去很像SQL。但是不要被语法结构 上的相似所迷惑,HQL是非常有意识的被设计为完全面向对象的查询,它可以理解如继承、多态 和关联之类的概念。 第 15 章 HQL: Hiberna转载 2013-03-19 23:43:30 · 1257 阅读 · 0 评论 -
详解JDBC与Hibernate区别
刚开始学习JAVA时,认为Hibernate是一个很神圣的东西,好像是会了SSH,就能走遍全世界一样。记得曾经在枫叶面试的时候,我们几个同 学出还说这个公司怎么这么的落后,还有JDBC,没有一点上进心。可是毕业以后才发现,却发现自已就像是井底之蛙一样。然而也不想做随风柳絮,所以决定好 好的总结一下,JDBC与Hibernate的区别。 JDBC与Hibernate在性能上相比,JDB转载 2013-12-23 20:26:29 · 1367 阅读 · 0 评论