}
private Object executeSelectKey(SessionScope sessionScope, Transaction trans, MappedStatement ms, Object param) throws SQLException {
Object generatedKey = null;
StatementScope statementScope;
InsertStatement insert = (InsertStatement) ms;
SelectKeyStatement selectKeyStatement = insert.getSelectKeyStatement();
if (selectKeyStatement != null) {
statementScope = beginStatementScope(sessionScope, selectKeyStatement);
try {
generatedKey = selectKeyStatement.executeQueryForObject(statementScope, trans, param, null);
String keyProp = selectKeyStatement.getKeyProperty();