- 같은 ID 로 DEL -> INSERT 시 충돌대응

- API 20건 조회 -> 전체조회
- API LIST 저장시 요청/완료 알 수 있도록 버튼 제어
This commit is contained in:
daekuk
2025-12-30 10:36:27 +09:00
parent 08c6bb44d5
commit ba6dff6f9e
3 changed files with 22 additions and 6 deletions
@@ -151,6 +151,10 @@ function saveApiGridData(scopeId, returnUrl) {
type : "POST",
url:mapping_url,
data: postData,
beforeSend: function() {
$("[id^='btn_']").prop("disabled", true);
$("#btn_modify").text("처리중 . . . . .");
},
success:function(args){
alert("저장 되었습니다.");
@@ -158,7 +162,11 @@ function saveApiGridData(scopeId, returnUrl) {
},
error:function(e){
alert(e.responseText);
}
},
complete: function() {
$("[id^='btn_']").prop("disabled", false);
$("#btn_modify").text("수정");
}
});
}
@@ -1,21 +1,31 @@
package com.eactive.eai.rms.data.entity.onl.authserver;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.eactive.eai.data.entity.onl.authserver.QScopeEntity;
import com.eactive.eai.data.entity.onl.authserver.ScopeEntity;
import com.eactive.eai.data.entity.onl.authserver.ScopeEntityId;
import com.eactive.eai.data.jpa.AbstractDataService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class ScopeEntityService extends AbstractDataService<ScopeEntity, ScopeEntityId, ScopeEntityEMSRepository> {
@PersistenceContext
private EntityManager entityManager; // AbstractDataService 의 entityManager가 private이라 접근 불가하여 별도 주입
public void deleteByIdScopeId(String scopeId) {
getJPAQueryFactory().delete(QScopeEntity.scopeEntity)
.where(QScopeEntity.scopeEntity.id.scopeid.eq(scopeId))
.execute();
// 동일 트랜잭션 내에서 같은 ID로 재저장 시 충돌(EntityExistsException)을 방지
entityManager.flush();
entityManager.clear();
}
}
@@ -310,8 +310,6 @@ public class EAIMessageService extends AbstractDataService<EAIMessageEntity, Str
.on(qScopeEntity.id.scopeid.eq(qScopeInfo.scopeId))
.where(predicate)
.orderBy(qScopeEntity.id.bzwksvckeyname.asc())
.offset(pageable.getOffset())
.limit(pageable.getPageSize())
.fetch();
return new PageImpl<>(result, pageable, result.size());