Hi,
I'm writing to ask you about something in my java program, I'm new in Spring framework, and I faced an error.
I have tried many times to solve it depending on online articles but actually no result.
I have an entity Class called Student and the id of this entity is a composed key in different Class (StudentId) which has @Embeddable annotation. My repository is (
and this is the error
Error creating bean with name 'HomeController': Unsatisfied dependency expressed through field 'studentRepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentRepo' defined in com.mu.application.repository.StudentRepo defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract java.util.List com.mu.application.repository.StudentRepo . findById_natAndId_res(java.lang.Short,java.lang.Integer); Reason: Validation failed for query for method public abstract java.util.List com.mu.application.repository.StudentRepo . findById_natAndId_res(java.lang.Short,java.lang.Integer)!; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List scom.mu.application.repository.StudentRepo . findById_natAndId_res(java.lang.Short,java.lang.Integer)!
I'm sure name convention is correct, all fields like my db + also if I search about s.id.res alone it works but s.id.nat doesn't work even they are in same class, so I'm sure the problem in s.id.nat