I have this interface:
public interface liteRepository extends CrudRepository<liteEntity, Long>, JpaSpecificationExecutor<liteEntity> {...}
It works, all is well.
However, intellij
does not register this class as a spring component. If I annotate this interface with @Component
, then intellij
recognizes this as a spring bean and I can @Autowire
this repository in my integration tests.
My code still works after annotation, but I'm not confident that I am not messing with things that I should not be messing with.
Question:
Is there any harm in adding the @Component
annotation to this interface?