1

Using Java 8, Spring 4.3.9 and a Postgre database.

I have a stored function defined as followed :

CREATE OR REPLACE FUNCTION public.getinformations (
  IN stateId integer,
  IN dateStart timestamp,
  IN dateEnd timestamp
)
  RETURNS SETOF DECLAREDTYPE
LANGUAGE plpgsql
AS $$ [...]

I want to call this in Spring and used StoredProcedureQuery :

StoredProcedureQuery query = entityManager.createStoredProcedureQuery("public.getinformations ")
    .registerStoredProcedureParameter("stateId",Long.class,ParameterMode.IN)
    .registerStoredProcedureParameter("dateStart",LocalDateTime.class,ParameterMode.IN)
    .registerStoredProcedureParameter("dateEnd",LocalDateTime.class,ParameterMode.IN);

But when the function is fetched I'm getting the following error :

ERROR: function public.getinformations (bigint, bytea, bytea) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Matthieu Durand
  • 107
  • 2
  • 10

0 Answers0