title: @ElementCollection does not store values inside my table (JPA)
body: <p>I have a <code>Set</code> of <code>Long</code> values inside my entity class. I want this Set to store values for particular instances of this class. Here's my code:</p>
  
  <pre><code>@Entity
  @Table(name = "accounts")
  public class DefaultAccount implements Account {
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "ID", nullable = false)
  private Long id;
  
  @Column(name = "email", nullable = false, unique = true)
  private String email;
  
  @Column(name = "password", nullable = false)
  private String password;
  
  @ElementCollection
  private Set&lt;Long&gt; managerAccounts = new HashSet&lt;Long&gt;();
  
  public DefaultAccount(String email, String password) {
          Assert.hasText(email);
          Assert.hasText(password);
          this.email = email;
          this.password = password;
      }
  
  public DefaultAccount(String email, String password, Set&lt;Long&gt; accounts)  {
          this(email, password);
          Assert.notEmpty(accounts);
          this.managerAccounts.addAll(accounts);
      }
  
  // Getters
  
  }
  </code></pre>
  
  <p><strong>Persist code:</strong></p>
  
  <pre><code>private EntityManager entityManager;
  
  @PersistenceContext(unitName = "crm-db")
  public void setEntityManager(EntityManager entityManager) {
      this.entityManager = entityManager;
  }
  
  public EntityManager getEntityManager() {
      return entityManager;
  }
  
  public void createAccount(Account account) {
  entityManager.persist(account);
  }
  </code></pre>
  
  <p>When using the second constructor to persist a <code>DefaultAccount</code> object, JPA does not pass values from <code>managerAccounts</code> <code>Set</code> to the database. What is the issue for this?</p>