title: How to call a stored procedure in Spring Boot?
body: <p>A query for a stored procedure for multiple delete yield an error message shown way below.</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE OR REPLACE PROCEDURE delete_dim_page(_page_id bigint)
   LANGUAGE plpgsql
   AS $procedure$
      
  begin
     delete from page_catalog where page_type_id = _page_id;
     delete from page_type where page_type_id = _page_id;
  END;
  $procedure$
  ;
  </code></pre>
  <p><strong>//entityclass</strong></p>
  <pre class="lang-java prettyprint-override"><code>@NamedStoredProcedureQuery(
      name = &quot;firstProcedure&quot;,
      procedureName = &quot;delete_dim_page&quot;,
      parameters = {
          @StoredProcedureParameter(
              mode=ParameterMode.IN,
              name=&quot;_page_id&quot;,
              type = Long.class
          )
      }
  )
  </code></pre>
  <p><strong>//service.java</strong></p>
  <pre class="lang-java prettyprint-override"><code>    StoredProcedureQuery query = em.createNamedStoredProcedureQuery(&quot;firstProcedure&quot;);
      query.setParameter(&quot;_page_id&quot;, pageTypeId);
      query.execute();
  </code></pre>
  <p>yields</p>
  <blockquote>
  <p>ERROR: delete_dim_page1(bigint) is a procedure<br />
  Hint: To call a procedure, use CALL.</p>
  </blockquote>
  <p>What is a recommendable way to call a stored procedure in Spring Boot?</p>