Class SqlQueryPlan

java.lang.Object
io.ebeaninternal.server.query.SqlQueryPlan
All Implemented Interfaces:
SpiQueryPlan

public final class SqlQueryPlan extends Object implements 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 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

      public Class<?> beanType()
      Description copied from interface: SpiQueryPlan
      The related entity bean type
      Specified by:
      beanType in interface SpiQueryPlan
    • name

      public String name()
      Description copied from interface: SpiQueryPlan
      The plan name.
      Specified by:
      name in interface SpiQueryPlan
    • hash

      public String hash()
      Description copied from interface: SpiQueryPlan
      The hash of the sql.
      Specified by:
      hash in interface SpiQueryPlan
    • sql

      public String sql()
      Description copied from interface: SpiQueryPlan
      The SQL for the query plan.
      Specified by:
      sql in interface SpiQueryPlan
    • profileLocation

      public io.ebean.ProfileLocation profileLocation()
      Description copied from interface: SpiQueryPlan
      The related profile location.
      Specified by:
      profileLocation in interface SpiQueryPlan
    • queryPlanInit

      public void queryPlanInit(long thresholdMicros)
      Description copied from interface: SpiQueryPlan
      Initiate bind capture with the give threshold.
      Specified by:
      queryPlanInit in interface SpiQueryPlan
    • createMeta

      public SpiDbQueryPlan createMeta(String bind, String planString)
      Description copied from interface: SpiQueryPlan
      Return as Database query plan.
      Specified by:
      createMeta in interface SpiQueryPlan
      Parameters:
      bind - Description of the bind values used
      planString - The raw database query plan