title: @ElementCollection Map of @Embeddable gets not persisted when field values are equal
body: <p>I have a problem with inserting elements into an <code>@ElementCollection</code> represented by a Map. When inserting elements with same values, they are not persisted.
  Given following <code>@Entity</code> and its <code>@Embeddable</code>:</p>
  
  <pre><code>@Entity
  @Table(name = "category", catalog = "my_db", schema = "")
  public class Category implements Serializable {
  
    @Id
    @Column(name = "id")
    private Integer id;
  
    @ElementCollection(fetch = FetchType.LAZY, targetClass = CategoryLabels.class)
    @CollectionTable(name = "category_labels", joinColumns =
    @JoinColumn(name = "category_id"), catalog = "my_db")
    @MapKeyColumn(name = "language_id")
    private Map&lt;Integer, CategoryLabels&gt; labels = new HashMap&lt;Integer, CategoryLabels&gt;();
  
  ...
  }
  
  
  @Embeddable
  public class CategoryLabels implements Serializable {
    @Column(name = "label1")
    private String label1;
  
    @Column(name = "label2")
    private String label2;
  
  ...
  }
  </code></pre>
  
  <p>Database entries</p>
  
  <pre><code>+-------------+-------------+-----------+---------+
  | category_id | language_id | label1    | label2  |
  +-------------+-------------+-----------+---------+
  |         183 |           1 | Capacity  | Timings |
  |         183 |           2 |           |         |
  +-------------+-------------+-----------+---------+
  </code></pre>
  
  <p>Inserting works fine, if label1 and label2 differ for each map entry (as seen above).</p>
  
  <p>But if I add one entry that has the same values for label1 and label2 as another entry, the second one is <strong>never persisted</strong> to the database.
  For example, if I add an entry to the Map with both labels empty (like the second entry in the example) but with language_id=3, this will never get persisted.</p>
  
  <p>I am aware of this common problem: <a href="http://en.wikibooks.org/wiki/Java_Persistence/ElementCollection#Common_Problems" rel="nofollow">http://en.wikibooks.org/wiki/Java_Persistence/ElementCollection#Common_Problems</a> and that embedded objects without ID are checked for their fields and foreign key <code>@JoinColumns</code> as ID.
  This does not seem to work in my case, the foreign key in the <code>@JoinColumn</code> is completely ignored for the ID-check.</p>
  
  <p>Is this a bug in Eclipselink or am I doing something wrong?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've set <code>-Declipselink.logging.level=FINEST</code> and this reveals that no SQLs are executed for the second and following entries with empty labels.</p>
  
  <p>Additionally I've made a sample project with which you can reproduce the problem:
  <a href="http://bit.ly/1bR8ywO" rel="nofollow">http://bit.ly/1bR8ywO</a></p>