HHH-2188 Query metadata gives NPE for polymorphic queries
This commit is contained in:
parent
eb7af53a51
commit
756b42ec6e
|
@ -40,6 +40,7 @@ import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import javax.naming.Reference;
|
import javax.naming.Reference;
|
||||||
import javax.naming.StringRefAddr;
|
import javax.naming.StringRefAddr;
|
||||||
|
|
||||||
|
@ -104,6 +105,7 @@ import org.hibernate.engine.profile.Association;
|
||||||
import org.hibernate.engine.profile.Fetch;
|
import org.hibernate.engine.profile.Fetch;
|
||||||
import org.hibernate.engine.profile.FetchProfile;
|
import org.hibernate.engine.profile.FetchProfile;
|
||||||
import org.hibernate.engine.query.spi.QueryPlanCache;
|
import org.hibernate.engine.query.spi.QueryPlanCache;
|
||||||
|
import org.hibernate.engine.query.spi.ReturnMetadata;
|
||||||
import org.hibernate.engine.spi.CacheImplementor;
|
import org.hibernate.engine.spi.CacheImplementor;
|
||||||
import org.hibernate.engine.spi.FilterDefinition;
|
import org.hibernate.engine.spi.FilterDefinition;
|
||||||
import org.hibernate.engine.spi.Mapping;
|
import org.hibernate.engine.spi.Mapping;
|
||||||
|
@ -151,7 +153,6 @@ import org.hibernate.tuple.entity.EntityTuplizer;
|
||||||
import org.hibernate.type.AssociationType;
|
import org.hibernate.type.AssociationType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.TypeResolver;
|
import org.hibernate.type.TypeResolver;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1195,15 +1196,15 @@ public final class SessionFactoryImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type[] getReturnTypes(String queryString) throws HibernateException {
|
public Type[] getReturnTypes(String queryString) throws HibernateException {
|
||||||
return queryPlanCache.getHQLQueryPlan( queryString, false, Collections.EMPTY_MAP )
|
final ReturnMetadata metadata = queryPlanCache.getHQLQueryPlan( queryString, false, Collections.EMPTY_MAP )
|
||||||
.getReturnMetadata()
|
.getReturnMetadata();
|
||||||
.getReturnTypes();
|
return metadata == null ? null : metadata.getReturnTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getReturnAliases(String queryString) throws HibernateException {
|
public String[] getReturnAliases(String queryString) throws HibernateException {
|
||||||
return queryPlanCache.getHQLQueryPlan( queryString, false, Collections.EMPTY_MAP )
|
final ReturnMetadata metadata = queryPlanCache.getHQLQueryPlan( queryString, false, Collections.EMPTY_MAP )
|
||||||
.getReturnMetadata()
|
.getReturnMetadata();
|
||||||
.getReturnAliases();
|
return metadata == null ? null : metadata.getReturnAliases();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException {
|
public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException {
|
||||||
|
|
Loading…
Reference in New Issue