JPA2.0 support of custom user-types and second level cache

≯℡__Kan透↙ 提交于 2019-12-01 17:47:53

Does JPA2.0 support custom user-types?

Nothing beyond @Embedded and @Embeddable (already in JPA 1.0). Depending on the complexity of your needs, they might do the job).

I would imagine, but I don't actually know, that JPA2.0 also defines a spec for second-level cache providers.

JPA 2.0 defines methods on the EntityManager to access the second level cache that is maintained by the persistence provider, a Cacheable annotation, some other things. But the way to plug a cache on your JPA provider is provider specific. So no, JPA doesn't define a spec for L2 cache providers. And if you want to use Terracota as the L2 cache provider with Hibernate as JPA 2.0 implementation, look at the Hibernate integration documentation.

References

  • JPA 2.0 specification
    • Section 3.7 "Caching"
    • Section 7.10 "Cache Interface"
    • Section 11.1.7 "Cacheable Annotation"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!