this.update(bean, transactionHandler.getConnection(), relationQuery);
}
public Integer update(T bean, Connection connection, RelationQuery relationQuery) throws SQLException {
UpdateQuery query = null;
try {
this.preUpdateRelations(bean, connection, relationQuery);
query = new UpdateQuery(connection, false, this.updateSQL);
IntegerCounter integerCounter = new IntegerCounter();
// All fields
this.setQueryValues(bean, query, integerCounter, this.columnMap.values());
// Keys from SimpleColumns for where statement
this.setQueryValues(bean, query, integerCounter, this.simpleKeys);
// Keys from many to one relations for where statement
this.setQueryValues(bean, query, integerCounter, this.manyToOneRelationKeys.values());
query.executeUpdate();
} finally {
UpdateQuery.autoCloseQuery(query);
}
this.updateRelations(bean, connection, relationQuery);
return query.getAffectedRows();
}