Module io.github.mmm.orm
Package io.github.mmm.orm.statement
Class AbstractEntityClause<R,E extends io.github.mmm.entity.bean.EntityBean,SELF extends AbstractEntityClause<R,E,SELF>>
java.lang.Object
io.github.mmm.orm.statement.AbstractDbClause
io.github.mmm.orm.statement.AbstractTypedClause<R,SELF>
io.github.mmm.orm.statement.AbstractEntityClause<R,E,SELF>
- Type Parameters:
R- type of the result. Only different from <E> for complex selects.E- type of theentity.SELF- type of this class itself.
- All Implemented Interfaces:
DbClause,TypedClause<R>
- Direct Known Subclasses:
AbstractEntitiesClause,CreateIndexOnClause,CreateTableClause,EntitySubClause,IntoClause
public abstract class AbstractEntityClause<R,E extends io.github.mmm.entity.bean.EntityBean,SELF extends AbstractEntityClause<R,E,SELF>>
extends AbstractTypedClause<R,SELF>
A
AbstractEntityClause is a DbClause of an SQL DbStatement that specifies the
entity and/or entity name (table) to operate on.- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Estatic final StringName of propertyaliasfor marshaling.static final StringName of propertygetEntityName()for marshalling. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEntityClause(AliasMap aliasMap, E entity, String entityName) The constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()protected AliasMapbooleanhasAlias()protected voidsetEntityName(String entityName) Methods inherited from class io.github.mmm.orm.statement.AbstractTypedClause
selfMethods inherited from class io.github.mmm.orm.statement.AbstractDbClause
toString
-
Field Details
-
NAME_ENTITY
Name of propertygetEntityName()for marshalling.- See Also:
-
NAME_ALIAS
Name of propertyaliasfor marshaling.- See Also:
-
entity
- See Also:
-
-
Constructor Details
-
AbstractEntityClause
The constructor.- Parameters:
aliasMap- theAliasMap.entity- theentityto operate on.entityName- theentity name.
-
-
Method Details
-
getAliasMap
-
getEntity
- Returns:
- the optional
EntityBeanfrom where to get the data and to operate on.
-
getEntityName
- Returns:
- the name of the
entityin the database (e.g. table name).
-
setEntityName
- Parameters:
entityName- new value ofgetEntityName().
-
getAlias
- Returns:
- alias the alias (variable name) for the
EntityBeanto query. Will be created lazily if notalready created. - See Also:
-
hasAlias
public boolean hasAlias()- Returns:
trueif analiashas already been assigned or created,falseotherwise.
-
as
- Parameters:
entityAlias- the alias (variable name) for theEntityBeanto query.- Returns:
- this
DbClauseitself for fluent API calls. - See Also:
-