1st level cache is your current session.
When we talk about caching in Hibernate, we normaly mean 2nd level cache, since that is the 'real' cache. So the annotation applies to that one - 2nd.
ehcache.xml and annotation have no relation between them.
First one tells EhCache how it should cache stuff, the second one tells Hibernate how to deal with annotated entity regarding caching.
Quote:
My goal is to configure ehcache with annotations and without ehcache.xml.
Then change/add Ehcache code.[/quote]