R
- row classpublic class PrimaryKeyWhereTranslator<R> extends AbstractWhereTranslator<R>
Column.primaryKey()
or Column.identity()
annotations or
by Row.primaryKeyFields()
.Constructor and Description |
---|
PrimaryKeyWhereTranslator(RowTranslator<R> rowTranslator)
Constructs based upon a row translator.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addColumnTranslator(java.lang.reflect.Field f,
java.lang.String annotationName)
Adds a
ColumnTranslator for a field. |
addColumnTranslator, addColumnTranslator, createColumnParameterPhrase, createSql, getParameters, getRowTranslator, initColumnTranslatorList, isCollectionOperand, setParameters
createColumnPhrase, createParameterPhrase, getColumnTranslator, getColumnTranslatorList, getRowClass, isIncluded, isIncludeIdentityColumns, isIncludeReadOnlyColumns, read, setIncludeIdentityColumns, setIncludeReadOnlyColumns, write
public PrimaryKeyWhereTranslator(RowTranslator<R> rowTranslator) throws TranslatorException
Row.primaryKeyFields()
is not empty, then
fields from Row.primaryKeyFields()
are used. Otherwise Column
for class
fields are used. If Row.primaryKeyFields()
is empty and no Column
annotation
exists for row, then the first declared field will be used as the primary key.rowTranslator
- obtain primary key information from this translatorTranslatorException
- if errorprotected void addColumnTranslator(java.lang.reflect.Field f, java.lang.String annotationName) throws TranslatorException
ColumnTranslator
for a field. Invoked by constructor.f
- add translator for this fieldannotationName
- annotation name to display in exception messageTranslatorException
- if no column translator exists for field