diff --git a/metadata/org.hibernate.orm/hibernate-core/6.2.0.Final/reflect-config.json b/metadata/org.hibernate.orm/hibernate-core/6.2.0.Final/reflect-config.json index 805d5eb93..73b7acf35 100644 --- a/metadata/org.hibernate.orm/hibernate-core/6.2.0.Final/reflect-config.json +++ b/metadata/org.hibernate.orm/hibernate-core/6.2.0.Final/reflect-config.json @@ -453,6 +453,46 @@ "name":"org.hibernate.event.spi.EventType", "allDeclaredFields":true }, + { + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.CurrentTimestampGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.CreationTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.CurrentTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.UpdateTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] } + ] + }, + { + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.GeneratedAlwaysGeneration", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.GeneratedGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.Generated"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.GenerationTime"] } + ] + }, + { + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.SourceGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.Source","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.SourceType","java.lang.Class","org.hibernate.generator.GeneratorCreationContext"] } + ] + }, + { + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.TenantIdGeneration", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["org.hibernate.annotations.TenantId","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }] + }, { "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, "name":"org.hibernate.id.Assigned", diff --git a/metadata/org.hibernate.orm/hibernate-core/6.5.0.Final/reflect-config.json b/metadata/org.hibernate.orm/hibernate-core/6.5.0.Final/reflect-config.json index e45c07b9a..52133ef4b 100644 --- a/metadata/org.hibernate.orm/hibernate-core/6.5.0.Final/reflect-config.json +++ b/metadata/org.hibernate.orm/hibernate-core/6.5.0.Final/reflect-config.json @@ -518,6 +518,46 @@ "name":"org.hibernate.event.spi.EventType", "allDeclaredFields":true }, +{ + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.CurrentTimestampGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.CreationTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.CurrentTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.UpdateTimestamp","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] } + ] +}, +{ + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.GeneratedAlwaysGeneration", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.GeneratedGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.Generated"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.GenerationTime"] } + ] +}, +{ + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.SourceGeneration", + "queryAllDeclaredConstructors":true, + "methods":[ + {"name":"","parameterTypes":["org.hibernate.annotations.Source","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }, + {"name":"","parameterTypes":["org.hibernate.annotations.SourceType","java.lang.Class","org.hibernate.generator.GeneratorCreationContext"] } + ] +}, +{ + "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, + "name":"org.hibernate.generator.internal.TenantIdGeneration", + "queryAllDeclaredConstructors":true, + "methods":[{"name":"","parameterTypes":["org.hibernate.annotations.TenantId","java.lang.reflect.Member","org.hibernate.generator.GeneratorCreationContext"] }] +}, { "condition":{"typeReachable":"org.hibernate.id.factory.internal.StandardIdentifierGeneratorFactory"}, "name":"org.hibernate.id.Assigned", diff --git a/tests/src/org.hibernate.orm/hibernate-core/6.5.0.Final/src/test/java/org_hibernate_orm/hibernate_core/IdentifierGeneratorTest.java b/tests/src/org.hibernate.orm/hibernate-core/6.5.0.Final/src/test/java/org_hibernate_orm/hibernate_core/IdentifierGeneratorTest.java index 9ea3362c1..71cbcf92b 100644 --- a/tests/src/org.hibernate.orm/hibernate-core/6.5.0.Final/src/test/java/org_hibernate_orm/hibernate_core/IdentifierGeneratorTest.java +++ b/tests/src/org.hibernate.orm/hibernate-core/6.5.0.Final/src/test/java/org_hibernate_orm/hibernate_core/IdentifierGeneratorTest.java @@ -26,6 +26,14 @@ public class IdentifierGeneratorTest { org.hibernate.id.ForeignGenerator.class }; + private static final Class[] VALUE_GENERATION_TYPE_GENERATORS_FROM_ANNOTATIONS = new Class[]{ + org.hibernate.generator.internal.CurrentTimestampGeneration.class, + org.hibernate.generator.internal.GeneratedAlwaysGeneration.class, + org.hibernate.generator.internal.GeneratedGeneration.class, + org.hibernate.generator.internal.SourceGeneration.class, + org.hibernate.generator.internal.TenantIdGeneration.class + }; + @Test public void testIdentifierGenerators() throws Exception { for (Class clazz : identifierGenerators) { @@ -33,4 +41,17 @@ public void testIdentifierGenerators() throws Exception { assertThat(constructor).isNotNull(); } } + + /** + * {@link org.hibernate.annotations.ValueGenerationType#generatedBy()} may hold types reflectively instantiated. + * This uses a list of those to make sure hints are present. + */ + @Test + public void testValueGenerationTypes() throws Exception { + for (Class clazz : VALUE_GENERATION_TYPE_GENERATORS_FROM_ANNOTATIONS) { + for (Constructor ctor : clazz.getDeclaredConstructors()) { + assertThat(clazz.getConstructor(ctor.getParameterTypes())).isEqualTo(ctor); + } + } + } }