Class SqlQueryPlan
java.lang.Object
io.ebeaninternal.server.query.SqlQueryPlan
- All Implemented Interfaces:
SpiQueryPlan
Query plan for a native SQL
SqlQuery.
Unlike ORM and DTO query plans there is no associated bean type. The timing
metric is held separately by the relational query engine (the sql.query.*
TimedMetricMap); this plan only owns the bind capture used to later
collect the database query plan via EXPLAIN.
-
Method Summary
Modifier and TypeMethodDescriptionClass<?> beanType()The related entity bean typebooleancollectFor(long exeMicros) Return true if the bind values for this query should be captured (based on the query execution time exceeding the armed threshold).createMeta(String bind, String planString) Return as Database query plan.hash()The hash of the sql.name()The plan name.io.ebean.ProfileLocationThe related profile location.voidqueryPlanInit(long thresholdMicros) Initiate bind capture with the give threshold.voidsetBind(io.ebeaninternal.server.bind.capture.BindCapture capture, long exeMicros, long startNanos) Set the captured bind values used to later collect the database query plan.sql()The SQL for the query plan.
-
Method Details
-
collectFor
public boolean collectFor(long exeMicros) Return true if the bind values for this query should be captured (based on the query execution time exceeding the armed threshold). -
setBind
public void setBind(io.ebeaninternal.server.bind.capture.BindCapture capture, long exeMicros, long startNanos) Set the captured bind values used to later collect the database query plan. -
beanType
Description copied from interface:SpiQueryPlanThe related entity bean type- Specified by:
beanTypein interfaceSpiQueryPlan
-
name
Description copied from interface:SpiQueryPlanThe plan name.- Specified by:
namein interfaceSpiQueryPlan
-
hash
Description copied from interface:SpiQueryPlanThe hash of the sql.- Specified by:
hashin interfaceSpiQueryPlan
-
sql
Description copied from interface:SpiQueryPlanThe SQL for the query plan.- Specified by:
sqlin interfaceSpiQueryPlan
-
profileLocation
public io.ebean.ProfileLocation profileLocation()Description copied from interface:SpiQueryPlanThe related profile location.- Specified by:
profileLocationin interfaceSpiQueryPlan
-
queryPlanInit
public void queryPlanInit(long thresholdMicros) Description copied from interface:SpiQueryPlanInitiate bind capture with the give threshold.- Specified by:
queryPlanInitin interfaceSpiQueryPlan
-
createMeta
Description copied from interface:SpiQueryPlanReturn as Database query plan.- Specified by:
createMetain interfaceSpiQueryPlan- Parameters:
bind- Description of the bind values usedplanString- The raw database query plan
-