First, even if most JPA persistence providers (like Hibernate, EclipseLink,...) provide support for second level cache(s), JPA 1.0 did not specify support of a second level cache. So, when playing with L2 cache, you are actually using JPA extensions which are not standard and are not portable from one provider to another. Hibernate's @Cache
annotation is not the same than EclipseLink's @Cache
annotation and is not comparable with OpenJPA's @DataCache
annotation. All these are different, they are proprietary. If you are using Hibernate (which is my understanding of your previous questions), you shouldn't look at EclipseLink proprietary things (or for your culture only but this question goes beyond culture if I may).
Second, what makes you think that EclipseLink's @Cache
annotation has anything to do with EHCache? AFAIK, EclipseLink uses its own cache implementation which is not related to EHCache.
Actually, I have the feeling that you are a bit lost here. You should maybe slow down a bit and do things step after step: choose one solution, stick with it, identify what you have to do, implements things one by one, and get the whole thing working. Focus on your goal, stop gathering more information for now, take some time to digest the new things you've learned.