Class AbstractEntityClause<R,E extends io.github.mmm.entity.bean.EntityBean,SELF extends AbstractEntityClause<R,E,SELF>>

Type Parameters:
R - type of the result. Only different from <E> for complex selects.
E - type of the entity.
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 Details

  • Constructor Details

    • AbstractEntityClause

      protected AbstractEntityClause(AliasMap aliasMap, E entity, String entityName)
      The constructor.
      Parameters:
      aliasMap - the AliasMap.
      entity - the entity to operate on.
      entityName - the entity name.
  • Method Details

    • getAliasMap

      protected AliasMap getAliasMap()
      Returns:
      the Map to map from alias to entity. A single Map instance is used per DbStatement to ensure unique aliases.
    • getEntity

      public E getEntity()
      Returns:
      the optional EntityBean from where to get the data and to operate on.
    • getEntityName

      public String getEntityName()
      Returns:
      the name of the entity in the database (e.g. table name).
    • setEntityName

      protected void setEntityName(String entityName)
      Parameters:
      entityName - new value of getEntityName().
    • getAlias

      public String getAlias()
      Returns:
      alias the alias (variable name) for the EntityBean to query. Will be created lazily if not already created.
      See Also:
    • hasAlias

      public boolean hasAlias()
      Returns:
      true if an alias has already been assigned or created, false otherwise.
    • as

      public SELF as(String entityAlias)
      Parameters:
      entityAlias - the alias (variable name) for the EntityBean to query.
      Returns:
      this DbClause itself for fluent API calls.
      See Also: