Hi,
Is it possible to add a persistent property to an entity that has a simple Map<String,String> type? I'm having trouble finding the JPA-compliant way to do it (I've seen an example in the hibernate tests package that should do it using hibernate-specific annotations).
Is there a way to keep the simple Map<String,String> field using standard annotations?
The types/tables are something like what appears below:
Code:
@Entity @Table("customers") Customer {
@Id int id;
String name;
[b]Map<String, String> properties[/b];
}
TABLE CUSTOMERS
-------------
ID NAME
1 "James"
2 "John"
TABLE CUSTOMER_PROPERTIES
-------------
CUST_ID PROP_KEY PROP_VALUE
1 "PREFERRED_CHEESE" "CHEDDAR"
1 "PREFERRED_MILK" "LOW FAT"