I want to call a database function from spring boot application which will return a decrypted value.
Is it possible to call database functions using spring data jpa? If possible how?
If not possible using spring data jpa, Is there any alternatives to call functions from spring boot?
Here is my function
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
@Queryfor that