Commit Graph

117 Commits

Author SHA1 Message Date
Jens Schauder
b74c82c724 DATAJDBC-436 - Replace @Wither with @With.
lombok.experimental.Wither is now deprecated and to be replaced by lombok.With which this change does.
2019-10-21 08:47:31 +02:00
Jens Schauder
c5c2d49b15 DATAJDBC-432 - Polishing.
Null handling in test.
2019-10-21 08:18:55 +02:00
Jens Schauder
7d8c78e9ec DATAJDBC-432 - Extracted AggregateChangeExecutor from AggregateChange.
This separates the execution plan of  a change encoded in the AggregateChange from its execution encoded in the AggregateChangeExecutor.
2019-10-21 08:18:55 +02:00
Jens Schauder
448f0e0d39 DATAJDBC-428 - Polishing.
Code formatting.
2019-10-16 14:34:24 +02:00
Jens Schauder
6e715cb6b3 DATAJDBC-427 - Polishing.
Used isEqual assertions instead of directly calling equals.
Code formatting.
2019-10-16 14:32:17 +02:00
mhyeon-lee
cef41525da DATAJDBC-428 - Fixes BasicJdbcConverter readValue for immutable entity with AggregateReference field.
Original pull request: #172.
2019-10-16 12:09:00 +02:00
mhyeon-lee
a6b3144e66 DATAJDBC-427 - IdOnlyAggregateReference no supports equality.
Original pull request: #172.
2019-10-16 12:08:02 +02:00
Mark Paluch
1314081c52 DATAJDBC-291 - Polishing.
Introduce factory methods for AggregateChange save/delete object creation. Replace computeIfAbsent pattern with appropriate methods. Add indirection for staged values traversal. Rename CascadingValuesLookup to StagedValues.
Javadoc, formatting.

Original pull request: #173.
2019-10-15 15:53:00 +02:00
Jens Schauder
feb60c8560 DATAJDBC-291 - Setting DB-generated ids now works across collections.
Original pull request: #173.
2019-10-15 15:52:47 +02:00
Mark Paluch
9277797d37 DATAJDBC-403 - Prepare next development iteration. 2019-09-30 16:17:28 +02:00
Mark Paluch
2c356f6346 DATAJDBC-403 - Release version 1.1 GA (Moore). 2019-09-30 15:51:07 +02:00
Jens Schauder
8feb7fbf71 DATAJDBC-413 - Polishing.
Removed excessive logging in tests.
Again.
2019-09-13 09:12:26 +02:00
Jens Schauder
1fe39cf1c9 DATAJDBC-413 - Use proper https URLs for MyBatis DTDs.
See also: https://github.com/mybatis/mybatis-3/issues/1559
2019-09-13 09:08:02 +02:00
Mark Paluch
4d1fff1c19 DATAJDBC-411 - Set project.root in module poms to correctly generate Javadoc.
By setting project.root, Javadoc is aggregated in the parent pom target so it can be collected during the distribution build.

Original pull request: #168.
2019-09-12 07:54:26 +02:00
Mark Paluch
5380daac6f DATAJDBC-404 - Prepare next development iteration. 2019-09-06 10:21:54 +02:00
Mark Paluch
c2f11ed104 DATAJDBC-404 - Release version 1.1 RC3 (Moore). 2019-09-06 10:10:42 +02:00
Mark Paluch
2f28153471 DATAJDBC-388 - Prepare next development iteration. 2019-08-05 15:53:01 +02:00
Mark Paluch
10ae98a572 DATAJDBC-388 - Release version 1.1 RC2 (Moore). 2019-08-05 15:35:35 +02:00
Oliver Drotbohm
5a8abe73e6 DATAJDBC-399 - Performance improvements in metadata lookups.
Avoid Stream usage in favor of a simple for loop in event triggering in JdbcAggregateTemplate. Tweaked JdbcMappingContext to verify the presence of parameter names on metadata creation. Avoid the re-resolution of the column name for a property by caching the resolved column name. This significantly improves performance as it avoids repeated parsing and concatenation of strings. Added caching to PersistentPropertyPathExtension.
2019-07-30 17:15:53 +02:00
Mark Paluch
1fb404a84e DATAJDBC-400 - Polishing.
Add version since which deprecations are in place. Inline variables.

Original pull request: #164.
2019-07-29 14:15:12 +02:00
Jens Schauder
2289195e8a DATAJDBC-400 - Remove Identifier from callbacks.
Retrieval of the Identifier has been shown to cost significant performance.

Original pull request: #164.
2019-07-29 14:14:37 +02:00
Mark Paluch
4ab69a10f7 DATAJDBC-398 - Polishing.
Convert space indent to tabs.

Original pull request: #163.
2019-07-26 12:35:07 +02:00
Jens Schauder
5e8161dbf3 DATAJDBC-398 - SimpleJdbcRepository methods are now transactional.
Original pull request: #163.
2019-07-26 12:34:56 +02:00
Jens Schauder
1d91d839b7 DATAJDBC-393 - Added missing create table script for integration tests. 2019-07-17 10:23:09 +02:00
Mark Paluch
257dd7d5d4 DATAJDBC-393 - Polishing.
Accept AggregateChange in BeforeSave and BeforeDelete callbacks. Add Javadoc. Fix generics usage in RelationalAuditingCallback. Align documentation for consistent entity callback documentation.

Add overloaded JdbcAggregateTemplate constructor to directly configure EntityCallbacks.

Original pull request: #161.
2019-07-16 13:09:08 +02:00
Jens Schauder
1a9612c64f DATAJDBC-393 - EntityCallback support.
An `EntityCallback` works very similar to an `ApplicationEvent` but returns a potentially changed instance.
The returned instance will be used in further processing which enables proper event handling for immutable classes.

Auditing was changed to use a callback making it work also with immutable objects.

Original pull request: #161.
2019-07-16 13:08:44 +02:00
Mark Paluch
d143d8fe71 DATAJDBC-390 - Polishing.
Slightly tweak Javadoc.

Original pull request: #159.
2019-07-15 11:39:06 +02:00
Jens Schauder
7089e077d5 DATAJDBC-390 - Add ordering to RelationalAuditingEventListener to run before other listeners without explicitly specified order.
When an event listener is used to set an id before saving it, this ensures the auditing happens before setting the id.
If this is not ensured the auditing listener doesn't consider the entity as new and doesn't set created date and created by user.

Original pull request: #159.
2019-07-15 11:35:53 +02:00
Oliver Drotbohm
c1e460bd9f DATAJDBC-395 - Added dedicated configuration class for MyBatis integration.
We now ship MyBatisJdbcConfiguration as an alternative to (Abstract)JdbcConfiguration to tweak the DataAccessStrategy bean registered to create one that tries MyBatis mappings first but still delegates to the default one.
2019-07-12 16:47:30 +02:00
Oliver Drotbohm
0d20e4b7b2 DATAJDBC-395 - Overhaul of AbstractJdbcConfiguration.
We now declare DataAccessStrategy as bean again as using a custom default caused the lazy resolution of a RelationResolver to break. Changed the signatures to avoid cross method invocations and allow us to declare the class to not need proxying.

Added integration tests to make sure the components that should be registered are actually registered and the configuration class is useable in the first place. With that in place, the broken cycle would've been caught immediately.
2019-07-12 16:30:24 +02:00
Jens Schauder
fb07912274 DATAJDBC-395 - Polishing.
Avoid line breaks in parameter lists.

Original pull request: #160.
2019-07-11 10:45:10 +02:00
Jens Schauder
b7ee1bbbb0 DATAJDBC-395 - AbstractJdbcConfiguration no longer registers a bean of type DataAccessStrategy.
This avoids having multiple beans of that type in an ApplicationContext when a custom DataAccessStrategy needs to be provided.

Original pull request: #160.
2019-07-11 10:44:46 +02:00
Mark Paluch
938a52cb33 DATAJDBC-391 - Revise readme for a consistent structure. 2019-07-09 11:19:19 +02:00
Jens Schauder
51b3a8cb11 DATAJDBC-383 - preliminary fix for not using http for MyBatis DTDs.
Currently there seems to be now well maintained https resource for MyBatis DTDs.
We therefore use the tagged sources directly for now.

See also: https://github.com/mybatis/mybatis-3/issues/1559
2019-06-18 11:01:35 +02:00
Christoph Strobl
c6b1894eed DATAJDBC-360 - Prepare next development iteration. 2019-06-14 15:12:51 +02:00
Christoph Strobl
2d2264048b DATAJDBC-360 - Release version 1.1 RC1 (Moore). 2019-06-14 14:44:25 +02:00
Christoph Strobl
b65f866fd5 DATAJDBC-384 - Polishing.
Update nullable annotations.

Original Pull Request: #157
2019-06-13 13:43:23 +02:00
Jens Schauder
bd03ef83d6 DATAJDBC-384 - Fixed MyBatisDataAccessStrategy.findAllByPath.
findAllByPath now falls back to the older findAllByProperty for better backward compatibility.
Also the path is included in the query name used for MyBatis.

Original Pull Request: #157
2019-06-13 13:42:58 +02:00
Christoph Strobl
3524d7bacf DATAJDBC-378 - Polishing
Move non integration tests to separate class.

Original Pull Request: #155
2019-06-13 10:32:58 +02:00
Jens Schauder
619396357a DATAJDBC-378 - Proper handling of null and empty collections in JdbcAggregateTemplate.
Original Pull Request: #155
2019-06-13 10:03:59 +02:00
Mark Paluch
bb70b89211 DATAJDBC-377 - Use testcontainers version property.
We now use the version property from Spring Data Build and import testcontainers-bom.
2019-05-22 14:57:46 +02:00
Jens Schauder
ebe76a0c7f DATAJDBC-374 - Polishing.
Clarified the effects of collections on nullable embedded entities.

Original pull request: #154.
2019-05-22 12:49:17 +02:00
Christoph Strobl
55a3f9c372 DATAJDBC-374 - Introduce shortcuts for Embedded#onEmpty(…)
@Embedded.Nullable & @Embedded.Empty offer shortcuts for @Embedded(onEmpty = USE_NULL) and @Embedded(onEmpty = USE_EMPTY) to reduce verbositility and simultaneously set JSR-305 @javax.annotation.Nonnull accordingly.

    @Embedded.Nullable
    EmbeddedEntity embeddedEntity;

Original pull request: #154.
2019-05-22 12:47:24 +02:00
Christoph Strobl
5830b83cf4 DATAJDBC-374 - Add onEmpty attribute to Embedded annotation.
The onEmpty attribute allows to define if an embedded entity should be set to null or a default instance if all properties backing the entity are actually null.

    @Embedded(onEmpty = USE_NULL)
    EmbeddedEntity embeddedEntity;

Original pull request: #154.
2019-05-22 12:46:46 +02:00
Mark Paluch
f69aa31958 DATAJDBC-223 - Polishing.
Simplify conditionals with nested ternary operators. Migrate RelationResolver.findAllBy to returning Iterable of Object instead of T as there is no type contract present. Use Spring utilities where applicable. Simplify tests. Fix warnings, Javadoc, Formatting.

Original pull request: #153.
2019-05-22 11:57:52 +02:00
Jens Schauder
097190ee42 DATAJDBC-223 - Chains of Lists or Maps get properly stored and loaded.
Also solved DATAJDBC-369 since it made refactoring easier.

Known limitation: Back-references to intermediate key columns currently can't get renamed and use the name defined by the property where they become part of the path.

Backward compatibility of the JdbcConfiguration is still broken.

Original pull request: #153.
2019-05-22 11:57:21 +02:00
Mark Paluch
221eb9dcc8 DATAJDBC-363 - Prepare next development iteration. 2019-05-13 12:17:52 +02:00
Mark Paluch
75aabdabba DATAJDBC-363 - Release version 1.1 M4 (Moore). 2019-05-13 11:59:50 +02:00
Jens Schauder
bf3f99c585 DATAJDBC-370 - Polishing.
Refactored code to better use existing code.

Original Pull Request: #151
2019-05-13 09:24:13 +02:00
Christoph Strobl
3a89ec0444 DATAJDBC-370 - Fix read/write of nulled embedded objects.
We now allow read and write of Objects annotated with Embedded that are actually null.
When writing all contained fields will be nulled.
Reading back the entity considers an embedded object to be null itself if all contained properties are null within the backing result.

Relates to DATAJDBC-364

Original Pull Request: #151
2019-05-13 09:24:13 +02:00