code: @Deprecated
      protected void prepareCriteria(Criteria criteria) {
          if (cacheQueries) {
              criteria.setCacheable(true);
          }
          if (shouldPassReadOnlyToHibernate()) {
              criteria.setReadOnly(true);
          }
          SessionHolder sessionHolder = (SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
          if (sessionHolder != null && sessionHolder.hasTimeout()) {
              criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds());
          }
      }
docs: Prepare the given Criteria object, applying cache settings and/or a
  transaction timeout.
  
  @param criteria the Criteria object to prepare
  @deprecated Deprecated because Hibernate Criteria are deprecated