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

BaseEntity 의 equals & hashCode 를 재정의한다. #434

Open
Songusika opened this issue Nov 16, 2023 · 0 comments
Open

BaseEntity 의 equals & hashCode 를 재정의한다. #434

Songusika opened this issue Nov 16, 2023 · 0 comments
Assignees
Labels
backend 백엔드 분야 refactoring

Comments

@Songusika
Copy link
Collaborator

Songusika commented Nov 16, 2023

기능 설명

엔티티의 ID값을 기준으로 동등성 비교를 하는건 어떻게 생각하시나요?

    @Test
    void Jpa는_엔티티의_동등성을_재정의하지_않는다(@Autowired EntityManager entityManager) {
        Room 나무 = roomRepository.save(나무());

        entityManager.clear();
        var found = roomRepository.findById(나무.getId());

        assertThat(found).get().isEqualTo(나무);
    }

개발 일정

No response

자식 이슈

No response

부가 설명

No response

@Songusika Songusika added the backend 백엔드 분야 label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend 백엔드 분야 refactoring
Projects
None yet
Development

No branches or pull requests

2 participants