java.lang.Object
st.orm.template.impl.MetamodelImpl<T,E>
- Type Parameters:
T- the primary table type.E- the record component type of the designated element.
- All Implemented Interfaces:
Metamodel<T,E>
Implementation that is used by the generated models.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionMetamodelImpl(Class<E> componentType) MetamodelImpl(Class<E> componentType, String path) MetamodelImpl(Class<E> componentType, String path, String component, boolean inline, Metamodel<T, ?> parent) -
Method Summary
Modifier and TypeMethodDescriptionReturns the component path.Returns the component type of the designated element.booleanisColumn()Returnstrueif the metamodel corresponds to a database column, returnsfalseotherwise, for example if the metamodel refers to the root metamodel or an inline record.Creates a new metamodel for the given record type.Creates a new metamodel for the given root rootTable and path.path()Returns the path to the database table.root()Returns the root metamodel.table()Returns the table that holds the column to which this metamodel is pointing.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface st.orm.template.Metamodel
componentPath
-
Constructor Details
-
MetamodelImpl
-
MetamodelImpl
-
MetamodelImpl
-
-
Method Details
-
of
Creates a new metamodel for the given record type.- Type Parameters:
T- the root table type.- Parameters:
table- the root table to create the metamodel for.- Returns:
- a new metamodel for the given record type.
-
of
public static <T extends Record,E> Metamodel<T,E> of(@Nonnull Class<T> rootTable, @Nonnull String path) Creates a new metamodel for the given root rootTable and path.This method is typically used to manually create a metamodel for a component of a record, which can be useful in cases where the metamodel can not be generated automatically, for example local records.
- Type Parameters:
T- the root rootTable type.E- the record component type of the designated component.- Parameters:
rootTable- the root rootTable to create the metamodel for.path- a dot separated path starting from the root rootTable.- Returns:
- a new metamodel for the given root rootTable and path.
- Throws:
PersistenceException- if the metamodel cannot be created for the root rootTable and path.
-
isColumn
public boolean isColumn()Returnstrueif the metamodel corresponds to a database column, returnsfalseotherwise, for example if the metamodel refers to the root metamodel or an inline record. -
root
Returns the root metamodel. This is typically the table specified in the FROM clause of a query. -
table
Returns the table that holds the column to which this metamodel is pointing. If the metamodel points to an inline record, the table is the parent table of the inline record. If the metamodel is a root metamodel, the root table is returned. -
componentType
Returns the component type of the designated element.- Specified by:
componentTypein interfaceMetamodel<T extends Record,E> - Returns:
- the component type of the designated element.
-
path
Returns the path to the database table. -
component
Returns the component path. -
toString
-