我的第一个Hibernate demo

使用Hibernate的3个准备,7个步骤

准备一:导入Hibernate库(jar包)


准备二:添加配置文件  hibernate.cfg.xml准备三:添加实体类和映射文件 User.hbm.xml 

User.hbm.xml:

User类:

七个步骤:

configuration--->sessionfactory--->打开session--->开始一个事务transaction--->持久化操作--->提交事务--->关闭session


第一个demo完成:

猜你喜欢

转载自blog.csdn.net/qq_39674542/article/details/80396369