Hibernate 繼承對映
阿新 • • 發佈:2019-01-22
建立表的表結構
// 測試
save 執行的sql 分別是 :
Hibernate: insert into hib_staff (staffName) values (?)
Hibernate: insert into hib_staff (staffName) values (?)
Hibernate: insert into hib_temp_staff (staffId, sid) values (?, ?)
Hibernate: insert into hib_staff (staffName) values (?)
Hibernate: insert into hib_temp_staff (date, sid) values (?, ?)
查詢子類 FormalStaff 的時候:
select this_.sid as sid0_0_, this_1_.staffName as staffName0_0_, this_.staffId as staffId1_0_ from hib_formal_staff this_ inner join hib_staff this_1_ on this_.sid=this_1_.sid