JPA MapsId example

MapsId annotation in JPA is used in ManyToOne or OneToOne relationships when mapping using EmbeddedId is involved. Let us see a JPA MapsId example to demonstrate the same. JPA MapsId Example: Consider we have following. Employee entity with fields idEmployee…

JPA Caching Example

Previously, we have seen the cocnept of JPA Caching. Let us now see a JPA Caching Example which shows how to configure JPA Cache and cache enttities using @Cacheable annotation. We know that EntityManager is first level cache and EntityManagerFactory…