From 5455da1e9646e84ef8e0d6e18e21baa039e1f62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dean=5B=EB=B0=B1=EB=B3=91=EB=82=A8=5D?= Date: Thu, 12 Feb 2026 19:16:13 +0900 Subject: [PATCH] hyperparam_with_modeltype --- .../hyperparam/HyperParamApiController.java | 5 +- .../postgres/core/HyperParamCoreService.java | 38 ++--- .../core/ModelTrainMngCoreService.java | 151 ++++++++---------- .../hyperparam/HyperParamRepositoryImpl.java | 151 +++++++++--------- 4 files changed, 169 insertions(+), 176 deletions(-) diff --git a/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java b/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java index f0c61c3..308a6b7 100644 --- a/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java +++ b/src/main/java/com/kamco/cd/training/hyperparam/HyperParamApiController.java @@ -101,8 +101,9 @@ public class HyperParamApiController { LocalDate endDate, @Parameter(description = "버전명", example = "G_000001") @RequestParam(required = false) String hyperVer, - @Parameter(description = "버전명", example = "G1,G2,G3") @RequestParam(required = false) ModelType model - , @Parameter( + @Parameter(description = "버전명", example = "G1,G2,G3") @RequestParam(required = false) + ModelType model, + @Parameter( description = "정렬", example = "createdDttm desc", schema = diff --git a/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java b/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java index 097a2ad..e2cf5b1 100644 --- a/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java +++ b/src/main/java/com/kamco/cd/training/postgres/core/HyperParamCoreService.java @@ -50,15 +50,15 @@ public class HyperParamCoreService { /** * 하이퍼파라미터 수정 * - * @param uuid uuid + * @param uuid uuid * @param createReq 등록 요청 * @return ver */ public String updateHyperParam(UUID uuid, HyperParam createReq) { ModelHyperParamEntity entity = - hyperParamRepository - .findHyperParamByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + hyperParamRepository + .findHyperParamByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); if (entity.getIsDefault()) { throw new CustomApiException("UNPROCESSABLE_ENTITY_UPDATE", HttpStatus.UNPROCESSABLE_ENTITY); @@ -79,9 +79,9 @@ public class HyperParamCoreService { */ public void deleteHyperParam(UUID uuid) { ModelHyperParamEntity entity = - hyperParamRepository - .findHyperParamByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + hyperParamRepository + .findHyperParamByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); // if (entity.getHyperVer().equals("HPs_0001")) { // throw new CustomApiException("UNPROCESSABLE_ENTITY", HttpStatus.UNPROCESSABLE_ENTITY); @@ -104,10 +104,10 @@ public class HyperParamCoreService { */ public HyperParamDto.Basic getInitHyperParam(ModelType model) { ModelHyperParamEntity entity = - hyperParamRepository - .getHyperparamByType(model) - .stream().filter(e -> e.getIsDefault() == Boolean.TRUE) - .findFirst().orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + hyperParamRepository.getHyperparamByType(model).stream() + .filter(e -> e.getIsDefault() == Boolean.TRUE) + .findFirst() + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); return entity.toDto(); } @@ -118,9 +118,9 @@ public class HyperParamCoreService { */ public HyperParamDto.Basic getHyperParam(UUID uuid) { ModelHyperParamEntity entity = - hyperParamRepository - .findHyperParamByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + hyperParamRepository + .findHyperParamByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); return entity.toDto(); } @@ -143,16 +143,16 @@ public class HyperParamCoreService { */ public String getFirstHyperParamVersion(ModelType model) { return hyperParamRepository - .findHyperParamVerByModelType(model) - .map(ModelHyperParamEntity::getHyperVer) - .map(ver -> increase(ver, model)) - .orElse(model.name() + "_000001"); + .findHyperParamVerByModelType(model) + .map(ModelHyperParamEntity::getHyperVer) + .map(ver -> increase(ver, model)) + .orElse(model.name() + "_000001"); } /** * 하이퍼 파라미터의 버전을 증가시킨다. * - * @param hyperVer 현재 버전 + * @param hyperVer 현재 버전 * @param modelType 모델 타입 * @return 증가된 버전 */ diff --git a/src/main/java/com/kamco/cd/training/postgres/core/ModelTrainMngCoreService.java b/src/main/java/com/kamco/cd/training/postgres/core/ModelTrainMngCoreService.java index 36ac52d..c6d3c91 100644 --- a/src/main/java/com/kamco/cd/training/postgres/core/ModelTrainMngCoreService.java +++ b/src/main/java/com/kamco/cd/training/postgres/core/ModelTrainMngCoreService.java @@ -65,9 +65,9 @@ public class ModelTrainMngCoreService { */ public void deleteModel(UUID uuid) { ModelMasterEntity entity = - modelMngRepository - .findByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + modelMngRepository + .findByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); entity.setDelYn(true); entity.setUpdatedDttm(ZonedDateTime.now()); entity.setUpdatedUid(userUtil.getId()); @@ -86,15 +86,16 @@ public class ModelTrainMngCoreService { // 최적화 파라미터는 모델 type의 디폴트사용 if (HyperParamSelectType.OPTIMIZED.getId().equals(addReq.getHyperParamType())) { ModelType modelType = ModelType.getValueData(addReq.getModelNo()); - hyperParamEntity = hyperParamRepository.getHyperparamByType(modelType) - .stream() - .filter(e -> e.getIsDefault() == Boolean.TRUE) - .findFirst().orElse(null); + hyperParamEntity = + hyperParamRepository.getHyperparamByType(modelType).stream() + .filter(e -> e.getIsDefault() == Boolean.TRUE) + .findFirst() + .orElse(null); // hyperParamEntity = hyperParamRepository.findByHyperVer("HPs_0001").orElse(null); } else { hyperParamEntity = - hyperParamRepository.findHyperParamByUuid(addReq.getHyperUuid()).orElse(null); + hyperParamRepository.findHyperParamByUuid(addReq.getHyperUuid()).orElse(null); } if (hyperParamEntity == null || hyperParamEntity.getHyperVer() == null) { @@ -102,8 +103,8 @@ public class ModelTrainMngCoreService { } String modelVer = - String.join( - ".", addReq.getModelNo(), hyperParamEntity.getHyperVer(), entity.getUuid().toString()); + String.join( + ".", addReq.getModelNo(), hyperParamEntity.getHyperVer(), entity.getUuid().toString()); entity.setModelVer(modelVer); entity.setHyperParamId(hyperParamEntity.getId()); entity.setModelNo(addReq.getModelNo()); @@ -135,7 +136,7 @@ public class ModelTrainMngCoreService { * data set 저장 * * @param modelId 저장한 모델 학습 id - * @param addReq 요청 파라미터 + * @param addReq 요청 파라미터 */ public void saveModelDataset(Long modelId, ModelTrainMngDto.AddReq addReq) { TrainingDataset dataset = addReq.getTrainingDataset(); @@ -168,9 +169,9 @@ public class ModelTrainMngCoreService { */ public void updateModelMaster(Long modelId, ModelTrainMngDto.UpdateReq req) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); if (req.getRequestPath() != null && !req.getRequestPath().isEmpty()) { entity.setRequestPath(req.getRequestPath()); } @@ -183,7 +184,7 @@ public class ModelTrainMngCoreService { /** * 모델 데이터셋 mapping 테이블 저장 * - * @param modelId 모델학습 id + * @param modelId 모델학습 id * @param datasetList 선택한 data set */ public void saveModelDatasetMap(Long modelId, List datasetList) { @@ -200,7 +201,7 @@ public class ModelTrainMngCoreService { * 모델학습 config 저장 * * @param modelId 모델학습 id - * @param req 요청 파라미터 + * @param req 요청 파라미터 * @return */ public void saveModelConfig(Long modelId, ModelTrainMngDto.ModelConfig req) { @@ -220,7 +221,7 @@ public class ModelTrainMngCoreService { /** * 데이터셋 매핑 생성 * - * @param modelUid 모델 UID + * @param modelUid 모델 UID * @param datasetIds 데이터셋 ID 목록 */ public void createDatasetMappings(Long modelUid, List datasetIds) { @@ -242,8 +243,8 @@ public class ModelTrainMngCoreService { public ModelMasterEntity findByUuid(UUID uuid) { try { return modelMngRepository - .findByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + .findByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); } catch (IllegalArgumentException e) { throw new BadRequestException("잘못된 UUID 형식입니다: " + uuid); } @@ -257,9 +258,9 @@ public class ModelTrainMngCoreService { */ public Long findModelIdByUuid(UUID uuid) { ModelMasterEntity entity = - modelMngRepository - .findByUuid(uuid) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + modelMngRepository + .findByUuid(uuid) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); return entity.getId(); } @@ -272,8 +273,8 @@ public class ModelTrainMngCoreService { public ModelConfigDto.Basic findModelConfigByModelId(UUID uuid) { ModelMasterEntity modelEntity = findByUuid(uuid); return modelConfigRepository - .findModelConfigByModelId(modelEntity.getId()) - .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); + .findModelConfigByModelId(modelEntity.getId()) + .orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND)); } /** @@ -304,21 +305,19 @@ public class ModelTrainMngCoreService { */ public ModelTrainMngDto.Basic findModelById(Long id) { ModelMasterEntity entity = - modelMngRepository - .findById(id) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + id)); + modelMngRepository + .findById(id) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + id)); return entity.toDto(); } - /** - * 마스터를 IN_PROGRESS로 전환하고, 현재 실행 jobId를 연결 - UI/중단/상태조회 모두 currentAttemptId를 기준으로 동작 - */ + /** 마스터를 IN_PROGRESS로 전환하고, 현재 실행 jobId를 연결 - UI/중단/상태조회 모두 currentAttemptId를 기준으로 동작 */ @Transactional public void markInProgress(Long modelId, Long jobId) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setStatusCd(TrainStatusType.IN_PROGRESS.getId()); master.setCurrentAttemptId(jobId); @@ -326,54 +325,46 @@ public class ModelTrainMngCoreService { // 필요하면 시작시간도 여기서 찍어줌 } - /** - * 마지막 에러 메시지 초기화 - 재시작/새 실행 때 이전 에러 흔적 제거 - */ + /** 마지막 에러 메시지 초기화 - 재시작/새 실행 때 이전 에러 흔적 제거 */ @Transactional public void clearLastError(Long modelId) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setLastError(null); } - /** - * 중단 처리(옵션) - cancel에서 쓰려고 하면 같이 구현 - */ + /** 중단 처리(옵션) - cancel에서 쓰려고 하면 같이 구현 */ @Transactional public void markStopped(Long modelId) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setStatusCd(TrainStatusType.STOPPED.getId()); } - /** - * 완료 처리(옵션) - Worker가 성공 시 호출 - */ + /** 완료 처리(옵션) - Worker가 성공 시 호출 */ @Transactional public void markCompleted(Long modelId) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setStatusCd(TrainStatusType.COMPLETED.getId()); } - /** - * step 1오류 처리(옵션) - Worker가 실패 시 호출 - */ + /** step 1오류 처리(옵션) - Worker가 실패 시 호출 */ @Transactional public void markError(Long modelId, String errorMessage) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setStatusCd(TrainStatusType.ERROR.getId()); master.setStep1State(TrainStatusType.ERROR.getId()); @@ -382,15 +373,13 @@ public class ModelTrainMngCoreService { master.setUpdatedDttm(ZonedDateTime.now()); } - /** - * step 2오류 처리(옵션) - Worker가 실패 시 호출 - */ + /** step 2오류 처리(옵션) - Worker가 실패 시 호출 */ @Transactional public void markStep2Error(Long modelId, String errorMessage) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); master.setStatusCd(TrainStatusType.ERROR.getId()); master.setStep2State(TrainStatusType.ERROR.getId()); @@ -402,9 +391,9 @@ public class ModelTrainMngCoreService { @Transactional public void markSuccess(Long modelId) { ModelMasterEntity master = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); // 모델 상태 완료 처리 master.setStatusCd(TrainStatusType.COMPLETED.getId()); @@ -432,9 +421,9 @@ public class ModelTrainMngCoreService { @Transactional(propagation = Propagation.REQUIRES_NEW) public void markStep1InProgress(Long modelId, Long jobId) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); entity.setStatusCd(TrainStatusType.IN_PROGRESS.getId()); entity.setStep1StrtDttm(ZonedDateTime.now()); @@ -452,9 +441,9 @@ public class ModelTrainMngCoreService { @Transactional(propagation = Propagation.REQUIRES_NEW) public void markStep2InProgress(Long modelId, Long jobId) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); entity.setStatusCd(TrainStatusType.IN_PROGRESS.getId()); entity.setStep2StrtDttm(ZonedDateTime.now()); @@ -472,9 +461,9 @@ public class ModelTrainMngCoreService { @Transactional(propagation = Propagation.REQUIRES_NEW) public void markStep1Success(Long modelId) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); entity.setStatusCd(TrainStatusType.COMPLETED.getId()); entity.setStep1State(TrainStatusType.COMPLETED.getId()); @@ -491,9 +480,9 @@ public class ModelTrainMngCoreService { @Transactional(propagation = Propagation.REQUIRES_NEW) public void markStep2Success(Long modelId) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); entity.setStatusCd(TrainStatusType.COMPLETED.getId()); entity.setStep2State(TrainStatusType.COMPLETED.getId()); @@ -504,9 +493,9 @@ public class ModelTrainMngCoreService { public void updateModelMasterBestEpoch(Long modelId, int epoch) { ModelMasterEntity entity = - modelMngRepository - .findById(modelId) - .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); + modelMngRepository + .findById(modelId) + .orElseThrow(() -> new IllegalArgumentException("Model not found: " + modelId)); entity.setBestEpoch(epoch); } diff --git a/src/main/java/com/kamco/cd/training/postgres/repository/hyperparam/HyperParamRepositoryImpl.java b/src/main/java/com/kamco/cd/training/postgres/repository/hyperparam/HyperParamRepositoryImpl.java index dc99306..c31b090 100644 --- a/src/main/java/com/kamco/cd/training/postgres/repository/hyperparam/HyperParamRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/training/postgres/repository/hyperparam/HyperParamRepositoryImpl.java @@ -34,56 +34,56 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom { public Optional findHyperParamVer() { return Optional.ofNullable( - queryFactory - .select(modelHyperParamEntity) - .from(modelHyperParamEntity) - .where(modelHyperParamEntity.delYn.isFalse()) - .orderBy(modelHyperParamEntity.hyperVer.desc()) - .limit(1) - .fetchOne()); + queryFactory + .select(modelHyperParamEntity) + .from(modelHyperParamEntity) + .where(modelHyperParamEntity.delYn.isFalse()) + .orderBy(modelHyperParamEntity.hyperVer.desc()) + .limit(1) + .fetchOne()); } @Override public Optional findHyperParamVerByModelType(ModelType modelType) { return Optional.ofNullable( - queryFactory - .select(modelHyperParamEntity) - .from(modelHyperParamEntity) - .where( - modelHyperParamEntity - .delYn - .isFalse() - .and(modelHyperParamEntity.modelType.eq(modelType))) - .orderBy(modelHyperParamEntity.hyperVer.desc()) - .limit(1) - .fetchOne()); + queryFactory + .select(modelHyperParamEntity) + .from(modelHyperParamEntity) + .where( + modelHyperParamEntity + .delYn + .isFalse() + .and(modelHyperParamEntity.modelType.eq(modelType))) + .orderBy(modelHyperParamEntity.hyperVer.desc()) + .limit(1) + .fetchOne()); } @Override public Optional findHyperParamByHyperVer(String hyperVer) { return Optional.ofNullable( - queryFactory - .select(modelHyperParamEntity) - .from(modelHyperParamEntity) - .where( - modelHyperParamEntity - .delYn - .isFalse() - .and(modelHyperParamEntity.hyperVer.eq(hyperVer))) - .limit(1) - .fetchOne()); + queryFactory + .select(modelHyperParamEntity) + .from(modelHyperParamEntity) + .where( + modelHyperParamEntity + .delYn + .isFalse() + .and(modelHyperParamEntity.hyperVer.eq(hyperVer))) + .limit(1) + .fetchOne()); } @Override public Optional findHyperParamByUuid(UUID uuid) { return Optional.ofNullable( - queryFactory - .select(modelHyperParamEntity) - .from(modelHyperParamEntity) - .where(modelHyperParamEntity.delYn.isFalse().and(modelHyperParamEntity.uuid.eq(uuid))) - .fetchOne()); + queryFactory + .select(modelHyperParamEntity) + .from(modelHyperParamEntity) + .where(modelHyperParamEntity.delYn.isFalse().and(modelHyperParamEntity.uuid.eq(uuid))) + .fetchOne()); } @Override @@ -119,28 +119,28 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom { } NumberExpression totalUseCnt = - modelHyperParamEntity - .m1UseCnt - .coalesce(0L) - .add(modelHyperParamEntity.m2UseCnt.coalesce(0L)) - .add(modelHyperParamEntity.m3UseCnt.coalesce(0L)); + modelHyperParamEntity + .m1UseCnt + .coalesce(0L) + .add(modelHyperParamEntity.m2UseCnt.coalesce(0L)) + .add(modelHyperParamEntity.m3UseCnt.coalesce(0L)); JPAQuery query = - queryFactory - .select( - Projections.constructor( - HyperParamDto.List.class, - modelHyperParamEntity.uuid, - modelHyperParamEntity.modelType.as("model"), - modelHyperParamEntity.hyperVer, - modelHyperParamEntity.createdDttm, - modelHyperParamEntity.lastUsedDttm, - modelHyperParamEntity.m1UseCnt, - modelHyperParamEntity.m2UseCnt, - modelHyperParamEntity.m3UseCnt, - totalUseCnt.as("totalUseCnt"))) - .from(modelHyperParamEntity) - .where(builder); + queryFactory + .select( + Projections.constructor( + HyperParamDto.List.class, + modelHyperParamEntity.uuid, + modelHyperParamEntity.modelType.as("model"), + modelHyperParamEntity.hyperVer, + modelHyperParamEntity.createdDttm, + modelHyperParamEntity.lastUsedDttm, + modelHyperParamEntity.m1UseCnt, + modelHyperParamEntity.m2UseCnt, + modelHyperParamEntity.m3UseCnt, + totalUseCnt.as("totalUseCnt"))) + .from(modelHyperParamEntity) + .where(builder); Sort.Order sortOrder = pageable.getSort().stream().findFirst().orElse(null); @@ -152,15 +152,17 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom { boolean asc = sortOrder.isAscending(); switch (property) { - case "createdDttm" -> query.orderBy( - asc - ? modelHyperParamEntity.createdDttm.asc() - : modelHyperParamEntity.createdDttm.desc()); + case "createdDttm" -> + query.orderBy( + asc + ? modelHyperParamEntity.createdDttm.asc() + : modelHyperParamEntity.createdDttm.desc()); - case "lastUsedDttm" -> query.orderBy( - asc - ? modelHyperParamEntity.lastUsedDttm.asc() - : modelHyperParamEntity.lastUsedDttm.desc()); + case "lastUsedDttm" -> + query.orderBy( + asc + ? modelHyperParamEntity.lastUsedDttm.asc() + : modelHyperParamEntity.lastUsedDttm.desc()); case "totalUseCnt" -> query.orderBy(asc ? totalUseCnt.asc() : totalUseCnt.desc()); @@ -169,14 +171,14 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom { } List content = - query.offset(pageable.getOffset()).limit(pageable.getPageSize()).fetch(); + query.offset(pageable.getOffset()).limit(pageable.getPageSize()).fetch(); Long total = - queryFactory - .select(modelHyperParamEntity.count()) - .from(modelHyperParamEntity) - .where(builder) - .fetchOne(); + queryFactory + .select(modelHyperParamEntity.count()) + .from(modelHyperParamEntity) + .where(builder) + .fetchOne(); long totalCount = (total != null) ? total : 0L; @@ -186,12 +188,13 @@ public class HyperParamRepositoryImpl implements HyperParamRepositoryCustom { @Override public List getHyperparamByType(ModelType modelType) { return queryFactory - .select(modelHyperParamEntity) - .from(modelHyperParamEntity) - .where( - modelHyperParamEntity - .delYn.isFalse() - .and(modelHyperParamEntity.modelType.eq(modelType))) - .fetch(); + .select(modelHyperParamEntity) + .from(modelHyperParamEntity) + .where( + modelHyperParamEntity + .delYn + .isFalse() + .and(modelHyperParamEntity.modelType.eq(modelType))) + .fetch(); } }