인프런 커뮤니티 질문&답변
findByID ? findById ? 에러 문제
작성
·
802
1
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'springConfig' defined in file [E:\스프링-부트\hello-spring\hello-spring\bin\main\hello\hellospring\controller\SpringConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springDataJpaMemberRepository' defined in hello.hellospring.repository.Impl.SpringDataJpaMemberRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional hello.hellospring.repository.Impl.MemberRepository.findByID(java.lang.Long)! No property ID found for type Member! Did you mean 'id'?
굵은색으로 표시됀게 문제의 원인인거 같아
MemberRepository 파일을 열어보니
제가 이렇게 해놧는대
findByID - > findById 로 바꿧더니 에러가 해결됐는대
이건또 어떤 규칙..인가요? 낙타등표기법을 명시해야만 Jpa가 인식을 하는건가요?
아직 Jpa 학습하기 전이라 무척 헷갈리네요 ..
퀴즈
순수 JDBC를 사용할 때, 데이터베이스 리소스(연결, Statement 등) 관리가 어려웠던 주된 이유는 무엇일까요?
SQL 쿼리를 직접 작성해야 해서
각 리소스를 사용 후 반드시 직접 닫아줘야 해서
테스트 간 데이터 독립성을 보장하기 어려워서
의존성 주입 설정이 복잡해서





