title: Do we have contains method for one to many relationship in CriteriaQuery?
body: <p>I have two relations</p>
  <pre><code>
  public class ObjectiveRelation extends BaseEntity implements Cloneable {
  
    @Column
    private String orgId;
  
    @ManyToOne
    @JoinColumn(name = &quot;descendant_id&quot;, columnDefinition = &quot;BIGINT DEFAULT NULL&quot;)
    private Objective descendantObjective;
  }
  
  
  </code></pre>
  <pre><code>public class Objective extends BaseEntity implements Cloneable {
  
    @Column
    @Enumerated(EnumType.STRING)
    private PrivacyType privacyType;
  
  @ElementCollection
    @CollectionTable
    @Column(name = &quot;user_id&quot;)
    private Set&lt;String&gt; viewPermittedUsers;
  
  </code></pre>
  <p>Now I'm trying to create a derived column (with values either 1 or 0) with this query.
  I'm checking if view_permitted_users is having that particular user or not.</p>
  <pre><code>
  Join&lt;Object, Object&gt; descendantObjectiveJoin = (Join&lt;Object, Object&gt;) objectiveRelationRoot
          .fetch(DESCENDANT_OBJECTIVE);
  
  query.multiselect(objectiveRelationRoot,
  builder.selectCase().when(builder.and(builder.equal(descendantObjectiveJoin.get(PRIVACY_TYPE), CUSTOM),
                      descendantObjectiveJoin.get(VIEW_PERMITTED_USERS).in(Arrays.asList(userId))
                  ), builder.literal(1))
  
  </code></pre>
  <p>But it is throwing error. Caused by: java.sql.SQLException: No value specified for parameter 63. I checked userId is not null while passing. Any other way I can do this?</p>