Halo
the two codes below generate the same query. there doesn't seem to be any difference between the addSubgraph and addAttributeNodes methods... so why do there exist two methods?
EntityGraph entityGraph = entityManager.createEntityGraph(Academy.class);
entityGraph.addAttributeNodes("students");
List<Academy> list = entityManager.createQuery("SELECT a FROM Academy a")
.setHint("jakarta.persistence.fetchgraph", entityGraph)
.getResultList();
and
EntityGraph entityGraph = entityManager.createEntityGraph(Academy.class);
entityGraph.addSubgraph("students");
List<Academy> list = entityManager.createQuery("SELECT a FROM Academy a")
.setHint("jakarta.persistence.fetchgraph", entityGraph)
.getResultList();