public class ColumnsSelectChunk extends SqlChunk
Column reference is specified as:
where property name is
a property of the entity references by table reference. Result is rendered as:
tableReference
.propertyNametableName.column
or alias.column
(if table has an alias).
There are some special values for propertyName
If previous chunk is also a column chunk, comma separator will be added in between.
Note that column alias are appended to the column name (using 'as' construct).
Macro rules:
$C{tableRef}
is rendered as FOO.col1, FOO.col2,...$C{tableRef.*}
is equal to above, renders all entity columns$C{tableRef.+}
renders to only identity columns$C{tableRef.%}
renders all but identity columns$C{tableRef.colRef}
is rendered as FOO.column$C{tableRef.[colRef1,colRef2|...]}
is rendered as FOO.column1, FOO.column2,..., support id sign (+)$C{entityRef.colRef}
renders to FOO$column$C{hint.entityRef...}
defines a hint$C{hint:entityRef...}
defines a hint with custom name$C{.columName}
renders as column name$C{hint:.columName}
renders as column name and defines its hintModifier and Type | Field and Description |
---|---|
protected java.lang.String |
columnAliasSeparator |
protected java.lang.String |
columnRef |
protected java.lang.String[] |
columnRefArr |
protected java.lang.String |
hint |
protected int |
includeColumns |
protected java.lang.String |
tableRef |
CHUNK_INSERT, CHUNK_MATCH, CHUNK_RAW, CHUNK_REFERENCE, CHUNK_SELECT_COLUMNS, CHUNK_TABLE, CHUNK_UPDATE, CHUNK_VALUE, COLS_ALL, COLS_ALL_BUT_ID, COLS_NA, COLS_NA_MULTI, COLS_ONLY_EXISTING, COLS_ONLY_IDS, nextChunk, previousChunk, templateData
Constructor and Description |
---|
ColumnsSelectChunk(DbEntityManager dbEntityManager,
java.lang.String columnAliasSeparator,
java.lang.String reference) |
ColumnsSelectChunk(DbEntityManager dbEntityManager,
java.lang.String columnAliasSeparator,
java.lang.String tableRef,
boolean includeAll) |
ColumnsSelectChunk(DbEntityManager dbEntityManager,
java.lang.String columnAliasSeparator,
java.lang.String tableRef,
java.lang.String... columnRefArr) |
ColumnsSelectChunk(DbEntityManager dbEntityManager,
java.lang.String columnAliasSeparator,
java.lang.String tableRef,
java.lang.String columnRef) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendAlias(java.lang.StringBuilder query,
DbEntityDescriptor ded,
DbEntityColumnDescriptor dec)
Appends alias.
|
protected void |
appendColumnName(java.lang.StringBuilder query,
DbEntityDescriptor ded,
DbEntityColumnDescriptor dec)
Simply appends column name with optional table reference and alias.
|
void |
init(TemplateData templateData)
Counts actual real hints.
|
void |
process(java.lang.StringBuilder out)
Process the chunk and appends data to the output.
|
appendMissingSpace, defineParameter, findColumnRef, getNextChunk, getPreviousChunk, insertChunkAfter, isEmptyColumnValue, isPreviousChunkOfSameType, isPreviousChunkOfType, isPreviousMacroChunk, isPreviousRawChunk, lookupName, lookupTableRef, lookupTableRef, lookupType, resolveClass, resolveTable, separateByCommaOrSpace
protected final java.lang.String tableRef
protected final java.lang.String columnRef
protected final java.lang.String[] columnRefArr
protected final int includeColumns
protected final java.lang.String hint
protected final java.lang.String columnAliasSeparator
public ColumnsSelectChunk(DbEntityManager dbEntityManager, java.lang.String columnAliasSeparator, java.lang.String tableRef, java.lang.String columnRef)
public ColumnsSelectChunk(DbEntityManager dbEntityManager, java.lang.String columnAliasSeparator, java.lang.String tableRef, java.lang.String... columnRefArr)
public ColumnsSelectChunk(DbEntityManager dbEntityManager, java.lang.String columnAliasSeparator, java.lang.String tableRef, boolean includeAll)
public ColumnsSelectChunk(DbEntityManager dbEntityManager, java.lang.String columnAliasSeparator, java.lang.String reference)
public void init(TemplateData templateData)
public void process(java.lang.StringBuilder out)
SqlChunk
protected void appendAlias(java.lang.StringBuilder query, DbEntityDescriptor ded, DbEntityColumnDescriptor dec)
protected void appendColumnName(java.lang.StringBuilder query, DbEntityDescriptor ded, DbEntityColumnDescriptor dec)
Copyright © 2003-present Jodd Team