code: static EntityManager proxy(EntityManager entityManager) {
      ProxyFactory proxyFactory = new ProxyFactory(entityManager);
      proxyFactory.addAdvice(new RepositoryEntityManagerEntityGraphInjector());
      return (EntityManager) proxyFactory.getProxy();
    }
docs: Builds a proxy on entity manager which is aware of methods that can make use of query hints.
  
  @param entityManager The entity manager to proxy
  @return The proxied entity manager