2
映射地圖集是否有JPA的方式映射給出如下類別與類型屬性Map<String, Set<Address>>
如何在JPA
:
class Company {
int id;
Map<String, Set<Address>> addresses; // Key is the country of the Address
}
class Address {
int id;
String country;
}
有三個表:
tbl_company
id INT
tbl_address
id INT
country VARCHAR(40)
tbl_company_address
company_id INT
address_id INT
如何映射此場景與JPA