title: How to annotate HashMap?
body: <p>I have this model:</p>
  
  <pre><code>@Entity
  public class ImageModel extends Model {
  @Id
  private String id;
  private String url;
  
  @ManyToMany(cascade = CascadeType.ALL)
  private Map&lt;String,String&gt; tags = new HashMap&lt;&gt;();
  
  public void add(String key, String value){
      tags.put(key,value);
  }
  
  public String get(String key){
       return tags.get(key);
  }
  
  }
  </code></pre>
  
  <p>This how I create a new object:</p>
  
  <pre><code> ImageModel imageModel = new ImageModel();
  /* fill object with data */
  imageModel.save(); // I saved it
  </code></pre>
  
  <p>But when I try to retrieve data, the HashMap has zero records:</p>
  
  <pre><code>HashMap&lt;String, String&gt; imageTags = (HashMap&lt;String, String&gt;) imageModel.getTags();
  </code></pre>
  
  <p>What can I do, so the informations from hashmap will be saved too? I have already looked to the other SO posts and I tried, but nothing seems to work:
  @ManyToMany(cascade = CascadeType.ALL)   <a href="https://stackoverflow.com/questions/853076/jpa-mapstring-string-mapping">JPA Map&lt;String,String&gt; mapping</a></p>
  
  <p>I must say that I am using Play framework 2.1 .</p>