Skip to content

[테크니컬 라이팅] 도기(이동엽) 미션 제출합니다.#1058

Open
dye0p wants to merge 8 commits intowoowacourse:dye0pfrom
dye0p:main
Open

[테크니컬 라이팅] 도기(이동엽) 미션 제출합니다.#1058
dye0p wants to merge 8 commits intowoowacourse:dye0pfrom
dye0p:main

Conversation

@dye0p
Copy link
Member

@dye0p dye0p commented Oct 14, 2025

No description provided.

Copy link

@kimdevv kimdevv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 글이네요. Soft Delete에 대해 다시 한 번 정리할 수 있는 시간이었습니다.


데이터를 물리적으로 삭제하는 것에는 한계가 있었습니다.

- GDPR, 개인정보보호법 등 법적 요구사항
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래 불릿 포인트와 같은 형식으로 맞추면 좋을 것 같아요!
- 법적 요구: GDPR, 개인정보보호법 등

@Entity
@Table(name = "users")
public class User {
@Id
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다른 코드 포매팅과 일관될 수 있게 한 칸 개행 추가하면 좋을 것 같아요!

@SQLDelete 는 플래그로 LocalDateTime 사용이 불가능 하다는 단점과 하나의 컬럼만 사용가능한 단점이 있는 @SoftDelete와 달리, 실행될 쿼리문을 직접 정의해줌으로써 2개 이상의 플래그 사용이
가능합니다.
<br>
@SQLRestriction 어노테이션의 속성으로 조회시 조건을 지정할 수 있습니다.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SQLRestriction 어노테이션을 간단하게 위에서 설명해 주시면 좋을 것 같아요. 이게 아직은 어떤 역할을 하는지 직관적으로 이해가 안 돼서요!

Comment on lines +334 to +337
## 4. @Where Deprecated 주의사항

Hibernate 6.3부터 @Where 어노테이션이 Deprecated되었습니다. 따라서
반드시 @SQLRestriction을 사용해야 합니다.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위에서는 @Where 어노테이션에 대해 아무런 설명이 없었는데 갑자기 Deprecated 되었다고 해서 조금 갑작스러웠어요! 위에서 언급하지 않은 부분이다보니 해당 문단이 필요할까? 싶었습니다!


선택 이유

- 두개의 삭제 플래그(isDeleted, deletedAt)를 사용해야 하는 상황
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

왜 두 개의 삭제 플래그가 필요했었는지도 함께 안내되면 좋을 것 같아요.

Comment on lines +31 to +32
- 백엔드 개발자(Java, Spring, JPA 환경)
- 데이터베이스 개발자
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 지정하고있는 대상독자의 범위가 넓은 것 같아요! 글의 본문은 이론보다 구현에 집중하고 있으니까 소프트 딜리트를 처음 접하는 백엔드(Spring, JPA) 개발자로 합치면 좋을 것 같아요

Comment on lines +58 to +62
```java
userRepeository.deleteById(userId);
```

이 메서드를 실행하면 회원은 데이터베이스에서 제거됩니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드를 시작하기 전에 userRepeository.deleteById(userId); 을 Java 기반 SpringDataJPA로 작성한 코드라고 명시해주면 맥락을 파악하기 좋을 것 같아요

Copy link

@jye326 jye326 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 글이군요! 독자 입장에서 자연스럽게 읽히도록 개선 사항을 몇 개 짚어봤습니다~

Comment on lines +14 to +21
<br>
하지만 만약 탈퇴한 계정을 복구하고싶다면 어떻게 해야 할까요?
<br>
다음과 같은 문제가 발생합니다.

- 실수로 삭제를 했다면 복구할 수 없다.
- 누가, 언제, 왜 삭제했는지 알 수 없다.
- 삭제된 사용자의 주문 내역이 외래키 제약으로 함께 삭제된다면
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문장 흐름이 부자연스러운 것 같아요

  1. 탈퇴한 계정을 복구하고 싶다면 어떻게 해야 할지 물어봤는데 갑자기 문제가 발생한다고 함.
  2. '삭제된 사용자의 주문 내역이 외래키 제약으로 함께 삭제된다면' 뒷말이 누락된 느낌이 든다

Comment on lines +45 to +46
1. 하드 딜리트의 한계
2. 소프트 딜리트란 무엇인가?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Hard Delete, Soft Delete 처럼 영문으로 명시하거나
  • 물리 삭제, 의미 삭제 등의 한글 번역으로 명시하는 것이 좋을 것 같아요


@SoftDelete는 디폴트로 boolean 타입의 deleted 필드가 추가되며, 엔티티 내부에 자바코드로 동일한 이름의 필드를 지정할 수 없습니다.
<br>
deleted 외에도 필드명은 자유롭게 커스텀이 가능하고, boolean 타입이 싫을 경우 converter를 사용할 수 있습니다.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converter가 뭔지 설명해주면 좋을 것 같아요

Comment on lines +363 to +367
만약, @Where에서 @SQLRestriction으로 마이그레이션을 해야 한다면
<br>
@Where와 @SQLRestriction의 문법은 동일합니다.
<br>
그래서 단순 어노테이션 이름만 변경하면 됩니다.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자연스럽게 한 문장으로 다듬을 수 있을 것 같아요


선택 이유

- 두개의 삭제 플래그(isDeleted, deletedAt)를 사용해야 하는 상황
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

두개의 -> 두 개의

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants