mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 17:15:02 +00:00
HHH-14024 Allow the creation of a different QueryPlan
This commit is contained in:
parent
e23dad19ca
commit
5968044118
@ -18,6 +18,7 @@
|
|||||||
import org.hibernate.Filter;
|
import org.hibernate.Filter;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.QueryException;
|
import org.hibernate.QueryException;
|
||||||
|
import org.hibernate.Session;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification;
|
import org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
@ -152,7 +153,7 @@ public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<Str
|
|||||||
final long startTime = ( stats ) ? System.nanoTime() : 0L;
|
final long startTime = ( stats ) ? System.nanoTime() : 0L;
|
||||||
|
|
||||||
LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString );
|
LOG.tracev( "Unable to locate HQL query plan in cache; generating ({0})", queryString );
|
||||||
value = new HQLQueryPlan( queryString, shallow, enabledFilters, factory );
|
value = createHQLQueryPlan( queryString, shallow, enabledFilters, factory );
|
||||||
|
|
||||||
if ( stats ) {
|
if ( stats ) {
|
||||||
final long endTime = System.nanoTime();
|
final long endTime = System.nanoTime();
|
||||||
@ -172,6 +173,10 @@ public HQLQueryPlan getHQLQueryPlan(String queryString, boolean shallow, Map<Str
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected HQLQueryPlan createHQLQueryPlan(String queryString, boolean shallow, Map<String, Filter> enabledFilters, SessionFactoryImplementor factory) {
|
||||||
|
return new HQLQueryPlan( queryString, shallow, enabledFilters, factory );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the query plan for the given collection HQL filter fragment, creating it and caching it if not already cached
|
* Get the query plan for the given collection HQL filter fragment, creating it and caching it if not already cached
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user