JPA: caching queries

前端 未结 6 1572
心在旅途
心在旅途 2021-02-07 08:13

I\'m using JPA to load and persist entities in my Java EE-based web application. Hibernate is used as an implementation of JPA, but I don\'t use Hibernate-specific features and

6条回答
  •  清酒与你
    2021-02-07 08:49

    You can't prepare queries that are not named. That is the main reason you should try to have named queries rather than simple queries inside your code. Also, named queries can be cached while simple queries inside your java code cannot. Of course this is an optional feature and is enabled using hints on your named query.

提交回复
热议问题