Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336651 - protected embeddables annotated with @ElementCollection are not brought in cache
Summary: protected embeddables annotated with @ElementCollection are not brought in cache
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 15:34 EST by Yiping Zhao CLA
Modified: 2022-06-09 10:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yiping Zhao CLA 2011-02-08 15:34:49 EST
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());
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:07:48 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:16:04 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink