title: JPA: Saving List of values as comma separated values
body: <p>I am receiving a simple list of values part of JSON request which I want to save as comma separated values. Tried using following but it did not work.</p>
  
  <pre><code>@Column(nullable = true)
  @GeneratedValue(strategy = GenerationType.AUTO)
  private ArrayList&lt;String&gt; services = new ArrayList&lt;String&gt;() ;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>@Column(nullable = true)
  @ElementCollection(targetClass = String.class)
  private List&lt;String&gt; services = new ArrayList&lt;String&gt;() ;
  </code></pre>
  
  <p><code>@ElementCollection</code> threw  an exception saying <code>table services does not exist</code>.</p>