- Type Parameters:
T- the root table type (the entity from which the path originates).E- the field type of the designated element.
- All Known Subinterfaces:
Metamodel<T,,E> Metamodel.Key<T,,E> TypedMetamodel<T,E, V>
- All Known Implementing Classes:
AbstractKeyMetamodel,AbstractMetamodel,AbstractNavigableMetamodel,Metamodel.KeyDelegate
Metamodel: everything needed to locate a field within the entity graph and use it
in a query (filter, join, order, group, select), without exposing value extraction.
Metamodel extends Navigable and adds the value-based operations (getValue, isSame,
isIdentical). Splitting these apart lets a path navigate beyond a Ref foreign key: the
referenced entity is not loaded, so such a path is Navigable (queryable) but not a full Metamodel
(not value-extractable). Query methods that only need to locate a column accept Navigable; methods that read
a value from a record (for example getResultGroupedBy) require a TypedMetamodel, so applying them to a
reference-crossing path fails to compile rather than at runtime.
- Since:
- 1.13
-
Method Summary
Modifier and TypeMethodDescriptionReturns this navigable as a metamodel that can locate a column.Returns the canonical metamodel for the field represented bythis.field()Returns the field name.default StringReturns the field path.Returns the field type of the designated element.flatten()Returns a flat list of leaf metamodels for this navigable.booleanisColumn()Returnstrueif this navigable corresponds to a database column,falseotherwise (for example the root navigable or an inline record).booleanisInline()Returnstrueif this navigable corresponds to an inline record,falseotherwise.path()Returns the path to the database table.root()Returns the root table type.table()Returns the navigable of the table that holds the column this navigable points to.Returns the type of the table that holds the column this navigable points to.
-
Method Details
-
canonical
Returns the canonical metamodel for the field represented bythis. The result captures only the table type and field, independent of position within a table graph, which makes it suitable for equality checks and column resolution.- Returns:
- the canonical metamodel for this navigable.
-
isColumn
boolean isColumn()Returnstrueif this navigable corresponds to a database column,falseotherwise (for example the root navigable or an inline record). A foreign key column is also a column.- Returns:
trueif this navigable maps to a column,falseotherwise.
-
isInline
boolean isInline()Returnstrueif this navigable corresponds to an inline record,falseotherwise.- Returns:
trueif this navigable maps to an inline record,falseotherwise.
-
root
Returns the root table type. This is typically the table specified in the FROM clause of a query.- Returns:
- the root table type.
-
table
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.- Returns:
- the navigable of the table that holds the column this navigable points to.
-
tableType
Returns the type of the table that holds the column this navigable points to.- Returns:
- the type of the table that holds the column this navigable points to.
-
path
String path()Returns the path to the database table.- Returns:
- path to the database table.
-
fieldType
Returns the field type of the designated element.- Returns:
- the field type of the designated element.
-
field
String field()Returns the field name.- Returns:
- field name.
-
fieldPath
Returns the field path.- Returns:
- field path.
-
flatten
Returns a flat list of leaf metamodels for this navigable. An inline record is recursively expanded into its individual column metamodels; any other navigable returns a singleton list, because it names its own column(s): an entity node names the foreign key column(s) that reference it, and a scalar names its column. The returned metamodels keep their position in the graph, so they are not canonical.The query builder's
groupByandorderBymetamodel overloads do not use this expansion: they resolve a path to the same columns a predicate on that path would use, so a multi-column path (a compound foreign key, an inline record) expands during column resolution rather than here.- Returns:
- a list of leaf metamodels.
-
asMetamodel
Returns this navigable as a metamodel that can locate a column. A full metamodel is returned as-is; a navigation-only node (one that navigates beyond aRef) is rebuilt into a resolvable metamodel for its path, so it can name a column in WHERE, ORDER BY, GROUP BY and HAVING.A rebuilt metamodel is query-only: it names a column but cannot extract a value from a record, which is why value operations keep taking
Metamodelrather thanNavigable.- Returns:
- this navigable as a metamodel.
- Since:
- 1.13
-