Skip to content

Commit

Permalink
elimu-ai#1684 addressed review comment to change hardcoded package na…
Browse files Browse the repository at this point in the history
…me ai.elimu.model by dynaically pulling package name using BaseEntity class
  • Loading branch information
diptechexpo committed Jul 8, 2024
1 parent 3221f77 commit 35bc4bd
Show file tree
Hide file tree
Showing 2 changed files with 1,133 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ai.elimu.web.servlet;

import ai.elimu.entity.BaseEntity;
import ai.elimu.model.v2.enums.Environment;
import ai.elimu.model.v2.enums.Language;
import ai.elimu.util.ConfigHelper;
Expand Down Expand Up @@ -81,7 +82,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(BaseEntity.class.getPackageName())) {
logger.info("beanDefinition.getBeanClassName(): " + beanDefinition.getBeanClassName());
try {
Class<?> annotatedClass = Class.forName(beanDefinition.getBeanClassName());
Expand Down
Loading

0 comments on commit 35bc4bd

Please sign in to comment.