We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1469f5 commit d8aa4d1Copy full SHA for d8aa4d1
Spring_part_7/src/main/java/spring/oldboy/repository/UserRepository.java
@@ -0,0 +1,18 @@
1
+package spring.oldboy.repository;
2
+
3
+import lombok.RequiredArgsConstructor;
4
+import org.springframework.beans.factory.annotation.Qualifier;
5
+import org.springframework.beans.factory.config.BeanDefinition;
6
+import org.springframework.context.annotation.Scope;
7
+import org.springframework.stereotype.Repository;
8
+import spring.oldboy.pool.ConnectionPool;
9
10
+@Repository
11
+@Scope(BeanDefinition.SCOPE_PROTOTYPE)
12
+@RequiredArgsConstructor
13
+public class UserRepository {
14
+ /* Перенос данной аннотации в конструктор прописан в lombok.config */
15
+ @Qualifier("pool2")
16
+ private final ConnectionPool connectionPool;
17
18
+}
0 commit comments