jdbctemplate query() vs entityManager createQuery()
-
25-09-2019 - |
Question
What is essential difference between these methods?
query() of JdbcTemplate and createQuery() of EntityManager?
As I understand, both execute query?
Solution
JdbcTemplate.query()
executes a raw SQL query via Spring's JDBC API
EntityManager.createQuery()
creates, but does not execute, a JPA query, via the native JPA API.
Same end result, very different mechanism.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow