title: JPA - ORA-00920: invalid relational operator
body: <p>I am using Spring JPA to retrieve data from Oracle DB.I am passing string parameters</p>
  
  <p>Code:</p>
  
  <pre><code>@Repository
  public interface TbBamiTemplateRepository extends JpaRepository&lt;TbBamiTemplate, TbBamiTemplatePK&gt; {
  
      @Query(value = "SELECT * FROM TB_BAMI_TEMPLATES WHERE referral_queue=:referralQueue AND TXN_TYPE=:txnType AND REFERRAL_RSN=:reffralRsn AND (:wlClause OR (ROLE='ALL' AND (TEMPLATE_TYPE='PUSH' OR TEMPLATE_TYPE='MAIL') )) AND ACTION=:action",nativeQuery=true)
      List&lt;TbBamiTemplate&gt; findRecordTemplateDetails(@Param("referralQueue")String referralQueue, @Param("txnType")String txnType,@Param("reffralRsn")String reffralRsn,@Param("action")String action,@Param("wlClause")String wlClause);
  }
  //wlClause is :(ROLE = OPS AND TEMPLATE_TYPE =MAIL) OR (ROLE = RM1 AND TEMPLATE_TYPE =PUSH) OR (ROLE = RM AND TEMPLATE_TYPE =PUSH) OR (ROLE = ARM AND TEMPLATE_TYPE =PUSH)
  </code></pre>
  
  <p>I am getting below exception:</p>
  
  <pre><code>  org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
    ....
    ....
  
   Caused by: java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator
  </code></pre>