Remove functionality not supported in Hibernate 6

Closes #16330
This commit is contained in:
Alexander Schwartz 2023-01-12 13:23:06 +01:00 committed by Václav Muzikář
parent 77a494d3be
commit 137a2bf0e9
2 changed files with 0 additions and 7 deletions

View file

@ -221,11 +221,8 @@ public class JpaUtils {
SessionFactoryImplementor sessionFactory = entityManager.getEntityManagerFactory().unwrap(SessionFactoryImplementor.class); SessionFactoryImplementor sessionFactory = entityManager.getEntityManagerFactory().unwrap(SessionFactoryImplementor.class);
if (isNative) { if (isNative) {
// NativeSQLQuerySpecification spec = new NativeSQLQuerySpecification(querySql, new NativeSQLQueryReturn[0], Collections.emptySet());
// sessionFactory.getQueryPlanCache().getNativeSQLQueryPlan(spec);
sessionFactory.addNamedQuery(queryName, entityManager.createNativeQuery(querySql)); sessionFactory.addNamedQuery(queryName, entityManager.createNativeQuery(querySql));
} else { } else {
// sessionFactory.getQueryPlanCache().getHQLQueryPlan(querySql, false, Collections.emptyMap());
sessionFactory.addNamedQuery(queryName, entityManager.createQuery(querySql)); sessionFactory.addNamedQuery(queryName, entityManager.createQuery(querySql));
} }
} }

View file

@ -147,12 +147,8 @@ public class JpaMapUtils {
SessionFactoryImplementor sessionFactory = entityManager.getEntityManagerFactory().unwrap(SessionFactoryImplementor.class); SessionFactoryImplementor sessionFactory = entityManager.getEntityManagerFactory().unwrap(SessionFactoryImplementor.class);
if (isNative) { if (isNative) {
// deprecation notes mention usage of a new QueryEngine in hibernate 6
// NativeSQLQuerySpecification spec = new NativeSQLQuerySpecification(querySql, new NativeSQLQueryReturn[0], Collections.emptySet());
// sessionFactory.getQueryPlanCache().getNativeSQLQueryPlan(spec);
sessionFactory.addNamedQuery(queryName, entityManager.createNativeQuery(querySql)); sessionFactory.addNamedQuery(queryName, entityManager.createNativeQuery(querySql));
} else { } else {
// sessionFactory.getQueryPlanCache().getHQLQueryPlan(querySql, false, Collections.emptyMap());
sessionFactory.addNamedQuery(queryName, entityManager.createQuery(querySql)); sessionFactory.addNamedQuery(queryName, entityManager.createQuery(querySql));
} }
} }