After reading this, experiencing a brief moment of denial, searching for some way to make this work with the MERGE statement, then finally accepting APC's comment, I have settled on the following alternative that may be helpful to someone else:
public List upsert(String updateSql, String insertSql, Map data){
List ids = new ArrayList();
Map params = new HashMap();
params.put("name", data.get("name"));
if(data.get("personId") != null){
params.put("personId", data.get("personId"));
int rowCount = jdbcTemplate.update(updateSql, params);
if(rowCount == 1){
ids.add(data.get("personId"));
}
}else{
keyHolder = new GeneratedKeyHolder();
int rowCount = jdbcTemplate.update(insertSql, params, keyHolder);
if(rowCount == 1){
ids.add(keyHolder.getKey().intValue());
}
}
return ids;
}