Long pk = null;
try {
pk = selectByActivityKey(Long.valueOf(key));
} catch (NumberFormatException nex) {
throw new ObjectNotFoundException
("Invalid key format for key = " + key);
} catch (SQLException ex) {
throw new EJBException(ex);
}
if (pk == null) {
throw new ObjectNotFoundException
("Row for id " + key + " not found.");
}
return pk;
}