always create EL query with effective entity class #PL-7225

This commit is contained in:
budarov 2016-05-18 18:43:34 +04:00
parent 83b2194b54
commit 72eee11579

View File

@ -89,7 +89,8 @@ public class QueryImpl<T> implements TypedQuery<T> {
String s = transformQueryString();
log.trace("Transformed JPQL query: " + s);
if (resultClass != null) {
query = (JpaQuery) emDelegate.createQuery(s, resultClass);
Class effectiveClass = metadata.getExtendedEntities().getEffectiveClass(resultClass);
query = (JpaQuery) emDelegate.createQuery(s, effectiveClass);
} else {
query = (JpaQuery) emDelegate.createQuery(s);
}