These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping to a Map<String, Set<String>>
PostPosted: Tue Sep 01, 2009 12:14 pm 
Newbie

Joined: Thu Jul 02, 2009 2:06 pm
Posts: 6
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.