Package st.orm.spi

Enum Class StatementOrigin

java.lang.Object
java.lang.Enum<StatementOrigin>
st.orm.spi.StatementOrigin
All Implemented Interfaces:
Serializable, Comparable<StatementOrigin>, Constable

public enum StatementOrigin extends Enum<StatementOrigin>
Classifies what caused a statement to execute.

A statement resolving a reference is shaped exactly like a primary key lookup the application could have written itself, so the statement text does not distinguish the two. The origin does, which is what makes the cost of resolving references visible as its own quantity rather than as a share of all lookups.

This property is low-cardinality and suitable as a metric tag.

Since:
1.13
  • Enum Constant Details

    • DIRECT

      public static final StatementOrigin DIRECT
      The statement was asked for directly: a repository call, a query builder, or a template.
    • FETCH

      public static final StatementOrigin FETCH
      The statement resolves a reference whose record was not loaded, through Ref.fetch() or Ref.fetchOrNull().

      There is one such statement per reference the code read that the selecting query did not resolve and the transaction's entity cache did not serve. Naming the reference in the query's fetch plan brings the referenced record back in the same statement instead.

  • Method Details

    • values

      public static StatementOrigin[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StatementOrigin valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null