@@ -772,29 +772,13 @@ private void prepareCollectionElement(
772
772
private void prepareBasicAttribute (
773
773
String declaringClassName ,
774
774
MemberDetails attributeMember ,
775
- TypeDetails attributeTypeDetails ) {
776
- final Class <Object > javaTypeClass = attributeTypeDetails .determineRawClass ().toJavaClass ();
777
-
775
+ TypeDetails attributeType ) {
776
+ final Class <Object > javaTypeClass = attributeType .determineRawClass ().toJavaClass ();
778
777
implicitJavaTypeAccess = ( typeConfiguration -> {
779
- final java .lang .reflect .Type attributeType = attributeTypeDetails .determineRawClass ().toJavaClass ();
780
- if ( attributeTypeDetails instanceof ParameterizedTypeDetails ) {
781
- final List <TypeDetails > arguments = attributeTypeDetails .asParameterizedType ().getArguments ();
782
- final int argumentsSize = arguments .size ();
783
- final java .lang .reflect .Type [] argumentTypes = new java .lang .reflect .Type [argumentsSize ];
784
- for ( int i = 0 ; i < argumentsSize ; i ++ ) {
785
- argumentTypes [i ] = arguments .get ( i ).determineRawClass ().toJavaClass ();
786
- }
787
- final TypeDetails owner = attributeTypeDetails .asParameterizedType ().getOwner ();
788
- final java .lang .reflect .Type ownerType ;
789
- if ( owner != null ) {
790
- ownerType = owner .determineRawClass ().toJavaClass ();
791
- }
792
- else {
793
- ownerType = null ;
794
- }
795
- return new ParameterizedTypeImpl ( attributeType , argumentTypes , ownerType );
778
+ if ( attributeType .getTypeKind () == TypeDetails .Kind .PARAMETERIZED_TYPE ) {
779
+ return ParameterizedTypeImpl .from ( attributeType .asParameterizedType () );
796
780
}
797
- return attributeType ;
781
+ return attributeType . determineRawClass (). toJavaClass () ;
798
782
} );
799
783
800
784
//noinspection deprecation
@@ -817,7 +801,7 @@ private void prepareBasicAttribute(
817
801
final AnnotationUsage <Enumerated > enumeratedAnn = attributeMember .getAnnotationUsage ( Enumerated .class );
818
802
if ( enumeratedAnn != null ) {
819
803
this .enumType = enumeratedAnn .getEnum ( "value" );
820
- if ( canUseEnumerated ( attributeTypeDetails , javaTypeClass ) ) {
804
+ if ( canUseEnumerated ( attributeType , javaTypeClass ) ) {
821
805
if ( this .enumType == null ) {
822
806
throw new IllegalStateException (
823
807
"jakarta.persistence.EnumType was null on @jakarta.persistence.Enumerated " +
@@ -831,7 +815,7 @@ private void prepareBasicAttribute(
831
815
"Property '%s.%s' is annotated '@Enumerated' but its type '%s' is not an enum" ,
832
816
declaringClassName ,
833
817
attributeMember .getName (),
834
- attributeTypeDetails .getName ()
818
+ attributeType .getName ()
835
819
)
836
820
);
837
821
}
0 commit comments