Exception
[Error] The return type is incompatible with Persistable<String>.getId()
헤르메스의날개
2023. 4. 19. 23:32
728x90
아래와 같은 오류가 발생했습니다.
The return type is incompatible with Persistable<String>.getId()
내용은 getId() 의 ID 의 Return Type이 String 이기 때문에 발생하는 오류입니다. ( ID의 Type은 Long 형입니다. )
Persistable 는 Spring Data JPA 구현 시 Merge 가 발생하는 문제를 해결하기 위해 사용하는 방법입니다.
https://hermeslog.tistory.com/693
[JPA] JPA Data Save 시 Select 쿼리가 먼저 실행 된다.
요즘 JPA를 공부하고 있습니다. MyBatis 만 하다가, 개인적으로 공부를 진행하고 있습니다. 하다보니 막히고, 이해가 안되는 부분이 많네요. 그때마다 검색과 삽질로 해결하고 있습니다. 여기 그 삽
hermeslog.tistory.com
저의 경우 해결 방법은 아래와 같습니다.
public abstract class BaseEntity implements Serializable, Persistable<String>
아래와 같이 변경합니다.
public abstract class BaseEntity implements Serializable, Persistable<Long>
728x90