問題:
I am wondering if it is possible using annotations to persist the attributes
map in the following class using JPA2 我想知道是否可以使用註釋使用JPA2在以下類中保留attributes
映射
public class Example {
long id;
// ....
Map<String, String> attributes = new HashMap<String, String>();
// ....
}
As we already have a pre existing production database, so ideally the values of attributes
could map to the following existing table: 由於我們已經有一個預先存在的生產數據庫,因此理想情況下, attributes
值可以映射到以下現有表:
create table example_attributes {
example_id bigint,
name varchar(100),
value varchar(100));