From 17fb2b9436d6f39070555c45a9a2ab1bf112c92c Mon Sep 17 00:00:00 2001 From: Cedomir Igaly Date: Sun, 2 Apr 2023 12:25:25 +0200 Subject: [PATCH] HHH-16261 - Not ignoring JDK 14 records when processing --- .../org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java | 2 +- .../jpamodelgen/annotation/MetaAttributeGenerationVisitor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java index 3be15381be..c8d448035e 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/JPAMetaModelEntityProcessor.java @@ -223,7 +223,7 @@ public class JPAMetaModelEntityProcessor extends AbstractProcessor { private void handleRootElementAnnotationMirrors(final Element element) { List annotationMirrors = element.getAnnotationMirrors(); for ( AnnotationMirror mirror : annotationMirrors ) { - if ( !ElementKind.CLASS.equals( element.getKind() ) ) { + if ( !ElementKind.CLASS.equals( element.getKind() ) && !ElementKind.RECORD.equals( element.getKind() ) ) { continue; } diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java index d2a04a6315..ce413ee563 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/MetaAttributeGenerationVisitor.java @@ -316,7 +316,7 @@ class BasicAttributeVisitor extends SimpleTypeVisitor6 { return Boolean.TRUE; } - if ( ElementKind.CLASS.equals( element.getKind() ) || ElementKind.INTERFACE.equals( element.getKind() ) ) { + if ( ElementKind.CLASS.equals( element.getKind() ) || ElementKind.INTERFACE.equals( element.getKind() ) || ElementKind.RECORD.equals( element.getKind() ) ) { TypeElement typeElement = ( (TypeElement) element ); String typeName = typeElement.getQualifiedName().toString(); if ( Constants.BASIC_TYPES.contains( typeName ) ) {