Skip to content

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jun 30, 2025

We now pre-initialize ClassGeneratingPropertyAccessorFactory and ClassGeneratingEntityInstantiator infrastructure to generate bytecode for their respective classes so that we include the generated code for the target AOT package. Also, we check for presence of these types to conditionally load generated classes if these are on the classpath.

This change required a stable class name therefore, we're hashing the fully-qualified class name and have aligned the class name from _Accessor to __Accessor (two underscores instead of one, same for Instantiator).

Closes #2595

@mp911de mp911de added type: enhancement A general enhancement theme: aot An issue related to Ahead-Of-Time processing labels Jun 30, 2025
@mp911de mp911de force-pushed the main branch 2 times, most recently from 646e077 to 6ac5cf8 Compare August 18, 2025 07:12
mp911de and others added 4 commits September 4, 2025 11:18
…ityInstantiator classes.

We now pre-initialize ClassGeneratingPropertyAccessorFactory and ClassGeneratingEntityInstantiator infrastructure to generate bytecode for their respective classes so that we include the generated code for the target AOT package. Also, we check for presence of these types to conditionally load generated classes if these are on the classpath.

This change required a stable class name therefore, we're hashing the fully-qualified class name and have aligned the class name from _Accessor to __Accessor (two underscores instead of one, same for Instantiator).
Update tests and add convenience API for registering configurations required to interact with certain types.
Move off TypeReference for known and loaded classes for easier handling. Introduce configuration for enabled and include/exclude filters. Refactor configuration to functional style.

# Conflicts:
#	src/main/java/org/springframework/data/aot/AotContext.java
#	src/main/java/org/springframework/data/aot/AotMappingContext.java
#	src/main/java/org/springframework/data/aot/DefaultAotContext.java
#	src/main/java/org/springframework/data/aot/ManagedTypesBeanRegistrationAotProcessor.java
#	src/main/java/org/springframework/data/repository/config/RepositoryRegistrationAotContribution.java
#	src/main/java/org/springframework/data/repository/config/RepositoryRegistrationAotProcessor.java
#	src/test/java/org/springframework/data/aot/AotContextUnitTests.java
@christophstrobl christophstrobl force-pushed the issue/2595 branch 2 times, most recently from a313db7 to 35a0fed Compare September 4, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-Of-Time processing type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include generated property accessors and entity instantiator bytecode in AOT classes
2 participants