Commit Graph

1302 Commits

Author SHA1 Message Date
Mark Paluch
0e57ea8872 Polishing.
Add reactive Query by Example and reactive/imperative Querydsl type hints.

See #2717
Original pull request: #2720
2022-10-19 11:44:58 +02:00
Christoph Strobl
c2293efb02 Add missing reflection hints.
Allow Kotlin to resolve everything it needs.

Closes #2717
Original pull request: #2720
2022-10-19 11:44:58 +02:00
Oliver Drotbohm
39e79a144e Consistently apply method ordering in DefaultProjectionInformation.
Fixes #2718.
2022-10-17 14:31:51 +02:00
Christoph Strobl
9e157dcf8f Polishing.
Update exception messages, align method names, extract methods
Original Pull Request: #2488
2022-10-12 14:40:19 +02:00
Mark Paluch
70cda7949d Consider component names for custom implementation and fragment bean registration.
We now consider the the actual repository & fragment bean name when checking for existing bean definitions of default custom implementation beans. Previously, we used the repository interface name without considering the repository bean name.

Closes #2487.
Original Pull Request: #2488
2022-10-12 14:39:30 +02:00
Mark Paluch
103d41f7f4 Resolve package cycle between repository and aot packages.
Closes #2707
2022-10-11 11:44:45 +02:00
Mark Paluch
0fe04e37f8 Polishing.
Refine control flow.

See #2704
Original pull request: #2705.
2022-10-10 13:47:37 +02:00
Christoph Strobl
529f88cf4c Use explicit type declarations for generated code.
See #2704
Original pull request: #2705.
2022-10-10 13:47:32 +02:00
Christoph Strobl
1fde452ab9 Fix AOT code generation for managed types.
Closes #2704
Original pull request: #2705.
2022-10-10 13:47:12 +02:00
Mark Paluch
b55f098b43 Remove references to ClassTypeInformation from TypeInformation.
Closes #2703
2022-10-06 16:20:22 +02:00
Jens Schauder
db34b52b89 Remove non Javadoc comments.
Closes #2699
2022-10-05 15:39:44 +02:00
Christoph Strobl
c5e95c251b Follow API changes in Spring Framework.
Closes: #2698
See: spring-projects/spring-data-build#1809
2022-10-05 11:06:59 +02:00
Christoph Strobl
9e9ddbf334 Use BindingReflectionHintsRegistrar to add reflection hints on types.
Closes: #2683
Original pull request: #2684.
2022-10-05 09:02:31 +02:00
Mark Paluch
9c993e22f5 Polishing.
Reformat code and reorder methods according to visibility. Reduce type and method visibility where applicable.

See #2680
Original pull request: #2682.
2022-10-04 15:46:14 +02:00
Christoph Strobl
e7cc9a6104 Generate custom bean initialization code for types exposed via ManagedTypes during AOT.
We now replace ManagedTypes bean definitions with generated code that contain the discovered types to avoid class path scaning.

Closes: #2680
Original pull request: #2682.
2022-10-04 15:46:14 +02:00
Mark Paluch
6a0a404ef2 Fall back to canonical constructor in constructor resolution when using Java Records.
We now fall back to the canonical constructor of records when we cannot disambiguate which constructor to use.

Also, reflect the Kotlin persistence creator mechanism.

Closes #2625
Original pull request: #2694.
2022-10-04 15:05:15 +02:00
Jens Schauder
e003edccc3 Improve documentation of SpelQueryContext.
Close #2693
2022-09-30 13:03:10 +02:00
Mark Paluch
cdcd21a064 Allow functional mapping of Range and Boundary.
We now support functional mapping of Range values by accepting a mapping function.

Closes #2692
2022-09-26 14:12:24 +02:00
Christoph Strobl
f157eff53c Remove usage of RuntimeHintsUtils & SynthesizedAnnotation.
Closes: #2685
2022-09-06 17:48:36 +02:00
Mark Paluch
9e94e110e4 Fix argument conversion in QuerydslPredicateBuilder.
We now consider the correct argument type instead of checking assignability of the actual property type against the input value.

Closes: #2649
Original Pull Request: #2650
2022-08-30 15:50:34 +02:00
Mark Paluch
a73b0d9936 Improve Pageable Javadoc.
Closes #2679
2022-08-23 10:34:32 +02:00
Mark Paluch
02ec7ed19d Polishing.
Update Kotlin, Reactive and List repository variant documentation.

See #2651
Original pull request: #2673.
2022-08-05 10:49:53 +02:00
Jens Schauder
7ff171fa1d Clarify behaviour of when save or delete operations result in a NOOP.
Behaviour of implementing modules need to adapt to the new clarification.

Closes #2651
Original pull request #2673
2022-08-05 10:49:46 +02:00
MINSOO, NAM
e9852fcdc7 Change initialCapacity in AnnotationAuditingMetadata to match the number of data being added.
As support for Joda Time has been removed from the PR below, the amount of data added has been reduced. So I change the initialCapacity of List from 5 to 3.

Closes #2668
2022-08-05 09:12:12 +02:00
Mark Paluch
42dadd89b4 Use CompletableFuture instead of deprecated ListenableFuture.
Closes #2669
2022-07-29 14:33:11 +02:00
Mark Paluch
7e1712a5de Refine @PageableDefault and @SortDefault annotations.
We now use MergedAnnotations to evaluate annotation attributes and to use aliasing across attributes. Also, SortDefault is not repeatable.

Closes #2657
2022-07-27 09:46:39 +02:00
Christoph Strobl
74e52612bf Use ManagedType BeanDefinition for AOT processing when possible.
We now try to read the types directly from the bean definition arguments first, before attempting to resolve the actual bean instance.
If resolving the bean fails, we currently only log an info message. This arrangement needs to be revisited.

See: #2593
2022-07-13 12:18:18 +02:00
Christoph Strobl
0905c77e5f Add factory method to Reactive-/AuditingHandler.
By providing a factory method that accepts the MappingContext we can avoid the creation of additional support beans during the configuration phase for store modules implementing auditing.

See: #2593
2022-07-11 12:14:38 +02:00
Christoph Strobl
fb07ad9b2e Add factory method to Reactive-/IsNewAwareAuditingHandler.
By providing a factory method that accepts the MappingContext we can avoid the creation of additional support beans during the configuration phase for store modules implementing auditing.

See: #2593
2022-07-08 08:32:27 +02:00
Mark Paluch
9c3696d335 Polishing.
Improve factory methods. Integrate auditing hints in AuditingBeanRegistrationAotProcessor. Reduce visibility, improve naming.

Original Pull Request: #2624
2022-07-04 14:22:08 +02:00
John Blum
7aafe577e2 Simplify logic in SpringDataBeanFactoryInitializationAotProcessor.
Original Pull Request: #2624
2022-07-04 14:22:08 +02:00
Mark Paluch
2d16692f51 Use constant fields for Reactive Wrapper Converters guards.
Enables reachability analysis. Previously, the presence checks were using method invocations and the AOT processing isn't following the methods.

Original Pull Request: #2624
2022-07-04 14:22:07 +02:00
Mark Paluch
e71f7c2bd6 Simplify field and method filter creation.
Update javadoc and reformat aot.factories.

Original Pull Request: #2624
2022-07-04 14:22:07 +02:00
Christoph Strobl
423edd21ea Use BeanRegistrationAotProcessor to provide hints for auditing.
This avoids having to touch modules to add something like ImportRuntimeHints(AuditingHints.ReactiveAuditingRuntimeHints.class) to the enabled auditing annotations.

Original Pull Request: #2624
2022-07-04 14:22:06 +02:00
Mark Paluch
0a423ac3f5 Open up AuditingBeanDefinitionRegistrarSupport.registerAuditHandlerBeanDefinition(…) to allow additional bean registrations.
Original Pull Request: #2624
2022-07-04 14:22:06 +02:00
Christoph Strobl
4e23153816 Move runtime hints into another package
Original Pull Request: #2624
2022-07-04 14:22:05 +02:00
Mark Paluch
51cda9993f Introduce PropertiesBasedNamedQueriesFactoryBean to reduce bean indirections.
We now provide PropertiesBasedNamedQueriesFactoryBean to create PropertiesBasedNamedQueries directly bypassing indirections through PropertiesFactoryBean and PropertiesBasedNamedQueries.

Original Pull Request: #2624
2022-07-04 14:22:05 +02:00
Christoph Strobl
0262380d29 Add native image runtime hints.
We provide an initial set of runtime hints required to spin up data repositories on GraalVM native image.
Additionally we skip synthetic types during type inspection.

Original Pull Request: #2624
2022-07-04 14:22:04 +02:00
John Blum
d8118de90f Review, refactor and polish Spring Data AOT infrastructure classes.
* Refactored logic in AOT infrastructure classes.
* Annotated AOT API with Spring's @NonNull and @Nullable annotations.
* Edited Javadoc.
* Introduced PredicateUtils abstract utility class encapsulating common Predicates on types and class members.
* Added comments for review and clarification.

Original Pull Request: #2624
2022-07-04 14:22:04 +02:00
Christoph Strobl
21ff2a7e34 Introduce infrastructure for AOT processing of repository declarations
This commit introduces initial support for framework 6 bases ahead of time processing of data components and adds extension points for module implementations.

See: #2593
Original Pull Request: #2624
2022-07-04 14:22:03 +02:00
Florian Cramer
2a299b2ff2 Use TypeFilterUtils to create TypeFilters.
Original pull request: #2647.
Closes #2481
2022-06-23 13:59:02 +02:00
Oliver Drotbohm
dfc3060ed7 Polishing.
See #2644.
2022-06-20 17:18:45 +02:00
Oliver Drotbohm
75387bb8ae Add RepositoryConfiurationExtension.getModuleIdentifier().
We're now unifying the lookup of a unique identifier for a Spring Data module in the RepositoryConfigurationExtension interface. Previous users of getModulePrefix() in subclasses of RCE should rather call getModuleIdentifier(). Implementations of RCE that previously implemented getModulePrefix() directly should rather switch to implementing getModuleName() and additionally getModuleIdentifier() in case the default implementations derivation of the identifier from the name doesn't produce the results intended.

RepositoryConfigurationExtensionSupport.getDefaultNamedQueryLocation() was changed to rather use the identifier to calculate the name of the named query location instead of the prefix.

Fixes #2644.
2022-06-20 17:18:45 +02:00
Mark Paluch
09558d77d8 Revert exposing getModulePrefix() on RepositoryConfigurationExtension.
This is a breaking change as many modules implement a protected method. We're going to change this later with #2644.

Original pull request: #2635.
See #2634.
2022-06-14 10:01:49 +02:00
Mark Paluch
35dbda7144 Polishing.
Add assertions, refine Javadoc.

Original pull request: #2635.
See #2634.
2022-06-14 10:01:49 +02:00
Christoph Strobl
02bf260d6d Introduce ManagedTypes.
We now provide an abstraction to describe a collection of entity types that can be provided to the mapping context as improvement over `Set<Class>` for easier context setup.

Original pull request: #2635.
Closes #2634.
2022-06-14 10:01:49 +02:00
Oliver Drotbohm
2a1a8f387f Additional refinements in TypeInformation reimplementation.
Slight refinements in TypeDiscoverer.equals(…) / hashCode() that are still not completely valid, are different enough to work for differentiating use cases but not 100% efficient for cache cases. Captured outstanding work in spring-projects/spring-data-commons#2643.

Reimplemented ….repository.query.Parameter.isDynamicProjectParameter(…) to bild on TypeInformation completely and properly unwrapp *all* wrapper types for type comparison.

Related ticket #2312.
2022-06-13 16:04:08 +02:00
Christoph Strobl
18a9f3aa13 Expose RepositoryFragments as infrastructure bean.
We now expose RepositoryFragments as a bean to be referenced when creating the actual repository.

Original Pull Request: #2596
2022-06-13 11:02:51 +02:00
Mark Paluch
712477bf36 Introduce PropertiesBasedNamedQueriesFactoryBean to reduce bean indirections.
We now provide PropertiesBasedNamedQueriesFactoryBean to create PropertiesBasedNamedQueries directly bypassing indirections through PropertiesFactoryBean and PropertiesBasedNamedQueries.

Resolves: #2584
Original Pull Request: #2596
2022-06-13 10:52:34 +02:00
Oliver Drotbohm
0f85f1c720 Prefer explicitly declared generic parameter over Iterable in TypeDiscoverer.getComponentType().
Related ticket: #2312.
2022-06-10 22:12:37 +02:00