@Override public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph) { if (!EntityGraphImpl.class.isInstance(entityGraph)) { throw new IllegalArgumentException( "Unknown type of EntityGraph for making named : " + entityGraph.getClass().getName()); } final EntityGraphImpl<T> copy = ((EntityGraphImpl<T>) entityGraph).makeImmutableCopy(graphName); final EntityGraphImpl old = entityGraphs.put(graphName, copy); if (old != null) { log.debugf("EntityGraph being replaced on EntityManagerFactory for name %s", graphName); } }