- All Implemented Interfaces:
Serializable,Comparable<StatementOrigin>,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe statement was asked for directly: a repository call, a query builder, or a template.The statement resolves a reference whose record was not loaded, throughRef.fetch()orRef.fetchOrNull(). -
Method Summary
Modifier and TypeMethodDescriptionstatic StatementOriginReturns the enum constant of this class with the specified name.static StatementOrigin[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DIRECT
The statement was asked for directly: a repository call, a query builder, or a template. -
FETCH
The statement resolves a reference whose record was not loaded, throughRef.fetch()orRef.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
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
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 nameNullPointerException- if the argument is null
-