Getting below error while loading data from database
java.lang.IllegalStateException: Required identifier property not found for class com.sudhirt.practice.springdatajdbcpractice.entity.AuthorRef!
at org.springframework.data.mapping.PersistentEntity.getRequiredIdProperty(PersistentEntity.java:105)
at org.springframework.data.jdbc.core.EntityRowMapper.readEntityFrom(EntityRowMapper.java:143)
at org.springframework.data.jdbc.core.EntityRowMapper.readFrom(EntityRowMapper.java:124)
at org.springframework.data.jdbc.core.EntityRowMapper.lambda$createInstance$0(EntityRowMapper.java:167)
Below is the entity class AuthorRef
@Data
@Table("BOOK_AUTHOR")
@NoArgsConstructor
@AllArgsConstructor
public class AuthorRef {
private Long author;
}
What might be the reason for above error?
Source code is available at https://github.com/sudhirtumati/spring-data-jdbc-sample