E
- the generic type of the queried object (typically a Bean
).SELF
- the generic type of this query itself (this) for fluent API calls.public abstract class AbstractStatement<E,SELF extends Statement<E,SELF>> extends Object implements Statement<E,SELF>
Statement
.Modifier and Type | Field and Description |
---|---|
private EntityAlias<?> |
alias |
private Map<String,EntityAlias<?>> |
aliasMap |
private SqlBuilder |
builder |
private SqlDialect |
dialect |
private Map<Class<? extends StatementFeature>,AbstractFeature> |
featureMap |
private Class<E> |
resultClass |
Constructor and Description |
---|
AbstractStatement(SqlDialect dialect,
EntityAlias<?> alias,
Class<E> resultClass)
The constructor.
|
AbstractStatement(SqlDialect dialect,
EntityAlias<E> alias)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlias(EntityAlias<?> entityAlias) |
void |
addAliases(EntityAlias<?>... aliases) |
protected void |
build(SqlBuilder sqlBuilder) |
protected void |
buildStart(SqlBuilder sqlBuilder) |
protected <F extends AbstractFeature> |
createFeature(Class<F> featureClass) |
protected SqlBuilder |
createSqlBuilder() |
protected <F extends AbstractFeature> |
feature(Class<F> featureClass) |
EntityAlias<?> |
getAlias() |
protected SqlBuilder |
getBuilder() |
SqlDialect |
getDialect() |
protected <F extends AbstractFeature> |
getFeature(Class<F> featureClass) |
List<Object> |
getParameters() |
protected Class<E> |
getResultClass() |
String |
getSql() |
boolean |
isSupportingAlias() |
protected SELF |
self() |
String |
toString() |
private final SqlDialect dialect
private final EntityAlias<?> alias
private final Map<Class<? extends StatementFeature>,AbstractFeature> featureMap
private final Map<String,EntityAlias<?>> aliasMap
private SqlBuilder builder
public AbstractStatement(SqlDialect dialect, EntityAlias<E> alias)
dialect
- - see getDialect()
.alias
- - see getAlias()
.public AbstractStatement(SqlDialect dialect, EntityAlias<?> alias, Class<E> resultClass)
dialect
- - see getDialect()
.alias
- - see getAlias()
.resultClass
- - see getResultClass()
.public SqlDialect getDialect()
getDialect
in interface Statement<E,SELF extends Statement<E,SELF>>
SqlDialect
to use.public EntityAlias<?> getAlias()
public boolean isSupportingAlias()
protected Class<E> getResultClass()
Class
reflecting the result or destination of this Statement
. For a regular
Statement
this is getAlias()
.getType()
but e.g. for
constructor
queries this will the top-level class to return.protected <F extends AbstractFeature> F getFeature(Class<F> featureClass)
protected <F extends AbstractFeature> F feature(Class<F> featureClass)
protected <F extends AbstractFeature> F createFeature(Class<F> featureClass)
protected SELF self()
protected SqlBuilder getBuilder()
SqlBuilder
.protected SqlBuilder createSqlBuilder()
SqlContext
.protected void buildStart(SqlBuilder sqlBuilder)
sqlBuilder
- the SqlBuilder
with the query context to build the SQL and bind variables.protected final void build(SqlBuilder sqlBuilder)
sqlBuilder
- the SqlBuilder
with the query context to build the SQL and bind variables.public List<Object> getParameters()
getParameters
in interface Statement<E,SELF extends Statement<E,SELF>>
unmodifiable
List
with the bind variables.public String getSql()
getSql
in interface Command
getSql
in interface Statement<E,SELF extends Statement<E,SELF>>
String
of this Statement
. May only be an SQL fragment as the final
operation such as FeatureFetch.fetch()
will complete the statement. Has to be rebuild after
every modification to the Statement
.public String toString()
public void addAlias(EntityAlias<?> entityAlias)
entityAlias
- the EntityAlias
to add.public void addAliases(EntityAlias<?>... aliases)
aliases
- the EntityAlias
es to add.Copyright © 2001–2016 mmm-Team. All rights reserved.