How to call custom oracle function in spring boot application?

257 Views Asked by At

I need to call custom oracle function from spring boot application without using native query.

below is my oracle function which is taking Date as input

create or replace FUNCTION todate(src_dt IN date) 
RETURN date
is
BEGIN 
RETURN(to_date(src_dt)); 
END;

i was searching solution on internet but so far did't find. people are saying some custom dialect need to create but not found any perfect step by step link.

below is my java code :-

 Query query1 = entityManager.createQuery("select todate(ActSubT.createdDt) from ActSubT ActSubT");
  List<Object> result=query1.getResultList();

this code should run , as of now its giving error as todate is oracle function and i haven't configured anything in application.yml file.

Please help

0

There are 0 best solutions below