title: JPA @JoinFormula with BindParameter
body: <p>I have a @OneToOne relationship described as below:</p>
  <pre><code>@OneToOne
  @JoinColumnsOrFormulas(
          {
                  @JoinColumnOrFormula(
                          column = @JoinColumn(name = &quot;PRODUCT_ID&quot;, referencedColumnName = &quot;PRODUCT_ID&quot;, insertable = false, updatable = false)
                  ),
                  @JoinColumnOrFormula(
                          column = @JoinColumn(name = &quot;CONFIG_NAME&quot;, referencedColumnName = &quot;CONFIG_NAME&quot;, insertable = false, updatable = false)
                  ),
                  @JoinColumnOrFormula(
                          formula = @JoinFormula(value = &quot;'PT-BT'&quot;, referencedColumnName = &quot;LANG_ID&quot;)
                  )
          }
  )
  private ConfigurationLanguage language;
  </code></pre>
  <p>The column <code>LANG_ID</code>is PrimaryKey on the table mapped by the <code>ConfigurationLanguage</code>entity.</p>
  <p>But now, instead of using the JoinFormula value as hardcoded, I need to pass it dynamically, using a bind parameter...</p>
  <p>Something like this:</p>
  <pre><code>@OneToOne
  @JoinColumnsOrFormulas(
          {
                  @JoinColumnOrFormula(
                          column = @JoinColumn(name = &quot;PRODUCT_ID&quot;, referencedColumnName = &quot;PRODUCT_ID&quot;, insertable = false, updatable = false)
                  ),
                  @JoinColumnOrFormula(
                          column = @JoinColumn(name = &quot;CONFIG_NAME&quot;, referencedColumnName = &quot;CONFIG_NAME&quot;, insertable = false, updatable = false)
                  ),
                  @JoinColumnOrFormula(
                          formula = @JoinFormula(value = &quot;:languageId&quot;, referencedColumnName = &quot;LANG_ID&quot;)
                  )
          }
  )
  private ConfigurationLanguage language;
  </code></pre>
  <p>Passing it to the JPQL Query as bellow:</p>
  <pre><code>TypedQuery&lt;ConfigurationCompany&gt; query = manager.createQuery(&quot;select c from ConfigurationCompany c &quot; +
          &quot;join c.language l &quot; +
          &quot;where c.id.customerId = :customerId &quot; +
          &quot;and c.id.companyId = :companyId &quot; +
          &quot;and c.id.productId = :productId &quot; +
          &quot;and c.id.codFilial = :codFilial &quot; +
          &quot;and (c.id.configName in :configNames or :configNamesEmpty = true)&quot;, ConfigurationCompany.class);
  
  query.setParameter(&quot;customerId&quot;, customerId);
  query.setParameter(&quot;companyId&quot;, companyId);
  query.setParameter(&quot;productId&quot;, productId);
  query.setParameter(&quot;codFilial&quot;, codFilial);
  query.setParameter(&quot;configNames&quot;, configNames);
  query.setParameter(&quot;configNamesEmpty&quot;, configNamesEmpty);
  query.setParameter(&quot;languageId&quot;, &quot;PT-BR&quot;); //&lt;&lt;&lt;&lt; THIS PARAMETER
  </code></pre>
  <p>But it's not working:</p>
  <pre><code>org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException: Invalid filter-parameter name format [languageId]; expecting {filter-name}.{param-name}
  </code></pre>
  <p>What Am I missing?</p>