The new name currently delegates to old version, so classes only implementing the old method still work. Old name is deprecated.
Original pull request: #243.
We now validate query method invocations to check method parameters whether they accept null values and reject execution if null values are not supported. We derive nullability support from repository interfaces declared using Kotlin and Spring's NonNullApi/Nullable annotations.
We also check whether a query method can return null. If a query method returns null which isn't supposed to do so, then we throw EmptyResultDataAccessException to prevent null return values.
interface UserRepository extends Repository<User, String> {
List<User> findByLastname(@Nullable String firstname);
@Nullable
User findByFirstnameAndLastname(String firstname, String lastname);
}
interface UserRepository : Repository<User, String> {
fun findByLastname(username: String?): List<User>
fun findByFirstnameAndLastname(firstname: String, lastname: String): User?
}
Original pull request: #241.
We now allow users to use our own Streamable interface as query method return types to easily invoke ….stream() on everything that returns an Iterable using non-parallel streaming by default.
AbstractAggregateRoot is now generified to be able to use its concrete type on methods returning an instance of itself. Added new methods andEvent(…) and andEventsFrom(…) to easily transfer events from another aggregate instance. Added unit tests for fundamental functionality of the base class.
We now prefer to inspect the arguments handed to save(…) methods over inspecting the return value as the invocation of the actual method is free to exchange the instance handed into it and return a completely new one with the events contained in the parameter completely wiped.
We're now trying to look up a uniquely available ObjectMapper instance from the application context falling back to a simple new instance in case none can be found.
We now forward method parameters of methods on projection interfaces to the expression evaluation. The parameters are exposed via an array named "args".
Add Nullable annotation to ParsingUtils, Sort.Order and PropertyValueProvider.
Add getRequiredAnnotation(…) to PersistentEntity and PersistentProperty to provide methods returning required, non-null annotations.
We filter interfaces annotated with @NoRepositoryBean from fragment interface candidates and not longer scan for implementations of these.
Extending a base repository usually requires an interface which is used as base interface instead of Repository/CrudRepository in user repositories. If the naming scheme of the extended interface and the implementation fits to fragment interfaces, then we previously registered the class additionally as fragment implementation. The bean registration caused container startup failures because of unsatisfied dependencies or would shadow the base repository implementation.
Original pull request #239.
Moved PreferredConstructorDiscoverers into PreferredConstructorDiscoverer to hide more API. Renamed ClassGeneratingKotlinEntityInstantiator to KotlinClassGeneratingEntityInstantiator.
Use org.springframework.util.Assert instead of com.mysema.commons.lang.Assert.
Original pull request: #233.
We now discover Kotlin constructors and apply parameter defaulting to allow construction of immutable value objects. Constructor discovery uses primary constructors by default and considers PersistenceConstructor annotations.
KotlinClassGeneratingEntityInstantiator can instantiate Kotlin classes with default parameters by resolving the synthetic constructor. Null values translate to parameter defaults.
class Person(val firstname: String = "Walter") {
}
class Address(val street: String, val city: String) {
@PersistenceConstructor
constructor(street: String = "Unknown", city: String = "Unknown", country: String) : this(street, city)
}
Original pull request: #233.
We turned Example and ExampleMatcher into interfaces with default implementations created via the static of methods. The default ExampleMatcher has strongly typed default implementation. This change allows store implementations to create their very own flavor of Example and ExampleMatcher allowing eg. non typed ones.
Original pull request: #238.
Path expressions are now evaluated one by one with the first one actually available in the payload being used for value lookup. Also tweaked the default behavior to return null in case of an single, invalid path.
Methods for domain event registration and access are now not following bean semantics anymore to avoid those accidentally leaking into formats that use the bean spec (e.g. Jackson to produce JSON).
We're now favoring the generic TypeInformation over trying to resolve the property type via field or PropertyDescriptor as only the former does proper generic type resolution.
Type specialization - i.e. enrichment of a raw type with a current generic context - is now only done if the current type is not yet resolved completely. This allows wildcarded target references to just fall back to the type to specialize, which will then by definition carry more generics information than the one to be specialized.
Revert the merging of a parent type's type variable map and only apply the locally available declared generics in case of parameterized types. Moved that augmentation into ParameterizedTypeInformation.
We now use CGLibs ReflectUtils.defineClass(…) to inject classes into the entity's class loader instead of our own code. ReflectUtils itself discovers whether the class loader is encapsulated and falls back to Unsafe for class definition. We no longer require our own code so the evil class was removed.
Original pull request: #234.
RxJava 1 development is phased out over time (Feature freeze in June 2017, EOL in March 2018) and we don't want to ship newly developed first-class support for libraries known to be no longer maintained. RxJava 1 type adoption support is not affected. Single and Observable can be still used in user-space code declaration, also copies of RxJava1CrudRepository (in user-space code) remain working.
XmlBeam 1.4.11 accidentally removed ProjectionFactory as public interface. Adapted our HttpMessageConverter implementation to make sure we still work on those versions.
Related ticket: https://github.com/SvenEwald/xmlbeam/issues/45
Marked all packages with Spring Frameworks @NonNullApi. Added Spring's @Nullable to methods, parameters and fields that take or produce null values. Adapted using code to make sure the IDE can evaluate the null flow properly. Fixed Javadoc in places where an invalid null handling policy was advertised. Strengthened null requirements for types that expose null-instances.
Removed null handling from converters for JodaTime and ThreeTenBP. Introduced factory methods Page.empty() and Page.empty(Pageable). Introduced default methods getRequiredGetter(), …Setter() and …Field() on PersistentProperty to allow non-nullable lookups of members. The same for TypeInformation.getrequiredActualType(), …SuperTypeInformation().
Tweaked PersistentPropertyCreator.addPropertiesForRemainingDescriptors() to filter unsuitable PropertyDescriptors before actually trying to create a Property instance from them as the new stronger nullability requirements would cause exceptions downstream.
Lazy.get() now expects a non-null return value. Clients being able to cope with null need to call ….orElse(…).
Original pull request: #232.
If you previously asked ProxyProjectionFactory for a proxy of an interface which the target instance already implements, it created a proxy although it could've returned the instance as is. It's now actually doing that avoiding superfluous proxy creation.