title: Spring Data JPA @Query with spel in a IN query
body: <p>I work on Spring Data JPA and I have a repository interface which implements JpaRepository.</p>
  
  <p>I have already written this query which works perfectly:</p>
  
  <pre><code>@Query ("FROM Person p " +
          "LEFT JOIN p.relatedContractRoleAttributions rcras " +
          "WHERE rcras.contract.id = :#{#contract.id} " +
          "AND rcras.relatedContractRole.code = :#{#code}")
  Person findByContractAndRelatedContractRole(@Param ("contract") Contract contract, @Param ("code") String code);
  </code></pre>
  
  <p>Now I want to write another query which can find in more than one code so I wrote this query:</p>
  
  <pre><code>@Query ("FROM Person p " +
          "LEFT JOIN p.relatedContractRoleAttributions rcras " +
          "WHERE rcras.contract.id = :#{#contract.id} " +
          "AND rcras.relatedContractRole.code IN (:#{#codes})")
  List&lt;Person&gt; findByContractAndRelatedContractRoles(@Param ("contract") Contract contract, @Param ("codes") String... codes);
  </code></pre>
  
  <p>But when I start my application I have this error:</p>
  
  <pre><code>Caused by: org.hibernate.QueryException: unexpected char: '#' [FROM com.krgcorporate.core.domain.access.Person p LEFT JOIN p.relatedContractRoleAttributions rcras WHERE rcras.contract.id = :#{#contract.id} AND rcras.relatedContractRole.code IN (:__$synthetic$__2)]
  </code></pre>
  
  <p>Do you have any idea why?</p>
  
  <p>Thanks for your help.</p>