Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore: πŸ› Add "Is Null" Filter on the Foreign Entity in the Chat Room Entity #228

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

psychology50
Copy link
Member

μž‘μ—… 이유

image

  • The reason why leaving a chat room fails is due to an issue in the hasOnlyAdmin() method.
  • When Hibernate.size() is called, it doesn't account for soft-deleted data, causing incorrect behavior.

μž‘μ—… 사항

public class ChatRoom extends DateAuditable {
    ...

    @OneToMany(mappedBy = "chatRoom")
    @SQLRestriction("deleted_at IS NULL") // Added filter for soft deletion
    private List<ChatMember> chatMembers = new ArrayList<>();
  • Although I dislike using @SQLRestriction, it seems acceptable in this case due to its limited scope.

리뷰어가 μ€‘μ μ μœΌλ‘œ 확인해야 ν•˜λŠ” λΆ€λΆ„

  • none

λ°œκ²¬ν•œ 이슈

  • none

@psychology50 psychology50 added bug κΈ΄κΈ‰ν•˜κ³ , μ€‘μš”λ„κ°€ 높은 이슈 fix κΈ°λŠ₯ μˆ˜μ • labels Jan 22, 2025
@psychology50 psychology50 self-assigned this Jan 22, 2025
@psychology50 psychology50 merged commit f1af051 into dev Jan 22, 2025
1 check passed
@psychology50 psychology50 deleted the fix/has-only-admin branch January 22, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug κΈ΄κΈ‰ν•˜κ³ , μ€‘μš”λ„κ°€ 높은 이슈 fix κΈ°λŠ₯ μˆ˜μ •
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant