Skip to content

Commit

Permalink
Register IdClass for reflection when defined through orm.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Dec 20, 2024
1 parent 93cd4fa commit 44f39dc
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ private void enlistOrmXmlMappingManagedClass(Collector collector, String package
collector.entityTypes.add(name);
}

var idClass = managed.getIdClass();
if (idClass != null) {
enlistIdClass(collector, DotName.createSimple(qualifyIfNecessary(packagePrefix, idClass.getClazz())));
}

enlistOrmXmlMappingListeners(collector, packagePrefix, managed.getEntityListenerContainer());
}

Expand Down Expand Up @@ -405,12 +410,16 @@ private void enlistJPAModelIdClasses(Collector collector, DotName dotName) {
}

for (AnnotationInstance annotation : jpaAnnotations) {
DotName targetDotName = annotation.value().asClass().name();
addClassHierarchyToReflectiveList(collector, targetDotName);
collector.modelTypes.add(targetDotName.toString());
DotName valueDotName = annotation.value().asClass().name();
enlistIdClass(collector, valueDotName);
}
}

private void enlistIdClass(Collector collector, DotName idClass) {
addClassHierarchyToReflectiveList(collector, idClass);
collector.modelTypes.add(idClass.toString());
}

private void enlistPotentialCdiBeanClasses(Collector collector, DotName dotName) {
Collection<AnnotationInstance> jpaAnnotations = index.getAnnotations(dotName);

Expand Down

0 comments on commit 44f39dc

Please sign in to comment.