final ColumnAttrib keyAttrib;
if (this.hasAnIndex()) {
// Need to look up the index
final IndexSpecification index = conn.getIndexForTable(this.getIndexName(), mapping.getTableName());
final byte[][] cols = index.getIndexedColumns();
final String indexedColumName = new String(cols[0]);
keyAttrib = mapping.getAttribByVariableName(indexedColumName);
}
else {
keyAttrib = mapping.getKeyAttrib();