R
- row classpublic class OrderByTranslator<R> extends ColumnsTranslator<R>
Constructor and Description |
---|
OrderByTranslator(RowTranslator<R> rowTranslator,
OrderBy orderByAnnotation)
Constructs for an order by annotation.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumnTranslator(ColumnTranslator<R> c)
Adds column translator with empty string qualifier.
|
void |
addColumnTranslator(ColumnTranslator<R> c,
java.lang.String qualifier)
Adds translator with a specific qualifier.
|
java.lang.String |
createColumnOrderByPhrase()
Creates column phrase with qualifiers.
|
java.lang.String |
createSql()
Creates order by phrase.
|
protected void |
initColumnTranslatorList(int columns)
Initializes objects to hold all column information.
|
protected void |
initSimpleOrderByColumns(RowTranslator<R> rowTranslator,
java.lang.String[] fieldNames,
java.lang.String qualifier)
Initializes when all columns used the same qualifier.
|
createColumnParameterPhrase, createColumnPhrase, createParameterPhrase, getColumnTranslator, getColumnTranslatorList, getRowClass, isIncluded, isIncludeIdentityColumns, isIncludeReadOnlyColumns, read, setIncludeIdentityColumns, setIncludeReadOnlyColumns, write
public OrderByTranslator(RowTranslator<R> rowTranslator, OrderBy orderByAnnotation) throws TranslatorException
rowTranslator
- row translator from which to get column informationorderByAnnotation
- annotation with order informationTranslatorException
- if errorprotected void initSimpleOrderByColumns(RowTranslator<R> rowTranslator, java.lang.String[] fieldNames, java.lang.String qualifier) throws NoColumnTranslatorException
rowTranslator
- row translator for rowfieldNames
- names of fields used in orderingqualifier
- empty String, "ASC", "DESC"NoColumnTranslatorException
- if no ColumnTranslator
exists for a field namepublic void addColumnTranslator(ColumnTranslator<R> c)
addColumnTranslator
in class ColumnsTranslator<R>
c
- translator to addpublic void addColumnTranslator(ColumnTranslator<R> c, java.lang.String qualifier)
c
- translator to addqualifier
- string to append after the order by column (example "ASC" or "DESC")protected void initColumnTranslatorList(int columns)
initColumnTranslatorList
in class ColumnsTranslator<R>
columns
- approximate number of columns that will be in translator (used as initial capacity)public java.lang.String createSql()
public java.lang.String createColumnOrderByPhrase()