Prior to this commit, the lookup of types to be added as persistent entities for a given PersistentProperty used the actual property type which did not consider the association target type at all. Removed the usage of Optional for the entity type information and switched to use TypeInformation for the raw association target type so that it can be considered in ….getActualType().
We now throw MappingInstantiationException with a nested BeanInstantiationException in alignment to ReflectionEntityInstantiator when attempting to create a new instance of an abstract class.
Closes#2348.
We now detect the component type of jMolecules' Association as association target type in AbstractPersistentProperty. AnnotationBasedPersistentProperty keeps the lookup of the explicit @Reference around but falls back to the Association analysis for that.
@Reference is now only considered by AnnotationBasedPersistentProperty. It was previously also (erroneously) considered by AbstractPersistentProperty.
It was also changed to return `null` in case no association target type could be looked up instead of returning the sole property's type in case that is an entity. This was done to satisfy the behavior documented on the interface but also to avoid the call to isEntity() during the calculation which might use association information in turn and thus lead to a stack overflow. Reworded the contract of PersistentProperty.getAssociationTargetType() to emphasize the symmetry with ….isAssociation() in implementation classes.
Closes: #2344.
We now support composed annotation that are annotated with `@Value`. we also expose MergedAnnotations through PreferredConstructor.Parameter for further use by store modules that want to inspect constructor argument annotations.
Closes: #2332
Original Pull Request: #2333
We now throw a RepositoryCreationException (or subclass) when a repository cannot be created due to a missing fragment, a fragment without implementation or if a well-known fragment is not supported by the repository factory.
Throw QueryCreationException if QueryExecutorMethodInterceptor cannot resolve a RepositoryQuery.
Closes#2341
Original pull request: #2342.
We now resolve only the raw class when checking if a primary constructor argument is assignable to method parameters of the synthetic copy method.
Previously we used ResolvableType's assignability check which considered generic type arguments. As the type resolution between the KType and copy method type is not symmetric, the check only succeeded in cases where both types could be resolved to the same type/assignable type. Using projections or Any caused asymmetric resolution and therefor the assignability check returned non-assignable.
Closes#2336.
We now resolve the copy method for Kotlin data classes that match the primary constructor. Previously, copy method resolution could find a secondary copy method as we didn't check for the primary constructor structure (parameter names and types).
Closes#2324.
We no recognize properties of type org.jmolecules.ddd.types.Association as associations in our PersistentProperty model.
Also, we now register JMolecules Converter implementations for Association and Identifier in CustomConversions so that they can persisted like their embedded primitive value out of the box.
Fixes#2315.
Original pull request: #2316.
This commit fixes an issue where we fail to detect all type arguments from a given constructor. calling getGenericParameterTypes in some cases does not include all Types, we now explicitly iterate over the parameters and extract the parameterized type that is used for creating the TypeInformation.
Closes: #2313
Original pull request: #2314.
We now consider default Querydsl bindings when registering a DefaultQuerydslBinderCustomizer bean. The default bindings are applied before applying type-specific bindings.
Closes#206.
Original Pull Request: #2292
Do not include the result value in the exception message to avoid data exposure.
Improve data flow to avoid superfluous null checks.
See #2290.
Original Pull Request: #2291.
We now throw UnsupportedOperationException when a projected value cannot be returned because it cannot be brought into the target type, either via conversion or projection.
This exception improves the error message by avoiding throwing IllegalArgumentException: Projection type must be an interface from the last branch that falls back into projections.
Closes#2290.
Original Pull Request: #2291
Introduce factory methods on Pageable, PageRequest, and QPageRequest to construct PageRequest objects. Replace builder with with…(…) methods.
Closes#322.
We now support PageRequest creation through PageRequest.ofSize(10).withPage(1).withSort(Direction.DESC, "foo"). Simplified Pageable instances can be created through Pageable.ofSize(10).withPage(1).
Closes#322.
Attach repository interface name to each repository init event.
Make spring.data.repository.postprocessors conditional to reduce the number of events. Append full fragment diagnostics.
Reorder methods, add author tag, reformat code.
Closes#2247.
Original pull request: #2273.
This commit adds support for collecting data repository startup metric (repository scanning, repository initialization) using core framework ApplicationStartup and StartupStep.
Collected metrics can be stored with Java Flight Recorder when using a FlightRecorderApplicationStartup.
Closes#2247.
Original pull request: #2273.
Also, tweak test case to avoid to refer to a field in a Spring class but rather use API to access the value. Changes in Spring Framework 5.3.4 require this as the internal structure of AbstractJackson2HttpMessageConverter changed to support custom ObjectMapper instances per type and media type.
Fixes GH-2284.
We now avoid the pre-computation of the base URI in PagedResourceAssemblerArgumentResolver as the actual assembler will fall back to using the URI of the current request by default anyway. The latter makes sure that request parameters, that are contained in the original requests appear in links created. If a controller wants to deviate from that behavior, they can create a dedicated link themselves and hand that to the assembler explicitly.
Fixes GH-2173, GH-452.
Introduce constructors accepting non-null ConversionService, handle conversion service defaulting in configuration classes by using ObjectProvider. Extract common code to create a predicate in getPredicate(…) method. Add unit test.
Convert spaces to tabs.
Related ticket: #2200.
Original pull request: #2274.
We now leniently skip parameter name resolution for types using unsigned types. The issue is caused by Kotlin's DefaultConstructorMarker that doesn't report a parameter name.
Closes#2215
We now check for double-nesting of JSON path evaluation results when the return type is a collection. If the result is double-wrapped and the nested object is a collection then we unwrap it.
Closes#2270
We now provide a KProperty extension leveraging KProperty references to express a property path. Using Kotlin property references (such as Author::name that translates to `book` or Book::author / Author.name translating to `book.author`) is refactoring-safe as the property expressions are part of the Kotlin language. We render KPropertyPath using the same semantics as our PropertyPath so that store-specific modules can leverage either property paths or accept KProperty directly.
In contrast to the previous implementation, KPropertyPath is private and the rendering function was renamed to toDotPath to align with PropertyPath.toDotPath.
Related ticket: DATAMONGO-2138 (spring-projects/spring-data-mongodb#3515)
Original Pull Request: #478Closes: #2250
Instead of using the first generic type parameter of a parameterized type as Map component type, we now explicitly lookup the super type's Map-specific generics configuration and use its first generic type parameter. The same for collection like types falling back to the parameter type bound to Iterable.
This avoids module cycles when it is used from a template.
The old version is still there, deprecated and delegates to the new version.
Original pull request: #472.
We now consider reactive wrapper types in all areas that previously relied on QueryExecutionConverters to handle reactive type information correctly. Specifically, we call supports(…) and perform type unwrapping to ensure to detect the correct return type.
We now support nullable wrappers for projection interfaces. Getters are inspected whether their return type is a supported nullable wrapper. If so, then the value can be wrapped into that type. Null values default in that case to their corresponding empty wrapper representation.
Original Pull Request: #459
Nullable wrappers such as Java 8 Optional, Guava Optional, Scala Option and Vavr Option are now handled in NullableWrapperConverters and are no longer coupled to QueryExecutionConverters so that this functionality can be reused.
Original Pull Request: #459
ReactiveWrappers doesn't belong in there in the first place so we're removing ReactiveWrappers support from QueryExecutionConverters so ReactiveWrappers is used from parts that need to be reactive-aware.
Original Pull Request: #459
CloseableIterator now allows construction of a Stream that is associated with a close hook to release resources after its use.
CloseableIterator<Person> iterator = …;
try (Stream<Person> stream = iterator.stream()) {
assertThat(stream.count()).isEqualTo(3);
}
We now allow for registering RepositoryMethodInvocationListeners to notify listeners upon repository method invocations (query methods and repository fragments). Listeners are notified upon method completion reporting the repository interface, the invoked methods, duration, outcome and arguments.
Original Pull Request: #455