Module io.github.mmm.entity.bean
Package io.github.mmm.entity.bean.sql
Class AbstractEntityClause<E extends EntityBean,SELF extends AbstractEntityClause<E,SELF>>
- java.lang.Object
-
- io.github.mmm.marshall.AbstractMarshallingObject
-
- io.github.mmm.entity.bean.sql.AbstractClause
-
- io.github.mmm.entity.bean.sql.AbstractTypedClause<E,SELF>
-
- io.github.mmm.entity.bean.sql.AbstractEntityClause<E,SELF>
-
- Type Parameters:
E- type of theentity.SELF- type of this class itself.
- All Implemented Interfaces:
Clause,TypedClause<E>,io.github.mmm.marshall.MarshallableObject,io.github.mmm.marshall.Marshaller<Object>,io.github.mmm.marshall.Marshalling<Object>,io.github.mmm.marshall.MarshallingObject,io.github.mmm.marshall.UnmarshallableObject,io.github.mmm.marshall.Unmarshaller<Object>
- Direct Known Subclasses:
AbstractEntitiesClause,CreateIndexOn,CreateTable,EntitySubClause,Into,Update
public abstract class AbstractEntityClause<E extends EntityBean,SELF extends AbstractEntityClause<E,SELF>> extends AbstractTypedClause<E,SELF>
AAbstractEntityClauseis aClauseof an SQLStatementthat specifies theentityand/orentity name(table) to operate on.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected Eentitystatic StringNAME_ALIASName of propertyaliasfor marshaling.static StringNAME_ENTITYName of propertygetEntityName()for marshalling.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEntityClause(E entity)The constructor.protectedAbstractEntityClause(E entity, String entityName)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELFas(String entityAlias)StringgetAlias()EgetEntity()StringgetEntityName()protected voidreadProperty(io.github.mmm.marshall.StructuredReader reader, String name)voidsetEntityName(String entityName)protected voidwriteProperties(io.github.mmm.marshall.StructuredWriter writer)-
Methods inherited from class io.github.mmm.entity.bean.sql.AbstractTypedClause
self
-
Methods inherited from class io.github.mmm.entity.bean.sql.AbstractClause
getMarshallingName, toString
-
-
-
-
Field Detail
-
NAME_ENTITY
public static final String NAME_ENTITY
Name of propertygetEntityName()for marshalling.- See Also:
- Constant Field Values
-
NAME_ALIAS
public static final String NAME_ALIAS
Name of propertyaliasfor marshaling.- See Also:
- Constant Field Values
-
entity
protected final transient E extends EntityBean entity
- See Also:
getEntityName()
-
-
Constructor Detail
-
AbstractEntityClause
protected AbstractEntityClause(E entity)
The constructor.- Parameters:
entity- theentity.
-
AbstractEntityClause
protected AbstractEntityClause(E entity, String entityName)
The constructor.- Parameters:
entity- theentityto operate on.entityName- theentity name.
-
-
Method Detail
-
getEntity
public E getEntity()
- Returns:
- the optional
EntityBeanfrom where to get the data and to operate on.
-
getEntityName
public String getEntityName()
- Returns:
- the name of the
entityin the database (e.g. table name).
-
setEntityName
public void setEntityName(String entityName)
- Parameters:
entityName- new value ofgetEntityName().
-
getAlias
public String getAlias()
- Returns:
- alias the alias (variable name) for the
EntityBeanto query. - See Also:
as(String)
-
as
public SELF as(String entityAlias)
- Parameters:
entityAlias- the alias (variable name) for theEntityBeanto query.- Returns:
- this
Clauseitself for fluent API calls. - See Also:
getAlias()
-
writeProperties
protected void writeProperties(io.github.mmm.marshall.StructuredWriter writer)
- Overrides:
writePropertiesin classAbstractClause
-
readProperty
protected void readProperty(io.github.mmm.marshall.StructuredReader reader, String name)- Overrides:
readPropertyin classAbstractClause
-
-