public <T> T cacheGet(Class<T> aClass, Object id) {
String key = cacheKey(aClass, id);
logger.finest("getting item from cache with cachekey=" + key);
T o = sessionCache != null ? (T) sessionCache.get(key) : null;
if (o == null) {
Cache c = getFactory().getCache(aClass);
if (c != null) {
o = (T) c.getObj(id);
if (o != null) {
logger.finest("Got item from second level cache!");
replaceEntityManager(o, this);
}
}