Package st.orm

Class AbstractNavigableMetamodel<T extends Data,E>

java.lang.Object
st.orm.AbstractNavigableMetamodel<T,E>
Type Parameters:
T - the root table type.
E - the field type of the designated element.
All Implemented Interfaces:
Navigable<T,E>

public abstract class AbstractNavigableMetamodel<T extends Data,E> extends Object implements Navigable<T,E>
Base implementation for generated navigation-only metamodels — nodes that navigate the entity graph beyond a Ref foreign key. Such a node locates a column for querying (filter, join, order, group, select) but does not extract values, because the referenced entity is not loaded. It therefore implements Navigable rather than Metamodel, which is what makes value-based operations (for example getResultGroupedBy) fail to compile on a reference-crossing path.
Since:
1.13
  • Constructor Details

    • AbstractNavigableMetamodel

      public AbstractNavigableMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Navigable<T,?> parent)
    • AbstractNavigableMetamodel

      protected AbstractNavigableMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Navigable<T,?> parent, boolean isColumn)
  • Method Details

    • equals

      public final boolean equals(Object o)
      Equality is based on Navigable.tableType(), path() and field(), matching AbstractMetamodel, so a navigation-only node and a full metamodel that reach the same field through the same path compare equal.
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • isColumn

      public boolean isColumn()
      Description copied from interface: Navigable
      Returns true if this navigable corresponds to a database column, false otherwise (for example the root navigable or an inline record). A foreign key column is also a column.
      Specified by:
      isColumn in interface Navigable<T extends Data,E>
      Returns:
      true if this navigable maps to a column, false otherwise.
    • root

      public Class<T> root()
      Description copied from interface: Navigable
      Returns the root table type. This is typically the table specified in the FROM clause of a query.
      Specified by:
      root in interface Navigable<T extends Data,E>
      Returns:
      the root table type.
    • table

      public Navigable<T,? extends Data> table()
      Description copied from interface: Navigable
      Returns the navigable of the table that holds the column this navigable points to. For an inline record the table is the parent table; for the root navigable the root table is returned.
      Specified by:
      table in interface Navigable<T extends Data,E>
      Returns:
      the navigable of the table that holds the column this navigable points to.
    • isInline

      public boolean isInline()
      Description copied from interface: Navigable
      Returns true if this navigable corresponds to an inline record, false otherwise.
      Specified by:
      isInline in interface Navigable<T extends Data,E>
      Returns:
      true if this navigable maps to an inline record, false otherwise.
    • fieldType

      public Class<E> fieldType()
      Description copied from interface: Navigable
      Returns the field type of the designated element.
      Specified by:
      fieldType in interface Navigable<T extends Data,E>
      Returns:
      the field type of the designated element.
    • path

      public String path()
      Description copied from interface: Navigable
      Returns the path to the database table.
      Specified by:
      path in interface Navigable<T extends Data,E>
      Returns:
      path to the database table.
    • field

      public String field()
      Description copied from interface: Navigable
      Returns the field name.
      Specified by:
      field in interface Navigable<T extends Data,E>
      Returns:
      field name.
    • toString

      public String toString()
      Overrides:
      toString in class Object