Skip to content

Commit f7e15b5

Browse files
committed
refactor: @configuration이 CGLib을 사용하지 않도록 변경
spring-projects/spring-boot#9068
1 parent 9348902 commit f7e15b5

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

detector/src/main/java/io/jeyong/detector/config/NPlusOneDetectorBaseConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,4 @@ public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(
2525
final QueryCaptureInspector queryCaptureInspector) {
2626
return hibernateProperties -> hibernateProperties.put(STATEMENT_INSPECTOR, queryCaptureInspector);
2727
}
28-
29-
public abstract NPlusOneQueryTemplate nPlusOneQueryTemplate();
3028
}

detector/src/main/java/io/jeyong/detector/config/NPlusOneDetectorExceptionConfig.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.springframework.context.annotation.Bean;
1212
import org.springframework.context.annotation.Configuration;
1313

14-
@Configuration
14+
@Configuration(proxyBeanMethods = false)
1515
@EnableConfigurationProperties(NPlusOneDetectorProperties.class)
1616
public class NPlusOneDetectorExceptionConfig extends NPlusOneDetectorBaseConfig {
1717

@@ -36,11 +36,10 @@ public ExceptionContext exceptionContext() {
3636
}
3737

3838
@Bean
39-
@Override
40-
public NPlusOneQueryTemplate nPlusOneQueryTemplate() {
39+
public NPlusOneQueryTemplate nPlusOneQueryTemplate(final ExceptionContext exceptionContext) {
4140
return new NPlusOneQueryCollector(
4241
nPlusOneDetectorProperties.getThreshold(),
4342
nPlusOneDetectorProperties.getExclude(),
44-
exceptionContext());
43+
exceptionContext);
4544
}
4645
}

detector/src/main/java/io/jeyong/detector/config/NPlusOneDetectorLoggingConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.springframework.context.annotation.Bean;
1212
import org.springframework.context.annotation.Configuration;
1313

14-
@Configuration
14+
@Configuration(proxyBeanMethods = false)
1515
@ConditionalOnProperty(
1616
prefix = "spring.jpa.properties.hibernate.detector",
1717
name = "enabled",
@@ -38,7 +38,6 @@ public void logInitialization() {
3838
}
3939

4040
@Bean
41-
@Override
4241
public NPlusOneQueryTemplate nPlusOneQueryTemplate() {
4342
return new NPlusOneQueryLogger(
4443
nPlusOneDetectorProperties.getThreshold(),

0 commit comments

Comments
 (0)