From 92c434dd9bbc0f9ff0d0bd918f015bb551bc83d6 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Wed, 28 Aug 2024 13:49:05 +0200 Subject: [PATCH] HHH-18520 Upgrade to hibernate-models 0.9.0 --- .../internal/AccessJpaAnnotation.java | 10 +-- .../annotations/internal/AnyAnnotation.java | 12 ++-- .../internal/AnyDiscriminatorAnnotation.java | 10 +-- .../AnyDiscriminatorValueAnnotation.java | 22 ++----- .../AnyDiscriminatorValuesAnnotation.java | 20 ++---- .../internal/AnyKeTypeAnnotation.java | 10 +-- .../internal/AnyKeyJavaClassAnnotation.java | 14 +---- .../internal/AnyKeyJavaTypeAnnotation.java | 14 +---- .../internal/AnyKeyJdbcTypeAnnotation.java | 14 +---- .../AnyKeyJdbcTypeCodeAnnotation.java | 14 +---- .../internal/AnyKeyTypeXmlAnnotation.java | 14 +---- .../annotations/internal/ArrayAnnotation.java | 10 +-- .../AssociationOverrideJpaAnnotation.java | 15 ++--- .../AssociationOverridesJpaAnnotation.java | 10 +-- .../internal/AttributeAccessorAnnotation.java | 14 ++--- .../AttributeBinderTypeAnnotation.java | 14 +---- .../AttributeOverrideJpaAnnotation.java | 10 ++- .../AttributeOverridesJpaAnnotation.java | 8 +-- .../annotations/internal/BagAnnotation.java | 8 +-- .../internal/BasicJpaAnnotation.java | 12 ++-- .../internal/BatchSizeAnnotation.java | 10 +-- .../annotations/internal/CacheAnnotation.java | 16 ++--- .../internal/CacheableJpaAnnotation.java | 10 +-- .../internal/CascadeAnnotation.java | 10 +-- .../annotations/internal/CheckAnnotation.java | 21 ++----- .../CheckConstraintJpaAnnotation.java | 14 ++--- .../internal/ChecksAnnotation.java | 8 +-- .../internal/CollateAnnotation.java | 10 +-- ...CollectionClassificationXmlAnnotation.java | 10 +-- .../internal/CollectionIdAnnotation.java | 23 ++----- .../CollectionIdJavaTypeAnnotation.java | 15 +---- .../CollectionIdJdbcTypeAnnotation.java | 15 +---- .../CollectionIdJdbcTypeCodeAnnotation.java | 15 +---- .../CollectionIdMutabilityAnnotation.java | 15 +---- .../internal/CollectionIdTypeAnnotation.java | 15 ++--- .../CollectionTableJpaAnnotation.java | 32 +++------- .../internal/CollectionTypeAnnotation.java | 15 ++--- .../CollectionTypeRegistrationAnnotation.java | 27 ++------ ...CollectionTypeRegistrationsAnnotation.java | 13 +--- .../internal/ColumnDefaultAnnotation.java | 10 +-- .../internal/ColumnJpaAnnotation.java | 39 +++++------- .../internal/ColumnResultJpaAnnotation.java | 12 ++-- .../internal/ColumnTransformerAnnotation.java | 19 ++---- .../ColumnTransformersAnnotation.java | 8 +-- .../internal/ColumnsAnnotation.java | 8 +-- .../internal/CommentAnnotation.java | 12 ++-- .../internal/CommentsAnnotation.java | 8 +-- .../internal/CompositeTypeAnnotation.java | 10 +-- .../CompositeTypeRegistrationAnnotation.java | 22 ++----- .../CompositeTypeRegistrationsAnnotation.java | 13 +--- .../internal/ConcreteProxyAnnotation.java | 12 +--- .../ConstructorResultJpaAnnotation.java | 12 ++-- .../internal/ConvertJpaAnnotation.java | 20 ++---- .../internal/ConverterJpaAnnotation.java | 10 +-- .../ConverterRegistrationAnnotation.java | 31 +++------- .../ConverterRegistrationsAnnotation.java | 15 ++--- .../internal/ConvertsJpaAnnotation.java | 20 +++--- .../internal/CreationTimestampAnnotation.java | 10 +-- .../internal/CurrentTimestampAnnotation.java | 11 ++-- .../DiscriminatorColumnJpaAnnotation.java | 44 +++---------- .../DiscriminatorFormulaAnnotation.java | 23 ++----- .../DiscriminatorOptionsAnnotation.java | 22 ++----- .../DiscriminatorValueJpaAnnotation.java | 12 ++-- .../internal/DynamicInsertAnnotation.java | 9 +-- .../internal/DynamicUpdateAnnotation.java | 8 +-- .../ElementCollectionJpaAnnotation.java | 19 ++---- .../EmbeddableInstantiatorAnnotation.java | 17 ++---- ...bleInstantiatorRegistrationAnnotation.java | 23 ++----- ...leInstantiatorRegistrationsAnnotation.java | 13 +--- .../internal/EmbeddableJpaAnnotation.java | 9 ++- .../internal/EmbeddedIdJpaAnnotation.java | 9 ++- .../internal/EmbeddedJpaAnnotation.java | 9 ++- .../internal/EntityJpaAnnotation.java | 10 +-- .../EntityListenersJpaAnnotation.java | 10 +-- .../internal/EntityResultJpaAnnotation.java | 21 ++----- .../internal/EnumeratedJpaAnnotation.java | 10 +-- .../EnumeratedValueJpaAnnotation.java | 5 +- .../ExcludeDefaultListenersJpaAnnotation.java | 9 ++- ...cludeSuperclassListenersJpaAnnotation.java | 9 ++- .../internal/ExtendsXmlAnnotation.java | 10 +-- .../annotations/internal/FetchAnnotation.java | 10 +-- .../internal/FetchProfileAnnotation.java | 15 ++--- .../FetchProfileOverrideAnnotation.java | 31 +++------- .../FetchProfileOverridesAnnotation.java | 15 ++--- .../internal/FetchProfilesAnnotation.java | 8 +-- .../internal/FieldResultJpaAnnotation.java | 12 ++-- .../internal/FilterAnnotation.java | 19 ++---- .../internal/FilterDefAnnotation.java | 31 +++------- .../internal/FilterDefsAnnotation.java | 8 +-- .../internal/FilterJoinTableAnnotation.java | 19 ++---- .../internal/FilterJoinTablesAnnotation.java | 8 +-- .../internal/FiltersAnnotation.java | 8 +-- .../internal/ForeignKeyJpaAnnotation.java | 21 ++----- .../internal/FormulaAnnotation.java | 10 +-- .../internal/FractionalSecondsAnnotation.java | 10 +-- .../internal/GeneratedAnnotation.java | 14 ++--- .../internal/GeneratedColumnAnnotation.java | 10 +-- .../internal/GeneratedValueJpaAnnotation.java | 12 ++-- .../internal/GenericGeneratorAnnotation.java | 24 ++------ .../internal/GenericGeneratorsAnnotation.java | 8 +-- .../internal/HQLSelectAnnotation.java | 10 +-- .../internal/IdClassJpaAnnotation.java | 10 +-- .../internal/IdGeneratorTypeAnnotation.java | 10 +-- .../annotations/internal/IdJpaAnnotation.java | 5 +- .../internal/ImmutableAnnotation.java | 5 +- .../internal/ImportedAnnotation.java | 10 +-- .../internal/IndexJpaAnnotation.java | 16 ++--- .../internal/InheritanceJpaAnnotation.java | 10 +-- .../internal/InstantiatorAnnotation.java | 10 +-- .../internal/JavaTypeAnnotation.java | 10 +-- .../JavaTypeRegistrationAnnotation.java | 25 +++----- .../JavaTypeRegistrationsAnnotation.java | 15 ++--- .../internal/JdbcTypeAnnotation.java | 10 +-- .../internal/JdbcTypeCodeAnnotation.java | 10 +-- .../JdbcTypeRegistrationAnnotation.java | 24 ++------ .../JdbcTypeRegistrationsAnnotation.java | 15 ++--- .../internal/JoinColumnJpaAnnotation.java | 38 +++++------- .../JoinColumnOrFormulaAnnotation.java | 10 ++- .../internal/JoinColumnsJpaAnnotation.java | 8 +-- .../JoinColumnsOrFormulasAnnotation.java | 15 ++--- .../internal/JoinFormulaAnnotation.java | 17 ++---- .../internal/JoinTableJpaAnnotation.java | 45 +++++--------- .../internal/LazyGroupAnnotation.java | 10 +-- .../internal/ListIndexBaseAnnotation.java | 10 +-- .../internal/ListIndexJavaTypeAnnotation.java | 10 +-- .../internal/ListIndexJdbcTypeAnnotation.java | 10 +-- .../ListIndexJdbcTypeCodeAnnotation.java | 17 ++---- .../internal/LobJpaAnnotation.java | 5 +- .../internal/ManyToAnyAnnotation.java | 10 +-- .../internal/ManyToManyJpaAnnotation.java | 16 ++--- .../internal/ManyToOneJpaAnnotation.java | 16 ++--- .../internal/MapKeyClassJpaAnnotation.java | 10 +-- .../internal/MapKeyColumnJpaAnnotation.java | 35 ++++------- .../MapKeyCompositeTypeAnnotation.java | 15 +---- .../MapKeyEnumeratedJpaAnnotation.java | 10 +-- .../internal/MapKeyJavaTypeAnnotation.java | 10 +-- .../internal/MapKeyJdbcTypeAnnotation.java | 10 +-- .../MapKeyJdbcTypeCodeAnnotation.java | 15 +---- .../MapKeyJoinColumnJpaAnnotation.java | 51 ++++------------ .../MapKeyJoinColumnsJpaAnnotation.java | 17 ++---- .../internal/MapKeyJpaAnnotation.java | 10 +-- .../internal/MapKeyMutabilityAnnotation.java | 11 ++-- .../internal/MapKeyTemporalJpaAnnotation.java | 10 +-- .../internal/MapKeyTypeAnnotation.java | 15 ++--- .../MappedSuperclassJpaAnnotation.java | 5 +- .../internal/MapsIdJpaAnnotation.java | 10 +-- .../internal/MutabilityAnnotation.java | 11 ++-- .../NamedAttributeNodeJpaAnnotation.java | 21 +++---- .../NamedEntityGraphJpaAnnotation.java | 31 +++------- .../NamedEntityGraphsJpaAnnotation.java | 10 +-- .../NamedNativeQueriesAnnotation.java | 8 +-- .../NamedNativeQueriesJpaAnnotation.java | 10 +-- .../internal/NamedNativeQueryAnnotation.java | 47 +++++++------- .../NamedNativeQueryJpaAnnotation.java | 32 +++------- .../internal/NamedQueriesAnnotation.java | 8 +-- .../internal/NamedQueriesJpaAnnotation.java | 8 +-- .../internal/NamedQueryAnnotation.java | 40 ++++++------ .../internal/NamedQueryJpaAnnotation.java | 16 +++-- ...edStoredProcedureQueriesJpaAnnotation.java | 13 +--- ...amedStoredProcedureQueryJpaAnnotation.java | 43 +++---------- .../internal/NamedSubgraphJpaAnnotation.java | 17 ++---- .../internal/NationalizedAnnotation.java | 5 +- .../internal/NaturalIdAnnotation.java | 10 +-- .../internal/NaturalIdCacheAnnotation.java | 10 +-- .../internal/NotFoundAnnotation.java | 10 +-- .../internal/OnDeleteAnnotation.java | 10 +-- .../internal/OneToManyJpaAnnotation.java | 23 +++---- .../internal/OneToOneJpaAnnotation.java | 20 +++--- .../internal/OptimisticLockAnnotation.java | 15 +---- .../internal/OptimisticLockingAnnotation.java | 10 +-- .../internal/OrderByAnnotation.java | 19 +++--- .../internal/OrderByJpaAnnotation.java | 10 +-- .../internal/OrderColumnJpaAnnotation.java | 25 +++----- .../internal/OverriddenCheckAnnotation.java | 20 +++--- .../internal/OverriddenChecksAnnotation.java | 26 ++++---- .../OverriddenColumnDefaultAnnotation.java | 22 ++++--- .../OverriddenColumnDefaultsAnnotation.java | 10 +-- ...rriddenDiscriminatorFormulaAnnotation.java | 20 +++--- ...riddenDiscriminatorFormulasAnnotation.java | 8 +-- ...verriddenFilterDefOverridesAnnotation.java | 8 +-- .../OverriddenFilterDefsAnnotation.java | 33 ++++++---- .../OverriddenFilterOverridesAnnotation.java | 10 +-- .../internal/OverriddenFiltersAnnotation.java | 34 +++++++---- .../internal/OverriddenFormulaAnnotation.java | 33 ++++++---- .../OverriddenFormulasAnnotation.java | 8 +-- .../OverriddenGeneratedColumnAnnotation.java | 29 +++++---- .../OverriddenGeneratedColumnsAnnotation.java | 8 +-- .../OverriddenJoinFormulaAnnotation.java | 31 ++++++---- .../OverriddenJoinFormulasAnnotation.java | 10 +-- .../internal/OverriddenOrderByAnnotation.java | 33 ++++++---- .../OverriddenOrderBysAnnotation.java | 8 +-- .../OverriddenSQLDeleteAllAnnotation.java | 31 ++++++---- .../OverriddenSQLDeleteAllsAnnotation.java | 10 +-- .../OverriddenSQLDeleteAnnotation.java | 31 ++++++---- .../OverriddenSQLDeletesAnnotation.java | 19 ++++-- .../OverriddenSQLInsertAnnotation.java | 31 ++++++---- .../OverriddenSQLInsertsAnnotation.java | 16 ++++- .../OverriddenSQLOrderAnnotation.java | 31 ++++++---- .../OverriddenSQLOrdersAnnotation.java | 8 +-- .../OverriddenSQLRestrictionAnnotation.java | 29 +++++---- .../OverriddenSQLRestrictionsAnnotation.java | 15 ++--- .../OverriddenSQLSelectAnnotation.java | 19 ++++-- .../OverriddenSQLSelectsAnnotation.java | 15 ++--- .../OverriddenSQLUpdateAnnotation.java | 31 ++++++---- .../OverriddenSQLUpdatesAnnotation.java | 17 ++++-- .../internal/OverrideVersionAnnotation.java | 17 ++++-- .../internal/ParamDefAnnotation.java | 14 ++--- .../internal/ParameterAnnotation.java | 12 ++-- .../internal/ParentAnnotation.java | 5 +- .../internal/PartitionKeyAnnotation.java | 5 +- .../internal/PostLoadJpaAnnotation.java | 5 +- .../internal/PostPersistJpaAnnotation.java | 5 +- .../internal/PostRemoveJpaAnnotation.java | 5 +- .../internal/PostUpdateJpaAnnotation.java | 5 +- .../internal/PrePersistJpaAnnotation.java | 5 +- .../internal/PreRemoveJpaAnnotation.java | 5 +- .../internal/PreUpdateJpaAnnotation.java | 5 +- .../PrimaryKeyJoinColumnJpaAnnotation.java | 38 +++--------- .../PrimaryKeyJoinColumnsJpaAnnotation.java | 17 ++---- .../internal/PropertyRefAnnotation.java | 10 +-- .../internal/QueryCacheLayoutAnnotation.java | 10 +-- .../internal/QueryHintJpaAnnotation.java | 12 ++-- .../annotations/internal/RowIdAnnotation.java | 10 +-- .../internal/SQLDeleteAllAnnotation.java | 19 +++--- .../internal/SQLDeleteAnnotation.java | 19 +++--- .../internal/SQLDeletesAnnotation.java | 15 ++--- .../internal/SQLInsertAnnotation.java | 19 +++--- .../internal/SQLInsertsAnnotation.java | 8 +-- .../SQLJoinTableRestrictionAnnotation.java | 17 ++---- .../internal/SQLOrderAnnotation.java | 10 +-- .../internal/SQLRestrictionAnnotation.java | 10 +-- .../internal/SQLSelectAnnotation.java | 22 ++----- .../internal/SQLUpdateAnnotation.java | 19 +++--- .../internal/SQLUpdatesAnnotation.java | 8 +-- .../internal/SecondaryRowAnnotation.java | 14 ++--- .../internal/SecondaryRowsAnnotation.java | 8 +-- .../internal/SecondaryTableJpaAnnotation.java | 36 ++++------- .../SecondaryTablesJpaAnnotation.java | 8 +-- .../SequenceGeneratorJpaAnnotation.java | 39 ++++-------- .../SequenceGeneratorsJpaAnnotation.java | 5 +- .../internal/SoftDeleteAnnotation.java | 24 +++----- .../internal/SortComparatorAnnotation.java | 10 +-- .../internal/SortNaturalAnnotation.java | 5 +- .../internal/SourceAnnotation.java | 10 +-- .../internal/SqlFragmentAliasAnnotation.java | 14 ++--- .../SqlResultSetMappingJpaAnnotation.java | 21 +++---- .../SqlResultSetMappingsJpaAnnotation.java | 10 +-- ...StoredProcedureParameterJpaAnnotation.java | 14 ++--- .../internal/StructAnnotation.java | 17 ++---- .../internal/SubselectAnnotation.java | 10 +-- .../internal/SynchronizeAnnotation.java | 12 ++-- .../internal/TableGeneratorJpaAnnotation.java | 61 +++++-------------- .../TableGeneratorsJpaAnnotation.java | 8 +-- .../internal/TableJpaAnnotation.java | 27 +++----- .../internal/TargetLegacyAnnotation.java | 10 +-- .../internal/TargetXmlAnnotation.java | 5 +- .../internal/TemporalJpaAnnotation.java | 10 +-- .../internal/TenantIdAnnotation.java | 5 +- .../internal/TimeZoneColumnAnnotation.java | 37 +++-------- .../internal/TimeZoneStorageAnnotation.java | 10 +-- .../internal/TransientJpaAnnotation.java | 5 +- .../annotations/internal/TypeAnnotation.java | 10 ++- .../internal/TypeBinderTypeAnnotation.java | 10 +-- .../internal/TypeRegistrationAnnotation.java | 22 ++----- .../internal/TypeRegistrationsAnnotation.java | 8 +-- .../UniqueConstraintJpaAnnotation.java | 19 ++---- .../internal/UpdateTimestampAnnotation.java | 10 +-- .../internal/UuidGeneratorAnnotation.java | 11 ++-- .../ValueGenerationTypeAnnotation.java | 15 +---- .../internal/VersionJpaAnnotation.java | 5 +- .../annotations/internal/ViewAnnotation.java | 10 +-- .../annotations/spi/AbstractOverrider.java | 14 ++--- 272 files changed, 1508 insertions(+), 2659 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AccessJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AccessJpaAnnotation.java index 63d60b73f2..3c6f29a900 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AccessJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AccessJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Access; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AccessJpaAnnotation implements Access { @@ -39,8 +35,8 @@ public class AccessJpaAnnotation implements Access { /** * Used in creating annotation instances from Jandex variant */ - public AccessJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ACCESS, "value", modelContext ); + public AccessJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.AccessType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyAnnotation.java index d5bfc640dc..30d256d097 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Any; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyAnnotation implements Any, AttributeMarker, AttributeMarker.Fetchable, AttributeMarker.Optionalable { @@ -42,9 +38,9 @@ public class AnyAnnotation implements Any, AttributeMarker, AttributeMarker.Fetc /** * Used in creating annotation instances from Jandex variant */ - public AnyAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.fetch = extractJandexValue( annotation, HibernateAnnotations.ANY, "fetch", modelContext ); - this.optional = extractJandexValue( annotation, HibernateAnnotations.ANY, "optional", modelContext ); + public AnyAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.optional = (boolean) attributeValues.get( "optional" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorAnnotation.java index 4828e9740f..57034281bc 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyDiscriminator; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyDiscriminatorAnnotation implements AnyDiscriminator { @@ -38,8 +34,8 @@ public class AnyDiscriminatorAnnotation implements AnyDiscriminator { /** * Used in creating annotation instances from Jandex variant */ - public AnyDiscriminatorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.ANY_DISCRIMINATOR, "value", modelContext ); + public AnyDiscriminatorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.DiscriminatorType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValueAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValueAnnotation.java index 497929f493..61fc7ae795 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValueAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValueAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyDiscriminatorValue; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyDiscriminatorValueAnnotation implements AnyDiscriminatorValue { @@ -39,19 +35,9 @@ public class AnyDiscriminatorValueAnnotation implements AnyDiscriminatorValue { /** * Used in creating annotation instances from Jandex variant */ - public AnyDiscriminatorValueAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.discriminator = extractJandexValue( - annotation, - HibernateAnnotations.ANY_DISCRIMINATOR_VALUE, - "discriminator", - modelContext - ); - this.entity = extractJandexValue( - annotation, - HibernateAnnotations.ANY_DISCRIMINATOR_VALUE, - "entity", - modelContext - ); + public AnyDiscriminatorValueAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.discriminator = (String) attributeValues.get( "discriminator" ); + this.entity = (Class) attributeValues.get( "entity" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValuesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValuesAnnotation.java index f6800cd353..31a6c0531e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValuesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyDiscriminatorValuesAnnotation.java @@ -6,18 +6,15 @@ */ package org.hibernate.boot.models.annotations.internal; +import java.lang.annotation.Annotation; +import java.util.Map; + import org.hibernate.annotations.AnyDiscriminatorValue; +import org.hibernate.annotations.AnyDiscriminatorValues; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import java.lang.annotation.Annotation; - -import org.hibernate.annotations.AnyDiscriminatorValues; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,13 +46,8 @@ public class AnyDiscriminatorValuesAnnotation /** * Used in creating annotation instances from Jandex variant */ - public AnyDiscriminatorValuesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.ANY_DISCRIMINATOR_VALUES, - "value", - modelContext - ); + public AnyDiscriminatorValuesAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (AnyDiscriminatorValue[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeTypeAnnotation.java index 1856e5331f..4c561c3b49 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.internal.AnyKeyType; -import org.hibernate.boot.models.XmlAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyKeTypeAnnotation implements AnyKeyType { @@ -37,8 +33,8 @@ public class AnyKeTypeAnnotation implements AnyKeyType { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, XmlAnnotations.ANY_KEY_TYPE, "value", modelContext ); + public AnyKeTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaClassAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaClassAnnotation.java index 2dcd5eaed6..7351f78c06 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaClassAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaClassAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyKeyJavaClass; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyKeyJavaClassAnnotation implements AnyKeyJavaClass { @@ -36,13 +33,8 @@ public class AnyKeyJavaClassAnnotation implements AnyKeyJavaClass { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeyJavaClassAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.ANY_KEY_JAVA_CLASS, - "value", - modelContext - ); + public AnyKeyJavaClassAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaTypeAnnotation.java index b08ee756b3..7ad8d71c37 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJavaTypeAnnotation.java @@ -7,15 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyKeyJavaType; import org.hibernate.models.spi.SourceModelBuildingContext; import org.hibernate.type.descriptor.java.BasicJavaType; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyKeyJavaTypeAnnotation implements AnyKeyJavaType { @@ -37,13 +34,8 @@ public class AnyKeyJavaTypeAnnotation implements AnyKeyJavaType { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeyJavaTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.ANY_KEY_JAVA_TYPE, - "value", - modelContext - ); + public AnyKeyJavaTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeAnnotation.java index c52b854c55..06c435fcf8 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeAnnotation.java @@ -7,15 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyKeyJdbcType; import org.hibernate.models.spi.SourceModelBuildingContext; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyKeyJdbcTypeAnnotation implements AnyKeyJdbcType { @@ -37,13 +34,8 @@ public class AnyKeyJdbcTypeAnnotation implements AnyKeyJdbcType { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeyJdbcTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.ANY_KEY_JDBC_TYPE, - "value", - modelContext - ); + public AnyKeyJdbcTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeCodeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeCodeAnnotation.java index 5258ff83c8..68b1727732 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeCodeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyJdbcTypeCodeAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AnyKeyJdbcTypeCode; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AnyKeyJdbcTypeCodeAnnotation implements AnyKeyJdbcTypeCode { @@ -36,13 +33,8 @@ public class AnyKeyJdbcTypeCodeAnnotation implements AnyKeyJdbcTypeCode { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeyJdbcTypeCodeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.ANY_KEY_JDBC_TYPE_CODE, - "value", - modelContext - ); + public AnyKeyJdbcTypeCodeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyTypeXmlAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyTypeXmlAnnotation.java index e417163555..46b43615fa 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyTypeXmlAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AnyKeyTypeXmlAnnotation.java @@ -7,15 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.internal.Abstract; import org.hibernate.boot.internal.AnyKeyType; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - /** * @author Steve Ebersole */ @@ -39,13 +36,8 @@ public class AnyKeyTypeXmlAnnotation implements AnyKeyType { /** * Used in creating annotation instances from Jandex variant */ - public AnyKeyTypeXmlAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.XmlAnnotations.ANY_KEY_TYPE, - "value", - modelContext - ); + public AnyKeyTypeXmlAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ArrayAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ArrayAnnotation.java index d68278e89f..faae8b5a4c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ArrayAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ArrayAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Array; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ArrayAnnotation implements Array { @@ -37,8 +33,8 @@ public class ArrayAnnotation implements Array { /** * Used in creating annotation instances from Jandex variant */ - public ArrayAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.length = extractJandexValue( annotation, HibernateAnnotations.ARRAY, "length", modelContext ); + public ArrayAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.length = (int) attributeValues.get( "length" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverrideJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverrideJpaAnnotation.java index e1a2a13a74..66dc2c1626 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverrideJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverrideJpaAnnotation.java @@ -7,16 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; import jakarta.persistence.AssociationOverride; import static org.hibernate.boot.models.JpaAnnotations.ASSOCIATION_OVERRIDE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -50,11 +49,13 @@ public class AssociationOverrideJpaAnnotation implements AssociationOverride { /** * Used in creating annotation instances from Jandex variant */ - public AssociationOverrideJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, ASSOCIATION_OVERRIDE, "name", modelContext ); - this.joinColumns = extractJandexValue( annotation, ASSOCIATION_OVERRIDE, "joinColumns", modelContext ); - this.foreignKey = extractJandexValue( annotation, ASSOCIATION_OVERRIDE, "foreignKey", modelContext ); - this.joinTable = extractJandexValue( annotation, ASSOCIATION_OVERRIDE, "joinTable", modelContext ); + public AssociationOverrideJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.joinColumns = (jakarta.persistence.JoinColumn[]) attributeValues.get( "joinColumns" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); + this.joinTable = (jakarta.persistence.JoinTable) attributeValues.get( "joinTable" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverridesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverridesJpaAnnotation.java index 508de0e439..13e6e87e1d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverridesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AssociationOverridesJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.AssociationOverrides; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -39,8 +37,10 @@ public class AssociationOverridesJpaAnnotation implements AssociationOverrides { /** * Used in creating annotation instances from Jandex variant */ - public AssociationOverridesJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ASSOCIATION_OVERRIDES, "value", modelContext ); + public AssociationOverridesJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.AssociationOverride[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeAccessorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeAccessorAnnotation.java index 922eb8383f..bd17f9652e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeAccessorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeAccessorAnnotation.java @@ -7,9 +7,9 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AttributeAccessor; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; import org.jboss.jandex.AnnotationInstance; @@ -41,14 +41,10 @@ public class AttributeAccessorAnnotation implements AttributeAccessor { /** * Used in creating annotation instances from Jandex variant */ - public AttributeAccessorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.ATTRIBUTE_ACCESSOR, "value", modelContext ); - this.strategy = extractJandexValue( - annotation, - HibernateAnnotations.ATTRIBUTE_ACCESSOR, - "strategy", - modelContext - ); + public AttributeAccessorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); + this.strategy = (Class) attributeValues + .get( "strategy" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeBinderTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeBinderTypeAnnotation.java index caf9316bd5..33c958eccd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeBinderTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeBinderTypeAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.AttributeBinderType; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class AttributeBinderTypeAnnotation implements AttributeBinderType { @@ -36,13 +33,8 @@ public class AttributeBinderTypeAnnotation implements AttributeBinderType { /** * Used in creating annotation instances from Jandex variant */ - public AttributeBinderTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.binder = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.ATTRIBUTE_BINDER_TYPE, - "binder", - modelContext - ); + public AttributeBinderTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.binder = (Class>) attributeValues.get( "binder" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverrideJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverrideJpaAnnotation.java index b7ffcb5247..15217713bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverrideJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverrideJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.AttributeOverride; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -42,9 +40,9 @@ public class AttributeOverrideJpaAnnotation implements AttributeOverride { /** * Used in creating annotation instances from Jandex variant */ - public AttributeOverrideJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.ATTRIBUTE_OVERRIDE, "name", modelContext ); - this.column = extractJandexValue( annotation, JpaAnnotations.ATTRIBUTE_OVERRIDE, "column", modelContext ); + public AttributeOverrideJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.column = (jakarta.persistence.Column) attributeValues.get( "column" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverridesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverridesJpaAnnotation.java index c18e9863f8..a58eae51f7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverridesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/AttributeOverridesJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.AttributeOverrides; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -39,8 +37,8 @@ public class AttributeOverridesJpaAnnotation implements AttributeOverrides { /** * Used in creating annotation instances from Jandex variant */ - public AttributeOverridesJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ATTRIBUTE_OVERRIDES, "value", modelContext ); + public AttributeOverridesJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.AttributeOverride[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BagAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BagAnnotation.java index 7c8e54f2de..6442a573c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BagAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BagAnnotation.java @@ -6,13 +6,11 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Bag; +import org.hibernate.models.spi.SourceModelBuildingContext; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") @@ -32,7 +30,7 @@ public class BagAnnotation implements Bag { /** * Used in creating annotation instances from Jandex variant */ - public BagAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public BagAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BasicJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BasicJpaAnnotation.java index 66dccf9ff4..0bcb385ce3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BasicJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BasicJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Basic; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class BasicJpaAnnotation @@ -45,9 +41,9 @@ public class BasicJpaAnnotation /** * Used in creating annotation instances from Jandex variant */ - public BasicJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.fetch = extractJandexValue( annotation, JpaAnnotations.BASIC, "fetch", modelContext ); - this.optional = extractJandexValue( annotation, JpaAnnotations.BASIC, "optional", modelContext ); + public BasicJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.optional = (boolean) attributeValues.get( "optional" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BatchSizeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BatchSizeAnnotation.java index 5a3a547896..e9536ffdc2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BatchSizeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/BatchSizeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.BatchSize; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class BatchSizeAnnotation implements BatchSize { @@ -37,8 +33,8 @@ public class BatchSizeAnnotation implements BatchSize { /** * Used in creating annotation instances from Jandex variant */ - public BatchSizeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.size = extractJandexValue( annotation, HibernateAnnotations.BATCH_SIZE, "size", modelContext ); + public BatchSizeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.size = (int) attributeValues.get( "size" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheAnnotation.java index adcddd0f88..113794cdfb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Cache; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CacheAnnotation implements Cache { @@ -46,11 +42,11 @@ public class CacheAnnotation implements Cache { /** * Used in creating annotation instances from Jandex variant */ - public CacheAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.usage = extractJandexValue( annotation, HibernateAnnotations.CACHE, "usage", modelContext ); - this.region = extractJandexValue( annotation, HibernateAnnotations.CACHE, "region", modelContext ); - this.includeLazy = extractJandexValue( annotation, HibernateAnnotations.CACHE, "includeLazy", modelContext ); - this.include = extractJandexValue( annotation, HibernateAnnotations.CACHE, "include", modelContext ); + public CacheAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.usage = (org.hibernate.annotations.CacheConcurrencyStrategy) attributeValues.get( "usage" ); + this.region = (String) attributeValues.get( "region" ); + this.includeLazy = (boolean) attributeValues.get( "includeLazy" ); + this.include = (String) attributeValues.get( "include" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheableJpaAnnotation.java index 5703590aa4..db46b66c9d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CacheableJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Cacheable; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CacheableJpaAnnotation implements Cacheable { @@ -39,8 +35,8 @@ public class CacheableJpaAnnotation implements Cacheable { /** * Used in creating annotation instances from Jandex variant */ - public CacheableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.CACHEABLE, "value", modelContext ); + public CacheableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (boolean) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CascadeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CascadeAnnotation.java index c3a6f93196..810306bc81 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CascadeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CascadeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Cascade; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CascadeAnnotation implements Cascade { @@ -37,8 +33,8 @@ public class CascadeAnnotation implements Cascade { /** * Used in creating annotation instances from Jandex variant */ - public CascadeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.CASCADE, "value", modelContext ); + public CascadeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.CascadeType[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckAnnotation.java index 13846c1649..979153016d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Check; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CheckAnnotation implements Check { @@ -39,19 +36,9 @@ public class CheckAnnotation implements Check { /** * Used in creating annotation instances from Jandex variant */ - public CheckAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.CHECK, - "name", - modelContext - ); - this.constraints = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.CHECK, - "constraints", - modelContext - ); + public CheckAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.constraints = (String) attributeValues.get( "constraints" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckConstraintJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckConstraintJpaAnnotation.java index 8111732128..83bd2b8e81 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckConstraintJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CheckConstraintJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.CheckConstraint; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CheckConstraintJpaAnnotation implements CheckConstraint { @@ -45,10 +41,10 @@ public class CheckConstraintJpaAnnotation implements CheckConstraint { /** * Used in creating annotation instances from Jandex variant */ - public CheckConstraintJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.CHECK_CONSTRAINT, "name", modelContext ); - this.constraint = extractJandexValue( annotation, JpaAnnotations.CHECK_CONSTRAINT, "constraint", modelContext ); - this.options = extractJandexValue( annotation, JpaAnnotations.CHECK_CONSTRAINT, "options", modelContext ); + public CheckConstraintJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.constraint = (String) attributeValues.get( "constraint" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ChecksAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ChecksAnnotation.java index 1d344967d4..dea020374b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ChecksAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ChecksAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Check; import org.hibernate.annotations.Checks; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class ChecksAnnotation implements Checks, RepeatableContainer { /** * Used in creating annotation instances from Jandex variant */ - public ChecksAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.CHECKS, "value", modelContext ); + public ChecksAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Check[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollateAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollateAnnotation.java index 0391b7252e..0f44d65b65 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollateAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollateAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Collate; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollateAnnotation implements Collate { @@ -37,8 +33,8 @@ public class CollateAnnotation implements Collate { /** * Used in creating annotation instances from Jandex variant */ - public CollateAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.COLLATE, "value", modelContext ); + public CollateAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionClassificationXmlAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionClassificationXmlAnnotation.java index 61f1c94523..9534852d3c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionClassificationXmlAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionClassificationXmlAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.internal.CollectionClassification; import org.hibernate.boot.internal.LimitedCollectionClassification; -import org.hibernate.boot.models.XmlAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollectionClassificationXmlAnnotation implements CollectionClassification { @@ -41,9 +37,9 @@ public class CollectionClassificationXmlAnnotation implements CollectionClassifi * Used in creating annotation instances from Jandex variant */ public CollectionClassificationXmlAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, XmlAnnotations.COLLECTION_CLASSIFICATION, "value", modelContext ); + this.value = (LimitedCollectionClassification) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdAnnotation.java index 81c45bf9f7..139f894196 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionId; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,20 +44,11 @@ public class CollectionIdAnnotation implements CollectionId { /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.column = extractJandexValue( annotation, HibernateAnnotations.COLLECTION_ID, "column", modelContext ); - this.generatorImplementation = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID, - "generatorImplementation", - modelContext - ); - this.generator = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID, - "generator", - modelContext - ); + public CollectionIdAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.column = (jakarta.persistence.Column) attributeValues.get( "column" ); + this.generatorImplementation = (Class) attributeValues + .get( "generatorImplementation" ); + this.generator = (String) attributeValues.get( "generator" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJavaTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJavaTypeAnnotation.java index 5eb9563de8..5b2e2f6701 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJavaTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJavaTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionIdJavaType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollectionIdJavaTypeAnnotation implements CollectionIdJavaType { @@ -37,13 +33,8 @@ public class CollectionIdJavaTypeAnnotation implements CollectionIdJavaType { /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdJavaTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID_JAVA_TYPE, - "value", - modelContext - ); + public CollectionIdJavaTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeAnnotation.java index f4b1ec88c7..7145cb5cc1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionIdJdbcType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; import org.hibernate.type.descriptor.jdbc.JdbcType; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollectionIdJdbcTypeAnnotation implements CollectionIdJdbcType { @@ -38,13 +34,8 @@ public class CollectionIdJdbcTypeAnnotation implements CollectionIdJdbcType { /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdJdbcTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID_JDBC_TYPE, - "value", - modelContext - ); + public CollectionIdJdbcTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeCodeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeCodeAnnotation.java index adf7a5bd45..6ebf374333 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeCodeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdJdbcTypeCodeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionIdJdbcTypeCode; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollectionIdJdbcTypeCodeAnnotation implements CollectionIdJdbcTypeCode { @@ -39,13 +35,8 @@ public class CollectionIdJdbcTypeCodeAnnotation implements CollectionIdJdbcTypeC /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdJdbcTypeCodeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID_JDBC_TYPE_CODE, - "value", - modelContext - ); + public CollectionIdJdbcTypeCodeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdMutabilityAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdMutabilityAnnotation.java index fa7b8df42e..ccd6df4419 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdMutabilityAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdMutabilityAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionIdMutability; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CollectionIdMutabilityAnnotation implements CollectionIdMutability { @@ -39,13 +35,8 @@ public class CollectionIdMutabilityAnnotation implements CollectionIdMutability /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdMutabilityAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_ID_MUTABILITY, - "value", - modelContext - ); + public CollectionIdMutabilityAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdTypeAnnotation.java index d5b0960cd1..ccc006b753 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionIdTypeAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionIdType; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.COLLECTION_ID_TYPE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,14 +39,9 @@ public class CollectionIdTypeAnnotation implements CollectionIdType { /** * Used in creating annotation instances from Jandex variant */ - public CollectionIdTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, COLLECTION_ID_TYPE, "value", modelContext ); - this.parameters = extractJandexValue( - annotation, - COLLECTION_ID_TYPE, - "parameters", - modelContext - ); + public CollectionIdTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTableJpaAnnotation.java index 61339e0778..9ba972b763 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTableJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbCollectionTableImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -16,12 +17,9 @@ import org.hibernate.boot.models.xml.internal.db.JoinColumnProcessing; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.CollectionTable; import static org.hibernate.boot.models.JpaAnnotations.COLLECTION_TABLE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyCatalog; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyOptionalString; @@ -73,25 +71,15 @@ public class CollectionTableJpaAnnotation implements CollectionTable, CommonTabl /** * Used in creating annotation instances from Jandex variant */ - public CollectionTableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, COLLECTION_TABLE, "name", modelContext ); - this.catalog = extractJandexValue( annotation, COLLECTION_TABLE, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, COLLECTION_TABLE, "schema", modelContext ); - this.joinColumns = extractJandexValue( - annotation, - COLLECTION_TABLE, - "joinColumns", - modelContext - ); - this.foreignKey = extractJandexValue( annotation, COLLECTION_TABLE, "foreignKey", modelContext ); - this.uniqueConstraints = extractJandexValue( - annotation, - COLLECTION_TABLE, - "uniqueConstraints", - modelContext - ); - this.indexes = extractJandexValue( annotation, COLLECTION_TABLE, "indexes", modelContext ); - this.options = extractJandexValue( annotation, COLLECTION_TABLE, "options", modelContext ); + public CollectionTableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.joinColumns = (jakarta.persistence.JoinColumn[]) attributeValues.get( "joinColumns" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); + this.uniqueConstraints = (jakarta.persistence.UniqueConstraint[]) attributeValues.get( "uniqueConstraints" ); + this.indexes = (jakarta.persistence.Index[]) attributeValues.get( "indexes" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeAnnotation.java index babda4c028..487cfcb84c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionType; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.COLLECTION_TYPE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,14 +39,9 @@ public class CollectionTypeAnnotation implements CollectionType { /** * Used in creating annotation instances from Jandex variant */ - public CollectionTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.type = extractJandexValue( annotation, COLLECTION_TYPE, "type", modelContext ); - this.parameters = extractJandexValue( - annotation, - COLLECTION_TYPE, - "parameters", - modelContext - ); + public CollectionTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.type = (Class) attributeValues.get( "type" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationAnnotation.java index 922c0d4b03..ec0992c88b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionTypeRegistration; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.COLLECTION_TYPE_REGISTRATION; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,26 +44,11 @@ public class CollectionTypeRegistrationAnnotation implements CollectionTypeRegis * Used in creating annotation instances from Jandex variant */ public CollectionTypeRegistrationAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.classification = extractJandexValue( - annotation, - COLLECTION_TYPE_REGISTRATION, - "classification", - modelContext - ); - this.type = extractJandexValue( - annotation, - COLLECTION_TYPE_REGISTRATION, - "type", - modelContext - ); - this.parameters = extractJandexValue( - annotation, - COLLECTION_TYPE_REGISTRATION, - "parameters", - modelContext - ); + this.classification = (org.hibernate.metamodel.CollectionClassification) attributeValues.get( "classification" ); + this.type = (Class) attributeValues.get( "type" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationsAnnotation.java index e3c31fb110..5f49e8900e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CollectionTypeRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CollectionTypeRegistration; import org.hibernate.annotations.CollectionTypeRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,14 +47,9 @@ public class CollectionTypeRegistrationsAnnotation * Used in creating annotation instances from Jandex variant */ public CollectionTypeRegistrationsAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COLLECTION_TYPE_REGISTRATIONS, - "value", - modelContext - ); + this.value = (CollectionTypeRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnDefaultAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnDefaultAnnotation.java index 6f0ddfbbf6..07eee16107 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnDefaultAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnDefaultAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ColumnDefault; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ColumnDefaultAnnotation implements ColumnDefault { @@ -37,8 +33,8 @@ public class ColumnDefaultAnnotation implements ColumnDefault { /** * Used in creating annotation instances from Jandex variant */ - public ColumnDefaultAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.COLUMN_DEFAULT, "value", modelContext ); + public ColumnDefaultAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnJpaAnnotation.java index b7ff0c2a1b..1ce3fa4613 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbColumnImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -18,11 +19,8 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Column; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -95,26 +93,21 @@ public class ColumnJpaAnnotation implements Column, /** * Used in creating annotation instances from Jandex variant */ - public ColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.COLUMN, "name", modelContext ); - this.unique = extractJandexValue( annotation, JpaAnnotations.COLUMN, "unique", modelContext ); - this.nullable = extractJandexValue( annotation, JpaAnnotations.COLUMN, "nullable", modelContext ); - this.insertable = extractJandexValue( annotation, JpaAnnotations.COLUMN, "insertable", modelContext ); - this.updatable = extractJandexValue( annotation, JpaAnnotations.COLUMN, "updatable", modelContext ); - this.columnDefinition = extractJandexValue( - annotation, - JpaAnnotations.COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.COLUMN, "options", modelContext ); - this.table = extractJandexValue( annotation, JpaAnnotations.COLUMN, "table", modelContext ); - this.length = extractJandexValue( annotation, JpaAnnotations.COLUMN, "length", modelContext ); - this.precision = extractJandexValue( annotation, JpaAnnotations.COLUMN, "precision", modelContext ); - this.scale = extractJandexValue( annotation, JpaAnnotations.COLUMN, "scale", modelContext ); - this.secondPrecision = extractJandexValue( annotation, JpaAnnotations.COLUMN, "secondPrecision", modelContext ); - this.check = extractJandexValue( annotation, JpaAnnotations.COLUMN, "check", modelContext ); - this.comment = extractJandexValue( annotation, JpaAnnotations.COLUMN, "comment", modelContext ); + public ColumnJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.unique = (boolean) attributeValues.get( "unique" ); + this.nullable = (boolean) attributeValues.get( "nullable" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.table = (String) attributeValues.get( "table" ); + this.length = (int) attributeValues.get( "length" ); + this.precision = (int) attributeValues.get( "precision" ); + this.scale = (int) attributeValues.get( "scale" ); + this.secondPrecision = (int) attributeValues.get( "secondPrecision" ); + this.check = (jakarta.persistence.CheckConstraint[]) attributeValues.get( "check" ); + this.comment = (String) attributeValues.get( "comment" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnResultJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnResultJpaAnnotation.java index a2c601dc72..35be83cd47 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnResultJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnResultJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ColumnResult; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ColumnResultJpaAnnotation implements ColumnResult { @@ -41,9 +37,9 @@ public class ColumnResultJpaAnnotation implements ColumnResult { /** * Used in creating annotation instances from Jandex variant */ - public ColumnResultJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.COLUMN_RESULT, "name", modelContext ); - this.type = extractJandexValue( annotation, JpaAnnotations.COLUMN_RESULT, "type", modelContext ); + public ColumnResultJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.type = (Class) attributeValues.get( "type" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformerAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformerAnnotation.java index 6c9550dd9a..ef6f33ef5b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformerAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformerAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ColumnTransformer; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ColumnTransformerAnnotation implements ColumnTransformer { @@ -44,15 +40,10 @@ public class ColumnTransformerAnnotation implements ColumnTransformer { /** * Used in creating annotation instances from Jandex variant */ - public ColumnTransformerAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.forColumn = extractJandexValue( - annotation, - HibernateAnnotations.COLUMN_TRANSFORMER, - "forColumn", - modelContext - ); - this.read = extractJandexValue( annotation, HibernateAnnotations.COLUMN_TRANSFORMER, "read", modelContext ); - this.write = extractJandexValue( annotation, HibernateAnnotations.COLUMN_TRANSFORMER, "write", modelContext ); + public ColumnTransformerAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.forColumn = (String) attributeValues.get( "forColumn" ); + this.read = (String) attributeValues.get( "read" ); + this.write = (String) attributeValues.get( "write" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformersAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformersAnnotation.java index 5b0dbf93dc..6b9fdb80be 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformersAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnTransformersAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ColumnTransformer; import org.hibernate.annotations.ColumnTransformers; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -31,8 +29,8 @@ public class ColumnTransformersAnnotation implements ColumnTransformers, Repeata this.value = extractJdkValue( annotation, HibernateAnnotations.COLUMN_TRANSFORMERS, "value", modelContext ); } - public ColumnTransformersAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.COLUMN_TRANSFORMERS, "value", modelContext ); + public ColumnTransformersAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (ColumnTransformer[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnsAnnotation.java index 57d7b7f829..faef22be0e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ColumnsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Columns; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,8 @@ public class ColumnsAnnotation implements Columns { /** * Used in creating annotation instances from Jandex variant */ - public ColumnsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.columns = extractJandexValue( annotation, HibernateAnnotations.COLUMNS, "columns", modelContext ); + public ColumnsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.columns = (jakarta.persistence.Column[]) attributeValues.get( "columns" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentAnnotation.java index aeb616503a..6602d41f96 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Comment; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CommentAnnotation implements Comment { @@ -40,9 +36,9 @@ public class CommentAnnotation implements Comment { /** * Used in creating annotation instances from Jandex variant */ - public CommentAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.COMMENT, "value", modelContext ); - this.on = extractJandexValue( annotation, HibernateAnnotations.COMMENT, "on", modelContext ); + public CommentAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); + this.on = (String) attributeValues.get( "on" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentsAnnotation.java index f02499f23e..ada468a550 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CommentsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Comments; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class CommentsAnnotation implements Comments, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.Comment[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeAnnotation.java index 9d23dd6404..995bbf4271 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CompositeType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CompositeTypeAnnotation implements CompositeType { @@ -37,8 +33,8 @@ public class CompositeTypeAnnotation implements CompositeType { /** * Used in creating annotation instances from Jandex variant */ - public CompositeTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.COMPOSITE_TYPE, "value", modelContext ); + public CompositeTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationAnnotation.java index 32e5fcac54..beba6ab7e4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CompositeTypeRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CompositeTypeRegistrationAnnotation implements CompositeTypeRegistration { @@ -41,19 +37,9 @@ public class CompositeTypeRegistrationAnnotation implements CompositeTypeRegistr /** * Used in creating annotation instances from Jandex variant */ - public CompositeTypeRegistrationAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.embeddableClass = extractJandexValue( - annotation, - HibernateAnnotations.COMPOSITE_TYPE_REGISTRATION, - "embeddableClass", - modelContext - ); - this.userType = extractJandexValue( - annotation, - HibernateAnnotations.COMPOSITE_TYPE_REGISTRATION, - "userType", - modelContext - ); + public CompositeTypeRegistrationAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.embeddableClass = (Class) attributeValues.get( "embeddableClass" ); + this.userType = (Class>) attributeValues.get( "userType" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationsAnnotation.java index 699c97479f..e09194e1d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CompositeTypeRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CompositeTypeRegistration; import org.hibernate.annotations.CompositeTypeRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,14 +47,9 @@ public class CompositeTypeRegistrationsAnnotation * Used in creating annotation instances from Jandex variant */ public CompositeTypeRegistrationsAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.COMPOSITE_TYPE_REGISTRATIONS, - "value", - modelContext - ); + this.value = (CompositeTypeRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConcreteProxyAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConcreteProxyAnnotation.java index c994d72006..69a3755bbf 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConcreteProxyAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConcreteProxyAnnotation.java @@ -6,17 +6,11 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.internal.OrmAnnotationDescriptor; -import org.hibernate.models.spi.SourceModelBuildingContext; -import org.hibernate.models.spi.AnnotationDescriptor; -import org.hibernate.models.spi.AttributeDescriptor; - -import org.jboss.jandex.AnnotationInstance; -import org.jboss.jandex.AnnotationValue; - import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ConcreteProxy; +import org.hibernate.models.spi.SourceModelBuildingContext; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") @@ -37,7 +31,7 @@ public class ConcreteProxyAnnotation implements ConcreteProxy { /** * Used in creating annotation instances from Jandex variant */ - public ConcreteProxyAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public ConcreteProxyAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConstructorResultJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConstructorResultJpaAnnotation.java index 85652d152d..dc518844ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConstructorResultJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConstructorResultJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ConstructorResult; import static org.hibernate.boot.models.JpaAnnotations.CONSTRUCTOR_RESULT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -42,9 +40,11 @@ public class ConstructorResultJpaAnnotation implements ConstructorResult { /** * Used in creating annotation instances from Jandex variant */ - public ConstructorResultJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetClass = extractJandexValue( annotation, CONSTRUCTOR_RESULT, "targetClass", modelContext ); - this.columns = extractJandexValue( annotation, CONSTRUCTOR_RESULT, "columns", modelContext ); + public ConstructorResultJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.targetClass = (Class) attributeValues.get( "targetClass" ); + this.columns = (jakarta.persistence.ColumnResult[]) attributeValues.get( "columns" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertJpaAnnotation.java index 0ce69ec4a1..3556015b22 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertJpaAnnotation.java @@ -7,17 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Convert; -import static org.hibernate.boot.models.JpaAnnotations.CONVERT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ConvertJpaAnnotation implements Convert { @@ -47,15 +42,10 @@ public class ConvertJpaAnnotation implements Convert { /** * Used in creating annotation instances from Jandex variant */ - public ConvertJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.converter = extractJandexValue( annotation, CONVERT, "converter", modelContext ); - this.attributeName = extractJandexValue( annotation, CONVERT, "attributeName", modelContext ); - this.disableConversion = extractJandexValue( - annotation, - CONVERT, - "disableConversion", - modelContext - ); + public ConvertJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.converter = (Class) attributeValues.get( "converter" ); + this.attributeName = (String) attributeValues.get( "attributeName" ); + this.disableConversion = (boolean) attributeValues.get( "disableConversion" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterJpaAnnotation.java index ffde9facb9..2b1a9a57a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Converter; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ConverterJpaAnnotation implements Converter { @@ -40,8 +36,8 @@ public class ConverterJpaAnnotation implements Converter { /** * Used in creating annotation instances from Jandex variant */ - public ConverterJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.autoApply = extractJandexValue( annotation, JpaAnnotations.CONVERTER, "autoApply", modelContext ); + public ConverterJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.autoApply = (boolean) attributeValues.get( "autoApply" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationAnnotation.java index 9ef0e2b687..d8383be99f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ConverterRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ConverterRegistrationAnnotation implements ConverterRegistration { @@ -43,25 +39,12 @@ public class ConverterRegistrationAnnotation implements ConverterRegistration { /** * Used in creating annotation instances from Jandex variant */ - public ConverterRegistrationAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.converter = extractJandexValue( - annotation, - HibernateAnnotations.CONVERTER_REGISTRATION, - "converter", - modelContext - ); - this.domainType = extractJandexValue( - annotation, - HibernateAnnotations.CONVERTER_REGISTRATION, - "domainType", - modelContext - ); - this.autoApply = extractJandexValue( - annotation, - HibernateAnnotations.CONVERTER_REGISTRATION, - "autoApply", - modelContext - ); + public ConverterRegistrationAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.converter = (Class>) attributeValues.get( "converter" ); + this.domainType = (Class) attributeValues.get( "domainType" ); + this.autoApply = (boolean) attributeValues.get( "autoApply" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationsAnnotation.java index 2a140a3f3b..c5849d921f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConverterRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ConverterRegistration; import org.hibernate.annotations.ConverterRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -43,13 +41,10 @@ public class ConverterRegistrationsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public ConverterRegistrationsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.CONVERTER_REGISTRATIONS, - "value", - modelContext - ); + public ConverterRegistrationsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (ConverterRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertsJpaAnnotation.java index c08424091f..7707e72934 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ConvertsJpaAnnotation.java @@ -6,16 +6,15 @@ */ package org.hibernate.boot.models.annotations.internal; +import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import java.lang.annotation.Annotation; - import jakarta.persistence.Converts; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -35,7 +34,7 @@ public class ConvertsJpaAnnotation implements Converts, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.Convert[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CreationTimestampAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CreationTimestampAnnotation.java index b2f3dd3db8..5d37143f13 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CreationTimestampAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CreationTimestampAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CreationTimestamp; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class CreationTimestampAnnotation implements CreationTimestamp { @@ -38,8 +34,8 @@ public class CreationTimestampAnnotation implements CreationTimestamp { /** * Used in creating annotation instances from Jandex variant */ - public CreationTimestampAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.source = extractJandexValue( annotation, HibernateAnnotations.CREATION_TIMESTAMP, "source", modelContext ); + public CreationTimestampAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.source = (org.hibernate.annotations.SourceType) attributeValues.get( "source" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CurrentTimestampAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CurrentTimestampAnnotation.java index 3f9a72b9e8..c90132dc25 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CurrentTimestampAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/CurrentTimestampAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.CurrentTimestamp; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.generator.EventType.INSERT; import static org.hibernate.generator.EventType.UPDATE; @@ -43,9 +40,9 @@ public class CurrentTimestampAnnotation implements CurrentTimestamp { /** * Used in creating annotation instances from Jandex variant */ - public CurrentTimestampAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.event = extractJandexValue( annotation, HibernateAnnotations.CURRENT_TIMESTAMP, "event", modelContext ); - this.source = extractJandexValue( annotation, HibernateAnnotations.CURRENT_TIMESTAMP, "source", modelContext ); + public CurrentTimestampAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.event = (org.hibernate.generator.EventType[]) attributeValues.get( "event" ); + this.source = (org.hibernate.annotations.SourceType) attributeValues.get( "source" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorColumnJpaAnnotation.java index 07e1852eee..5f1822086d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorColumnJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbDiscriminatorColumnImpl; import org.hibernate.boot.models.annotations.spi.ColumnDetails; @@ -14,12 +15,8 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.DiscriminatorColumn; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DiscriminatorColumnJpaAnnotation implements DiscriminatorColumn, ColumnDetails { @@ -55,37 +52,14 @@ public class DiscriminatorColumnJpaAnnotation implements DiscriminatorColumn, Co /** * Used in creating annotation instances from Jandex variant */ - public DiscriminatorColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( - annotation, - org.hibernate.boot.models.JpaAnnotations.DISCRIMINATOR_COLUMN, - "name", - modelContext - ); - this.discriminatorType = extractJandexValue( - annotation, - org.hibernate.boot.models.JpaAnnotations.DISCRIMINATOR_COLUMN, - "discriminatorType", - modelContext - ); - this.columnDefinition = extractJandexValue( - annotation, - org.hibernate.boot.models.JpaAnnotations.DISCRIMINATOR_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( - annotation, - org.hibernate.boot.models.JpaAnnotations.DISCRIMINATOR_COLUMN, - "options", - modelContext - ); - this.length = extractJandexValue( - annotation, - org.hibernate.boot.models.JpaAnnotations.DISCRIMINATOR_COLUMN, - "length", - modelContext - ); + public DiscriminatorColumnJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.discriminatorType = (jakarta.persistence.DiscriminatorType) attributeValues.get( "discriminatorType" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.length = (int) attributeValues.get( "length" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorFormulaAnnotation.java index 4719bbc813..759ccab1da 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorFormulaAnnotation.java @@ -7,14 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DiscriminatorFormula; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DiscriminatorFormulaAnnotation implements DiscriminatorFormula { @@ -39,19 +36,11 @@ public class DiscriminatorFormulaAnnotation implements DiscriminatorFormula { /** * Used in creating annotation instances from Jandex variant */ - public DiscriminatorFormulaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.DISCRIMINATOR_FORMULA, - "value", - modelContext - ); - this.discriminatorType = extractJandexValue( - annotation, - org.hibernate.boot.models.HibernateAnnotations.DISCRIMINATOR_FORMULA, - "discriminatorType", - modelContext - ); + public DiscriminatorFormulaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); + this.discriminatorType = (jakarta.persistence.DiscriminatorType) attributeValues.get( "discriminatorType" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorOptionsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorOptionsAnnotation.java index 672e47cc23..12000dcccf 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorOptionsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorOptionsAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DiscriminatorOptions; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DiscriminatorOptionsAnnotation implements DiscriminatorOptions { @@ -41,19 +37,9 @@ public class DiscriminatorOptionsAnnotation implements DiscriminatorOptions { /** * Used in creating annotation instances from Jandex variant */ - public DiscriminatorOptionsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.force = extractJandexValue( - annotation, - HibernateAnnotations.DISCRIMINATOR_OPTIONS, - "force", - modelContext - ); - this.insert = extractJandexValue( - annotation, - HibernateAnnotations.DISCRIMINATOR_OPTIONS, - "insert", - modelContext - ); + public DiscriminatorOptionsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.force = (boolean) attributeValues.get( "force"); + this.insert = (boolean) attributeValues.get( "insert"); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorValueJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorValueJpaAnnotation.java index f4ce590ae4..ec4ef46505 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorValueJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DiscriminatorValueJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.DiscriminatorValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DiscriminatorValueJpaAnnotation implements DiscriminatorValue { @@ -38,8 +34,10 @@ public class DiscriminatorValueJpaAnnotation implements DiscriminatorValue { /** * Used in creating annotation instances from Jandex variant */ - public DiscriminatorValueJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.DISCRIMINATOR_VALUE, "value", modelContext ); + public DiscriminatorValueJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicInsertAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicInsertAnnotation.java index 8d75aec646..d1b363a086 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicInsertAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicInsertAnnotation.java @@ -7,16 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DynamicInsert; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DynamicInsertAnnotation implements DynamicInsert { @@ -36,7 +31,7 @@ public class DynamicInsertAnnotation implements DynamicInsert { /** * Used in creating annotation instances from Jandex variant */ - public DynamicInsertAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public DynamicInsertAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicUpdateAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicUpdateAnnotation.java index d9ce28fed7..87040c8cbe 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicUpdateAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/DynamicUpdateAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DynamicUpdate; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class DynamicUpdateAnnotation implements DynamicUpdate { @@ -36,7 +32,7 @@ public class DynamicUpdateAnnotation implements DynamicUpdate { /** * Used in creating annotation instances from Jandex variant */ - public DynamicUpdateAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public DynamicUpdateAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ElementCollectionJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ElementCollectionJpaAnnotation.java index 58ceb3827b..655d7465ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ElementCollectionJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ElementCollectionJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ElementCollection; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ElementCollectionJpaAnnotation implements ElementCollection, AttributeMarker.Fetchable { @@ -43,14 +39,11 @@ public class ElementCollectionJpaAnnotation implements ElementCollection, Attrib /** * Used in creating annotation instances from Jandex variant */ - public ElementCollectionJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetClass = extractJandexValue( - annotation, - JpaAnnotations.ELEMENT_COLLECTION, - "targetClass", - modelContext - ); - this.fetch = extractJandexValue( annotation, JpaAnnotations.ELEMENT_COLLECTION, "fetch", modelContext ); + public ElementCollectionJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.targetClass = (Class) attributeValues.get( "targetClass" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorAnnotation.java index b554ddff26..3dfb3360e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.EmbeddableInstantiator; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EmbeddableInstantiatorAnnotation implements EmbeddableInstantiator { @@ -39,13 +35,10 @@ public class EmbeddableInstantiatorAnnotation implements EmbeddableInstantiator /** * Used in creating annotation instances from Jandex variant */ - public EmbeddableInstantiatorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.EMBEDDABLE_INSTANTIATOR, - "value", - modelContext - ); + public EmbeddableInstantiatorAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationAnnotation.java index e8a83a1079..1fa49573d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.EmbeddableInstantiatorRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EmbeddableInstantiatorRegistrationAnnotation implements EmbeddableInstantiatorRegistration { @@ -42,20 +38,11 @@ public class EmbeddableInstantiatorRegistrationAnnotation implements EmbeddableI * Used in creating annotation instances from Jandex variant */ public EmbeddableInstantiatorRegistrationAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.embeddableClass = extractJandexValue( - annotation, - HibernateAnnotations.EMBEDDABLE_INSTANTIATOR_REGISTRATION, - "embeddableClass", - modelContext - ); - this.instantiator = extractJandexValue( - annotation, - HibernateAnnotations.EMBEDDABLE_INSTANTIATOR_REGISTRATION, - "instantiator", - modelContext - ); + this.embeddableClass = (Class) attributeValues.get( "embeddableClass" ); + this.instantiator = (Class) attributeValues + .get( "instantiator" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationsAnnotation.java index 1c250cecf6..c9b93ab8e1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableInstantiatorRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.EmbeddableInstantiatorRegistration; import org.hibernate.annotations.EmbeddableInstantiatorRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,14 +47,9 @@ public class EmbeddableInstantiatorRegistrationsAnnotation * Used in creating annotation instances from Jandex variant */ public EmbeddableInstantiatorRegistrationsAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.EMBEDDABLE_INSTANTIATOR_REGISTRATIONS, - "value", - modelContext - ); + this.value = (EmbeddableInstantiatorRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableJpaAnnotation.java index 06483f2ccf..36a6259068 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddableJpaAnnotation.java @@ -6,11 +6,10 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.models.spi.SourceModelBuildingContext; import jakarta.persistence.Embeddable; @@ -33,7 +32,7 @@ public class EmbeddableJpaAnnotation implements Embeddable { /** * Used in creating annotation instances from Jandex variant */ - public EmbeddableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public EmbeddableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedIdJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedIdJpaAnnotation.java index 9fb367219d..487a715978 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedIdJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedIdJpaAnnotation.java @@ -6,11 +6,10 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.models.spi.SourceModelBuildingContext; import jakarta.persistence.EmbeddedId; @@ -32,7 +31,7 @@ public class EmbeddedIdJpaAnnotation implements EmbeddedId { /** * Used in creating annotation instances from Jandex variant */ - public EmbeddedIdJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public EmbeddedIdJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedJpaAnnotation.java index 3519c021ba..02b4fead31 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EmbeddedJpaAnnotation.java @@ -6,11 +6,10 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.models.spi.SourceModelBuildingContext; import jakarta.persistence.Embedded; @@ -33,7 +32,7 @@ public class EmbeddedJpaAnnotation implements Embedded { /** * Used in creating annotation instances from Jandex variant */ - public EmbeddedJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public EmbeddedJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityJpaAnnotation.java index 44c0468478..5fc189abbd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Entity; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EntityJpaAnnotation implements Entity { @@ -39,8 +35,8 @@ public class EntityJpaAnnotation implements Entity { /** * Used in creating annotation instances from Jandex variant */ - public EntityJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.ENTITY, "name", modelContext ); + public EntityJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityListenersJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityListenersJpaAnnotation.java index a76e0fad78..b076bcfc60 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityListenersJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityListenersJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.EntityListeners; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EntityListenersJpaAnnotation implements EntityListeners { @@ -38,8 +34,8 @@ public class EntityListenersJpaAnnotation implements EntityListeners { /** * Used in creating annotation instances from Jandex variant */ - public EntityListenersJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ENTITY_LISTENERS, "value", modelContext ); + public EntityListenersJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityResultJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityResultJpaAnnotation.java index b674397409..f8c298812e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityResultJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EntityResultJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.EntityResult; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EntityResultJpaAnnotation implements EntityResult { @@ -47,16 +43,11 @@ public class EntityResultJpaAnnotation implements EntityResult { /** * Used in creating annotation instances from Jandex variant */ - public EntityResultJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.entityClass = extractJandexValue( annotation, JpaAnnotations.ENTITY_RESULT, "entityClass", modelContext ); - this.lockMode = extractJandexValue( annotation, JpaAnnotations.ENTITY_RESULT, "lockMode", modelContext ); - this.fields = extractJandexValue( annotation, JpaAnnotations.ENTITY_RESULT, "fields", modelContext ); - this.discriminatorColumn = extractJandexValue( - annotation, - JpaAnnotations.ENTITY_RESULT, - "discriminatorColumn", - modelContext - ); + public EntityResultJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.entityClass = (Class) attributeValues.get( "entityClass" ); + this.lockMode = (jakarta.persistence.LockModeType) attributeValues.get( "lockMode" ); + this.fields = (jakarta.persistence.FieldResult[]) attributeValues.get( "fields" ); + this.discriminatorColumn = (String) attributeValues.get( "discriminatorColumn" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedJpaAnnotation.java index 92e7dc3549..53de5bf8f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Enumerated; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class EnumeratedJpaAnnotation implements Enumerated { @@ -39,8 +35,8 @@ public class EnumeratedJpaAnnotation implements Enumerated { /** * Used in creating annotation instances from Jandex variant */ - public EnumeratedJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ENUMERATED, "value", modelContext ); + public EnumeratedJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.EnumType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedValueJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedValueJpaAnnotation.java index 892dc8492f..34b4ef74d9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedValueJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/EnumeratedValueJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.EnumeratedValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class EnumeratedValueJpaAnnotation implements EnumeratedValue { /** * Used in creating annotation instances from Jandex variant */ - public EnumeratedValueJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public EnumeratedValueJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeDefaultListenersJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeDefaultListenersJpaAnnotation.java index 776d96840d..79ab3be725 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeDefaultListenersJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeDefaultListenersJpaAnnotation.java @@ -6,11 +6,10 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.models.spi.SourceModelBuildingContext; import jakarta.persistence.ExcludeDefaultListeners; @@ -36,7 +35,7 @@ public class ExcludeDefaultListenersJpaAnnotation implements ExcludeDefaultListe * Used in creating annotation instances from Jandex variant */ public ExcludeDefaultListenersJpaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeSuperclassListenersJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeSuperclassListenersJpaAnnotation.java index a27ad9c0ef..05f94759ab 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeSuperclassListenersJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExcludeSuperclassListenersJpaAnnotation.java @@ -6,11 +6,10 @@ */ package org.hibernate.boot.models.annotations.internal; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import org.jboss.jandex.AnnotationInstance; - import java.lang.annotation.Annotation; +import java.util.Map; + +import org.hibernate.models.spi.SourceModelBuildingContext; import jakarta.persistence.ExcludeSuperclassListeners; @@ -36,7 +35,7 @@ public class ExcludeSuperclassListenersJpaAnnotation implements ExcludeSuperclas * Used in creating annotation instances from Jandex variant */ public ExcludeSuperclassListenersJpaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExtendsXmlAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExtendsXmlAnnotation.java index 8eb3329c86..d612b59b6f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExtendsXmlAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ExtendsXmlAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.internal.Extends; -import org.hibernate.boot.models.XmlAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ExtendsXmlAnnotation implements Extends { @@ -37,8 +33,8 @@ public class ExtendsXmlAnnotation implements Extends { /** * Used in creating annotation instances from Jandex variant */ - public ExtendsXmlAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.superType = extractJandexValue( annotation, XmlAnnotations.EXTENDS, "superType", modelContext ); + public ExtendsXmlAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.superType = (String) attributeValues.get( "superType" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchAnnotation.java index c087bc3919..f29bdc64ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Fetch; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class FetchAnnotation implements Fetch { @@ -37,8 +33,8 @@ public class FetchAnnotation implements Fetch { /** * Used in creating annotation instances from Jandex variant */ - public FetchAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FETCH, "value", modelContext ); + public FetchAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.FetchMode) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileAnnotation.java index 24ff50ba09..5f8b6d35f5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FetchProfile; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,14 +44,9 @@ public class FetchProfileAnnotation implements FetchProfile { /** * Used in creating annotation instances from Jandex variant */ - public FetchProfileAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.FETCH_PROFILE, "name", modelContext ); - this.fetchOverrides = extractJandexValue( - annotation, - HibernateAnnotations.FETCH_PROFILE, - "fetchOverrides", - modelContext - ); + public FetchProfileAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.fetchOverrides = (FetchOverride[]) attributeValues.get( "fetchOverrides" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverrideAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverrideAnnotation.java index 8f23007c76..74e20de661 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverrideAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverrideAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FetchProfileOverride; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class FetchProfileOverrideAnnotation implements FetchProfileOverride { @@ -44,25 +40,12 @@ public class FetchProfileOverrideAnnotation implements FetchProfileOverride { /** * Used in creating annotation instances from Jandex variant */ - public FetchProfileOverrideAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.mode = extractJandexValue( - annotation, - DialectOverrideAnnotations.FETCH_PROFILE_OVERRIDE, - "mode", - modelContext - ); - this.fetch = extractJandexValue( - annotation, - DialectOverrideAnnotations.FETCH_PROFILE_OVERRIDE, - "fetch", - modelContext - ); - this.profile = extractJandexValue( - annotation, - DialectOverrideAnnotations.FETCH_PROFILE_OVERRIDE, - "profile", - modelContext - ); + public FetchProfileOverrideAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.mode = (org.hibernate.annotations.FetchMode) attributeValues.get( "mode" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.profile = (String) attributeValues.get( "profile" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverridesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverridesAnnotation.java index 5d72a8cddd..6b69860567 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverridesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfileOverridesAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FetchProfileOverrides; import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -45,13 +43,10 @@ public class FetchProfileOverridesAnnotation /** * Used in creating annotation instances from Jandex variant */ - public FetchProfileOverridesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - DialectOverrideAnnotations.FETCH_PROFILE_OVERRIDES, - "value", - modelContext - ); + public FetchProfileOverridesAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.FetchProfileOverride[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfilesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfilesAnnotation.java index c3a287aed8..2ab4edcdf8 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfilesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FetchProfilesAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FetchProfile; import org.hibernate.annotations.FetchProfiles; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class FetchProfilesAnnotation implements FetchProfiles, RepeatableContain /** * Used in creating annotation instances from Jandex variant */ - public FetchProfilesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FETCH_PROFILES, "value", modelContext ); + public FetchProfilesAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (FetchProfile[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FieldResultJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FieldResultJpaAnnotation.java index 7330f7c919..f1a715f405 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FieldResultJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FieldResultJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.FieldResult; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class FieldResultJpaAnnotation implements FieldResult { @@ -40,9 +36,9 @@ public class FieldResultJpaAnnotation implements FieldResult { /** * Used in creating annotation instances from Jandex variant */ - public FieldResultJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.FIELD_RESULT, "name", modelContext ); - this.column = extractJandexValue( annotation, JpaAnnotations.FIELD_RESULT, "column", modelContext ); + public FieldResultJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.column = (String) attributeValues.get( "column" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterAnnotation.java index 124ea2e476..894ec72cf0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Filter; import org.hibernate.boot.jaxb.mapping.spi.JaxbFilterImpl; @@ -17,9 +18,6 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -52,16 +50,11 @@ public class FilterAnnotation implements Filter, FilterDetails { /** * Used in creating annotation instances from Jandex variant */ - public FilterAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.FILTER, "name", modelContext ); - this.condition = extractJandexValue( annotation, HibernateAnnotations.FILTER, "condition", modelContext ); - this.deduceAliasInjectionPoints = extractJandexValue( - annotation, - HibernateAnnotations.FILTER, - "deduceAliasInjectionPoints", - modelContext - ); - this.aliases = extractJandexValue( annotation, HibernateAnnotations.FILTER, "aliases", modelContext ); + public FilterAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.condition = (String) attributeValues.get( "condition" ); + this.deduceAliasInjectionPoints = (boolean) attributeValues.get( "deduceAliasInjectionPoints" ); + this.aliases = (org.hibernate.annotations.SqlFragmentAlias[]) attributeValues.get( "aliases" ); } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefAnnotation.java index 671ea58e8c..478131654e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FilterDef; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,27 +47,12 @@ public class FilterDefAnnotation implements FilterDef { /** * Used in creating annotation instances from Jandex variant */ - public FilterDefAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.FILTER_DEF, "name", modelContext ); - this.defaultCondition = extractJandexValue( - annotation, - HibernateAnnotations.FILTER_DEF, - "defaultCondition", - modelContext - ); - this.autoEnabled = extractJandexValue( - annotation, - HibernateAnnotations.FILTER_DEF, - "autoEnabled", - modelContext - ); - this.applyToLoadByKey = extractJandexValue( - annotation, - HibernateAnnotations.FILTER_DEF, - "applyToLoadByKey", - modelContext - ); - this.parameters = extractJandexValue( annotation, HibernateAnnotations.FILTER_DEF, "parameters", modelContext ); + public FilterDefAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.defaultCondition = (String) attributeValues.get( "defaultCondition" ); + this.autoEnabled = (boolean) attributeValues.get( "autoEnabled" ); + this.applyToLoadByKey = (boolean) attributeValues.get( "applyToLoadByKey" ); + this.parameters = (org.hibernate.annotations.ParamDef[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefsAnnotation.java index b20facbb53..21dec71d73 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterDefsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDefs; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class FilterDefsAnnotation implements FilterDefs, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (FilterDef[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTableAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTableAnnotation.java index 9e9d54f770..2aeacd7137 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTableAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTableAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FilterJoinTable; import org.hibernate.boot.jaxb.mapping.spi.JaxbFilterImpl; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.FILTER_JOIN_TABLE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -52,16 +50,11 @@ public class FilterJoinTableAnnotation implements FilterJoinTable, FilterDetails /** * Used in creating annotation instances from Jandex variant */ - public FilterJoinTableAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, FILTER_JOIN_TABLE, "name", modelContext ); - this.condition = extractJandexValue( annotation, FILTER_JOIN_TABLE, "condition", modelContext ); - this.deduceAliasInjectionPoints = extractJandexValue( - annotation, - FILTER_JOIN_TABLE, - "deduceAliasInjectionPoints", - modelContext - ); - this.aliases = extractJandexValue( annotation, FILTER_JOIN_TABLE, "aliases", modelContext ); + public FilterJoinTableAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.condition = (String) attributeValues.get( "condition" ); + this.deduceAliasInjectionPoints = (boolean) attributeValues.get( "deduceAliasInjectionPoints" ); + this.aliases = (org.hibernate.annotations.SqlFragmentAlias[]) attributeValues.get( "aliases" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTablesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTablesAnnotation.java index 8334a43aad..1b97a3c8e7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTablesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FilterJoinTablesAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FilterJoinTable; import org.hibernate.annotations.FilterJoinTables; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class FilterJoinTablesAnnotation implements FilterJoinTables, RepeatableC /** * Used in creating annotation instances from Jandex variant */ - public FilterJoinTablesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FILTER_JOIN_TABLES, "value", modelContext ); + public FilterJoinTablesAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (FilterJoinTable[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FiltersAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FiltersAnnotation.java index b694d2ecfa..6f1cf38835 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FiltersAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FiltersAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Filter; import org.hibernate.annotations.Filters; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class FiltersAnnotation implements Filters, RepeatableContainer { /** * Used in creating annotation instances from Jandex variant */ - public FiltersAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FILTERS, "value", modelContext ); + public FiltersAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Filter[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ForeignKeyJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ForeignKeyJpaAnnotation.java index 89efccc2ba..699574b93e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ForeignKeyJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ForeignKeyJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ForeignKey; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ForeignKeyJpaAnnotation implements ForeignKey { @@ -48,16 +44,11 @@ public class ForeignKeyJpaAnnotation implements ForeignKey { /** * Used in creating annotation instances from Jandex variant */ - public ForeignKeyJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.FOREIGN_KEY, "name", modelContext ); - this.value = extractJandexValue( annotation, JpaAnnotations.FOREIGN_KEY, "value", modelContext ); - this.foreignKeyDefinition = extractJandexValue( - annotation, - JpaAnnotations.FOREIGN_KEY, - "foreignKeyDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.FOREIGN_KEY, "options", modelContext ); + public ForeignKeyJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.value = (jakarta.persistence.ConstraintMode) attributeValues.get( "value" ); + this.foreignKeyDefinition = (String) attributeValues.get( "foreignKeyDefinition" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FormulaAnnotation.java index 814d40473c..dcad15a591 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FormulaAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Formula; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class FormulaAnnotation implements Formula { @@ -37,8 +33,8 @@ public class FormulaAnnotation implements Formula { /** * Used in creating annotation instances from Jandex variant */ - public FormulaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FORMULA, "value", modelContext ); + public FormulaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FractionalSecondsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FractionalSecondsAnnotation.java index cfa1a5abda..939a924395 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FractionalSecondsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/FractionalSecondsAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.FractionalSeconds; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class FractionalSecondsAnnotation implements FractionalSeconds { @@ -37,8 +33,8 @@ public class FractionalSecondsAnnotation implements FractionalSeconds { /** * Used in creating annotation instances from Jandex variant */ - public FractionalSecondsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.FRACTIONAL_SECONDS, "value", modelContext ); + public FractionalSecondsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedAnnotation.java index d919053632..dc21544ce6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Generated; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.generator.EventType; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class GeneratedAnnotation implements Generated { @@ -45,10 +41,10 @@ public class GeneratedAnnotation implements Generated { /** * Used in creating annotation instances from Jandex variant */ - public GeneratedAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.event = extractJandexValue( annotation, HibernateAnnotations.GENERATED, "event", modelContext ); - this.sql = extractJandexValue( annotation, HibernateAnnotations.GENERATED, "sql", modelContext ); - this.writable = extractJandexValue( annotation, HibernateAnnotations.GENERATED, "writable", modelContext ); + public GeneratedAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.event = (EventType[]) attributeValues.get( "event" ); + this.sql = (String) attributeValues.get( "sql" ); + this.writable = (boolean) attributeValues.get( "writable" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedColumnAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedColumnAnnotation.java index be0b6ca7a8..f059121bee 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedColumnAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedColumnAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.GeneratedColumn; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class GeneratedColumnAnnotation implements GeneratedColumn { @@ -37,8 +33,8 @@ public class GeneratedColumnAnnotation implements GeneratedColumn { /** * Used in creating annotation instances from Jandex variant */ - public GeneratedColumnAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.GENERATED_COLUMN, "value", modelContext ); + public GeneratedColumnAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedValueJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedValueJpaAnnotation.java index 089dadfdc9..1e238db147 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedValueJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GeneratedValueJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.GeneratedValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class GeneratedValueJpaAnnotation implements GeneratedValue { @@ -42,9 +38,9 @@ public class GeneratedValueJpaAnnotation implements GeneratedValue { /** * Used in creating annotation instances from Jandex variant */ - public GeneratedValueJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.strategy = extractJandexValue( annotation, JpaAnnotations.GENERATED_VALUE, "strategy", modelContext ); - this.generator = extractJandexValue( annotation, JpaAnnotations.GENERATED_VALUE, "generator", modelContext ); + public GeneratedValueJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.strategy = (jakarta.persistence.GenerationType) attributeValues.get( "strategy" ); + this.generator = (String) attributeValues.get( "generator" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorAnnotation.java index ea680fe5a7..a273ce9389 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.GenericGenerator; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -52,21 +50,11 @@ public class GenericGeneratorAnnotation implements GenericGenerator { /** * Used in creating annotation instances from Jandex variant */ - public GenericGeneratorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.GENERIC_GENERATOR, "name", modelContext ); - this.type = extractJandexValue( annotation, HibernateAnnotations.GENERIC_GENERATOR, "type", modelContext ); - this.strategy = extractJandexValue( - annotation, - HibernateAnnotations.GENERIC_GENERATOR, - "strategy", - modelContext - ); - this.parameters = extractJandexValue( - annotation, - HibernateAnnotations.GENERIC_GENERATOR, - "parameters", - modelContext - ); + public GenericGeneratorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.type = (Class) attributeValues.get( "type" ); + this.strategy = (String) attributeValues.get( "strategy" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorsAnnotation.java index c4b89c775f..0591950607 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/GenericGeneratorsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerators; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class GenericGeneratorsAnnotation implements GenericGenerators, Repeatabl /** * Used in creating annotation instances from Jandex variant */ - public GenericGeneratorsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.GENERIC_GENERATORS, "value", modelContext ); + public GenericGeneratorsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (GenericGenerator[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/HQLSelectAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/HQLSelectAnnotation.java index 8806de60cc..4dd219a498 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/HQLSelectAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/HQLSelectAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.HQLSelect; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class HQLSelectAnnotation implements HQLSelect { @@ -39,8 +35,8 @@ public class HQLSelectAnnotation implements HQLSelect { /** * Used in creating annotation instances from Jandex variant */ - public HQLSelectAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.query = extractJandexValue( annotation, HibernateAnnotations.HQL_SELECT, "query", modelContext ); + public HQLSelectAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.query = (String) attributeValues.get( "query" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdClassJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdClassJpaAnnotation.java index 04d8ea0580..e044aba51c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdClassJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdClassJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.IdClass; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class IdClassJpaAnnotation implements IdClass { @@ -38,8 +34,8 @@ public class IdClassJpaAnnotation implements IdClass { /** * Used in creating annotation instances from Jandex variant */ - public IdClassJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ID_CLASS, "value", modelContext ); + public IdClassJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdGeneratorTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdGeneratorTypeAnnotation.java index ea8e9a68d2..38f3f677b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdGeneratorTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdGeneratorTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.IdGeneratorType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class IdGeneratorTypeAnnotation implements IdGeneratorType { @@ -37,8 +33,8 @@ public class IdGeneratorTypeAnnotation implements IdGeneratorType { /** * Used in creating annotation instances from Jandex variant */ - public IdGeneratorTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.ID_GENERATOR_TYPE, "value", modelContext ); + public IdGeneratorTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdJpaAnnotation.java index 18c8c74ea2..cafed33272 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IdJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Id; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class IdJpaAnnotation implements Id { /** * Used in creating annotation instances from Jandex variant */ - public IdJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public IdJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImmutableAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImmutableAnnotation.java index 90bd644874..3d060bc4b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImmutableAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImmutableAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Immutable; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ImmutableAnnotation implements Immutable { @@ -32,7 +31,7 @@ public class ImmutableAnnotation implements Immutable { /** * Used in creating annotation instances from Jandex variant */ - public ImmutableAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public ImmutableAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImportedAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImportedAnnotation.java index b7f379d550..1961816d91 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImportedAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ImportedAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Imported; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ImportedAnnotation implements Imported { @@ -38,8 +34,8 @@ public class ImportedAnnotation implements Imported { /** * Used in creating annotation instances from Jandex variant */ - public ImportedAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.rename = extractJandexValue( annotation, HibernateAnnotations.IMPORTED, "rename", modelContext ); + public ImportedAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.rename = (String) attributeValues.get( "rename" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IndexJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IndexJpaAnnotation.java index 895fb9eff3..6edf4e3982 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IndexJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/IndexJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Index; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class IndexJpaAnnotation implements Index { @@ -47,11 +43,11 @@ public class IndexJpaAnnotation implements Index { /** * Used in creating annotation instances from Jandex variant */ - public IndexJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.INDEX, "name", modelContext ); - this.columnList = extractJandexValue( annotation, JpaAnnotations.INDEX, "columnList", modelContext ); - this.unique = extractJandexValue( annotation, JpaAnnotations.INDEX, "unique", modelContext ); - this.options = extractJandexValue( annotation, JpaAnnotations.INDEX, "options", modelContext ); + public IndexJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.columnList = (String) attributeValues.get( "columnList" ); + this.unique = (boolean) attributeValues.get( "unique" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InheritanceJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InheritanceJpaAnnotation.java index 5ec1ac13ad..d405ac64b5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InheritanceJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InheritanceJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Inheritance; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class InheritanceJpaAnnotation implements Inheritance { @@ -39,8 +35,8 @@ public class InheritanceJpaAnnotation implements Inheritance { /** * Used in creating annotation instances from Jandex variant */ - public InheritanceJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.strategy = extractJandexValue( annotation, JpaAnnotations.INHERITANCE, "strategy", modelContext ); + public InheritanceJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.strategy = (jakarta.persistence.InheritanceType) attributeValues.get( "strategy" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InstantiatorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InstantiatorAnnotation.java index b95d2ccb86..6aec0e47ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InstantiatorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/InstantiatorAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Instantiator; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class InstantiatorAnnotation implements Instantiator { @@ -37,8 +33,8 @@ public class InstantiatorAnnotation implements Instantiator { /** * Used in creating annotation instances from Jandex variant */ - public InstantiatorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.INSTANTIATOR, "value", modelContext ); + public InstantiatorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeAnnotation.java index 35f089e1a8..8a94a818f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JavaType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JavaTypeAnnotation implements JavaType { @@ -37,8 +33,8 @@ public class JavaTypeAnnotation implements JavaType { /** * Used in creating annotation instances from Jandex variant */ - public JavaTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.JAVA_TYPE, "value", modelContext ); + public JavaTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationAnnotation.java index f4dc98fcfe..56249fe8aa 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JavaTypeRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JavaTypeRegistrationAnnotation implements JavaTypeRegistration { @@ -39,19 +35,12 @@ public class JavaTypeRegistrationAnnotation implements JavaTypeRegistration { /** * Used in creating annotation instances from Jandex variant */ - public JavaTypeRegistrationAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.javaType = extractJandexValue( - annotation, - HibernateAnnotations.JAVA_TYPE_REGISTRATION, - "javaType", - modelContext - ); - this.descriptorClass = extractJandexValue( - annotation, - HibernateAnnotations.JAVA_TYPE_REGISTRATION, - "descriptorClass", - modelContext - ); + public JavaTypeRegistrationAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.javaType = (Class) attributeValues.get( "javaType" ); + this.descriptorClass = (Class>) attributeValues + .get( "descriptorClass" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationsAnnotation.java index bc9d79bfda..421c95b9c0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JavaTypeRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JavaTypeRegistration; import org.hibernate.annotations.JavaTypeRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,13 +39,10 @@ public class JavaTypeRegistrationsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public JavaTypeRegistrationsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.JAVA_TYPE_REGISTRATIONS, - "value", - modelContext - ); + public JavaTypeRegistrationsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (JavaTypeRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeAnnotation.java index a5f9213d56..3576361445 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JdbcType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JdbcTypeAnnotation implements JdbcType { @@ -37,8 +33,8 @@ public class JdbcTypeAnnotation implements JdbcType { /** * Used in creating annotation instances from Jandex variant */ - public JdbcTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.JDBC_TYPE, "value", modelContext ); + public JdbcTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeCodeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeCodeAnnotation.java index eebd1301ee..69c9e4e371 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeCodeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeCodeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JdbcTypeCodeAnnotation implements JdbcTypeCode { @@ -37,8 +33,8 @@ public class JdbcTypeCodeAnnotation implements JdbcTypeCode { /** * Used in creating annotation instances from Jandex variant */ - public JdbcTypeCodeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.JDBC_TYPE_CODE, "value", modelContext ); + public JdbcTypeCodeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationAnnotation.java index e3d5d821fc..7339227429 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JdbcTypeRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JdbcTypeRegistrationAnnotation implements JdbcTypeRegistration { @@ -40,19 +36,11 @@ public class JdbcTypeRegistrationAnnotation implements JdbcTypeRegistration { /** * Used in creating annotation instances from Jandex variant */ - public JdbcTypeRegistrationAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.JDBC_TYPE_REGISTRATION, - "value", - modelContext - ); - this.registrationCode = extractJandexValue( - annotation, - HibernateAnnotations.JDBC_TYPE_REGISTRATION, - "registrationCode", - modelContext - ); + public JdbcTypeRegistrationAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); + this.registrationCode = (int) attributeValues.get( "registrationCode" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationsAnnotation.java index 0190cfa971..f383d5b016 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JdbcTypeRegistrationsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JdbcTypeRegistrations; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,13 +38,10 @@ public class JdbcTypeRegistrationsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public JdbcTypeRegistrationsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.JDBC_TYPE_REGISTRATIONS, - "value", - modelContext - ); + public JdbcTypeRegistrationsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.JdbcTypeRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnJpaAnnotation.java index 4f80cded88..538af10ce7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbColumnImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbJoinColumnImpl; @@ -23,7 +24,6 @@ import jakarta.persistence.JoinColumn; import jakarta.persistence.MapKeyJoinColumn; import jakarta.persistence.PrimaryKeyJoinColumn; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -81,29 +81,19 @@ public class JoinColumnJpaAnnotation implements JoinColumn { /** * Used in creating annotation instances from Jandex variant */ - public JoinColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "name", modelContext ); - this.referencedColumnName = extractJandexValue( - annotation, - JpaAnnotations.JOIN_COLUMN, - "referencedColumnName", - modelContext - ); - this.unique = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "unique", modelContext ); - this.nullable = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "nullable", modelContext ); - this.insertable = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "insertable", modelContext ); - this.updatable = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "updatable", modelContext ); - this.columnDefinition = extractJandexValue( - annotation, - JpaAnnotations.JOIN_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "options", modelContext ); - this.table = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "table", modelContext ); - this.foreignKey = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "foreignKey", modelContext ); - this.check = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "check", modelContext ); - this.comment = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMN, "comment", modelContext ); + public JoinColumnJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.referencedColumnName = (String) attributeValues.get( "referencedColumnName" ); + this.unique = (boolean) attributeValues.get( "unique" ); + this.nullable = (boolean) attributeValues.get( "nullable" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.table = (String) attributeValues.get( "table" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); + this.check = (jakarta.persistence.CheckConstraint[]) attributeValues.get( "check" ); + this.comment = (String) attributeValues.get( "comment" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnOrFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnOrFormulaAnnotation.java index 5749b808cd..fef55ca99c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnOrFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnOrFormulaAnnotation.java @@ -7,16 +7,14 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.JOIN_COLUMN_OR_FORMULA; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -44,9 +42,9 @@ public class JoinColumnOrFormulaAnnotation implements JoinColumnOrFormula { /** * Used in creating annotation instances from Jandex variant */ - public JoinColumnOrFormulaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.formula = extractJandexValue( annotation, JOIN_COLUMN_OR_FORMULA, "formula", modelContext ); - this.column = extractJandexValue( annotation, JOIN_COLUMN_OR_FORMULA, "column", modelContext ); + public JoinColumnOrFormulaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.formula = (org.hibernate.annotations.JoinFormula) attributeValues.get( "formula" ); + this.column = (jakarta.persistence.JoinColumn) attributeValues.get( "column" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsJpaAnnotation.java index a19c380edb..f2113ed763 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; @@ -17,7 +18,6 @@ import org.jboss.jandex.AnnotationInstance; import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumns; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -44,9 +44,9 @@ public class JoinColumnsJpaAnnotation implements JoinColumns, RepeatableContaine /** * Used in creating annotation instances from Jandex variant */ - public JoinColumnsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMNS, "value", modelContext ); - this.foreignKey = extractJandexValue( annotation, JpaAnnotations.JOIN_COLUMNS, "foreignKey", modelContext ); + public JoinColumnsJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (JoinColumn[]) attributeValues.get( "value" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsOrFormulasAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsOrFormulasAnnotation.java index 32488af3a8..dc9631f28c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsOrFormulasAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinColumnsOrFormulasAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JoinColumnOrFormula; import org.hibernate.annotations.JoinColumnsOrFormulas; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,13 +44,10 @@ public class JoinColumnsOrFormulasAnnotation /** * Used in creating annotation instances from Jandex variant */ - public JoinColumnsOrFormulasAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.JOIN_COLUMNS_OR_FORMULAS, - "value", - modelContext - ); + public JoinColumnsOrFormulasAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (JoinColumnOrFormula[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinFormulaAnnotation.java index 50c9c9cd42..5b52f8b05b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinFormulaAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.JoinFormula; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class JoinFormulaAnnotation implements JoinFormula { @@ -40,14 +36,9 @@ public class JoinFormulaAnnotation implements JoinFormula { /** * Used in creating annotation instances from Jandex variant */ - public JoinFormulaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.JOIN_FORMULA, "value", modelContext ); - this.referencedColumnName = extractJandexValue( - annotation, - HibernateAnnotations.JOIN_FORMULA, - "referencedColumnName", - modelContext - ); + public JoinFormulaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); + this.referencedColumnName = (String) attributeValues.get( "referencedColumnName" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinTableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinTableJpaAnnotation.java index 2726d41e3e..6d4c95426d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinTableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/JoinTableJpaAnnotation.java @@ -8,6 +8,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; import java.util.List; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbJoinColumnImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbJoinTableImpl; @@ -19,11 +20,8 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.collections.CollectionHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.JoinTable; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyCatalog; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyOptionalString; @@ -102,34 +100,19 @@ public class JoinTableJpaAnnotation implements JoinTable, CommonTableDetails { /** * Used in creating annotation instances from Jandex variant */ - public JoinTableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "name", modelContext ); - this.catalog = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "schema", modelContext ); - this.joinColumns = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "joinColumns", modelContext ); - this.inverseJoinColumns = extractJandexValue( - annotation, - JpaAnnotations.JOIN_TABLE, - "inverseJoinColumns", - modelContext - ); - this.foreignKey = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "foreignKey", modelContext ); - this.inverseForeignKey = extractJandexValue( - annotation, - JpaAnnotations.JOIN_TABLE, - "inverseForeignKey", - modelContext - ); - this.uniqueConstraints = extractJandexValue( - annotation, - JpaAnnotations.JOIN_TABLE, - "uniqueConstraints", - modelContext - ); - this.indexes = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "indexes", modelContext ); - this.check = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "check", modelContext ); - this.comment = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "comment", modelContext ); - this.options = extractJandexValue( annotation, JpaAnnotations.JOIN_TABLE, "options", modelContext ); + public JoinTableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.joinColumns = (jakarta.persistence.JoinColumn[]) attributeValues.get( "joinColumns" ); + this.inverseJoinColumns = (jakarta.persistence.JoinColumn[]) attributeValues.get( "inverseJoinColumns" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); + this.inverseForeignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "inverseForeignKey" ); + this.uniqueConstraints = (jakarta.persistence.UniqueConstraint[]) attributeValues.get( "uniqueConstraints" ); + this.indexes = (jakarta.persistence.Index[]) attributeValues.get( "indexes" ); + this.check = (jakarta.persistence.CheckConstraint[]) attributeValues.get( "check" ); + this.comment = (String) attributeValues.get( "comment" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LazyGroupAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LazyGroupAnnotation.java index c7ea28e0ac..7ccf0dccaa 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LazyGroupAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LazyGroupAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.LazyGroup; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class LazyGroupAnnotation implements LazyGroup { @@ -37,8 +33,8 @@ public class LazyGroupAnnotation implements LazyGroup { /** * Used in creating annotation instances from Jandex variant */ - public LazyGroupAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.LAZY_GROUP, "value", modelContext ); + public LazyGroupAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexBaseAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexBaseAnnotation.java index a23593f3af..cedb89ef8e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexBaseAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexBaseAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ListIndexBase; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ListIndexBaseAnnotation implements ListIndexBase { @@ -38,8 +34,8 @@ public class ListIndexBaseAnnotation implements ListIndexBase { /** * Used in creating annotation instances from Jandex variant */ - public ListIndexBaseAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.LIST_INDEX_BASE, "value", modelContext ); + public ListIndexBaseAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJavaTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJavaTypeAnnotation.java index bd97a7e549..8de06e2e22 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJavaTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJavaTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ListIndexJavaType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ListIndexJavaTypeAnnotation implements ListIndexJavaType { @@ -37,8 +33,8 @@ public class ListIndexJavaTypeAnnotation implements ListIndexJavaType { /** * Used in creating annotation instances from Jandex variant */ - public ListIndexJavaTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.LIST_INDEX_JAVA_TYPE, "value", modelContext ); + public ListIndexJavaTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeAnnotation.java index f30ddf6c0a..d020c2ca84 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ListIndexJdbcType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ListIndexJdbcTypeAnnotation implements ListIndexJdbcType { @@ -37,8 +33,8 @@ public class ListIndexJdbcTypeAnnotation implements ListIndexJdbcType { /** * Used in creating annotation instances from Jandex variant */ - public ListIndexJdbcTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.LIST_INDEX_JDBC_TYPE, "value", modelContext ); + public ListIndexJdbcTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeCodeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeCodeAnnotation.java index d321d2e0b9..a723a1f20e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeCodeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ListIndexJdbcTypeCodeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ListIndexJdbcTypeCode; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ListIndexJdbcTypeCodeAnnotation implements ListIndexJdbcTypeCode { @@ -37,13 +33,10 @@ public class ListIndexJdbcTypeCodeAnnotation implements ListIndexJdbcTypeCode { /** * Used in creating annotation instances from Jandex variant */ - public ListIndexJdbcTypeCodeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.LIST_INDEX_JDBC_TYPE_CODE, - "value", - modelContext - ); + public ListIndexJdbcTypeCodeAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LobJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LobJpaAnnotation.java index 6e2764f951..e6ccedd3df 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LobJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/LobJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Lob; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class LobJpaAnnotation implements Lob { /** * Used in creating annotation instances from Jandex variant */ - public LobJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public LobJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToAnyAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToAnyAnnotation.java index 9314a8f993..f08326d045 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToAnyAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToAnyAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ManyToAny; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ManyToAnyAnnotation implements ManyToAny { @@ -38,8 +34,8 @@ public class ManyToAnyAnnotation implements ManyToAny { /** * Used in creating annotation instances from Jandex variant */ - public ManyToAnyAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.fetch = extractJandexValue( annotation, HibernateAnnotations.MANY_TO_ANY, "fetch", modelContext ); + public ManyToAnyAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToManyJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToManyJpaAnnotation.java index 987ebf94c2..c3abddb64f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToManyJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToManyJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ManyToMany; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ManyToManyJpaAnnotation implements ManyToMany, @@ -52,11 +48,11 @@ public class ManyToManyJpaAnnotation implements ManyToMany, /** * Used in creating annotation instances from Jandex variant */ - public ManyToManyJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetEntity = extractJandexValue( annotation, JpaAnnotations.MANY_TO_MANY, "targetEntity", modelContext ); - this.cascade = extractJandexValue( annotation, JpaAnnotations.MANY_TO_MANY, "cascade", modelContext ); - this.fetch = extractJandexValue( annotation, JpaAnnotations.MANY_TO_MANY, "fetch", modelContext ); - this.mappedBy = extractJandexValue( annotation, JpaAnnotations.MANY_TO_MANY, "mappedBy", modelContext ); + public ManyToManyJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.targetEntity = (Class) attributeValues.get( "targetEntity" ); + this.cascade = (jakarta.persistence.CascadeType[]) attributeValues.get( "cascade" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.mappedBy = (String) attributeValues.get( "mappedBy" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToOneJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToOneJpaAnnotation.java index 38558127f1..752d67b294 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToOneJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ManyToOneJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.ManyToOne; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ManyToOneJpaAnnotation implements ManyToOne, @@ -53,11 +49,11 @@ public class ManyToOneJpaAnnotation implements ManyToOne, /** * Used in creating annotation instances from Jandex variant */ - public ManyToOneJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetEntity = extractJandexValue( annotation, JpaAnnotations.MANY_TO_ONE, "targetEntity", modelContext ); - this.cascade = extractJandexValue( annotation, JpaAnnotations.MANY_TO_ONE, "cascade", modelContext ); - this.fetch = extractJandexValue( annotation, JpaAnnotations.MANY_TO_ONE, "fetch", modelContext ); - this.optional = extractJandexValue( annotation, JpaAnnotations.MANY_TO_ONE, "optional", modelContext ); + public ManyToOneJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.targetEntity = (Class) attributeValues.get( "targetEntity" ); + this.cascade = (jakarta.persistence.CascadeType[]) attributeValues.get( "cascade" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.optional = (boolean) attributeValues.get( "optional" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyClassJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyClassJpaAnnotation.java index 48360ce581..e2330823d4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyClassJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyClassJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKeyClass; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyClassJpaAnnotation implements MapKeyClass { @@ -38,8 +34,8 @@ public class MapKeyClassJpaAnnotation implements MapKeyClass { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyClassJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_CLASS, "value", modelContext ); + public MapKeyClassJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyColumnJpaAnnotation.java index 44a3d170d9..3b212a9c92 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyColumnJpaAnnotation.java @@ -7,21 +7,17 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbMapKeyColumnImpl; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.ColumnDetails; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Column; import jakarta.persistence.MapKeyColumn; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyColumnJpaAnnotation implements MapKeyColumn, @@ -80,23 +76,18 @@ public class MapKeyColumnJpaAnnotation implements MapKeyColumn, /** * Used in creating annotation instances from Jandex variant */ - public MapKeyColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "name", modelContext ); - this.unique = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "unique", modelContext ); - this.nullable = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "nullable", modelContext ); - this.insertable = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "insertable", modelContext ); - this.updatable = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "updatable", modelContext ); - this.columnDefinition = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "options", modelContext ); - this.table = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "table", modelContext ); - this.length = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "length", modelContext ); - this.precision = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "precision", modelContext ); - this.scale = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_COLUMN, "scale", modelContext ); + public MapKeyColumnJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.unique = (boolean) attributeValues.get( "unique" ); + this.nullable = (boolean) attributeValues.get( "nullable" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.table = (String) attributeValues.get( "table" ); + this.length = (int) attributeValues.get( "length" ); + this.precision = (int) attributeValues.get( "precision" ); + this.scale = (int) attributeValues.get( "scale" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyCompositeTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyCompositeTypeAnnotation.java index fd37fe7aab..af78ec1290 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyCompositeTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyCompositeTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyCompositeType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyCompositeTypeAnnotation implements MapKeyCompositeType { @@ -37,13 +33,8 @@ public class MapKeyCompositeTypeAnnotation implements MapKeyCompositeType { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyCompositeTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.MAP_KEY_COMPOSITE_TYPE, - "value", - modelContext - ); + public MapKeyCompositeTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyEnumeratedJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyEnumeratedJpaAnnotation.java index c8500e19d9..4b34a78704 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyEnumeratedJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyEnumeratedJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKeyEnumerated; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyEnumeratedJpaAnnotation implements MapKeyEnumerated { @@ -39,8 +35,8 @@ public class MapKeyEnumeratedJpaAnnotation implements MapKeyEnumerated { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyEnumeratedJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_ENUMERATED, "value", modelContext ); + public MapKeyEnumeratedJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.EnumType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJavaTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJavaTypeAnnotation.java index 99e3456cb1..67c2cec2b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJavaTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJavaTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyJavaType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyJavaTypeAnnotation implements MapKeyJavaType { @@ -37,8 +33,8 @@ public class MapKeyJavaTypeAnnotation implements MapKeyJavaType { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJavaTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.MAP_KEY_JAVA_TYPE, "value", modelContext ); + public MapKeyJavaTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeAnnotation.java index 4e61ee7d07..c328406fc8 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyJdbcType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyJdbcTypeAnnotation implements MapKeyJdbcType { @@ -37,8 +33,8 @@ public class MapKeyJdbcTypeAnnotation implements MapKeyJdbcType { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJdbcTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.MAP_KEY_JDBC_TYPE, "value", modelContext ); + public MapKeyJdbcTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeCodeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeCodeAnnotation.java index 73919f7f98..d233f4a60c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeCodeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJdbcTypeCodeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyJdbcTypeCode; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyJdbcTypeCodeAnnotation implements MapKeyJdbcTypeCode { @@ -37,13 +33,8 @@ public class MapKeyJdbcTypeCodeAnnotation implements MapKeyJdbcTypeCode { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJdbcTypeCodeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.MAP_KEY_JDBC_TYPE_CODE, - "value", - modelContext - ); + public MapKeyJdbcTypeCodeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (int) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnJpaAnnotation.java index ca1785be72..5b79605434 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbMapKeyJoinColumnImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -15,11 +16,8 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKeyJoinColumn; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -71,42 +69,17 @@ public class MapKeyJoinColumnJpaAnnotation implements MapKeyJoinColumn { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJoinColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMN, "name", modelContext ); - this.referencedColumnName = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMN, - "referencedColumnName", - modelContext - ); - this.unique = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMN, "unique", modelContext ); - this.nullable = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMN, "nullable", modelContext ); - this.insertable = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMN, - "insertable", - modelContext - ); - this.updatable = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMN, - "updatable", - modelContext - ); - this.columnDefinition = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMN, "options", modelContext ); - this.table = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMN, "table", modelContext ); - this.foreignKey = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMN, - "foreignKey", - modelContext - ); + public MapKeyJoinColumnJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.referencedColumnName = (String) attributeValues.get( "referencedColumnName" ); + this.unique = (boolean) attributeValues.get( "unique" ); + this.nullable = (boolean) attributeValues.get( "nullable" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.table = (String) attributeValues.get( "table" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnsJpaAnnotation.java index 17ca619caf..6728acd5c9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJoinColumnsJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKeyJoinColumn; import jakarta.persistence.MapKeyJoinColumns; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -49,14 +47,11 @@ public class MapKeyJoinColumnsJpaAnnotation implements MapKeyJoinColumns, Repeat /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJoinColumnsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_JOIN_COLUMNS, "value", modelContext ); - this.foreignKey = extractJandexValue( - annotation, - JpaAnnotations.MAP_KEY_JOIN_COLUMNS, - "foreignKey", - modelContext - ); + public MapKeyJoinColumnsJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (MapKeyJoinColumn[]) attributeValues.get( "value" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJpaAnnotation.java index 7c3b4e2ca9..4d341ff69d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKey; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyJpaAnnotation implements MapKey { @@ -39,8 +35,8 @@ public class MapKeyJpaAnnotation implements MapKey { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.MAP_KEY, "name", modelContext ); + public MapKeyJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyMutabilityAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyMutabilityAnnotation.java index e2370362c6..57ea7ad4ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyMutabilityAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyMutabilityAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyMutability; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyMutabilityAnnotation implements MapKeyMutability { @@ -37,8 +33,9 @@ public class MapKeyMutabilityAnnotation implements MapKeyMutability { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyMutabilityAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.MAP_KEY_MUTABILITY, "value", modelContext ); + public MapKeyMutabilityAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues + .get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTemporalJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTemporalJpaAnnotation.java index 7551189b2b..4465e6adce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTemporalJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTemporalJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapKeyTemporal; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapKeyTemporalJpaAnnotation implements MapKeyTemporal { @@ -38,8 +34,8 @@ public class MapKeyTemporalJpaAnnotation implements MapKeyTemporal { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyTemporalJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.MAP_KEY_TEMPORAL, "value", modelContext ); + public MapKeyTemporalJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.TemporalType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTypeAnnotation.java index 1e5a0b46a7..2bc2cb56d7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapKeyTypeAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.MapKeyType; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,14 +39,9 @@ public class MapKeyTypeAnnotation implements MapKeyType { /** * Used in creating annotation instances from Jandex variant */ - public MapKeyTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.MAP_KEY_TYPE, "value", modelContext ); - this.parameters = extractJandexValue( - annotation, - HibernateAnnotations.MAP_KEY_TYPE, - "parameters", - modelContext - ); + public MapKeyTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MappedSuperclassJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MappedSuperclassJpaAnnotation.java index d1db0d7089..9144040b02 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MappedSuperclassJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MappedSuperclassJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MappedSuperclass; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -34,7 +33,7 @@ public class MappedSuperclassJpaAnnotation implements MappedSuperclass { /** * Used in creating annotation instances from Jandex variant */ - public MappedSuperclassJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public MappedSuperclassJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapsIdJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapsIdJpaAnnotation.java index f3c10d3c8f..aa35e520e0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapsIdJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MapsIdJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.MapsId; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MapsIdJpaAnnotation implements MapsId { @@ -39,8 +35,8 @@ public class MapsIdJpaAnnotation implements MapsId { /** * Used in creating annotation instances from Jandex variant */ - public MapsIdJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.MAPS_ID, "value", modelContext ); + public MapsIdJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MutabilityAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MutabilityAnnotation.java index 9752d6b9ef..c56dfbc8f2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MutabilityAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/MutabilityAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Mutability; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class MutabilityAnnotation implements Mutability { @@ -37,8 +33,9 @@ public class MutabilityAnnotation implements Mutability { /** * Used in creating annotation instances from Jandex variant */ - public MutabilityAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.MUTABILITY, "value", modelContext ); + public MutabilityAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues + .get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedAttributeNodeJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedAttributeNodeJpaAnnotation.java index 492d8e3446..e91eb52f96 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedAttributeNodeJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedAttributeNodeJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedAttributeNode; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NamedAttributeNodeJpaAnnotation implements NamedAttributeNode { @@ -44,15 +40,12 @@ public class NamedAttributeNodeJpaAnnotation implements NamedAttributeNode { /** * Used in creating annotation instances from Jandex variant */ - public NamedAttributeNodeJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.NAMED_ATTRIBUTE_NODE, "value", modelContext ); - this.subgraph = extractJandexValue( annotation, JpaAnnotations.NAMED_ATTRIBUTE_NODE, "subgraph", modelContext ); - this.keySubgraph = extractJandexValue( - annotation, - JpaAnnotations.NAMED_ATTRIBUTE_NODE, - "keySubgraph", - modelContext - ); + public NamedAttributeNodeJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); + this.subgraph = (String) attributeValues.get( "subgraph" ); + this.keySubgraph = (String) attributeValues.get( "keySubgraph" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphJpaAnnotation.java index 2ce51016ce..2ccd764376 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedEntityGraph; import static org.hibernate.boot.models.JpaAnnotations.NAMED_ENTITY_GRAPH; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -52,27 +50,12 @@ public class NamedEntityGraphJpaAnnotation implements NamedEntityGraph { /** * Used in creating annotation instances from Jandex variant */ - public NamedEntityGraphJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, NAMED_ENTITY_GRAPH, "name", modelContext ); - this.attributeNodes = extractJandexValue( - annotation, - NAMED_ENTITY_GRAPH, - "attributeNodes", - modelContext - ); - this.includeAllAttributes = extractJandexValue( - annotation, - NAMED_ENTITY_GRAPH, - "includeAllAttributes", - modelContext - ); - this.subgraphs = extractJandexValue( annotation, NAMED_ENTITY_GRAPH, "subgraphs", modelContext ); - this.subclassSubgraphs = extractJandexValue( - annotation, - NAMED_ENTITY_GRAPH, - "subclassSubgraphs", - modelContext - ); + public NamedEntityGraphJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.attributeNodes = (jakarta.persistence.NamedAttributeNode[]) attributeValues.get( "attributeNodes" ); + this.includeAllAttributes = (boolean) attributeValues.get( "includeAllAttributes" ); + this.subgraphs = (jakarta.persistence.NamedSubgraph[]) attributeValues.get( "subgraphs" ); + this.subclassSubgraphs = (jakarta.persistence.NamedSubgraph[]) attributeValues.get( "subclassSubgraphs" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphsJpaAnnotation.java index 1c6a2cbc71..66b57d228c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedEntityGraphsJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedEntityGraph; import jakarta.persistence.NamedEntityGraphs; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,10 @@ public class NamedEntityGraphsJpaAnnotation implements NamedEntityGraphs, Repeat /** * Used in creating annotation instances from Jandex variant */ - public NamedEntityGraphsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.NAMED_ENTITY_GRAPHS, "value", modelContext ); + public NamedEntityGraphsJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (NamedEntityGraph[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesAnnotation.java index 38cfc6fae0..87c1284a5a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesAnnotation.java @@ -7,16 +7,14 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.NamedNativeQueries; import org.hibernate.annotations.NamedNativeQuery; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.NAMED_NATIVE_QUERIES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class NamedNativeQueriesAnnotation implements NamedNativeQueries, Repeata /** * Used in creating annotation instances from Jandex variant */ - public NamedNativeQueriesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, NAMED_NATIVE_QUERIES, "value", modelContext ); + public NamedNativeQueriesAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (NamedNativeQuery[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesJpaAnnotation.java index 219a9ed4bf..648dc6c28c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueriesJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedNativeQueries; import jakarta.persistence.NamedNativeQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,10 @@ public class NamedNativeQueriesJpaAnnotation implements NamedNativeQueries, Repe /** * Used in creating annotation instances from Jandex variant */ - public NamedNativeQueriesJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERIES, "value", modelContext ); + public NamedNativeQueriesJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (NamedNativeQuery[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryAnnotation.java index dd6dae1fdf..45441f7229 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryAnnotation.java @@ -9,6 +9,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.hibernate.CacheMode; import org.hibernate.annotations.FlushModeType; @@ -21,14 +22,9 @@ import org.hibernate.internal.util.collections.CollectionHelper; import org.hibernate.models.spi.MutableClassDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.CacheRetrieveMode; import jakarta.persistence.CacheStoreMode; -import static org.hibernate.boot.models.HibernateAnnotations.NAMED_NATIVE_QUERY; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NamedNativeQueryAnnotation implements NamedNativeQuery { @@ -48,6 +44,9 @@ public class NamedNativeQueryAnnotation implements NamedNativeQuery { String[] querySpaces; boolean callable; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public NamedNativeQueryAnnotation(SourceModelBuildingContext modelContext) { resultClass = void.class; resultSetMapping = ""; @@ -64,6 +63,9 @@ public class NamedNativeQueryAnnotation implements NamedNativeQuery { callable = false; } + /** + * Used in creating annotation instances from JDK variant + */ public NamedNativeQueryAnnotation(NamedNativeQuery annotation, SourceModelBuildingContext modelContext) { this.name = annotation.name(); this.query = annotation.query(); @@ -86,22 +88,25 @@ public class NamedNativeQueryAnnotation implements NamedNativeQuery { this.callable = annotation.callable(); } - public NamedNativeQueryAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "name", modelContext ); - this.query = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "query", modelContext ); - this.resultClass = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "resultClass", modelContext ); - this.resultSetMapping = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "resultSetMapping", modelContext ); - this.flushMode = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "flushMode", modelContext ); - this.cacheable = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "cacheable", modelContext ); - this.cacheRegion = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "cacheRegion", modelContext ); - this.fetchSize = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "fetchSize", modelContext ); - this.timeout = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "timeout", modelContext ); - this.comment = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "comment", modelContext ); - this.cacheStoreMode = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "cacheStoreMode", modelContext ); - this.cacheRetrieveMode = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "cacheRetrieveMode", modelContext ); - this.readOnly = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "readOnly", modelContext ); - this.querySpaces = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "querySpaces", modelContext ); - this.callable = extractJandexValue( annotation, NAMED_NATIVE_QUERY, "callable", modelContext ); + /** + * Used in creating annotation instances from Jandex variant + */ + public NamedNativeQueryAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.query = (String) attributeValues.get( "query" ); + this.resultClass = (Class) attributeValues.get( "resultClass" ); + this.resultSetMapping = (String) attributeValues.get( "resultSetMapping" ); + this.flushMode = (FlushModeType) attributeValues.get( "flushMode" ); + this.cacheable = (boolean) attributeValues.get( "cacheable" ); + this.cacheRegion = (String) attributeValues.get( "cacheRegion" ); + this.fetchSize = (int) attributeValues.get( "fetchSize" ); + this.timeout = (int) attributeValues.get( "timeout" ); + this.comment = (String) attributeValues.get( "comment" ); + this.cacheStoreMode = (CacheStoreMode) attributeValues.get( "cacheStoreMode" ); + this.cacheRetrieveMode = (CacheRetrieveMode) attributeValues.get( "cacheRetrieveMode" ); + this.readOnly = (boolean) attributeValues.get( "readOnly" ); + this.querySpaces = (String[]) attributeValues.get( "querySpaces" ); + this.callable = (boolean) attributeValues.get( "callable" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryJpaAnnotation.java index 35c2c17378..b585d10b8b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedNativeQueryJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbNamedNativeQueryImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -16,11 +17,8 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.MutableClassDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedNativeQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -64,25 +62,15 @@ public class NamedNativeQueryJpaAnnotation implements NamedNativeQuery { /** * Used in creating annotation instances from Jandex variant */ - public NamedNativeQueryJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "name", modelContext ); - this.query = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "query", modelContext ); - this.hints = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "hints", modelContext ); - this.resultClass = extractJandexValue( - annotation, - JpaAnnotations.NAMED_NATIVE_QUERY, - "resultClass", - modelContext - ); - this.resultSetMapping = extractJandexValue( - annotation, - JpaAnnotations.NAMED_NATIVE_QUERY, - "resultSetMapping", - modelContext - ); - this.entities = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "entities", modelContext ); - this.classes = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "classes", modelContext ); - this.columns = extractJandexValue( annotation, JpaAnnotations.NAMED_NATIVE_QUERY, "columns", modelContext ); + public NamedNativeQueryJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.query = (String) attributeValues.get( "query" ); + this.hints = (jakarta.persistence.QueryHint[]) attributeValues.get( "hints" ); + this.resultClass = (Class) attributeValues.get( "resultClass" ); + this.resultSetMapping = (String) attributeValues.get( "resultSetMapping" ); + this.entities = (jakarta.persistence.EntityResult[]) attributeValues.get( "entities" ); + this.classes = (jakarta.persistence.ConstructorResult[]) attributeValues.get( "classes" ); + this.columns = (jakarta.persistence.ColumnResult[]) attributeValues.get( "columns" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesAnnotation.java index da3748952e..ce4b3072cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesAnnotation.java @@ -7,16 +7,14 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.NamedQueries; import org.hibernate.annotations.NamedQuery; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.NAMED_QUERIES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class NamedQueriesAnnotation implements NamedQueries, RepeatableContainer /** * Used in creating annotation instances from Jandex variant */ - public NamedQueriesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, NAMED_QUERIES, "value", modelContext ); + public NamedQueriesAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (NamedQuery[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesJpaAnnotation.java index b0a83bc4a0..2f0c7905cb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueriesJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedQueries; import jakarta.persistence.NamedQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,8 @@ public class NamedQueriesJpaAnnotation implements NamedQueries, RepeatableContai /** * Used in creating annotation instances from Jandex variant */ - public NamedQueriesJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERIES, "value", modelContext ); + public NamedQueriesJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (NamedQuery[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryAnnotation.java index 26e2802bec..01eb1aa921 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.CacheMode; import org.hibernate.annotations.FlushModeType; @@ -16,13 +17,9 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.CacheRetrieveMode; import jakarta.persistence.CacheStoreMode; -import static org.hibernate.boot.models.HibernateAnnotations.NAMED_QUERY; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.xml.internal.QueryProcessing.interpretFlushMode; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,6 +38,9 @@ public class NamedQueryAnnotation implements NamedQuery { CacheRetrieveMode cacheRetrieveMode; boolean readOnly; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public NamedQueryAnnotation(SourceModelBuildingContext modelContext) { resultClass = void.class; flushMode = FlushModeType.PERSISTENCE_CONTEXT; @@ -54,6 +54,9 @@ public class NamedQueryAnnotation implements NamedQuery { readOnly = false; } + /** + * Used in creating annotation instances from JDK and Jandes variant + */ public NamedQueryAnnotation(NamedQuery annotation, SourceModelBuildingContext modelContext) { this.name = annotation.name(); this.query = annotation.query(); @@ -73,19 +76,22 @@ public class NamedQueryAnnotation implements NamedQuery { this.readOnly = annotation.readOnly(); } - public NamedQueryAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, NAMED_QUERY, "name", modelContext ); - this.query = extractJandexValue( annotation, NAMED_QUERY, "query", modelContext ); - this.resultClass = extractJandexValue( annotation, NAMED_QUERY, "resultClass", modelContext ); - this.flushMode = extractJandexValue( annotation, NAMED_QUERY, "flushMode", modelContext ); - this.cacheable = extractJandexValue( annotation, NAMED_QUERY, "cacheable", modelContext ); - this.cacheRegion = extractJandexValue( annotation, NAMED_QUERY, "cacheRegion", modelContext ); - this.fetchSize = extractJandexValue( annotation, NAMED_QUERY, "fetchSize", modelContext ); - this.timeout = extractJandexValue( annotation, NAMED_QUERY, "timeout", modelContext ); - this.comment = extractJandexValue( annotation, NAMED_QUERY, "comment", modelContext ); - this.cacheStoreMode = extractJandexValue( annotation, NAMED_QUERY, "cacheStoreMode", modelContext ); - this.cacheRetrieveMode = extractJandexValue( annotation, NAMED_QUERY, "cacheRetrieveMode", modelContext ); - this.readOnly = extractJandexValue( annotation, NAMED_QUERY, "readOnly", modelContext ); + /** + * Used in creating annotation instances from Jandex variant + */ + public NamedQueryAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.query = (String) attributeValues.get( "query" ); + this.resultClass = (Class) attributeValues.get( "resultClass" ); + this.flushMode = (FlushModeType) attributeValues.get( "flushMode" ); + this.cacheable = (boolean) attributeValues.get( "cacheable" ); + this.cacheRegion = (String) attributeValues.get( "cacheRegion" ); + this.fetchSize = (int) attributeValues.get( "fetchSize" ); + this.timeout = (int) attributeValues.get( "timeout" ); + this.comment = (String) attributeValues.get( "comment" ); + this.cacheStoreMode = (CacheStoreMode) attributeValues.get( "cacheStoreMode" ); + this.cacheRetrieveMode = (CacheRetrieveMode) attributeValues.get( "cacheRetrieveMode" ); + this.readOnly = (boolean) attributeValues.get( "readOnly" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryJpaAnnotation.java index 94f60ce6b4..5948582cf9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedQueryJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbNamedHqlQueryImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -14,11 +15,8 @@ import org.hibernate.boot.models.xml.internal.QueryProcessing; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.internal.util.NullnessHelper.coalesce; @@ -54,12 +52,12 @@ public class NamedQueryJpaAnnotation implements NamedQuery { /** * Used in creating annotation instances from Jandex variant */ - public NamedQueryJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERY, "name", modelContext ); - this.query = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERY, "query", modelContext ); - this.resultClass = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERY, "resultClass", modelContext ); - this.lockMode = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERY, "lockMode", modelContext ); - this.hints = extractJandexValue( annotation, JpaAnnotations.NAMED_QUERY, "hints", modelContext ); + public NamedQueryJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.query = (String) attributeValues.get( "query" ); + this.resultClass = (Class) attributeValues.get( "resultClass" ); + this.lockMode = (jakarta.persistence.LockModeType) attributeValues.get( "lockMode" ); + this.hints = (jakarta.persistence.QueryHint[]) attributeValues.get( "hints" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueriesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueriesJpaAnnotation.java index fec59aa14d..1c541b422f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueriesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueriesJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedStoredProcedureQueries; import jakarta.persistence.NamedStoredProcedureQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -50,14 +48,9 @@ public class NamedStoredProcedureQueriesJpaAnnotation * Used in creating annotation instances from Jandex variant */ public NamedStoredProcedureQueriesJpaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERIES, - "value", - modelContext - ); + this.value = (NamedStoredProcedureQuery[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueryJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueryJpaAnnotation.java index 1128e8bcf8..be20f2d9b1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueryJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedStoredProcedureQueryJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbNamedStoredProcedureQueryImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -14,11 +15,8 @@ import org.hibernate.boot.models.xml.internal.QueryProcessing; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedStoredProcedureQuery; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -64,39 +62,14 @@ public class NamedStoredProcedureQueryJpaAnnotation implements NamedStoredProced * Used in creating annotation instances from Jandex variant */ public NamedStoredProcedureQueryJpaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, "name", modelContext ); - this.procedureName = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, - "procedureName", - modelContext - ); - this.parameters = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, - "parameters", - modelContext - ); - this.resultClasses = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, - "resultClasses", - modelContext - ); - this.resultSetMappings = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, - "resultSetMappings", - modelContext - ); - this.hints = extractJandexValue( - annotation, - JpaAnnotations.NAMED_STORED_PROCEDURE_QUERY, - "hints", - modelContext - ); + this.name = (String) attributeValues.get( "name" ); + this.procedureName = (String) attributeValues.get( "procedureName" ); + this.parameters = (jakarta.persistence.StoredProcedureParameter[]) attributeValues.get( "parameters" ); + this.resultClasses = (Class[]) attributeValues.get( "resultClasses" ); + this.resultSetMappings = (String[]) attributeValues.get( "resultSetMappings" ); + this.hints = (jakarta.persistence.QueryHint[]) attributeValues.get( "hints" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedSubgraphJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedSubgraphJpaAnnotation.java index 090b27b3c8..494c8e8fff 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedSubgraphJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NamedSubgraphJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.NamedSubgraph; import static org.hibernate.boot.models.JpaAnnotations.NAMED_SUBGRAPH; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -44,15 +42,10 @@ public class NamedSubgraphJpaAnnotation implements NamedSubgraph { /** * Used in creating annotation instances from Jandex variant */ - public NamedSubgraphJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, NAMED_SUBGRAPH, "name", modelContext ); - this.type = extractJandexValue( annotation, NAMED_SUBGRAPH, "type", modelContext ); - this.attributeNodes = extractJandexValue( - annotation, - NAMED_SUBGRAPH, - "attributeNodes", - modelContext - ); + public NamedSubgraphJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.type = (Class) attributeValues.get( "type" ); + this.attributeNodes = (jakarta.persistence.NamedAttributeNode[]) attributeValues.get( "attributeNodes" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NationalizedAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NationalizedAnnotation.java index 8b557f245c..e68566f445 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NationalizedAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NationalizedAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Nationalized; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NationalizedAnnotation implements Nationalized { @@ -32,7 +31,7 @@ public class NationalizedAnnotation implements Nationalized { /** * Used in creating annotation instances from Jandex variant */ - public NationalizedAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public NationalizedAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdAnnotation.java index a8ec1215c7..01daaa8421 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.NaturalId; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NaturalIdAnnotation implements NaturalId { @@ -38,8 +34,8 @@ public class NaturalIdAnnotation implements NaturalId { /** * Used in creating annotation instances from Jandex variant */ - public NaturalIdAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.mutable = extractJandexValue( annotation, HibernateAnnotations.NATURAL_ID, "mutable", modelContext ); + public NaturalIdAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.mutable = (boolean) attributeValues.get( "mutable" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdCacheAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdCacheAnnotation.java index 991694c132..144ffc0753 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdCacheAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NaturalIdCacheAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.NaturalIdCache; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NaturalIdCacheAnnotation implements NaturalIdCache { @@ -38,8 +34,8 @@ public class NaturalIdCacheAnnotation implements NaturalIdCache { /** * Used in creating annotation instances from Jandex variant */ - public NaturalIdCacheAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.region = extractJandexValue( annotation, HibernateAnnotations.NATURAL_ID_CACHE, "region", modelContext ); + public NaturalIdCacheAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.region = (String) attributeValues.get( "region" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NotFoundAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NotFoundAnnotation.java index 7ef2fe9f7f..bc23c9699c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NotFoundAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/NotFoundAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.NotFound; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class NotFoundAnnotation implements NotFound { @@ -38,8 +34,8 @@ public class NotFoundAnnotation implements NotFound { /** * Used in creating annotation instances from Jandex variant */ - public NotFoundAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.action = extractJandexValue( annotation, HibernateAnnotations.NOT_FOUND, "action", modelContext ); + public NotFoundAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.action = (org.hibernate.annotations.NotFoundAction) attributeValues.get( "action" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OnDeleteAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OnDeleteAnnotation.java index 5108fd7dc6..f4169612f5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OnDeleteAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OnDeleteAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.OnDelete; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OnDeleteAnnotation implements OnDelete { @@ -37,8 +33,8 @@ public class OnDeleteAnnotation implements OnDelete { /** * Used in creating annotation instances from Jandex variant */ - public OnDeleteAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.action = extractJandexValue( annotation, HibernateAnnotations.ON_DELETE, "action", modelContext ); + public OnDeleteAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.action = (org.hibernate.annotations.OnDeleteAction) attributeValues.get( "action" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToManyJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToManyJpaAnnotation.java index a55883a19a..d78ff356ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToManyJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToManyJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.OneToMany; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OneToManyJpaAnnotation implements OneToMany, AttributeMarker.Fetchable, AttributeMarker.Cascadeable { @@ -52,17 +48,12 @@ public class OneToManyJpaAnnotation implements OneToMany, AttributeMarker.Fetcha /** * Used in creating annotation instances from Jandex variant */ - public OneToManyJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetEntity = extractJandexValue( annotation, JpaAnnotations.ONE_TO_MANY, "targetEntity", modelContext ); - this.cascade = extractJandexValue( annotation, JpaAnnotations.ONE_TO_MANY, "cascade", modelContext ); - this.fetch = extractJandexValue( annotation, JpaAnnotations.ONE_TO_MANY, "fetch", modelContext ); - this.mappedBy = extractJandexValue( annotation, JpaAnnotations.ONE_TO_MANY, "mappedBy", modelContext ); - this.orphanRemoval = extractJandexValue( - annotation, - JpaAnnotations.ONE_TO_MANY, - "orphanRemoval", - modelContext - ); + public OneToManyJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.targetEntity = (Class) attributeValues.get( "targetEntity" ); + this.cascade = (jakarta.persistence.CascadeType[]) attributeValues.get( "cascade" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.mappedBy = (String) attributeValues.get( "mappedBy" ); + this.orphanRemoval = (boolean) attributeValues.get( "orphanRemoval" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToOneJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToOneJpaAnnotation.java index 4ed3f09354..b5df6063bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToOneJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OneToOneJpaAnnotation.java @@ -7,17 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.AttributeMarker; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.OneToOne; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OneToOneJpaAnnotation @@ -56,13 +52,13 @@ public class OneToOneJpaAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OneToOneJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.targetEntity = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "targetEntity", modelContext ); - this.cascade = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "cascade", modelContext ); - this.fetch = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "fetch", modelContext ); - this.optional = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "optional", modelContext ); - this.mappedBy = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "mappedBy", modelContext ); - this.orphanRemoval = extractJandexValue( annotation, JpaAnnotations.ONE_TO_ONE, "orphanRemoval", modelContext ); + public OneToOneJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.targetEntity = (Class) attributeValues.get( "targetEntity" ); + this.cascade = (jakarta.persistence.CascadeType[]) attributeValues.get( "cascade" ); + this.fetch = (jakarta.persistence.FetchType) attributeValues.get( "fetch" ); + this.optional = (boolean) attributeValues.get( "optional" ); + this.mappedBy = (String) attributeValues.get( "mappedBy" ); + this.orphanRemoval = (boolean) attributeValues.get( "orphanRemoval" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockAnnotation.java index b33504ca59..fdd15e49b8 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.OptimisticLock; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OptimisticLockAnnotation implements OptimisticLock { @@ -37,13 +33,8 @@ public class OptimisticLockAnnotation implements OptimisticLock { /** * Used in creating annotation instances from Jandex variant */ - public OptimisticLockAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.excluded = extractJandexValue( - annotation, - HibernateAnnotations.OPTIMISTIC_LOCK, - "excluded", - modelContext - ); + public OptimisticLockAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.excluded = (boolean) attributeValues.get( "excluded" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockingAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockingAnnotation.java index 1490a0f59e..fb616add4a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockingAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OptimisticLockingAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.OptimisticLocking; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OptimisticLockingAnnotation implements OptimisticLocking { @@ -38,8 +34,8 @@ public class OptimisticLockingAnnotation implements OptimisticLocking { /** * Used in creating annotation instances from Jandex variant */ - public OptimisticLockingAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.type = extractJandexValue( annotation, HibernateAnnotations.OPTIMISTIC_LOCKING, "type", modelContext ); + public OptimisticLockingAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.type = (org.hibernate.annotations.OptimisticLockType) attributeValues.get( "type" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java index 8c2c9ded79..d6d75d32c3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java @@ -7,30 +7,35 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.OrderBy; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OrderByAnnotation implements OrderBy { private String clause; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OrderByAnnotation(SourceModelBuildingContext modelContext) { this.clause = ""; } + /** + * Used in creating annotation instances from JDK variant + */ public OrderByAnnotation(OrderBy annotation, SourceModelBuildingContext modelContext) { clause = annotation.clause(); } - public OrderByAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - clause = extractJandexValue( annotation, HibernateAnnotations.ORDER_BY, "clause", modelContext ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OrderByAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + clause = (String) attributeValues.get( "clause" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByJpaAnnotation.java index 3d7db05bb9..8504da9461 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.OrderBy; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OrderByJpaAnnotation implements OrderBy { @@ -39,8 +35,8 @@ public class OrderByJpaAnnotation implements OrderBy { /** * Used in creating annotation instances from Jandex variant */ - public OrderByJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.ORDER_BY, "value", modelContext ); + public OrderByJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderColumnJpaAnnotation.java index 76b2a95150..db453a675b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderColumnJpaAnnotation.java @@ -7,20 +7,16 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbOrderColumnImpl; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.ColumnDetails; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.OrderColumn; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OrderColumnJpaAnnotation implements OrderColumn, @@ -62,18 +58,13 @@ public class OrderColumnJpaAnnotation implements OrderColumn, /** * Used in creating annotation instances from Jandex variant */ - public OrderColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.ORDER_COLUMN, "name", modelContext ); - this.nullable = extractJandexValue( annotation, JpaAnnotations.ORDER_COLUMN, "nullable", modelContext ); - this.insertable = extractJandexValue( annotation, JpaAnnotations.ORDER_COLUMN, "insertable", modelContext ); - this.updatable = extractJandexValue( annotation, JpaAnnotations.ORDER_COLUMN, "updatable", modelContext ); - this.columnDefinition = extractJandexValue( - annotation, - JpaAnnotations.ORDER_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.ORDER_COLUMN, "options", modelContext ); + public OrderColumnJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.nullable = (boolean) attributeValues.get( "nullable" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenCheckAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenCheckAnnotation.java index 84ab2aef98..2a23c9571a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenCheckAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenCheckAnnotation.java @@ -7,20 +7,17 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Check; import org.hibernate.annotations.DialectOverride; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.AbstractOverrider; import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_CHECK; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -32,9 +29,15 @@ public class OverriddenCheckAnnotation implements DialectOverride.Check, DialectOverrider { private Check override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenCheckAnnotation(SourceModelBuildingContext modelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenCheckAnnotation(DialectOverride.Check annotation, SourceModelBuildingContext modelContext) { dialect( annotation.dialect() ); before( annotation.before() ); @@ -42,9 +45,12 @@ public class OverriddenCheckAnnotation override( extractJdkValue( annotation, DIALECT_OVERRIDE_CHECK, "override", modelContext ) ); } - public OverriddenCheckAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - super( annotation, DIALECT_OVERRIDE_CHECK, modelContext ); - override( extractJandexValue( annotation, DIALECT_OVERRIDE_CHECK, "override", modelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenCheckAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + super( attributeValues, DIALECT_OVERRIDE_CHECK, modelContext ); + override( (Check) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenChecksAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenChecksAnnotation.java index 1caf830e75..d37683efcd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenChecksAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenChecksAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -26,20 +24,24 @@ public class OverriddenChecksAnnotation implements DialectOverride.Checks, RepeatableContainer { private DialectOverride.Check[] value; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenChecksAnnotation(SourceModelBuildingContext modelContext) { } - public OverriddenChecksAnnotation(DialectOverride.Checks source, SourceModelBuildingContext modelContext) { - value( extractJdkValue( source, DialectOverrideAnnotations.DIALECT_OVERRIDE_CHECKS, "value", modelContext ) ); + /** + * Used in creating annotation instances from JDK variant + */ + public OverriddenChecksAnnotation(DialectOverride.Checks annotation, SourceModelBuildingContext modelContext) { + value( extractJdkValue( annotation, DialectOverrideAnnotations.DIALECT_OVERRIDE_CHECKS, "value", modelContext ) ); } - public OverriddenChecksAnnotation(AnnotationInstance source, SourceModelBuildingContext modelContext) { - value( extractJandexValue( - source, - DialectOverrideAnnotations.DIALECT_OVERRIDE_CHECKS, - "value", - modelContext - ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenChecksAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + value( (DialectOverride.Check[]) attributeValues.get( "value" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultAnnotation.java index 4aa2c63173..d076750233 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultAnnotation.java @@ -7,20 +7,17 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ColumnDefault; import org.hibernate.annotations.DialectOverride; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.AbstractOverrider; import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_COLUMN_DEFAULT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -32,9 +29,15 @@ public class OverriddenColumnDefaultAnnotation implements DialectOverride.ColumnDefault, DialectOverrider { private ColumnDefault override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenColumnDefaultAnnotation(SourceModelBuildingContext modelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenColumnDefaultAnnotation( DialectOverride.ColumnDefault annotation, SourceModelBuildingContext modelContext) { @@ -44,9 +47,14 @@ public class OverriddenColumnDefaultAnnotation override( extractJdkValue( annotation, DIALECT_OVERRIDE_COLUMN_DEFAULT, "override", modelContext ) ); } - public OverriddenColumnDefaultAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - super( annotation, DIALECT_OVERRIDE_COLUMN_DEFAULT, modelContext ); - override( extractJandexValue( annotation, DIALECT_OVERRIDE_COLUMN_DEFAULT, "override", modelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenColumnDefaultAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + super( attributeValues, DIALECT_OVERRIDE_COLUMN_DEFAULT, modelContext ); + override( (ColumnDefault) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultsAnnotation.java index 6ea0de67e8..4afab75685 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenColumnDefaultsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_COLUMN_DEFAULTS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -45,8 +43,10 @@ public class OverriddenColumnDefaultsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenColumnDefaultsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_COLUMN_DEFAULTS, "value", modelContext ); + public OverriddenColumnDefaultsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.ColumnDefault[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulaAnnotation.java index cb04e2a3bd..e51e5d440b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulaAnnotation.java @@ -7,20 +7,17 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.DiscriminatorFormula; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.AbstractOverrider; import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_DISCRIMINATOR_FORMULA; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -32,9 +29,15 @@ public class OverriddenDiscriminatorFormulaAnnotation implements DialectOverride.DiscriminatorFormula, DialectOverrider { private DiscriminatorFormula override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenDiscriminatorFormulaAnnotation(SourceModelBuildingContext modelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenDiscriminatorFormulaAnnotation( DialectOverride.DiscriminatorFormula annotation, SourceModelBuildingContext modelContext) { @@ -44,11 +47,14 @@ public class OverriddenDiscriminatorFormulaAnnotation override( extractJdkValue( annotation, DIALECT_OVERRIDE_DISCRIMINATOR_FORMULA, "override", modelContext ) ); } + /** + * Used in creating annotation instances from Jandex variant + */ public OverriddenDiscriminatorFormulaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - super( annotation, DIALECT_OVERRIDE_DISCRIMINATOR_FORMULA, modelContext ); - override( extractJandexValue( annotation, DIALECT_OVERRIDE_DISCRIMINATOR_FORMULA, "override", modelContext ) ); + super( attributeValues, DIALECT_OVERRIDE_DISCRIMINATOR_FORMULA, modelContext ); + override( (DiscriminatorFormula) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulasAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulasAnnotation.java index fdce337226..797153f035 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulasAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenDiscriminatorFormulasAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_DISCRIMINATOR_FORMULAS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -46,9 +44,9 @@ public class OverriddenDiscriminatorFormulasAnnotation * Used in creating annotation instances from Jandex variant */ public OverriddenDiscriminatorFormulasAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_DISCRIMINATOR_FORMULAS, "value", modelContext ); + this.value = (DialectOverride.DiscriminatorFormula[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefOverridesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefOverridesAnnotation.java index 2c7b4b8423..07263f9b3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefOverridesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefOverridesAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FILTER_DEF_OVERRIDES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -45,9 +43,9 @@ public class OverriddenFilterDefOverridesAnnotation * Used in creating annotation instances from Jandex variant */ public OverriddenFilterDefOverridesAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_FILTER_DEF_OVERRIDES, "value", modelContext ); + this.value = (DialectOverride.FilterDefs[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefsAnnotation.java index ab3697956a..00342d90c4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterDefsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.FilterDefs; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FILTER_DEFS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,19 +29,32 @@ public class OverriddenFilterDefsAnnotation implements DialectOverride.FilterDefs, DialectOverrider { private FilterDefs override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenFilterDefsAnnotation(SourceModelBuildingContext modelContext) { } - public OverriddenFilterDefsAnnotation(DialectOverride.FilterDefs source, SourceModelBuildingContext modelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_FILTER_DEFS, "override", modelContext ) ); + /** + * Used in creating annotation instances from JDK variant + */ + public OverriddenFilterDefsAnnotation( + DialectOverride.FilterDefs annotation, + SourceModelBuildingContext modelContext) { + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_FILTER_DEFS, "override", modelContext ) ); } - public OverriddenFilterDefsAnnotation(AnnotationInstance source, SourceModelBuildingContext modelContext) { - super( source, DIALECT_OVERRIDE_FILTER_DEFS, modelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_FILTER_DEFS, "override", modelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenFilterDefsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + super( attributeValues, DIALECT_OVERRIDE_FILTER_DEFS, modelContext ); + override( (FilterDefs) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterOverridesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterOverridesAnnotation.java index 2b418186db..31fd662218 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterOverridesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFilterOverridesAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FILTER_OVERRIDES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -44,8 +42,10 @@ public class OverriddenFilterOverridesAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenFilterOverridesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_FILTER_OVERRIDES, "value", modelContext ); + public OverriddenFilterOverridesAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.Filters[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFiltersAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFiltersAnnotation.java index 34be0568ee..11298f204c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFiltersAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFiltersAnnotation.java @@ -7,20 +7,17 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.Filters; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.AbstractOverrider; import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FILTERS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -32,19 +29,32 @@ public class OverriddenFiltersAnnotation implements DialectOverride.Filters, DialectOverrider { private Filters override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenFiltersAnnotation(SourceModelBuildingContext sourceModelContext) { } - public OverriddenFiltersAnnotation(DialectOverride.Filters source, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_FILTERS, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from JDK variant + */ + public OverriddenFiltersAnnotation( + DialectOverride.Filters annotation, + SourceModelBuildingContext sourceModelContext) { + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_FILTERS, "override", sourceModelContext ) ); } - public OverriddenFiltersAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_FILTERS, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_FILTERS, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenFiltersAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_FILTERS, sourceModelContext ); + override( (Filters) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulaAnnotation.java index 4b19690308..52fd4bbf54 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.Formula; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FORMULA; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,19 +29,32 @@ public class OverriddenFormulaAnnotation implements DialectOverride.Formula, DialectOverrider { private Formula override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenFormulaAnnotation(SourceModelBuildingContext sourceModelContext) { } - public OverriddenFormulaAnnotation(DialectOverride.Formula source, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_FORMULA, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from JDK variant + */ + public OverriddenFormulaAnnotation( + DialectOverride.Formula annotation, + SourceModelBuildingContext sourceModelContext) { + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_FORMULA, "override", sourceModelContext ) ); } - public OverriddenFormulaAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_FORMULA, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_FORMULA, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenFormulaAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_FORMULA, sourceModelContext ); + override( (Formula) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulasAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulasAnnotation.java index a25ed6bd79..15bb001740 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulasAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenFormulasAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_FORMULAS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -42,8 +40,8 @@ public class OverriddenFormulasAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenFormulasAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_FORMULAS, "value", modelContext ); + public OverriddenFormulasAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.Formula[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnAnnotation.java index a4cd945e8e..d9f40ffec2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.GeneratedColumn; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_GENERATED_COLUMN; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,23 +29,32 @@ public class OverriddenGeneratedColumnAnnotation implements DialectOverride.GeneratedColumn, DialectOverrider { private GeneratedColumn override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenGeneratedColumnAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenGeneratedColumnAnnotation( - DialectOverride.GeneratedColumn source, + DialectOverride.GeneratedColumn annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_GENERATED_COLUMN, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_GENERATED_COLUMN, "override", sourceModelContext ) ); } + /** + * Used in creating annotation instances from Jandex variant + */ public OverriddenGeneratedColumnAnnotation( - AnnotationInstance source, + Map attributeValues, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_GENERATED_COLUMN, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_GENERATED_COLUMN, "override", sourceModelContext ) ); + super( attributeValues, DIALECT_OVERRIDE_GENERATED_COLUMN, sourceModelContext ); + override( (GeneratedColumn) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnsAnnotation.java index 94ddda5b48..b2bd4ff754 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenGeneratedColumnsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_GENERATED_COLUMNS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -45,9 +43,9 @@ public class OverriddenGeneratedColumnsAnnotation * Used in creating annotation instances from Jandex variant */ public OverriddenGeneratedColumnsAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_GENERATED_COLUMNS, "value", modelContext ); + this.value = (DialectOverride.GeneratedColumn[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulaAnnotation.java index 1a95c33bbd..13c0e7d89b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.JoinFormula; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_JOIN_FORMULA; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenJoinFormulaAnnotation implements DialectOverride.JoinFormula, DialectOverrider { private JoinFormula override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenJoinFormulaAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenJoinFormulaAnnotation( - DialectOverride.JoinFormula source, + DialectOverride.JoinFormula annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_JOIN_FORMULA, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_JOIN_FORMULA, "override", sourceModelContext ) ); } - public OverriddenJoinFormulaAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_JOIN_FORMULA, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_JOIN_FORMULA, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenJoinFormulaAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_JOIN_FORMULA, sourceModelContext ); + override( (JoinFormula) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulasAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulasAnnotation.java index 8599f1926b..6c80540677 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulasAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenJoinFormulasAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_JOIN_FORMULAS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -44,8 +42,10 @@ public class OverriddenJoinFormulasAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenJoinFormulasAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_JOIN_FORMULAS, "value", modelContext ); + public OverriddenJoinFormulasAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.JoinFormula[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java index 3cf3d172a0..56c78f6cff 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.OrderBy; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_ORDER_BY; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,19 +29,32 @@ public class OverriddenOrderByAnnotation implements DialectOverride.OrderBy, DialectOverrider { private OrderBy override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenOrderByAnnotation(SourceModelBuildingContext sourceModelContext) { } - public OverriddenOrderByAnnotation(DialectOverride.OrderBy source, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_ORDER_BY, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from JDK variant + */ + public OverriddenOrderByAnnotation( + DialectOverride.OrderBy annotation, + SourceModelBuildingContext sourceModelContext) { + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_ORDER_BY, "override", sourceModelContext ) ); } - public OverriddenOrderByAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_ORDER_BY, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_ORDER_BY, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenOrderByAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_ORDER_BY, sourceModelContext ); + override( (OrderBy) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java index 6dd0a7a2a6..88f8169102 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_ORDER_BYS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -42,8 +40,8 @@ public class OverriddenOrderBysAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenOrderBysAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_ORDER_BYS, "value", modelContext ); + public OverriddenOrderBysAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.OrderBy[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllAnnotation.java index 385672ad97..2d8adc09f6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLDeleteAll; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_DELETE_ALL; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenSQLDeleteAllAnnotation implements DialectOverride.SQLDeleteAll, DialectOverrider { private SQLDeleteAll override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLDeleteAllAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLDeleteAllAnnotation( - DialectOverride.SQLDeleteAll source, + DialectOverride.SQLDeleteAll annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_DELETE_ALL, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_DELETE_ALL, "override", sourceModelContext ) ); } - public OverriddenSQLDeleteAllAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_DELETE_ALL, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_DELETE_ALL, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLDeleteAllAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_DELETE_ALL, sourceModelContext ); + override( (SQLDeleteAll) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllsAnnotation.java index 11be8f8b80..77a36f219b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAllsAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_DELETE_ALLS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -44,8 +42,10 @@ public class OverriddenSQLDeleteAllsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenSQLDeleteAllsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_DELETE_ALLS, "value", modelContext ); + public OverriddenSQLDeleteAllsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLDeleteAll[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAnnotation.java index 248b9277ff..f9347a8a92 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeleteAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLDelete; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_DELETE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenSQLDeleteAnnotation implements DialectOverride.SQLDelete, DialectOverrider { private SQLDelete override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLDeleteAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLDeleteAnnotation( - DialectOverride.SQLDelete source, + DialectOverride.SQLDelete annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_DELETE, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_DELETE, "override", sourceModelContext ) ); } - public OverriddenSQLDeleteAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_DELETE, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_DELETE, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLDeleteAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_DELETE, sourceModelContext ); + override( (SQLDelete) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeletesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeletesAnnotation.java index bbd81a082c..a13d950e83 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeletesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLDeletesAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_DELETES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -26,17 +24,28 @@ public class OverriddenSQLDeletesAnnotation implements DialectOverride.SQLDeletes, RepeatableContainer { private DialectOverride.SQLDelete[] value; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLDeletesAnnotation(SourceModelBuildingContext modelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLDeletesAnnotation( DialectOverride.SQLDeletes annotation, SourceModelBuildingContext modelContext) { this.value = extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_DELETES, "value", modelContext ); } - public OverriddenSQLDeletesAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_DELETES, "value", modelContext ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLDeletesAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLDelete[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertAnnotation.java index 079aa3f3d4..9af358df3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLInsert; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_INSERT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenSQLInsertAnnotation implements DialectOverride.SQLInsert, DialectOverrider { private SQLInsert override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLInsertAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLInsertAnnotation( - DialectOverride.SQLInsert source, + DialectOverride.SQLInsert annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_INSERT, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_INSERT, "override", sourceModelContext ) ); } - public OverriddenSQLInsertAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_INSERT, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_INSERT, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLInsertAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_INSERT, sourceModelContext ); + override( (SQLInsert) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertsAnnotation.java index 06b223821d..fad1311dc9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLInsertsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; @@ -26,17 +27,28 @@ public class OverriddenSQLInsertsAnnotation implements DialectOverride.SQLInserts, RepeatableContainer { private DialectOverride.SQLInsert[] value; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLInsertsAnnotation(SourceModelBuildingContext sourceModelBuildingContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLInsertsAnnotation( DialectOverride.SQLInserts annotation, SourceModelBuildingContext modelContext) { this.value = extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_INSERTS, "value", modelContext ); } - public OverriddenSQLInsertsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_INSERTS, "value", modelContext ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLInsertsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLInsert[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrderAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrderAnnotation.java index 360041cc47..61a3be72ff 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrderAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrderAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLOrder; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_ORDER; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenSQLOrderAnnotation implements DialectOverride.SQLOrder, DialectOverrider { private SQLOrder override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLOrderAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLOrderAnnotation( - DialectOverride.SQLOrder source, + DialectOverride.SQLOrder annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_ORDER, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_ORDER, "override", sourceModelContext ) ); } - public OverriddenSQLOrderAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_ORDER, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_ORDER, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLOrderAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_ORDER, sourceModelContext ); + override( (SQLOrder) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrdersAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrdersAnnotation.java index 44d40bd2c8..4a27d46007 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrdersAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLOrdersAnnotation.java @@ -7,16 +7,14 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.DialectOverride.SQLOrders; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_ORDERS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,8 @@ public class OverriddenSQLOrdersAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenSQLOrdersAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_ORDERS, "value", modelContext ); + public OverriddenSQLOrdersAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLOrder[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionAnnotation.java index d233dae607..5cd5698798 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLRestriction; @@ -16,11 +17,8 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_ORDER; import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_RESTRICTION; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -32,23 +30,32 @@ public class OverriddenSQLRestrictionAnnotation implements DialectOverride.SQLRestriction, DialectOverrider { private SQLRestriction override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLRestrictionAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLRestrictionAnnotation( - DialectOverride.SQLRestriction source, + DialectOverride.SQLRestriction annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_RESTRICTION, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_RESTRICTION, "override", sourceModelContext ) ); } + /** + * Used in creating annotation instances from Jandex variant + */ public OverriddenSQLRestrictionAnnotation( - AnnotationInstance source, + Map attributeValues, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_ORDER, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_RESTRICTION, "override", sourceModelContext ) ); + super( attributeValues, DIALECT_OVERRIDE_SQL_ORDER, sourceModelContext ); + override( (SQLRestriction) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionsAnnotation.java index ac9b77c9bb..24805022e4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLRestrictionsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.DialectOverride.SQLRestrictions; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,13 +44,10 @@ public class OverriddenSQLRestrictionsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenSQLRestrictionsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_RESTRICTIONS, - "value", - modelContext - ); + public OverriddenSQLRestrictionsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLRestriction[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectAnnotation.java index 2864cdd8b1..4103c6d292 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLSelect; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_SELECT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,9 +29,15 @@ public class OverriddenSQLSelectAnnotation implements DialectOverride.SQLSelect, DialectOverrider { private SQLSelect override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLSelectAnnotation(SourceModelBuildingContext modelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLSelectAnnotation( DialectOverride.SQLSelect annotation, SourceModelBuildingContext modelContext) { @@ -43,9 +47,12 @@ public class OverriddenSQLSelectAnnotation override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_SELECT, "override", modelContext ) ); } - public OverriddenSQLSelectAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - super( annotation, DIALECT_OVERRIDE_SQL_SELECT, modelContext ); - override( extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_SELECT, "override", modelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLSelectAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_SELECT, modelContext ); + override( (SQLSelect) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectsAnnotation.java index 0c4bb96469..390377b736 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLSelectsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.DialectOverride.SQLRestrictions; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,13 +44,10 @@ public class OverriddenSQLSelectsAnnotation /** * Used in creating annotation instances from Jandex variant */ - public OverriddenSQLSelectsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_RESTRICTIONS, - "value", - modelContext - ); + public OverriddenSQLSelectsAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (DialectOverride.SQLSelect[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdateAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdateAnnotation.java index d23ab1b90a..bbd64df7b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdateAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdateAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.annotations.SQLUpdate; @@ -16,10 +17,7 @@ import org.hibernate.boot.models.annotations.spi.DialectOverrider; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_UPDATE; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -31,21 +29,32 @@ public class OverriddenSQLUpdateAnnotation implements DialectOverride.SQLUpdate, DialectOverrider { private SQLUpdate override; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLUpdateAnnotation(SourceModelBuildingContext sourceModelContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLUpdateAnnotation( - DialectOverride.SQLUpdate source, + DialectOverride.SQLUpdate annotation, SourceModelBuildingContext sourceModelContext) { - dialect( source.dialect() ); - before( source.before() ); - sameOrAfter( source.sameOrAfter() ); - override( extractJdkValue( source, DIALECT_OVERRIDE_SQL_UPDATE, "override", sourceModelContext ) ); + dialect( annotation.dialect() ); + before( annotation.before() ); + sameOrAfter( annotation.sameOrAfter() ); + override( extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_UPDATE, "override", sourceModelContext ) ); } - public OverriddenSQLUpdateAnnotation(AnnotationInstance source, SourceModelBuildingContext sourceModelContext) { - super( source, DIALECT_OVERRIDE_SQL_UPDATE, sourceModelContext ); - override( extractJandexValue( source, DIALECT_OVERRIDE_SQL_UPDATE, "override", sourceModelContext ) ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverriddenSQLUpdateAnnotation( + Map attributeValues, + SourceModelBuildingContext sourceModelContext) { + super( attributeValues, DIALECT_OVERRIDE_SQL_UPDATE, sourceModelContext ); + override( (SQLUpdate) attributeValues.get( "override" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdatesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdatesAnnotation.java index 8d3358409e..1df0765694 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdatesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenSQLUpdatesAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_SQL_UPDATES; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; /** @@ -26,19 +24,28 @@ public class OverriddenSQLUpdatesAnnotation implements DialectOverride.SQLUpdates, RepeatableContainer { private DialectOverride.SQLUpdate[] value; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverriddenSQLUpdatesAnnotation(SourceModelBuildingContext sourceModelBuildingContext) { } + /** + * Used in creating annotation instances from JDK variant + */ public OverriddenSQLUpdatesAnnotation( DialectOverride.SQLUpdates annotation, SourceModelBuildingContext sourceModelContext) { this.value = extractJdkValue( annotation, DIALECT_OVERRIDE_SQL_UPDATES, "value", sourceModelContext ); } + /** + * Used in creating annotation instances from Jandex variant + */ public OverriddenSQLUpdatesAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext sourceModelContext) { - this.value = extractJandexValue( annotation, DIALECT_OVERRIDE_SQL_UPDATES, "value", sourceModelContext ); + this.value = (DialectOverride.SQLUpdate[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverrideVersionAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverrideVersionAnnotation.java index d01e736057..d9ffdfdbc2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverrideVersionAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverrideVersionAnnotation.java @@ -7,29 +7,38 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class OverrideVersionAnnotation implements DialectOverride.Version { private int major; private int minor; + /** + * Used in creating dynamic annotation instances (e.g. from XML) + */ public OverrideVersionAnnotation(SourceModelBuildingContext modelContext) { this.minor = 0; } + /** + * Used in creating annotation instances from JDK variant + */ public OverrideVersionAnnotation(DialectOverride.Version annotation, SourceModelBuildingContext modelContext) { major( annotation.major() ); minor( annotation.minor() ); } - public OverrideVersionAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - throw new UnsupportedOperationException( "Not implemented yet" ); + /** + * Used in creating annotation instances from Jandex variant + */ + public OverrideVersionAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + major( (Integer) attributeValues.get( "major" ) ); + minor( (Integer) attributeValues.get( "minor" ) ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParamDefAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParamDefAnnotation.java index b190919521..ff69379a79 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParamDefAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParamDefAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ParamDef; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ParamDefAnnotation implements ParamDef { @@ -42,10 +38,10 @@ public class ParamDefAnnotation implements ParamDef { /** * Used in creating annotation instances from Jandex variant */ - public ParamDefAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.PARAM_DEF, "name", modelContext ); - this.type = extractJandexValue( annotation, HibernateAnnotations.PARAM_DEF, "type", modelContext ); - this.resolver = extractJandexValue( annotation, HibernateAnnotations.PARAM_DEF, "resolver", modelContext ); + public ParamDefAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.type = (Class) attributeValues.get( "type" ); + this.resolver = (Class) attributeValues.get( "resolver" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParameterAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParameterAnnotation.java index 896fbc8844..065f89e3fa 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParameterAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParameterAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Parameter; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ParameterAnnotation implements Parameter { @@ -39,9 +35,9 @@ public class ParameterAnnotation implements Parameter { /** * Used in creating annotation instances from Jandex variant */ - public ParameterAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.PARAMETER, "name", modelContext ); - this.value = extractJandexValue( annotation, HibernateAnnotations.PARAMETER, "value", modelContext ); + public ParameterAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParentAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParentAnnotation.java index 427b0b709d..c9cba33feb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParentAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ParentAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Parent; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ParentAnnotation implements Parent { @@ -32,7 +31,7 @@ public class ParentAnnotation implements Parent { /** * Used in creating annotation instances from Jandex variant */ - public ParentAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public ParentAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PartitionKeyAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PartitionKeyAnnotation.java index b2d91e621b..75845bd023 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PartitionKeyAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PartitionKeyAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.PartitionKey; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class PartitionKeyAnnotation implements PartitionKey { @@ -32,7 +31,7 @@ public class PartitionKeyAnnotation implements PartitionKey { /** * Used in creating annotation instances from Jandex variant */ - public PartitionKeyAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PartitionKeyAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostLoadJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostLoadJpaAnnotation.java index 7c294f663c..3a48a62ff1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostLoadJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostLoadJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PostLoad; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class PostLoadJpaAnnotation implements PostLoad { /** * Used in creating annotation instances from Jandex variant */ - public PostLoadJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PostLoadJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostPersistJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostPersistJpaAnnotation.java index 70b386c5e7..c526eefbbf 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostPersistJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostPersistJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PostPersist; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class PostPersistJpaAnnotation implements PostPersist { /** * Used in creating annotation instances from Jandex variant */ - public PostPersistJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PostPersistJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostRemoveJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostRemoveJpaAnnotation.java index c39269f5bf..fa0526d5dc 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostRemoveJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostRemoveJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PostRemove; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class PostRemoveJpaAnnotation implements PostRemove { /** * Used in creating annotation instances from Jandex variant */ - public PostRemoveJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PostRemoveJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostUpdateJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostUpdateJpaAnnotation.java index df3bf473fb..5f15a520fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostUpdateJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PostUpdateJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PostUpdate; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class PostUpdateJpaAnnotation implements PostUpdate { /** * Used in creating annotation instances from Jandex variant */ - public PostUpdateJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PostUpdateJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrePersistJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrePersistJpaAnnotation.java index 4de639df47..7a42d2feb4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrePersistJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrePersistJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PrePersist; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class PrePersistJpaAnnotation implements PrePersist { /** * Used in creating annotation instances from Jandex variant */ - public PrePersistJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PrePersistJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreRemoveJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreRemoveJpaAnnotation.java index c7b41f19fb..4f902aa884 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreRemoveJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreRemoveJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PreRemove; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -33,7 +32,7 @@ public class PreRemoveJpaAnnotation implements PreRemove { /** * Used in creating annotation instances from Jandex variant */ - public PreRemoveJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PreRemoveJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreUpdateJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreUpdateJpaAnnotation.java index 8f1019b517..5cd59f682a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreUpdateJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PreUpdateJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PreUpdate; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class PreUpdateJpaAnnotation implements PreUpdate { /** * Used in creating annotation instances from Jandex variant */ - public PreUpdateJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public PreUpdateJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnJpaAnnotation.java index b6055028b4..c9cf8493c3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbPrimaryKeyJoinColumnImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -16,12 +17,9 @@ import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PrimaryKeyJoinColumn; import static org.hibernate.boot.models.JpaAnnotations.PRIMARY_KEY_JOIN_COLUMN; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -58,32 +56,14 @@ public class PrimaryKeyJoinColumnJpaAnnotation implements PrimaryKeyJoinColumn, /** * Used in creating annotation instances from Jandex variant */ - public PrimaryKeyJoinColumnJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, PRIMARY_KEY_JOIN_COLUMN, "name", modelContext ); - this.referencedColumnName = extractJandexValue( - annotation, - PRIMARY_KEY_JOIN_COLUMN, - "referencedColumnName", - modelContext - ); - this.columnDefinition = extractJandexValue( - annotation, - PRIMARY_KEY_JOIN_COLUMN, - "columnDefinition", - modelContext - ); - this.options = extractJandexValue( - annotation, - PRIMARY_KEY_JOIN_COLUMN, - "options", - modelContext - ); - this.foreignKey = extractJandexValue( - annotation, - PRIMARY_KEY_JOIN_COLUMN, - "foreignKey", - modelContext - ); + public PrimaryKeyJoinColumnJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.referencedColumnName = (String) attributeValues.get( "referencedColumnName" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.options = (String) attributeValues.get( "options" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnsJpaAnnotation.java index d249d21469..ab48f8dc5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PrimaryKeyJoinColumnsJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.PrimaryKeyJoinColumn; import jakarta.persistence.PrimaryKeyJoinColumns; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -54,14 +52,11 @@ public class PrimaryKeyJoinColumnsJpaAnnotation /** * Used in creating annotation instances from Jandex variant */ - public PrimaryKeyJoinColumnsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.PRIMARY_KEY_JOIN_COLUMNS, "value", modelContext ); - this.foreignKey = extractJandexValue( - annotation, - JpaAnnotations.PRIMARY_KEY_JOIN_COLUMNS, - "foreignKey", - modelContext - ); + public PrimaryKeyJoinColumnsJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (PrimaryKeyJoinColumn[]) attributeValues.get( "value" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PropertyRefAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PropertyRefAnnotation.java index 7e09f67996..841a8138b5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PropertyRefAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/PropertyRefAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.PropertyRef; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class PropertyRefAnnotation implements PropertyRef { @@ -37,8 +33,8 @@ public class PropertyRefAnnotation implements PropertyRef { /** * Used in creating annotation instances from Jandex variant */ - public PropertyRefAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.PROPERTY_REF, "value", modelContext ); + public PropertyRefAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryCacheLayoutAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryCacheLayoutAnnotation.java index d5bc67e486..76b5b2cdae 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryCacheLayoutAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryCacheLayoutAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.QueryCacheLayout; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class QueryCacheLayoutAnnotation implements QueryCacheLayout { @@ -38,8 +34,8 @@ public class QueryCacheLayoutAnnotation implements QueryCacheLayout { /** * Used in creating annotation instances from Jandex variant */ - public QueryCacheLayoutAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.layout = extractJandexValue( annotation, HibernateAnnotations.QUERY_CACHE_LAYOUT, "layout", modelContext ); + public QueryCacheLayoutAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.layout = (org.hibernate.annotations.CacheLayout) attributeValues.get( "layout" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryHintJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryHintJpaAnnotation.java index adc09f198b..abc44bb4dc 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryHintJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/QueryHintJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.QueryHint; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class QueryHintJpaAnnotation implements QueryHint { @@ -40,9 +36,9 @@ public class QueryHintJpaAnnotation implements QueryHint { /** * Used in creating annotation instances from Jandex variant */ - public QueryHintJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.QUERY_HINT, "name", modelContext ); - this.value = extractJandexValue( annotation, JpaAnnotations.QUERY_HINT, "value", modelContext ); + public QueryHintJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/RowIdAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/RowIdAnnotation.java index 88c7b7aae0..a31656c6c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/RowIdAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/RowIdAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.RowId; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class RowIdAnnotation implements RowId { @@ -38,8 +34,8 @@ public class RowIdAnnotation implements RowId { /** * Used in creating annotation instances from Jandex variant */ - public RowIdAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.ROW_ID, "value", modelContext ); + public RowIdAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAllAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAllAnnotation.java index 35bd3582bb..88c08fdb8c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAllAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAllAnnotation.java @@ -7,17 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLDeleteAll; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.CustomSqlDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLDeleteAllAnnotation implements SQLDeleteAll, CustomSqlDetails { @@ -51,12 +46,12 @@ public class SQLDeleteAllAnnotation implements SQLDeleteAll, CustomSqlDetails { /** * Used in creating annotation instances from Jandex variant */ - public SQLDeleteAllAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.sql = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE_ALL, "sql", modelContext ); - this.callable = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE_ALL, "callable", modelContext ); - this.verify = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE_ALL, "verify", modelContext ); - this.check = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE_ALL, "check", modelContext ); - this.table = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE_ALL, "table", modelContext ); + public SQLDeleteAllAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.sql = (String) attributeValues.get( "sql" ); + this.callable = (boolean) attributeValues.get( "callable" ); + this.verify = (Class) attributeValues.get( "verify" ); + this.check = (org.hibernate.annotations.ResultCheckStyle) attributeValues.get( "check" ); + this.table = (String) attributeValues.get( "table" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAnnotation.java index 1033278077..0f126c1197 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeleteAnnotation.java @@ -7,17 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLDelete; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.CustomSqlDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLDeleteAnnotation implements SQLDelete, CustomSqlDetails { @@ -51,12 +46,12 @@ public class SQLDeleteAnnotation implements SQLDelete, CustomSqlDetails { /** * Used in creating annotation instances from Jandex variant */ - public SQLDeleteAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.sql = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE, "sql", modelContext ); - this.callable = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE, "callable", modelContext ); - this.verify = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE, "verify", modelContext ); - this.check = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE, "check", modelContext ); - this.table = extractJandexValue( annotation, HibernateAnnotations.SQL_DELETE, "table", modelContext ); + public SQLDeleteAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.sql = (String) attributeValues.get( "sql" ); + this.callable = (boolean) attributeValues.get( "callable" ); + this.verify = (Class) attributeValues.get( "verify" ); + this.check = (org.hibernate.annotations.ResultCheckStyle) attributeValues.get( "check" ); + this.table = (String) attributeValues.get( "table" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeletesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeletesAnnotation.java index 7f781059e7..112e51d2f5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeletesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLDeletesAnnotation.java @@ -6,18 +6,15 @@ */ package org.hibernate.boot.models.annotations.internal; +import java.lang.annotation.Annotation; +import java.util.Map; + import org.hibernate.annotations.SQLDelete; +import org.hibernate.annotations.SQLDeletes; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import java.lang.annotation.Annotation; - -import org.hibernate.annotations.SQLDeletes; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +38,8 @@ public class SQLDeletesAnnotation implements SQLDeletes, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SQLDelete[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertAnnotation.java index 976b04d2ef..0bae372b9f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertAnnotation.java @@ -7,17 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLInsert; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.CustomSqlDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLInsertAnnotation implements SQLInsert, CustomSqlDetails { @@ -51,12 +46,12 @@ public class SQLInsertAnnotation implements SQLInsert, CustomSqlDetails { /** * Used in creating annotation instances from Jandex variant */ - public SQLInsertAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.sql = extractJandexValue( annotation, HibernateAnnotations.SQL_INSERT, "sql", modelContext ); - this.callable = extractJandexValue( annotation, HibernateAnnotations.SQL_INSERT, "callable", modelContext ); - this.verify = extractJandexValue( annotation, HibernateAnnotations.SQL_INSERT, "verify", modelContext ); - this.check = extractJandexValue( annotation, HibernateAnnotations.SQL_INSERT, "check", modelContext ); - this.table = extractJandexValue( annotation, HibernateAnnotations.SQL_INSERT, "table", modelContext ); + public SQLInsertAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.sql = (String) attributeValues.get( "sql" ); + this.callable = (boolean) attributeValues.get( "callable" ); + this.verify = (Class) attributeValues.get( "verify" ); + this.check = (org.hibernate.annotations.ResultCheckStyle) attributeValues.get( "check" ); + this.table = (String) attributeValues.get( "table" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertsAnnotation.java index 05e0dfe155..8073a38b38 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLInsertsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLInsert; import org.hibernate.annotations.SQLInserts; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class SQLInsertsAnnotation implements SQLInserts, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SQLInsert[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLJoinTableRestrictionAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLJoinTableRestrictionAnnotation.java index cc375dff0b..1fe6af6f78 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLJoinTableRestrictionAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLJoinTableRestrictionAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLJoinTableRestriction; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLJoinTableRestrictionAnnotation implements SQLJoinTableRestriction { @@ -39,13 +35,10 @@ public class SQLJoinTableRestrictionAnnotation implements SQLJoinTableRestrictio /** * Used in creating annotation instances from Jandex variant */ - public SQLJoinTableRestrictionAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( - annotation, - HibernateAnnotations.SQL_JOIN_TABLE_RESTRICTION, - "value", - modelContext - ); + public SQLJoinTableRestrictionAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLOrderAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLOrderAnnotation.java index 7e73b91d12..edd8182a65 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLOrderAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLOrderAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLOrder; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLOrderAnnotation implements SQLOrder { @@ -37,8 +33,8 @@ public class SQLOrderAnnotation implements SQLOrder { /** * Used in creating annotation instances from Jandex variant */ - public SQLOrderAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SQL_ORDER, "value", modelContext ); + public SQLOrderAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLRestrictionAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLRestrictionAnnotation.java index 14e4c117da..919f1e117c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLRestrictionAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLRestrictionAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLRestriction; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLRestrictionAnnotation implements SQLRestriction { @@ -37,8 +33,8 @@ public class SQLRestrictionAnnotation implements SQLRestriction { /** * Used in creating annotation instances from Jandex variant */ - public SQLRestrictionAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SQL_RESTRICTION, "value", modelContext ); + public SQLRestrictionAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLSelectAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLSelectAnnotation.java index add5bc1ef6..4ea586d0ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLSelectAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLSelectAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLSelect; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import static org.hibernate.boot.models.HibernateAnnotations.SQL_SELECT; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -46,20 +44,10 @@ public class SQLSelectAnnotation implements SQLSelect { /** * Used in creating annotation instances from Jandex variant */ - public SQLSelectAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.sql = extractJandexValue( annotation, SQL_SELECT, "sql", modelContext ); - this.resultSetMapping = extractJandexValue( - annotation, - SQL_SELECT, - "resultSetMapping", - modelContext - ); - this.querySpaces = extractJandexValue( - annotation, - SQL_SELECT, - "querySpaces", - modelContext - ); + public SQLSelectAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.sql = (String) attributeValues.get( "sql" ); + this.resultSetMapping = (jakarta.persistence.SqlResultSetMapping) attributeValues.get( "resultSetMapping" ); + this.querySpaces = (String[]) attributeValues.get( "querySpaces" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdateAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdateAnnotation.java index 31b985efcb..e36a355f96 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdateAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdateAnnotation.java @@ -7,17 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLUpdate; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.CustomSqlDetails; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SQLUpdateAnnotation implements SQLUpdate, CustomSqlDetails { @@ -51,12 +46,12 @@ public class SQLUpdateAnnotation implements SQLUpdate, CustomSqlDetails { /** * Used in creating annotation instances from Jandex variant */ - public SQLUpdateAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.sql = extractJandexValue( annotation, HibernateAnnotations.SQL_UPDATE, "sql", modelContext ); - this.callable = extractJandexValue( annotation, HibernateAnnotations.SQL_UPDATE, "callable", modelContext ); - this.verify = extractJandexValue( annotation, HibernateAnnotations.SQL_UPDATE, "verify", modelContext ); - this.check = extractJandexValue( annotation, HibernateAnnotations.SQL_UPDATE, "check", modelContext ); - this.table = extractJandexValue( annotation, HibernateAnnotations.SQL_UPDATE, "table", modelContext ); + public SQLUpdateAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.sql = (String) attributeValues.get( "sql" ); + this.callable = (boolean) attributeValues.get( "callable" ); + this.verify = (Class) attributeValues.get( "verify" ); + this.check = (org.hibernate.annotations.ResultCheckStyle) attributeValues.get( "check" ); + this.table = (String) attributeValues.get( "table" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdatesAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdatesAnnotation.java index e8684e84cb..eed44a22a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdatesAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SQLUpdatesAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SQLUpdate; import org.hibernate.annotations.SQLUpdates; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class SQLUpdatesAnnotation implements SQLUpdates, RepeatableContainer attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SQLUpdate[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowAnnotation.java index e389df7a3d..abacefa439 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SecondaryRow; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SecondaryRowAnnotation implements SecondaryRow { @@ -44,10 +40,10 @@ public class SecondaryRowAnnotation implements SecondaryRow { /** * Used in creating annotation instances from Jandex variant */ - public SecondaryRowAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.table = extractJandexValue( annotation, HibernateAnnotations.SECONDARY_ROW, "table", modelContext ); - this.owned = extractJandexValue( annotation, HibernateAnnotations.SECONDARY_ROW, "owned", modelContext ); - this.optional = extractJandexValue( annotation, HibernateAnnotations.SECONDARY_ROW, "optional", modelContext ); + public SecondaryRowAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.table = (String) attributeValues.get( "table" ); + this.owned = (boolean) attributeValues.get( "owned" ); + this.optional = (boolean) attributeValues.get( "optional" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowsAnnotation.java index 7c0a34fedb..cc4a4092fd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryRowsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SecondaryRow; import org.hibernate.annotations.SecondaryRows; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class SecondaryRowsAnnotation implements SecondaryRows, RepeatableContain /** * Used in creating annotation instances from Jandex variant */ - public SecondaryRowsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SECONDARY_ROWS, "value", modelContext ); + public SecondaryRowsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SecondaryRow[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTableJpaAnnotation.java index 92ec25f98a..c500c373ed 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTableJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbSecondaryTableImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -16,11 +17,8 @@ import org.hibernate.boot.models.xml.internal.db.JoinColumnProcessing; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.SecondaryTable; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyOptionalString; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.collectCheckConstraints; @@ -85,27 +83,17 @@ public class SecondaryTableJpaAnnotation implements SecondaryTable, CommonTableD /** * Used in creating annotation instances from Jandex variant */ - public SecondaryTableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "name", modelContext ); - this.catalog = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "schema", modelContext ); - this.pkJoinColumns = extractJandexValue( - annotation, - JpaAnnotations.SECONDARY_TABLE, - "pkJoinColumns", - modelContext - ); - this.foreignKey = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "foreignKey", modelContext ); - this.uniqueConstraints = extractJandexValue( - annotation, - JpaAnnotations.SECONDARY_TABLE, - "uniqueConstraints", - modelContext - ); - this.indexes = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "indexes", modelContext ); - this.check = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "check", modelContext ); - this.comment = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "comment", modelContext ); - this.options = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLE, "options", modelContext ); + public SecondaryTableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.pkJoinColumns = (jakarta.persistence.PrimaryKeyJoinColumn[]) attributeValues.get( "pkJoinColumns" ); + this.foreignKey = (jakarta.persistence.ForeignKey) attributeValues.get( "foreignKey" ); + this.uniqueConstraints = (jakarta.persistence.UniqueConstraint[]) attributeValues.get( "uniqueConstraints" ); + this.indexes = (jakarta.persistence.Index[]) attributeValues.get( "indexes" ); + this.check = (jakarta.persistence.CheckConstraint[]) attributeValues.get( "check" ); + this.comment = (String) attributeValues.get( "comment" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTablesJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTablesJpaAnnotation.java index a7dab44eae..078604a109 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTablesJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SecondaryTablesJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.SecondaryTable; import jakarta.persistence.SecondaryTables; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,8 @@ public class SecondaryTablesJpaAnnotation implements SecondaryTables, Repeatable /** * Used in creating annotation instances from Jandex variant */ - public SecondaryTablesJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.SECONDARY_TABLES, "value", modelContext ); + public SecondaryTablesJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SecondaryTable[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorJpaAnnotation.java index 1918534913..9ddf6050c6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.SequenceGenerator; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SequenceGeneratorJpaAnnotation implements SequenceGenerator { @@ -57,29 +53,16 @@ public class SequenceGeneratorJpaAnnotation implements SequenceGenerator { /** * Used in creating annotation instances from Jandex variant */ - public SequenceGeneratorJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.SEQUENCE_GENERATOR, "name", modelContext ); - this.sequenceName = extractJandexValue( - annotation, - JpaAnnotations.SEQUENCE_GENERATOR, - "sequenceName", - modelContext - ); - this.catalog = extractJandexValue( annotation, JpaAnnotations.SEQUENCE_GENERATOR, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, JpaAnnotations.SEQUENCE_GENERATOR, "schema", modelContext ); - this.initialValue = extractJandexValue( - annotation, - JpaAnnotations.SEQUENCE_GENERATOR, - "initialValue", - modelContext - ); - this.allocationSize = extractJandexValue( - annotation, - JpaAnnotations.SEQUENCE_GENERATOR, - "allocationSize", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.SEQUENCE_GENERATOR, "options", modelContext ); + public SequenceGeneratorJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.sequenceName = (String) attributeValues.get( "sequenceName" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.initialValue = (int) attributeValues.get( "initialValue" ); + this.allocationSize = (int) attributeValues.get( "allocationSize" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorsJpaAnnotation.java index 8eb0f17d9b..06584adf7a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SequenceGeneratorsJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; @@ -41,8 +42,8 @@ public class SequenceGeneratorsJpaAnnotation implements SequenceGenerators, Repe /** * Used in creating annotation instances from Jandex variant */ - public SequenceGeneratorsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.SEQUENCE_GENERATORS, "value", modelContext ); + public SequenceGeneratorsJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (SequenceGenerator[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SoftDeleteAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SoftDeleteAnnotation.java index 631ca1a801..f7c1091114 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SoftDeleteAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SoftDeleteAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SoftDelete; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SoftDeleteAnnotation implements SoftDelete { @@ -48,17 +44,13 @@ public class SoftDeleteAnnotation implements SoftDelete { /** * Used in creating annotation instances from Jandex variant */ - public SoftDeleteAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.columnName = extractJandexValue( - annotation, - HibernateAnnotations.SOFT_DELETE, - "columnName", - modelContext - ); - this.strategy = extractJandexValue( annotation, HibernateAnnotations.SOFT_DELETE, "strategy", modelContext ); - this.options = extractJandexValue( annotation, HibernateAnnotations.SOFT_DELETE, "options", modelContext ); - this.comment = extractJandexValue( annotation, HibernateAnnotations.SOFT_DELETE, "comment", modelContext ); - this.converter = extractJandexValue( annotation, HibernateAnnotations.SOFT_DELETE, "converter", modelContext ); + public SoftDeleteAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.columnName = (String) attributeValues.get( "columnName" ); + this.strategy = (org.hibernate.annotations.SoftDeleteType) attributeValues.get( "strategy" ); + this.options = (String) attributeValues.get( "options" ); + this.comment = (String) attributeValues.get( "comment" ); + this.converter = (Class>) attributeValues. + get( "converter" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortComparatorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortComparatorAnnotation.java index 7ef5f10fa5..268ea959e0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortComparatorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortComparatorAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SortComparator; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SortComparatorAnnotation implements SortComparator { @@ -37,8 +33,8 @@ public class SortComparatorAnnotation implements SortComparator { /** * Used in creating annotation instances from Jandex variant */ - public SortComparatorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SORT_COMPARATOR, "value", modelContext ); + public SortComparatorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortNaturalAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortNaturalAnnotation.java index 56e5f1c774..2f9f73fb76 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortNaturalAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SortNaturalAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SortNatural; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SortNaturalAnnotation implements SortNatural { @@ -32,7 +31,7 @@ public class SortNaturalAnnotation implements SortNatural { /** * Used in creating annotation instances from Jandex variant */ - public SortNaturalAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public SortNaturalAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SourceAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SourceAnnotation.java index 763b59f0dc..691c078a2a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SourceAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SourceAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Source; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SourceAnnotation implements Source { @@ -38,8 +34,8 @@ public class SourceAnnotation implements Source { /** * Used in creating annotation instances from Jandex variant */ - public SourceAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SOURCE, "value", modelContext ); + public SourceAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.SourceType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlFragmentAliasAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlFragmentAliasAnnotation.java index 46f8aae20a..4ebdd1fdbb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlFragmentAliasAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlFragmentAliasAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.SqlFragmentAlias; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SqlFragmentAliasAnnotation implements SqlFragmentAlias { @@ -43,10 +39,10 @@ public class SqlFragmentAliasAnnotation implements SqlFragmentAlias { /** * Used in creating annotation instances from Jandex variant */ - public SqlFragmentAliasAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.alias = extractJandexValue( annotation, HibernateAnnotations.SQL_FRAGMENT_ALIAS, "alias", modelContext ); - this.table = extractJandexValue( annotation, HibernateAnnotations.SQL_FRAGMENT_ALIAS, "table", modelContext ); - this.entity = extractJandexValue( annotation, HibernateAnnotations.SQL_FRAGMENT_ALIAS, "entity", modelContext ); + public SqlFragmentAliasAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.alias = (String) attributeValues.get( "alias" ); + this.table = (String) attributeValues.get( "table" ); + this.entity = (Class) attributeValues.get( "entity" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingJpaAnnotation.java index db923d329c..c12b0aec34 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingJpaAnnotation.java @@ -7,15 +7,13 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.SqlResultSetMapping; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -48,16 +46,13 @@ public class SqlResultSetMappingJpaAnnotation implements SqlResultSetMapping { /** * Used in creating annotation instances from Jandex variant */ - public SqlResultSetMappingJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.SQL_RESULT_SET_MAPPING, "name", modelContext ); - this.entities = extractJandexValue( - annotation, - JpaAnnotations.SQL_RESULT_SET_MAPPING, - "entities", - modelContext - ); - this.classes = extractJandexValue( annotation, JpaAnnotations.SQL_RESULT_SET_MAPPING, "classes", modelContext ); - this.columns = extractJandexValue( annotation, JpaAnnotations.SQL_RESULT_SET_MAPPING, "columns", modelContext ); + public SqlResultSetMappingJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.entities = (jakarta.persistence.EntityResult[]) attributeValues.get( "entities" ); + this.classes = (jakarta.persistence.ConstructorResult[]) attributeValues.get( "classes" ); + this.columns = (jakarta.persistence.ColumnResult[]) attributeValues.get( "columns" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingsJpaAnnotation.java index 355980466a..f01c84eb43 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SqlResultSetMappingsJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.SqlResultSetMapping; import jakarta.persistence.SqlResultSetMappings; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -42,8 +40,10 @@ public class SqlResultSetMappingsJpaAnnotation /** * Used in creating annotation instances from Jandex variant */ - public SqlResultSetMappingsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.SQL_RESULT_SET_MAPPINGS, "value", modelContext ); + public SqlResultSetMappingsJpaAnnotation( + Map attributeValues, + SourceModelBuildingContext modelContext) { + this.value = (SqlResultSetMapping[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StoredProcedureParameterJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StoredProcedureParameterJpaAnnotation.java index 532f71a96d..3790d48110 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StoredProcedureParameterJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StoredProcedureParameterJpaAnnotation.java @@ -7,19 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbStoredProcedureParameterImpl; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.StoredProcedureParameter; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class StoredProcedureParameterJpaAnnotation implements StoredProcedureParameter { @@ -50,11 +46,11 @@ public class StoredProcedureParameterJpaAnnotation implements StoredProcedurePar * Used in creating annotation instances from Jandex variant */ public StoredProcedureParameterJpaAnnotation( - AnnotationInstance annotation, + Map attributeValues, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.STORED_PROCEDURE_PARAMETER, "name", modelContext ); - this.mode = extractJandexValue( annotation, JpaAnnotations.STORED_PROCEDURE_PARAMETER, "mode", modelContext ); - this.type = extractJandexValue( annotation, JpaAnnotations.STORED_PROCEDURE_PARAMETER, "type", modelContext ); + this.name = (String) attributeValues.get( "name" ); + this.mode = (jakarta.persistence.ParameterMode) attributeValues.get( "mode" ); + this.type = (Class) attributeValues.get( "type" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StructAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StructAnnotation.java index 278a2ed49d..5c2d300ef6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StructAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/StructAnnotation.java @@ -7,16 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Struct; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class StructAnnotation implements Struct { @@ -45,11 +40,11 @@ public class StructAnnotation implements Struct { /** * Used in creating annotation instances from Jandex variant */ - public StructAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.STRUCT, "name", modelContext ); - this.catalog = extractJandexValue( annotation, HibernateAnnotations.STRUCT, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, HibernateAnnotations.STRUCT, "schema", modelContext ); - this.attributes = extractJandexValue( annotation, HibernateAnnotations.STRUCT, "attributes", modelContext ); + public StructAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.attributes = (String[]) attributeValues.get( "attributes" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SubselectAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SubselectAnnotation.java index 352c5bdd4f..d511270906 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SubselectAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SubselectAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Subselect; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SubselectAnnotation implements Subselect { @@ -37,8 +33,8 @@ public class SubselectAnnotation implements Subselect { /** * Used in creating annotation instances from Jandex variant */ - public SubselectAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SUBSELECT, "value", modelContext ); + public SubselectAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SynchronizeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SynchronizeAnnotation.java index 188527cfe5..7c63dc7dd5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SynchronizeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/SynchronizeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Synchronize; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class SynchronizeAnnotation implements Synchronize { @@ -40,9 +36,9 @@ public class SynchronizeAnnotation implements Synchronize { /** * Used in creating annotation instances from Jandex variant */ - public SynchronizeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.SYNCHRONIZE, "value", modelContext ); - this.logical = extractJandexValue( annotation, HibernateAnnotations.SYNCHRONIZE, "logical", modelContext ); + public SynchronizeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (String[]) attributeValues.get( "value" ); + this.logical = (boolean) attributeValues.get( "logical" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorJpaAnnotation.java index 69d209bfb4..6bf4492ef2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorJpaAnnotation.java @@ -7,21 +7,18 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbTableGeneratorImpl; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.IndexCollector; import org.hibernate.boot.models.annotations.spi.UniqueConstraintCollector; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.internal.util.StringHelper; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.TableGenerator; import static org.hibernate.boot.models.JpaAnnotations.TABLE_GENERATOR; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.collectIndexes; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.collectUniqueConstraints; @@ -81,49 +78,19 @@ public class TableGeneratorJpaAnnotation implements TableGenerator, UniqueConstr /** * Used in creating annotation instances from Jandex variant */ - public TableGeneratorJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, TABLE_GENERATOR, "name", modelContext ); - this.table = extractJandexValue( annotation, TABLE_GENERATOR, "table", modelContext ); - this.catalog = extractJandexValue( annotation, TABLE_GENERATOR, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, TABLE_GENERATOR, "schema", modelContext ); - this.pkColumnName = extractJandexValue( - annotation, - TABLE_GENERATOR, - "pkColumnName", - modelContext - ); - this.valueColumnName = extractJandexValue( - annotation, - TABLE_GENERATOR, - "valueColumnName", - modelContext - ); - this.pkColumnValue = extractJandexValue( - annotation, - TABLE_GENERATOR, - "pkColumnValue", - modelContext - ); - this.initialValue = extractJandexValue( - annotation, - TABLE_GENERATOR, - "initialValue", - modelContext - ); - this.allocationSize = extractJandexValue( - annotation, - TABLE_GENERATOR, - "allocationSize", - modelContext - ); - this.uniqueConstraints = extractJandexValue( - annotation, - TABLE_GENERATOR, - "uniqueConstraints", - modelContext - ); - this.indexes = extractJandexValue( annotation, TABLE_GENERATOR, "indexes", modelContext ); - this.options = extractJandexValue( annotation, TABLE_GENERATOR, "options", modelContext ); + public TableGeneratorJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.table = (String) attributeValues.get( "table" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.pkColumnName = (String) attributeValues.get( "pkColumnName" ); + this.valueColumnName = (String) attributeValues.get( "valueColumnName" ); + this.pkColumnValue = (String) attributeValues.get( "pkColumnValue" ); + this.initialValue = (int) attributeValues.get( "initialValue" ); + this.allocationSize = (int) attributeValues.get( "allocationSize" ); + this.uniqueConstraints = (jakarta.persistence.UniqueConstraint[]) attributeValues.get( "uniqueConstraints" ); + this.indexes = (jakarta.persistence.Index[]) attributeValues.get( "indexes" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorsJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorsJpaAnnotation.java index d675d59375..9ae3e3d343 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorsJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableGeneratorsJpaAnnotation.java @@ -7,17 +7,15 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.TableGenerator; import jakarta.persistence.TableGenerators; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,8 +39,8 @@ public class TableGeneratorsJpaAnnotation implements TableGenerators, Repeatable /** * Used in creating annotation instances from Jandex variant */ - public TableGeneratorsJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.TABLE_GENERATORS, "value", modelContext ); + public TableGeneratorsJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (TableGenerator[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableJpaAnnotation.java index 8efb17cc22..8cd13646ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TableJpaAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.jaxb.mapping.spi.JaxbTableImpl; import org.hibernate.boot.models.JpaAnnotations; @@ -14,11 +15,8 @@ import org.hibernate.boot.models.annotations.spi.CommonTableDetails; import org.hibernate.boot.models.xml.spi.XmlDocumentContext; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Table; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyCatalog; import static org.hibernate.boot.models.xml.internal.XmlAnnotationHelper.applyOptionalString; @@ -70,20 +68,15 @@ public class TableJpaAnnotation implements Table, CommonTableDetails { /** * Used in creating annotation instances from Jandex variant */ - public TableJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.TABLE, "name", modelContext ); - this.catalog = extractJandexValue( annotation, JpaAnnotations.TABLE, "catalog", modelContext ); - this.schema = extractJandexValue( annotation, JpaAnnotations.TABLE, "schema", modelContext ); - this.uniqueConstraints = extractJandexValue( - annotation, - JpaAnnotations.TABLE, - "uniqueConstraints", - modelContext - ); - this.indexes = extractJandexValue( annotation, JpaAnnotations.TABLE, "indexes", modelContext ); - this.check = extractJandexValue( annotation, JpaAnnotations.TABLE, "check", modelContext ); - this.comment = extractJandexValue( annotation, JpaAnnotations.TABLE, "comment", modelContext ); - this.options = extractJandexValue( annotation, JpaAnnotations.TABLE, "options", modelContext ); + public TableJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.catalog = (String) attributeValues.get( "catalog" ); + this.schema = (String) attributeValues.get( "schema" ); + this.uniqueConstraints = (jakarta.persistence.UniqueConstraint[]) attributeValues.get( "uniqueConstraints" ); + this.indexes = (jakarta.persistence.Index[]) attributeValues.get( "indexes" ); + this.check = (jakarta.persistence.CheckConstraint[]) attributeValues.get( "check" ); + this.comment = (String) attributeValues.get( "comment" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetLegacyAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetLegacyAnnotation.java index 68d8d1b863..6dba8d140c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetLegacyAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetLegacyAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Target; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TargetLegacyAnnotation implements Target { @@ -37,8 +33,8 @@ public class TargetLegacyAnnotation implements Target { /** * Used in creating annotation instances from Jandex variant */ - public TargetLegacyAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.TARGET_LEGACY, "value", modelContext ); + public TargetLegacyAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetXmlAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetXmlAnnotation.java index c40c52db72..7a0cfc7743 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetXmlAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TargetXmlAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.boot.internal.Target; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TargetXmlAnnotation implements Target { @@ -25,7 +24,7 @@ public class TargetXmlAnnotation implements Target { throw new UnsupportedOperationException( "Should only ever be sourced from XML" ); } - public TargetXmlAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public TargetXmlAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { throw new UnsupportedOperationException( "Should only ever be sourced from XML" ); } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TemporalJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TemporalJpaAnnotation.java index 135b737611..78be55264d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TemporalJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TemporalJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Temporal; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TemporalJpaAnnotation implements Temporal { @@ -38,8 +34,8 @@ public class TemporalJpaAnnotation implements Temporal { /** * Used in creating annotation instances from Jandex variant */ - public TemporalJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, JpaAnnotations.TEMPORAL, "value", modelContext ); + public TemporalJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (jakarta.persistence.TemporalType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TenantIdAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TenantIdAnnotation.java index 03d0724193..5557362749 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TenantIdAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TenantIdAnnotation.java @@ -7,12 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TenantId; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TenantIdAnnotation implements TenantId { @@ -32,7 +31,7 @@ public class TenantIdAnnotation implements TenantId { /** * Used in creating annotation instances from Jandex variant */ - public TenantIdAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public TenantIdAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneColumnAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneColumnAnnotation.java index 618303e066..24fb4550b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneColumnAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneColumnAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TimeZoneColumn; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TimeZoneColumnAnnotation implements TimeZoneColumn { @@ -56,29 +52,14 @@ public class TimeZoneColumnAnnotation implements TimeZoneColumn { /** * Used in creating annotation instances from Jandex variant */ - public TimeZoneColumnAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, HibernateAnnotations.TIME_ZONE_COLUMN, "name", modelContext ); - this.insertable = extractJandexValue( - annotation, - HibernateAnnotations.TIME_ZONE_COLUMN, - "insertable", - modelContext - ); - this.updatable = extractJandexValue( - annotation, - HibernateAnnotations.TIME_ZONE_COLUMN, - "updatable", - modelContext - ); - this.columnDefinition = extractJandexValue( - annotation, - HibernateAnnotations.TIME_ZONE_COLUMN, - "columnDefinition", - modelContext - ); - this.table = extractJandexValue( annotation, HibernateAnnotations.TIME_ZONE_COLUMN, "table", modelContext ); - this.options = extractJandexValue( annotation, HibernateAnnotations.TIME_ZONE_COLUMN, "options", modelContext ); - this.comment = extractJandexValue( annotation, HibernateAnnotations.TIME_ZONE_COLUMN, "comment", modelContext ); + public TimeZoneColumnAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.insertable = (boolean) attributeValues.get( "insertable" ); + this.updatable = (boolean) attributeValues.get( "updatable" ); + this.columnDefinition = (String) attributeValues.get( "columnDefinition" ); + this.table = (String) attributeValues.get( "table" ); + this.options = (String) attributeValues.get( "options" ); + this.comment = (String) attributeValues.get( "comment" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneStorageAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneStorageAnnotation.java index 642e98cd53..34e9f34430 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneStorageAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TimeZoneStorageAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TimeZoneStorage; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TimeZoneStorageAnnotation implements TimeZoneStorage { @@ -38,8 +34,8 @@ public class TimeZoneStorageAnnotation implements TimeZoneStorage { /** * Used in creating annotation instances from Jandex variant */ - public TimeZoneStorageAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.TIME_ZONE_STORAGE, "value", modelContext ); + public TimeZoneStorageAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (org.hibernate.annotations.TimeZoneStorageType) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TransientJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TransientJpaAnnotation.java index 4c7233f267..111055a53b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TransientJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TransientJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Transient; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class TransientJpaAnnotation implements Transient { /** * Used in creating annotation instances from Jandex variant */ - public TransientJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public TransientJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeAnnotation.java index bf824b98c1..e42e1ad8b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeAnnotation.java @@ -7,14 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.Type; import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -41,9 +39,9 @@ public class TypeAnnotation implements Type { /** * Used in creating annotation instances from Jandex variant */ - public TypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.TYPE, "value", modelContext ); - this.parameters = extractJandexValue( annotation, HibernateAnnotations.TYPE, "parameters", modelContext ); + public TypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (Class>) attributeValues.get( "value" ); + this.parameters = (org.hibernate.annotations.Parameter[]) attributeValues.get( "parameters" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeBinderTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeBinderTypeAnnotation.java index 1deddc39ab..4459b9e995 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeBinderTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeBinderTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TypeBinderType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TypeBinderTypeAnnotation implements TypeBinderType { @@ -37,8 +33,8 @@ public class TypeBinderTypeAnnotation implements TypeBinderType { /** * Used in creating annotation instances from Jandex variant */ - public TypeBinderTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.binder = extractJandexValue( annotation, HibernateAnnotations.TYPE_BINDER_TYPE, "binder", modelContext ); + public TypeBinderTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.binder = (Class>) attributeValues.get( "binder" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationAnnotation.java index 877c352bb0..d6df5a712c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TypeRegistration; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class TypeRegistrationAnnotation implements TypeRegistration { @@ -39,19 +35,9 @@ public class TypeRegistrationAnnotation implements TypeRegistration { /** * Used in creating annotation instances from Jandex variant */ - public TypeRegistrationAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.basicClass = extractJandexValue( - annotation, - HibernateAnnotations.TYPE_REGISTRATION, - "basicClass", - modelContext - ); - this.userType = extractJandexValue( - annotation, - HibernateAnnotations.TYPE_REGISTRATION, - "userType", - modelContext - ); + public TypeRegistrationAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.basicClass = (Class) attributeValues.get( "basicClass" ); + this.userType = (Class>) attributeValues.get( "userType" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationsAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationsAnnotation.java index 81a01bb1b0..c4743ce02f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationsAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/TypeRegistrationsAnnotation.java @@ -7,6 +7,7 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.TypeRegistration; import org.hibernate.annotations.TypeRegistrations; @@ -14,9 +15,6 @@ import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.boot.models.annotations.spi.RepeatableContainer; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -40,8 +38,8 @@ public class TypeRegistrationsAnnotation implements TypeRegistrations, Repeatabl /** * Used in creating annotation instances from Jandex variant */ - public TypeRegistrationsAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.value = extractJandexValue( annotation, HibernateAnnotations.TYPE_REGISTRATIONS, "value", modelContext ); + public TypeRegistrationsAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.value = (TypeRegistration[]) attributeValues.get( "value" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UniqueConstraintJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UniqueConstraintJpaAnnotation.java index f9e1e9cacb..0e7bbfe6a1 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UniqueConstraintJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UniqueConstraintJpaAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; -import org.hibernate.boot.models.JpaAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.UniqueConstraint; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class UniqueConstraintJpaAnnotation implements UniqueConstraint { @@ -44,15 +40,10 @@ public class UniqueConstraintJpaAnnotation implements UniqueConstraint { /** * Used in creating annotation instances from Jandex variant */ - public UniqueConstraintJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.name = extractJandexValue( annotation, JpaAnnotations.UNIQUE_CONSTRAINT, "name", modelContext ); - this.columnNames = extractJandexValue( - annotation, - JpaAnnotations.UNIQUE_CONSTRAINT, - "columnNames", - modelContext - ); - this.options = extractJandexValue( annotation, JpaAnnotations.UNIQUE_CONSTRAINT, "options", modelContext ); + public UniqueConstraintJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.name = (String) attributeValues.get( "name" ); + this.columnNames = (String[]) attributeValues.get( "columnNames" ); + this.options = (String) attributeValues.get( "options" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UpdateTimestampAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UpdateTimestampAnnotation.java index 99732afddd..015c3ccef5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UpdateTimestampAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UpdateTimestampAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.UpdateTimestamp; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class UpdateTimestampAnnotation implements UpdateTimestamp { @@ -38,8 +34,8 @@ public class UpdateTimestampAnnotation implements UpdateTimestamp { /** * Used in creating annotation instances from Jandex variant */ - public UpdateTimestampAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.source = extractJandexValue( annotation, HibernateAnnotations.UPDATE_TIMESTAMP, "source", modelContext ); + public UpdateTimestampAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.source = (org.hibernate.annotations.SourceType) attributeValues.get( "source" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UuidGeneratorAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UuidGeneratorAnnotation.java index dcd7b51e5e..66a76843b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UuidGeneratorAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/UuidGeneratorAnnotation.java @@ -7,16 +7,12 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.UuidGenerator; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.id.uuid.UuidValueGenerator; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class UuidGeneratorAnnotation implements UuidGenerator { @@ -42,8 +38,9 @@ public class UuidGeneratorAnnotation implements UuidGenerator { /** * Used in creating annotation instances from Jandex variant */ - public UuidGeneratorAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.style = extractJandexValue( annotation, HibernateAnnotations.UUID_GENERATOR, "style", modelContext ); + public UuidGeneratorAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.style = (Style) attributeValues.get( "style" ); + this.algorithm = (Class) attributeValues.get( "algorithm" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ValueGenerationTypeAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ValueGenerationTypeAnnotation.java index 9f8a028f5f..988b6f18e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ValueGenerationTypeAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ValueGenerationTypeAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.ValueGenerationType; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ValueGenerationTypeAnnotation implements ValueGenerationType { @@ -37,13 +33,8 @@ public class ValueGenerationTypeAnnotation implements ValueGenerationType { /** * Used in creating annotation instances from Jandex variant */ - public ValueGenerationTypeAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.generatedBy = extractJandexValue( - annotation, - HibernateAnnotations.VALUE_GENERATION_TYPE, - "generatedBy", - modelContext - ); + public ValueGenerationTypeAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.generatedBy = (Class) attributeValues.get( "generatedBy" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/VersionJpaAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/VersionJpaAnnotation.java index c71e81889d..d3a95bcd93 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/VersionJpaAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/VersionJpaAnnotation.java @@ -7,11 +7,10 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - import jakarta.persistence.Version; @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @@ -32,7 +31,7 @@ public class VersionJpaAnnotation implements Version { /** * Used in creating annotation instances from Jandex variant */ - public VersionJpaAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { + public VersionJpaAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ViewAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ViewAnnotation.java index ba1146d5ea..5fe86985b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ViewAnnotation.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/ViewAnnotation.java @@ -7,15 +7,11 @@ package org.hibernate.boot.models.annotations.internal; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.View; -import org.hibernate.boot.models.HibernateAnnotations; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - @SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) @jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") public class ViewAnnotation implements View { @@ -38,8 +34,8 @@ public class ViewAnnotation implements View { /** * Used in creating annotation instances from Jandex variant */ - public ViewAnnotation(AnnotationInstance annotation, SourceModelBuildingContext modelContext) { - this.query = extractJandexValue( annotation, HibernateAnnotations.VIEW, "query", modelContext ); + public ViewAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { + this.query = (String) attributeValues.get( "query" ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/spi/AbstractOverrider.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/spi/AbstractOverrider.java index 941e5cdfce..afd4efa3f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/spi/AbstractOverrider.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/spi/AbstractOverrider.java @@ -7,18 +7,14 @@ package org.hibernate.boot.models.annotations.spi; import java.lang.annotation.Annotation; +import java.util.Map; import org.hibernate.annotations.DialectOverride; -import org.hibernate.boot.models.DialectOverrideAnnotations; import org.hibernate.dialect.DatabaseVersion; import org.hibernate.dialect.Dialect; import org.hibernate.models.spi.AnnotationDescriptor; import org.hibernate.models.spi.SourceModelBuildingContext; -import org.jboss.jandex.AnnotationInstance; - -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJandexValue; - /** * Base support for {@linkplain DialectOverrider} annotations * @@ -33,12 +29,12 @@ public abstract class AbstractOverrider implements Dialect } public AbstractOverrider( - AnnotationInstance annotation, + Map attributeValues, AnnotationDescriptor descriptor, SourceModelBuildingContext modelContext) { - dialect( extractJandexValue( annotation, descriptor, "dialect", modelContext ) ); - before( extractJandexValue( annotation, descriptor, "before", modelContext ) ); - sameOrAfter( extractJandexValue( annotation, descriptor, "sameOrAfter", modelContext ) ); + dialect( (Class) attributeValues.get( "dialect" ) ); + before( (DialectOverride.Version) attributeValues.get( "before" ) ); + sameOrAfter( (DialectOverride.Version) attributeValues.get( "sameOrAfter" ) ); } @Override