Skip to content

Commit

Permalink
HHH-18894 Create and return new EnumJavaType object if class name rep…
Browse files Browse the repository at this point in the history
…resents enum that is not currently known
  • Loading branch information
cigaly committed Dec 6, 2024
1 parent 2807cf6 commit dea55b0
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,21 @@ public Set<EmbeddableType<?>> getEmbeddables() {

@Override
public EnumJavaType<?> getEnumType(String className) {
return enumJavaTypes.get( className );
final EnumJavaType<?> enumJavaType = enumJavaTypes.get( className );
if ( enumJavaType != null ) {
return enumJavaType;
}
final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
try {
final Class<Object> clazz = classLoaderService.classForName( className );
if ( clazz == null || !clazz.isEnum() ) {
return null;
}
return new EnumJavaType( clazz );
}
catch (ClassLoadingException e) {
throw new RuntimeException( e );
}
}

@Override
Expand Down

0 comments on commit dea55b0

Please sign in to comment.