From db4e2fcd9c8a09a50e091d6b40cb9623bb3a0791 Mon Sep 17 00:00:00 2001 From: jo-elimu <1451036+jo-elimu@users.noreply.github.com> Date: Sat, 13 Jul 2024 18:07:59 +0700 Subject: [PATCH] refactor(servlet): remove hardcoded package name refs #1684 --- src/main/java/ai/elimu/web/servlet/CustomDispatcherServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ai/elimu/web/servlet/CustomDispatcherServlet.java b/src/main/java/ai/elimu/web/servlet/CustomDispatcherServlet.java index 45ac8a3b9..6872251fb 100644 --- a/src/main/java/ai/elimu/web/servlet/CustomDispatcherServlet.java +++ b/src/main/java/ai/elimu/web/servlet/CustomDispatcherServlet.java @@ -81,7 +81,7 @@ private void createJpaSchemaExport() { // Scan for classes annotated as JPA @Entity ClassPathScanningCandidateComponentProvider entityScanner = new ClassPathScanningCandidateComponentProvider(true); entityScanner.addIncludeFilter(new AnnotationTypeFilter(Entity.class)); - for (BeanDefinition beanDefinition : entityScanner.findCandidateComponents("ai.elimu.model")) { + for (BeanDefinition beanDefinition : entityScanner.findCandidateComponents(ai.elimu.model.BaseEntity.class.getPackageName())) { logger.info("beanDefinition.getBeanClassName(): " + beanDefinition.getBeanClassName()); try { Class annotatedClass = Class.forName(beanDefinition.getBeanClassName());