Does native query i开发者_StackOverflow中文版n JPA (createNativeQuery) supports caching?
I am filling my own data transfer object because the sql query joins several tables and takes only several colu
Does native query i开发者_StackOverflow中文版n JPA (createNativeQuery
) supports caching?
I am filling my own data transfer object because the sql query joins several tables and takes only several columns form them.
Regards
This is possible but you must use an explicit .addScalar
or .addEntity
.
See also
- Caching SQL query problem
- Hibernate: Truly Understanding the Second-Level and Query Caches
精彩评论