Antilog의 개발로 쓰다
article thumbnail
반응형

Error

Failed to create query for method public abstract java.util.List com.wordata.test.repository.StudentRepository.findAllByOrderByNameDesc()! No property name found for type Student! Did you mean 'namme'?

에러 발생 상황

JPA Entity를 구현할때 멤버 변수 이름과 테이블 필드의 이름이 다르게 구현

(해당 상황에서는 오타로 name을 namme로 적어둠)

에러 발생 이유

JPA Entity를 구현할때 멤버 변수 이름과 테이블 필드 이름이 일치하지 않을 경우 발생

해결 방법

멤버 변수 이름과 테이블 필드 이름을 일치시켜주거나

@Column(name="*") 어노테이션을 사용하여 테이블 필드와 멤버 변수 이름을 맞출 수 있도록 한다.

 

반응형
profile

Antilog의 개발로 쓰다

@Parker_J_S

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

profile on loading

Loading...