I am trying to invoke a Stored Procedure whose signature looks like the following:
CREATE OR REPLACE PROCEDURE FIND_FIRST_BOOKMARK_GT(bookmark IN NUMBER, cur OUT
Faced with the same issue using @Procedure
. As a workaround, you could refer to the entityManager in the service class and call procedure from it.
@Service
public interface ResponseService {
@PersistenceContext
EntityManager entityManager;
public Response findFirstBookmarkGreaterThan(Long bookmark){
Query query = entityManager.createNamedStoredProcedureQuery("Response.findFirstBookmarkGreaterThan");
query.setParameter("bookmark", bookmark);
return query.getFirstResult();
};
}
Note that Response must be an @Entity
.