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

Redis Repository의 문제점 #90

Closed
khcho0125 opened this issue Oct 2, 2022 · 0 comments · Fixed by #112
Closed

Redis Repository의 문제점 #90

khcho0125 opened this issue Oct 2, 2022 · 0 comments · Fixed by #112
Assignees
Labels
bug 버그가 발생한 경우 refactor 코드 리팩토링 할 경우

Comments

@khcho0125
Copy link
Member

khcho0125 commented Oct 2, 2022

Describe

  • Redis Repository가 Custom Jpa Query를 인식하지 못하고 Null을 반환하는 문제

    • ex) queryAuthCodeByKey
  • Redis Repository의 불변 필드 바인딩 실패

    • ex) val key: String

How

  1. Jpa가 기본 지원해주는 Query 사용

  2. Redis Persistence Entity의 data class 변경

Additional

정확한 코드와 이메일을 입력했음에도 Jpa Query 인식 불가로 인한 Null 반환

we introduced support for immutable objects and we no longer update final fields.

불변 객체에 대한 지원을 도입했으며 더 이상 final 필드를 업데이트하지 않습니다.

Your Kotlin class is a regular open class, however fields are final as they are declared with val and not var. We support Kotlin data classes with immutable fields as we're using the copy(…) method to create updated object instances

Kotlin 클래스는 정규 open 클래스지만 필드는 var가 아닌 val로 선언되므로 final 필드입니다. copy(…) 방법을 사용하여 업데이트된 객체 인스턴스를 만들 때 불변 필드가 있는 Kotlin data 클래스를 지원합니다.

원인은 Redis의 Object 저장 방식으로 추론되었습니다.
데이터를 꺼내올 때 같은 Object를 생성해야 가능하다고 합니다.

Kotlin의 data class는 직렬화에 필요한 모든 기능들을 구현하기 때문에 해결 가능한 것으로 판단됩니다.

@khcho0125 khcho0125 added bug 버그가 발생한 경우 refactor 코드 리팩토링 할 경우 labels Oct 2, 2022
@khcho0125 khcho0125 added this to the 1차 기능 마감 milestone Oct 2, 2022
@khcho0125 khcho0125 self-assigned this Oct 2, 2022
@khcho0125 khcho0125 moved this from Todo to Defer in SimTong-Backend Backlog Oct 2, 2022
@khcho0125 khcho0125 moved this from Defer to Todo in SimTong-Backend Backlog Oct 2, 2022
khcho0125 added a commit that referenced this issue Oct 13, 2022
@khcho0125 khcho0125 moved this from Todo to In Progress in SimTong-Backend Backlog Oct 13, 2022
Repository owner moved this from In Progress to Done in SimTong-Backend Backlog Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 버그가 발생한 경우 refactor 코드 리팩토링 할 경우
Projects
Development

Successfully merging a pull request may close this issue.

2 participants