title: how to store a Map<String, List<String>> using JPA
body: <p>I am trying to store a <code>Map&lt;String, List&lt;String&gt;&gt;</code>; using JPA.</p>
  
  <p>My entity looks like:</p>
  
  <pre><code>@Entity
  @Table(name = "Profiles_table")
  public class Profiles {
  
      @Id
      @Column(name = "profile_ID", updatable = false, nullable = false)
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
  
      private final HashMap&lt;String, List&lt;String&gt;&gt; AllProfiles;
      ...
  }
  </code></pre>
  
  <p>I have tried a lot of settings for the map but its not working...</p>
  
  <p>The last one I tried:</p>
  
  <pre><code>@ElementCollection
  @MapKeyColumn(name = "Profil")
  @Column(name = "Permissions")
  @CollectionTable(name = "Profiles_permissions", joinColumns = @JoinColumn(name = "profile_ID"))
  </code></pre>
  
  <p>The following exception is thrown:</p>
  
  <pre><code>org.hibernate.AnnotationException: Illegal attempt to map a non collection as a
  @OneToMany, @ManyToMany or @CollectionOfElements: [...]Profiles.AllProfiles
  </code></pre>
  
  <p>thanks in advance </p>