不知道為什么,我的主鍵默認策略時插入數(shù)據(jù)主鍵都是0
2018-04-05
student表里沒有card屬性啊 ?。。。。ㄔ徫业臒o知,我是小白一個)
1,JPA:全稱是java persistence API ,
簡單理解:JPA是標準接口,hibernate是實現(xiàn),但是其功能是JPA的超集。
2,hibernate如何實現(xiàn)與JPA的關(guān)系?
通過hibernate-annotation ,hibernate- entitymanager和hibernate- core 三個組件來實現(xiàn)。
3,在一般實際開發(fā)中,優(yōu)先考慮使用JPA注解,這樣更有利于程序的移植和擴展。
4,hibernate注解的分類:
1,類級別注解:主要是@Entity @Table @Embeddable 嵌入類
2,屬性級別注解3,映射關(guān)系注解
簡單理解:JPA是標準接口,hibernate是實現(xiàn),但是其功能是JPA的超集。
2,hibernate如何實現(xiàn)與JPA的關(guān)系?
通過hibernate-annotation ,hibernate- entitymanager和hibernate- core 三個組件來實現(xiàn)。
3,在一般實際開發(fā)中,優(yōu)先考慮使用JPA注解,這樣更有利于程序的移植和擴展。
4,hibernate注解的分類:
1,類級別注解:主要是@Entity @Table @Embeddable 嵌入類
2,屬性級別注解3,映射關(guān)系注解
2018-03-21
4.2.4不需要創(chuàng)建SessionFactory 老師可能是習(xí)慣吧
// 創(chuàng)建hibernate配置對象
Configuration config = new Configuration().configure();
SchemaExport schema = new SchemaExport(config);
schema.create(true, true);
// 創(chuàng)建hibernate配置對象
Configuration config = new Configuration().configure();
SchemaExport schema = new SchemaExport(config);
schema.create(true, true);
2018-03-21
只有我在糾結(jié)他的那個事務(wù)的自動提交么,沒有設(shè)置為false
http://files.cnblogs.com/files/lt123/hib_anno3.rar
2018-02-28
用的是SessionFactroy,既然要兼容JPA規(guī)范,應(yīng)該用EntityManager
2017-11-25