title: How to call a Database function using spring data jpa?
body: <p>I want to call a database function from spring boot application which will return a decrypted value. </p>
  
  <p>Is it possible to call database functions using spring data jpa? 
  If possible how? </p>
  
  <p>If not possible using spring data jpa, Is there any alternatives to call functions from spring boot?</p>
  
  <p>Here is my function</p>
  
  <pre><code>IF OBJECT_ID('fn_MASK_CARD') IS NOT NULL
      DROP FUNCTION fn_MASK_CARD
  GO
  
  CREATE FUNCTION fn_MASK_CARD (
      @CARD_NUMBER  VARCHAR(19)
      )
     RETURNS VARCHAR(19)
  AS
  BEGIN
      RETURN SUBSTRING(@CARD_NUMBER,1,6)+REPLICATE('#',LEN(@CARD_NUMBER)-10)+
                                                          SUBSTRING(@CARD_NUMBER,LEN(@CARD_NUMBER)-3,LEN(@CARD_NUMBER));
  END
  GO
  </code></pre>