Search code examples
javaspring-bootspring-data-jpaspring-jdbc

calling function that returns ref cursor without entity in spring jpa


I am looking for a way to call function that returns ref cursor without using entity. I found a way by using CollableStatement. if my spring boot app does not have any other entity to be handled, does it make sense not using jpa at all? and just use java.sql? meaning just connect and execute collablestatement query?

If there is any better way or my understanding is incorrect, please guide.

Thanks!


Solution

  • I don't think it makes sense to use JPA in your case.

    JPA is mainly about CRUD functionality and it seems you are not using any of that.

    I recommend to take a look at Springs JdbcTemplate, it probably fits your needs much better.