diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MapOfMapEntity.java b/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MapOfMapEntity.java new file mode 100644 index 0000000000..e52d858e61 --- /dev/null +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MapOfMapEntity.java @@ -0,0 +1,30 @@ +package org.hibernate.processor.test.map; + +import java.util.Map; + +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.type.SqlTypes; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +@Entity +@Table( name = "MAP_OF_MAP_ENTITY" ) +public class MapOfMapEntity { + @Id + @Column(name="key_") + private String key; + + @JdbcTypeCode(SqlTypes.JSON) + private Map> mapOfMap; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } +} diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MetamodelGeneratedTest.java b/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MetamodelGeneratedTest.java new file mode 100644 index 0000000000..d00bb4c2da --- /dev/null +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/map/MetamodelGeneratedTest.java @@ -0,0 +1,21 @@ +package org.hibernate.processor.test.map; + +import org.hibernate.processor.test.util.CompilationTest; +import org.hibernate.processor.test.util.TestForIssue; +import org.hibernate.processor.test.util.WithClasses; + +import org.junit.Test; +import org.junit.jupiter.api.Assertions; + +import static org.hibernate.processor.test.util.TestUtil.getMetamodelClassFor; + +public class MetamodelGeneratedTest extends CompilationTest { + + @Test + @WithClasses({ MapOfMapEntity.class }) + @TestForIssue(jiraKey = " HHH-17514") + public void test() { + Class repositoryClass = getMetamodelClassFor( MapOfMapEntity.class ); + Assertions.assertNotNull( repositoryClass ); + } +}