|
|
@@ -41,17 +41,17 @@ public class SqlOperationAspect extends AbstractLoggingAspect {
|
|
|
String paramValue = null;
|
|
|
String paramValue2 = null;
|
|
|
|
|
|
- // ✅ 실행된 메서드의 파라미터 이름과 어노테이션의 param 값 비교
|
|
|
+ // 실행된 메서드의 파라미터 이름과 어노테이션의 param 값 비교
|
|
|
String[] paramNames = signature.getParameterNames();
|
|
|
for (int ii = 0; ii < paramNames.length; ii++) {
|
|
|
if (!Objects.equals(param, "")) {
|
|
|
if (paramNames[ii].equalsIgnoreCase(param)) {
|
|
|
- paramValue = String.valueOf(args[ii]); // ✅ 해당 값 추출
|
|
|
+ paramValue = String.valueOf(args[ii]); // 해당 값 추출
|
|
|
}
|
|
|
}
|
|
|
if (!Objects.equals(param, "") && !Objects.equals(param2, "")) {
|
|
|
if (paramNames[ii].equalsIgnoreCase(param2)) {
|
|
|
- paramValue2 = String.valueOf(args[ii]); // ✅ 해당 값 추출
|
|
|
+ paramValue2 = String.valueOf(args[ii]); // 해당 값 추출
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -60,27 +60,27 @@ public class SqlOperationAspect extends AbstractLoggingAspect {
|
|
|
long executionTime;
|
|
|
Object result;
|
|
|
try {
|
|
|
- result = joinPoint.proceed(); // ✅ SQL 실행
|
|
|
+ result = joinPoint.proceed(); // SQL 실행
|
|
|
} catch (Exception e) {
|
|
|
executionTime = System.currentTimeMillis() - start;
|
|
|
log.error("[{}] {}: Exception: {}", type, LogUtils.elapsedLog(tableName, executionTime), e.getMessage());
|
|
|
if (signature.getReturnType().equals(int.class)) {
|
|
|
- return -1; // ❗ int 반환 타입 예외 발생 시 -1 반환
|
|
|
+ return -1; // int 반환 타입 예외 발생 시 -1 반환
|
|
|
}
|
|
|
|
|
|
if (Objects.requireNonNull(sqlOperation.type()) == SqlOperation.SqlType.SELECT) {
|
|
|
- return null; // ❗ SELECT 예외 발생 시 null 반환
|
|
|
+ return null; // SELECT 예외 발생 시 null 반환
|
|
|
}
|
|
|
- return -1; // ❗ 예외 발생 시 -1 반환
|
|
|
+ return -1; // 예외 발생 시 -1 반환
|
|
|
}
|
|
|
executionTime = System.currentTimeMillis() - start;
|
|
|
|
|
|
int count = 1;
|
|
|
if (signature.getReturnType().equals(int.class)) {
|
|
|
- count = (int)result; // ✅ int 반환 타입 처리
|
|
|
+ count = (int)result; // int 반환 타입 처리
|
|
|
} else if (signature.getReturnType().equals(List.class)) {
|
|
|
- List<?> list = (List<?>)result; // ✅ List 반환 타입 처리
|
|
|
- count = list.size(); // ✅ List의 크기 계산
|
|
|
+ List<?> list = (List<?>)result; // List 반환 타입 처리
|
|
|
+ count = list.size(); // List의 크기 계산
|
|
|
}
|
|
|
|
|
|
if (!Objects.equals(param, "") && paramValue == null) {
|