protected void store ( Object id , Object entity , boolean spillOverToL2 ) { String key = cacheKey ( entity . getClass ( ) , id ) ; LOG . debug ( "Writing to L1 >> " + key ) ; sessionCache . put ( key , entity ) ; if ( spillOverToL2 ) { LOG . debug ( "Writing to L2 >>" + key ) ; // save to second level cache Cache c = ( Cache ) getL2Cache ( ) ; if ( c != null ) { c . put ( key , entity ) ; } } }
Save to cache .