-
id標簽,id表示主鍵 generator class="generatorClass"表示主鍵生成策略查看全部
-
hbm配置文件常用設置查看全部
-
openSession()和getCurrentSession()的區別查看全部
-
若存在多個@Test注解則將按順序執行方法查看全部
-
獲得session對象的兩種方法查看全部
-
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.username">root</property> <property name="connection.password"></property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql///bullet</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="show_sql">true</property> <property name="format_sql">true</property> <property name="hbm2ddl.auto">create</property> </session-factory> </hibernate-configuration> 這節課的代碼查看全部
-
使用doWork()方法自動提交事務時,session應該調用flush()方法查看全部
-
hibernate對數據的操作都是封裝在事務中,并且默認是非自動提交的昂視,所以用session保存對象時,如果不開啟事務,并且手工提交事務,對象并不會真正保存在數據庫中。 如果想讓hibernate想jdbc那樣自動提交事務,必須調用session對象的doWork()方法,獲得jdbc的connection后,設置其為自動提交事務模式(注意:通常并不推薦這樣做)查看全部
-
session可以理解為操作數據庫的對象 session與connection是多對一關系,每個session都有一個與之對應的connection,一個connection不同時刻可以供多個session使用。 把對象保存在關系數據庫中需要調用session的各種方法,如save(),update(),createQuery()查看全部
-
hibernate的執行流程查看全部
-
hibernate.cfg.xml常用配置 注意:hibernate的前綴可以省略,即:hibernatedialect等同于dialect查看全部
-
hibernate創建流程查看全部
-
load方法調用代理查看全部
-
hibernate配置文檔支持hibernate類型和java類型查看全部
-
基本類型1查看全部
舉報
0/150
提交
取消