Module storm.foundation
Package st.orm
Class AbstractMetamodel<T extends Data,E,V extends @Nullable Object>
java.lang.Object
st.orm.AbstractMetamodel<T,E,V>
- Type Parameters:
T- the primary table type.E- the field type of the designated element.V- the value type of the designated element.
- All Implemented Interfaces:
Metamodel<T,,E> Navigable<T,,E> TypedMetamodel<T,E, V>
- Direct Known Subclasses:
AbstractKeyMetamodel
public abstract class AbstractMetamodel<T extends Data,E,V extends @Nullable Object>
extends Object
implements TypedMetamodel<T,E,V>
Implementation that is used by the generated models.
- Since:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface st.orm.Metamodel
Metamodel.Key<T extends Data,E>, Metamodel.KeyDelegate<T extends Data, E> -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractMetamodel(Class<E> fieldType) AbstractMetamodel(Class<E> fieldType, String path) AbstractMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent) protectedAbstractMetamodel(Class<E> fieldType, String path, String field, boolean inline, @Nullable Metamodel<T, ?> parent, boolean isColumn) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfield()Returns the field name.Returns the field type of the designated element.final inthashCode()booleanisColumn()Returnstrueif the metamodel corresponds to a database column, returnsfalseotherwise, for example, if the metamodel refers to the root metamodel or an inline record.booleanisInline()Returnstrueif the metamodel corresponds to an inline record, returnsfalseotherwise.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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface st.orm.Metamodel
isIdentical, isSameMethods inherited from interface st.orm.Navigable
asMetamodel, canonical, fieldPath, flatten, tableTypeMethods inherited from interface st.orm.TypedMetamodel
getValue
-
Constructor Details
-
AbstractMetamodel
-
AbstractMetamodel
-
AbstractMetamodel
-
AbstractMetamodel
-
-
Method Details
-
equals
-
hashCode
public final int hashCode()Hash code is based onfieldType()oftable(),path()andfield().The hash is cached: metamodel instances are immutable and are hashed on every compilation-key lookup. The benign race follows the
String.hashCode()pattern, recomputing only when the hash happens to be zero. -
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.Note that a column can also be a table, for example, in the case of a foreign key.
-
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. -
isInline
public boolean isInline()Returnstrueif the metamodel corresponds to an inline record, returnsfalseotherwise. -
fieldType
Returns the field type of the designated element. -
path
Returns the path to the database table. -
field
Returns the field name. -
toString
-