I'm currently using Spring for a project, and I'm confused how Spring can actually instantiate an annotated interface such as a JpaRepository
.
As far as I know, an interface cannot be instantiated without an implementation. Also it was in my understanding, that any annotations in interfaces are not inherit to the implementing class (Which should render them useless?)
So how is Spring able to actually get a working bean out of only a annotated interface as below?
@Repository
public interface ExampleRepository extends PagingAndSortingRepository<ExampleEntity, Long>{
}