I have very simple query. I want to make sure that I don't have any confusion.
I saw in the spec that caching is not a part of spec and is provided according to specific orm tool providers.
I'm using Hibernate as an ORM tool in my application. But to be vendor independent I'm using everything (annotations, classes, etc) of JPA (javax.persistence) and not anything specifically provided by Hibernate.
I'm using EntityManager
and EntityManagerFactory
instead of SessionFactory
and Session
.
My query is that in the blogs I saw that cache providers and caching mechanism provided by Hibernate is taken care of by Session (indirectly). So is it possible that EntityManager
will also be able to use to cache providers and cache configuration and hence the entities and queries specified as cacheable will be able to use the caching features?
(I think they should be).
Also is there any api provided by JPA (like Statistics api provided by Hibernate) to measure and view caching statistics?
Please help me in this regards.
相关问题
- JPA one-to-many association to an entity with @Inh
- How does the JPA handle partial, non-disjoint inhe
- How does the JPA handle partial, non-disjoint inhe
- Tell hibernate hbm2ddl not create individual table
- How can I access the repository from the entity in
相关文章
- 这个SpringBoot 2.2.x,怎么判断?
- Hibernate Tutorial - Where to put Mapping File?
- Hibernate doesn't generate cascade
- Setup and Tear Down of Complex Database State With
- Is there a google API to read cached content? [clo
- Writing CRUDRepository's findBy() method on a
- QueryDSL Window functions
- How to left join unrelated entities?
Yes, it will work just fine. If you look at the code,
EntityManagerImpl
delegates to aSessionImpl
, so everything will work as with pure hibernate. Also check this article about caching in JPA 2.0