public M findFirstByCache ( String cacheName , Object key , String sql , Object ... paras ) { ICache cache = _getConfig ( ) . getCache ( ) ; M result = cache . get ( cacheName , key ) ; if ( result == null ) { result = findFirst ( sql , paras ) ; cache . put ( cacheName , key , result ) ; } return result ; }
Find first model by cache . I recommend add limit 1 in your sql .