简体   繁体   English

JPA本机查询和缓存

[英]JPA native query and cache

Does native query in JPA ( createNativeQuery ) supports caching? JPA( createNativeQuery )中的本机查询是否支持缓存?
I am filling my own data transfer object because the sql query joins several tables and takes only several columns form them. 我正在填充我自己的数据传输对象,因为sql查询连接了几个表,并且只从它们中获取几个列。

Regards 问候

This is possible but you must use an explicit .addScalar or .addEntity . 这是可能的,但您必须使用显式的.addScalar.addEntity

See also 也可以看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM