This line could be moved up to the above if clause, then there is also no need for the idParameterName variable:
if(mambuEntity != nul){
params.put(getIdParameter(mambuEntity), entityId);
}