| Summary: | protected embeddables annotated with @ElementCollection are not brought in cache | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Yiping Zhao <yiping.zhao> |
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
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());