![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
文章平均质量分 64
s-diamond
这个作者很懒,什么都没留下…
展开
-
使用hibernate根据配置的实体bean类无法自动创建数据库表
import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.cfg.Configuration; import org.hibernate.tool.hbm2ddl.SchemaExp原创 2016-07-22 23:54:49 · 1528 阅读 · 0 评论 -
Hibernate3.3.2使用c3p0最为数据库连接池
先引入c3p0-0.9.1.jar,我的在这个文件夹中:hibernate-distribution-3.3.2.GA\lib\optional\c3p0;如果没有可以去官网下载即可。 接着将c3p0需要的配置设置入hibernate.cfg.xml中: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibern原创 2016-07-27 17:39:39 · 354 阅读 · 0 评论 -
使用spring管理hibernate的事务
beans.xml中: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/contex原创 2016-08-21 20:38:12 · 325 阅读 · 0 评论 -
hibernate中当Teacher与Student具有多对多的关系时,且使用关联关系,没有实体的中间表,如何使用hql根据student的名字取出拥有他的teacher
例如: Teacher中有: 基本属性: private String teacherId; private String teacherName; 关联关系: Set students = new HashSet();//这是某个老师的手底下有的所有学生 getter上的映射就不写了。 Student中有: 基本属性: private String studentId; p原创 2016-08-10 08:51:22 · 412 阅读 · 0 评论 -
在spring3.2.0+hibernate3.3.2+struts2 2.2.3中使用websocket,运行环境是tomcat8.0.36,获取HttpSession
直接看如何获取HttpSession对象。 首先必须得写一个继承javax.websocket.server.ServerEndpointConfig.Configurator类的类来获取HttpSession: import javax.servlet.http.HttpSession; import javax.websocket.HandshakeResponse; impo原创 2016-08-25 17:00:42 · 2045 阅读 · 0 评论