Community
Participate
Working Groups
I have expanded the jpa/cacheable model by adding CacheableRelationshipsEntity.java which is cacheable true, "protectedEmbeddables" in it is annotated with following: @ElementCollection @CollectionTable( name="CACHREL_PROTECTEMB", joinColumns=@JoinColumn(name="ID") ) public List<ProtectedEmbeddable> getProtectedEmbeddables() { return protectedEmbeddables; } In testCreateEntities(), an instance of ProtectedEmbeddable is added to instance of CacheableRelationshipsEntity, see here: CacheableRelationshipsEntity prse = new CacheableRelationshipsEntity(); prse.addProtectedEmbeddable(pe); em.persist(prse); In the test testEmbeddableProtectedCaching(), the return collection is empty, no related ProtectedEmbeddable entity is brought to cache: CacheableRelationshipsEntity cachedCRE = (CacheableRelationshipsEntity) session.getIdentityMapAccessor().getFromIdentityMap(cre); System.out.println("====the size of the collection is " + cachedCRE.getProtectedEmbeddables().size());
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink