-
Notifications
You must be signed in to change notification settings - Fork 683
Add support for AOT Repositories #3265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
mp911de
pushed a commit
that referenced
this issue
Apr 14, 2025
…gments in BeanDefinition AOT code. We now provide infrastructure to generate AOT repository method code that implements Query method behavior. No longer use spring.factories but write some custom bean config code so that one of the properties can provide an instance of the generated repository. Closes #3265
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
Introduce RepositoryFragmentsFunction and a collection of functions to provide a well-formed contract. Use RepositoryMetadata from initialized RepositoryFactoryBean. See #3265
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
Fix fragment method order lookup. Lazify ProjectionFactory retrieval on DefaultFragmentCreationContext. See #3265
mp911de
pushed a commit
that referenced
this issue
Apr 14, 2025
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
Introduce Environment to AotContext. Move JSON classes to aot/generate package. Refine exposed API. See #3265
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
Introduce Environment to AotContext. Move JSON classes to aot/generate package. Refine exposed API. See #3265
mp911de
added a commit
that referenced
this issue
Apr 14, 2025
Introduce Environment to AotContext. Move JSON classes to aot/generate package. Refine exposed API. See #3265
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
…gments in BeanDefinition AOT code. We now provide infrastructure to generate AOT repository method code that implements Query method behavior. No longer use spring.factories but write some custom bean config code so that one of the properties can provide an instance of the generated repository. Closes #3265
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
Introduce RepositoryFragmentsFunction and a collection of functions to provide a well-formed contract. Use RepositoryMetadata from initialized RepositoryFactoryBean. See #3265
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
Fix fragment method order lookup. Lazify ProjectionFactory retrieval on DefaultFragmentCreationContext. See #3265
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
schauder
pushed a commit
that referenced
this issue
Apr 16, 2025
Introduce Environment to AotContext. Move JSON classes to aot/generate package. Refine exposed API. See #3265
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
It makes sense to leverage AOT processing to pre-process repository definitions and to prepare repository query methods for improved query execution so that we don't need to use runtime query generation and query derivation.
During AOT processing, we have all necessary details to determine the actual query, extract value expressions and to generate code that runs the query.
We could generate something along the lines of:
for a repository:
AOT processing binds assumptions made during build-time processing into code so that repositories are assigned statically to a Spring Data module (i.e., Spring Data repositories are generally implemented by the availability of a store module if no store-specific annotations or repository declarations are being used).
Customizing bean registration code fragments allows mounting the generated AOT fragment to the final repository.
A major benefit is that all query processing and validation happens during build time and we no longer need to parse and derive queries provided through an AOT repository.
In certain arrangements, AOT repository query methods can become overly complex (e.g. JPA stored procedures, dynamic projections) in which it doesn't make sense to generate such a method.
Related, since we have all query information at hand, we could generate a repository JSON metadata file containing query details for later usage.
For the time being, we focus on imperative repository query methods. Reactive ones will be discussed at a later stage.
The text was updated successfully, but these errors were encountered: