Package st.orm

Interface TypedMetamodel<T extends Data,E,V extends @Nullable Object>

Type Parameters:
T - the root table type.
E - the field type.
V - the declared component type, possibly nullable.
All Superinterfaces:
Metamodel<T,E>, Navigable<T,E>
All Known Implementing Classes:
AbstractKeyMetamodel, AbstractMetamodel

public interface TypedMetamodel<T extends Data,E,V extends @Nullable Object> extends Metamodel<T,E>
A Metamodel that also carries the declared component type of the field it represents.

The component type parameter V reflects how the field is declared on the record: for eagerly fetched fields, V equals the field type E; for Ref fields, V is Ref<E>. APIs bind both parameters to the same type variable to require an eagerly fetched path at compile time, for example TypedMetamodel<T, V, V>.

V admits nullable arguments: the generated nullable metamodel chain binds it to the nullable form of the component type, carrying the field's nullability in the type.

The metamodels generated for record fields implement this interface via AbstractMetamodel.

Since:
1.13
  • Method Details

    • getValue

      V getValue(T record)
      Extracts the value of the field represented by this metamodel from the given record, typed as the declared component type: the field type itself for eagerly fetched fields, Ref<E> for Ref fields.
      Specified by:
      getValue in interface Metamodel<T extends Data,E>
      Parameters:
      record - the root record from which the value is extracted.
      Returns:
      the extracted value, or null if the value cannot be resolved.
      Since:
      1.13