Skip to content

Commit

Permalink
refact: updaste annotation operation at execute single entity
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Dec 28, 2023
1 parent ec9f811 commit 5ae605c
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,21 @@ private static Object executeIterable(Operation operation, Iterable entities, Re
return entities;
}
}
private static Object executeSingleEntity(Operation operation, Object param, ReturnType returnType) {
boolean result = operation.repository.update(param);
if (returnType.isVoid()) {
return Void.TYPE;
} else if (returnType.isBoolean()) {
return result;
} else if (returnType.isInt()) {
return 1;
} else {
return param;
}
}
};

private static Object executeSingleEntity(Operation operation, Object param, ReturnType returnType) {
boolean result = operation.repository.update(param);
if (returnType.isVoid()) {
return Void.TYPE;
} else if (returnType.isBoolean()) {
return result;
} else if (returnType.isInt()) {
return 1;
} else {
return param;
}
}


private static void checkParameterNumber(Operation operation) {
if (operation.params.length != 1) {
Expand Down

0 comments on commit 5ae605c

Please sign in to comment.