I would like to annotate a mapping of one table to a Map<String, Set<String>>. I have a table like this:
Code:
CREATE TABLE external_identifiers (
id int(10) NOT NULL,
item_id varchar(32) NOT NULL,
reference_type varchar(255) NOT NULL,
value varchar(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY external_identifiers_unique_values (umid, reference_type, value)
);
and an entity table, Item, that links to this one via item_id. The Item object should contain a Map associating Strings ("reference_type") with Sets (or Lists or other Collections) of Strings ("value").
Is there a straightforward way of creating this mapping with Hibernate/JPA?
Thanks for any advice you can offer,
-- Scott