@ SuppressWarnings ( "unchecked" ) protected < T > T lookup ( Class < T > entityClass , Object id ) { String key = cacheKey ( entityClass , id ) ; LOG . debug ( "Reading from L1 >> " + key ) ; T o = ( T ) sessionCache . get ( key ) ; // go to second-level cache if ( o == null ) { LOG . debug ( "Reading from L2 >> " + key ) ; Cache c = ( Cache ) getL2Cache ( ) ; if ( c != null ) { o = ( T ) c . get ( key ) ; if ( o != null ) { LOG . debug ( "Found item in second level cache!" ) ; } } } return o ; }
Find in cache .