@@ -95,16 +95,16 @@ private void collectAttributeConversionInfo(Map<String, AttributeConversionInfo>
9595 // collect superclass info first
9696 collectAttributeConversionInfo ( infoMap , entityClassDetails .getSuperClass () );
9797
98- final var sourceModelContext = getSourceModelContext ();
98+ final var modelContext = getSourceModelContext ();
9999 final boolean canContainConvert =
100- entityClassDetails .hasAnnotationUsage ( jakarta .persistence .Entity .class , sourceModelContext )
101- || entityClassDetails .hasAnnotationUsage ( jakarta .persistence .MappedSuperclass .class , sourceModelContext )
102- || entityClassDetails .hasAnnotationUsage ( jakarta .persistence .Embeddable .class , sourceModelContext );
100+ entityClassDetails .hasAnnotationUsage ( jakarta .persistence .Entity .class , modelContext )
101+ || entityClassDetails .hasAnnotationUsage ( jakarta .persistence .MappedSuperclass .class , modelContext )
102+ || entityClassDetails .hasAnnotationUsage ( jakarta .persistence .Embeddable .class , modelContext );
103103 if ( ! canContainConvert ) {
104104 return ;
105105 }
106106
107- entityClassDetails .forEachAnnotationUsage ( Convert .class , sourceModelContext , (usage ) -> {
107+ entityClassDetails .forEachAnnotationUsage ( Convert .class , modelContext , (usage ) -> {
108108 final var info = new AttributeConversionInfo ( usage , entityClassDetails );
109109 if ( isEmpty ( info .getAttributeName () ) ) {
110110 throw new IllegalStateException ( "@Convert placed on @Entity/@MappedSuperclass must define attributeName" );
@@ -120,9 +120,11 @@ public void startingProperty(MemberDetails property) {
120120 if ( !attributeConversionInfoMap .containsKey ( propertyName ) ) {
121121 property .forEachAnnotationUsage ( Convert .class , getSourceModelContext (), (usage ) -> {
122122 final var info = new AttributeConversionInfo ( usage , property );
123- final String path = isEmpty ( info .getAttributeName () )
124- ? propertyName
125- : propertyName + '.' + info .getAttributeName ();
123+ final String infoAttributeName = info .getAttributeName ();
124+ final String path =
125+ isEmpty ( infoAttributeName )
126+ ? propertyName
127+ : propertyName + '.' + infoAttributeName ;
126128 attributeConversionInfoMap .put ( path , info );
127129 } );
128130 }
@@ -166,7 +168,7 @@ public void addProperty(Property prop, MemberDetails memberDetails, ClassDetails
166168 //TODO handle quote and non quote table comparison
167169 final String tableName = prop .getValue ().getTable ().getName ();
168170 if ( getJoinsPerRealTableName ().containsKey ( tableName ) ) {
169- final Join join = getJoinsPerRealTableName ().get ( tableName );
171+ final var join = getJoinsPerRealTableName ().get ( tableName );
170172 addPropertyToJoin ( prop , memberDetails , declaringClass , join );
171173 }
172174 else {
@@ -180,14 +182,14 @@ public void addProperty(Property prop, MemberDetails memberDetails, ClassDetails
180182
181183 @ Override
182184 public Join addJoin (JoinTable joinTableAnn , boolean noDelayInPkColumnCreation ) {
183- final Join join = entityBinder .addJoinTable ( joinTableAnn , this , noDelayInPkColumnCreation );
185+ final var join = entityBinder .addJoinTable ( joinTableAnn , this , noDelayInPkColumnCreation );
184186 joins = entityBinder .getSecondaryTables ();
185187 return join ;
186188 }
187189
188190 @ Override
189191 public Join addJoin (JoinTable joinTable , Table table , boolean noDelayInPkColumnCreation ) {
190- final Join join = entityBinder .createJoin (
192+ final var join = entityBinder .createJoin (
191193 this ,
192194 noDelayInPkColumnCreation ,
193195 false ,
@@ -289,10 +291,10 @@ static void prepareActualProperty(
289291 }
290292
291293 // If the property depends on a type variable, we have to copy it and the Value
292- final Property actualProperty = property .copy ();
294+ final var actualProperty = property .copy ();
293295 actualProperty .setGeneric ( true );
294296 actualProperty .setReturnedClassName ( memberDetails .getType ().getName () );
295- final Value value = actualProperty .getValue ().copy ();
297+ final var value = actualProperty .getValue ().copy ();
296298 if ( value instanceof Collection collection ) {
297299 if ( !allowCollections ) {
298300 throw new AssertionFailure ( "Collections are not allowed as identifier properties" );
@@ -301,13 +303,13 @@ static void prepareActualProperty(
301303// collection.setOwner( null );
302304 collection .setRole ( memberDetails .getDeclaringType ().getName () + "." + property .getName () );
303305 // To copy the element and key values, we need to defer setting the type name until the CollectionBinder ran
304- final Value originalValue = property .getValue ();
306+ final var originalValue = property .getValue ();
305307 context .getMetadataCollector ().addSecondPass (
306308 new SecondPass () {
307309 @ Override
308310 public void doSecondPass (Map <String , PersistentClass > persistentClasses ) {
309311 final var initializedCollection = (Collection ) originalValue ;
310- final Value element = initializedCollection .getElement ().copy ();
312+ final var element = initializedCollection .getElement ().copy ();
311313 setTypeName ( element , memberDetails .getElementType ().getName () );
312314 if ( initializedCollection instanceof IndexedCollection indexedCollection ) {
313315 final Value index = indexedCollection .getIndex ().copy ();
0 commit comments