inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

ZZAMBA님의 게시글

ZZAMBA ZZAMBA

@rksidksrksi

수강평 작성수
13
평균평점
5.0

게시글 2

질문&답변

PartialType과 OmitType 동시 적용

chatGPT에 물어보니 바로 알려주네요. 자답합니다. @InputType() export class UpdateUserInput extends PartialType( OmitType(CreateUserInput, ['loginId', 'email'], InputType)) { }

좋아요수
0
댓글수
1
조회수
602

질문&답변

트랜잭션 템플릿 사용 로직

status는 TransactionTemplate에서 생성해서 넘겨줍니다. executeWithoutResult 함수는 execute 함수를 호출합니다. TransactionTemplate에는 execute 함수가 구현되어 있고 간략히는 아래와 같습니다. @Override @Nullable public T execute(TransactionCallback action) throws TransactionException { /* (중략) */ TransactionStatus status = this.transactionManager.getTransaction(this); T result; try { result = action.doInTransaction(status); } /* (중략) */ this.transactionManager.commit(status); return result; } } 즉, status는 TransactionTemplate에서 생성해서 doInTransaction의 매개인자로 넣어줍니다.

좋아요수
4
댓글수
2
조회수
834