The entity creation not skips the property population entirely if the metamodel indicates that the instantiation already creates a complete entity. If there's need to actively populate properties, we now correctly skip the ones already consumed by the constructor.
Original pull request: #86.
If a parent DbAction does not offer a generated id, the id of the entity is used instead. This behavior was broken by DATAJDBC-241.
Related tickets: DATAJDBC-241.
Original pull request: #85.
Immutable entities can now be saved and loaded and the immutability will be honored.
This feature is currently limited to a single level of reference.
In order to implement this the logic for updating IDs with those generated from the database got moved out of the DefaultDataAccessStrategy into the AggregateChange.
As part of that move DataAccessStrategy.save now returns a generated id, if available.
See also: DATAJDBC-248.
Slight rewording of individual parts. Include namespace/populator/return type includes. Use spring-framework-docs variable where possible.
Original pull request: #81.
Introduced variable for linking to JavaDoc.
Used the `revnumber` in there in order to link to the proper version of the JavaDoc.
Changed package and class names matching the changes of DATAJDBC-226.
Fixed some typos.
Original pull request: #81.
Also made RelationalMappingContext actually use the JdbcSimpleTypes.
In order for this to work the database needs to be able to handle parameters of type UUID and store them either as such or internally convert them.
Currently no conversion by Spring Data JDBC happens.
Original pull request: #76.
We now no longer import JdbcConfiguration to prevent bean overrides when creating a configuration class that extends JdbcConfiguration. Using EnableJdbcRepositories requires either an import of the configuration class inside the application code or registration of the required RelationalConverter and RelationalMappingContext beans.
Related ticket: DATAJDBC-244
Enhance Javadoc. Fix generics for AggregateChange in JdbcAggregateTemplate. Use Lombok's Data annotation where possible. Typos.
Original pull request: #80.
Note: Immutable entities still aren't supported yet, these are just the API changes plus implementations that work for mutable entities.
The API of DbActions will need further evolution.
Original pull request: #80.
All the methods in JdbcConfiguration are now protected so the class can be extended and the methods overwritten in order to customize the configuration of Spring Data JDBC.
Return List<DbChange<?>> in RelationalEntityWriters so AggregateChange can be assembled in less places to reduce the number of abstractions per method. Change ResultOrException in FunctionCollector to static class so instances no longer retain a reference to their enclosing class. Fix DbAction generics in AggregateChange. Replace simple constructors with Lombok usage. Javadoc, typos, formatting.
Original pull request: #79.
JdbcEntityWriter and JdbcDeleteEntityWriter now use an iterative approach based on PersistentPropertyPath instead of a recursive one.
DbAction is now split into multiple interfaces representing different variants of actions.
The implementations are simple value types without any implementation inheritance hierarchy.
All elements of a DbAction implementation are not null making usage and construction of instances much easier.
Original pull request: #79.
We now support configurable conversion by introducing CustomConversions and RelationalConverter. CustomConversions is a registry for converters that should be applied on a per-type basis for properties. CustomConversions is typically registered as bean and fed into RelationalMappingContext and the newly introduced RelationalConverter to consider simple types and conversion rules.
RelationalConverter with its implementation BasicRelationalConverter encapsulates conversion infrastructure such as EntityInstantiator, CustomConversions, and MappingContext that is required during relational value conversion. BasicRelationalConverter is responsible for simple value conversion and entity instantiation to pull related code together. It's not in full charge of row result to object mapping as this responsibility remains as part of DataAccessStrategy.
This change supersedes and removes ConversionCustomizer.
We now treat all properties of an entity mutable and continue to use the reflective PersistentPropertyAccessor implementation to make sure we don't break the old behavior of reflectively mutating immutable objects.
This is a workaround for now and has to be replaced by more exhaustive changes later.
Related tickets: DATACMNS-1322.
All packages now use @NoNullApi.
All warnings related to that fixed, except a few cases where upstream annotations are simply wrong.
Added null checks.
Fixed generic types where possible.
Improved Javadoc.
Code Formatting.
Replaced the direct use of EntityInstantiator with EntityInstantiators.
Moved it into the MappingContext because instantiation is part of the mapping process.
Original pull request: #68.
Edited for spelling, punctuation, grammar, usage, and corporate voice.
Also added an epub cover image and the SVG file from which it can be generated.
Original pull request: #73.
Moved to both the usage of the newly introduced PersistentEntity.isNew(…) and identifier lookups via PersistentEntity instead of using a custom EntityInformation implementation. JdbcRepositoryFactory now creates a PersistentEntityInformation, SimpleJdbcRepository simply works with a PersistentEntity.
Removed references to EntityInformation (a repository subsystem concept) from the template implementation. Removed BasicJdbcPersistentEntity and its tests entirely. JdbcAuditingEventListener is now using an IsNewAwareAuditingHandler.
Related tickets: DATACMNS-1333.
Moved the implementation from the DelimiterNamingStrategy into the NamingStrategy.
Dropped the support for different separators, since there is no good way to support it in the default implementations of an interface.
A getSeparator() method would bleed into the public API.
Also the added value of that flexibility seems limited.
During migration of the various test it became obvious that SqlGeneratorUnitTests was broken since test failures happend on a worker thread not on the main test thread.
This is fixed as well with this commit.
Such a parameter would only make sense with inheritance and we don't support inheritance at all in the moment.
Anything we need in order to support inheritance should be added once we do support inheritance.
The existing test only analysed Spring Data JDBC itself.
The new test also considers packages from commons and treats
org.springframework.data.x.X
and
org.springframework.data.jdbc.x.Y
as belonging to the same "sub-module" "x".
Moved the dependency to NamedParameterJdbcOperations out of JdbcMappingContext. This revealed that despite the DataAccessStrategy abstraction, there are a couple of places in the query execution subsystem that work with a plain NamedParameterJdbcOperations instance, so that we now have to carry that around all the way from the repository factory bean. Improving that is subject for further changes.
A bit of JavaDoc and generics polish here and there.
Moved annotation processing of @Table and @Column into metamodel classes so that the NamingStrategy is only responsible for generic fallbacks. Allow @Column to be used as meta-annotation.