My requirement is i need to call 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.
below error i am getting
java.lang.IllegalArgumentException: org.hibernate.QueryException:
No data type for node:
org.hibernate.hql.internal.ast.tree.MethodNode
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'todate' {originalText=todate}
Please help