This question already has an answer here:
Will hibernate cache (EHCache for eg) will work with jpa specific code (if I use EntityManager/EM Factory instead of Session/SessionFactory)?
Hibernate offers to select different cache providers for query and L2 caching, but there seems to be no clear statement whether this has an effect if Hibernate is used as plain JPA provider only, i.e. by running queries with
EntityManager instead of
Session. All introductions simply speak of Hibernate which can mean Hibernate with Hibernate-specific features or Hibernate as JPA provider and then provide code examples involving Hibernate - to advertise the use or because it's a necessity?
In case that matters, I'm referring to a Java EE environment.