Skip to content

Commit

Permalink
Merge pull request quarkusio#17339 from yrodiere/i17285
Browse files Browse the repository at this point in the history
Auto-indexing in Jandex of classes referenced from Hibernate ORM entities/embedables/XML mappings/etc
  • Loading branch information
Sanne authored May 19, 2021
2 parents 5bad4ab + 59e88e1 commit cb884e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public JpaModelIndexBuildItem jpaEntitiesIndexer(
IndexingUtil.indexClass(jpaModel.getClassName(), indexer, index.getIndex(), additionalIndex,
HibernateOrmProcessor.class.getClassLoader());
}
CompositeIndex compositeIndex = CompositeIndex.create(index.getIndex(), indexer.complete());
CompositeIndex compositeIndex = CompositeIndex.create(index.getComputingIndex(), indexer.complete());
return new JpaModelIndexBuildItem(compositeIndex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,14 @@ private void addClassHierarchyToReflectiveList(Collector collector, DotName clas
}
// we need to check for enums
for (FieldInfo fieldInfo : classInfo.fields()) {
DotName fieldType = fieldInfo.type().name();
ClassInfo fieldTypeClassInfo = index.getClassByName(fieldType);
Type fieldType = fieldInfo.type();
if (Type.Kind.PRIMITIVE == fieldType.kind()) {
continue;
}
DotName fieldClassName = fieldInfo.type().name();
ClassInfo fieldTypeClassInfo = index.getClassByName(fieldClassName);
if (fieldTypeClassInfo != null && ClassNames.ENUM.equals(fieldTypeClassInfo.superName())) {
collector.enumTypes.add(fieldType.toString());
collector.enumTypes.add(fieldClassName.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@ quarkus.datasource.libraryA.db-kind=h2
quarkus.datasource.libraryB.db-kind=h2

quarkus.hibernate-orm.mapping-files=no-file

quarkus.index-dependency.libraryA.group-id=io.quarkus
quarkus.index-dependency.libraryA.artifact-id=quarkus-integration-test-jpa-xml-legacy-library-a
quarkus.index-dependency.libraryB.group-id=io.quarkus
quarkus.index-dependency.libraryB.artifact-id=quarkus-integration-test-jpa-xml-legacy-library-b

0 comments on commit cb884e2

Please sign in to comment.