Does Spring Profile Annotation Work on @Repository?

Viewed 19

I am a bit new with spring framework, I am currently trying to restrict the usage of one repository only for certain profiles,
I am trying to make code change like below so that this repository is only usable for p1 and p2 profile

@Repository
@Profile({"p1","p2"})
public class someRepository {
  // inner logic....
}

will this work as expected ?

0 Answers
Related