title: Constants as parameter in NamedQueries is it a good practice?
body: <p>I'm using constants to organize my <code>@NamedQueries</code>, but I'm in doubt about the parameters, is it a good practice use constants as parameters too?</p>
  
  <p>For example, in the whole application my NamedQueries filter by a company Id. So I created:</p>
  
  <pre><code>public static final String PARAM_EMPRESA_ID = "empresaId";
  </code></pre>
  
  <p>And I use like this:</p>
  
  <pre><code>@NamedQuery(name = EmbalagemAbaSuperiorTipo.QUERY_FETCH_BY_EMPRESA,
              query = "SELECT ep FROM EmbalagemAbaSuperiorTipo ep WHERE ep.empresa.id = :" + AppController.PARAM_EMPRESA_ID + " ORDER BY ep.descricao")
  </code></pre>
  
  <p>Could this cause any performance issue when Hibernate needs to compile the queries? And is there any better recommendation?</p>
  
  <p>Thanks in advance</p>