title: JPQL query for item in list stored with AttributeConverter
body: <p>As Tobias Liefke suggested <a href="https://stackoverflow.com/questions/34048978/convert-list-in-entity-to-single-string-column-in-database/50352664?noredirect=1#comment87724535_50352664">here</a>, I have implemented an <code>AttributeConverter</code> to store list values into a single string column separated by commas. </p>
  
  <p>Converter Class:</p>
  
  <pre><code>public class ListNumbersConverter implements AttributeConverter&lt;List&lt;Long&gt;, String&gt;
  </code></pre>
  
  <p>Field in Entity class:</p>
  
  <pre><code>@Column(name = "user_ids", nullable = false)
  @Convert(converter = ListNumbersConverter.class)
  private List&lt;Long&gt; userIds;
  </code></pre>
  
  <p>It is working fine but I can't query the records for specific list items. I tried using <code>IN</code> operator in JPQL query like below:</p>
  
  <pre><code>? in userIds 
  </code></pre>
  
  <p>With this I get only a result if input param is the first element in the DB value. e.g: DB value is "1,2,3". I am able to retrieve this record if input param value is 1 for above mentioned query, but not able to retrieve if value is either 2 or 3. How do I have to write my query to retrieve all records that contain a specific item?</p>
  
  <p>My database is MySQL.</p>