Commit Graph

518 Commits

Author SHA1 Message Date
Mark Paluch
c0803ddafe DATAJDBC-341 - Polishing.
Remove SpecialColumnValue in favor of JdbcPropertyValueProvider.hasProperty(…). Rename ResultSetWrapper to ResultSetAccessor. Replace ResultSetAccessor usage in JdbcConverter with ResultSet to avoid visibility issues.

Original pull request: #201.
2020-03-31 11:46:58 +02:00
Jens Schauder
95ca73df2f DATAJDBC-341 - Reworked the changes.
Turns out this was a little more involved than expected.
This modifies the implementation to not use exceptions for flow control.

Properties that get set via setter, wither or field access get not invoked for missing columns.
When properties get referenced in constructors a missing column results in an exception.

As a side effect we now access the `ResultSet` by index.
Depending on how the driver is implemented this might improve the performance a little.

Original pull request: #201.
2020-03-31 11:46:43 +02:00
Thomas Lang
c2062dbb9d DATAJDBC-341 - Map NULL values in EntityRowMapper for columns not being fetched in the query.
Original pull request: #170.
2020-03-30 19:55:41 +02:00
Mark Paluch
6769528068 DATAJDBC-453 - Polishing.
Remove unused AggregateChangeExecutionContext. Extract MutableAggregateChange interface and use it to encapsulate the implementation class. Expose MutableAggregateChange in entity callbacks where mutation of the MutableAggregateChange is intended.

Fix generics and license headers, tweak Javadoc.

Original pull request: #197.
2020-03-30 14:08:15 +02:00
Jens Schauder
51b6784579 DATAJDBC-453 - DbActions and AggregateChange are effectively immutable.
Removed the Interpreter and replaced it with AggregateChangeExecutor and  AggregateChangeExecutionContext.
The latter handles the mutable data like ids and versions.

Original pull request: #197.
2020-03-30 14:08:03 +02:00
Mark Paluch
6a1ef7d69c DATAJDBC-513 - Polishing.
Add Criteria.toString and Update.toString.
2020-03-30 09:51:46 +02:00
Mark Paluch
15f868120a DATAJDBC-514 - Add support for Between and Not Like to Criteria API and SQL generation.
We now support Conditions.between, notBetween, and notLike as additional criteria conditions and support case-insensitive comparisons.
For LIKE escaping we pick up the Escaper configured at Dialect level. The newly introduced ValueFunction allows string transformation before computing a value by applying the Escaper to the raw value. Escaping is required for StartingWith, Contains and EndsWith PartTree operations.

Original pull request: spring-projects/spring-data-r2dbc#295.
2020-03-27 16:12:08 +01:00
Mark Paluch
d61651ad1e DATAJDBC-514 - Polishing.
Use AssertJ version specified by Spring Data Build.

Original pull request: spring-projects/spring-data-r2dbc#295.
2020-03-27 16:12:05 +01:00
Roman Chigvintsev
74540327f6 DATAJDBC-514 - Add infrastructure for query derivation in Spring Data Relational.
Original pull request: spring-projects/spring-data-r2dbc#295.
2020-03-27 12:27:43 +01:00
Mark Paluch
7802f6e19e DATAJDBC-513 - Introduce Query, Criteria and Update Objects for Spring Data Relational. 2020-03-27 12:11:43 +01:00
Jens Schauder
beaeb5cbdf DATAJDBC-512 - Polishing.
Removed some accidental leftovers from the development process.
Added a note in the `new-features`.

Original pull request: #203.
2020-03-26 17:22:44 +01:00
Mark Paluch
4e23fa6fdf DATAJDBC-512 - Add support H2 dialect.
Original pull request: #203.
2020-03-26 17:22:44 +01:00
Mark Paluch
ef02b6e9cd DATAJDBC-455 - Polishing.
Rename Dialect bean to jdbcDialect to avoid generic bean names. Require JdbcOperations in DialectResolver. Rename JdbcDialectResolver to DialectResolver for consistent naming with R2DBC the underlying type is a Dialect.

Tweak Javadoc and extend documentation with custom conversions include from Spring Data Commons. Extract MySQL identifier processing defaults into constant.

Original pull request: #202.
2020-03-26 11:08:55 +01:00
Jens Schauder
1c4ff416c9 DATAJDBC-455 - Documentation.
Original pull request: #202.
2020-03-26 11:08:53 +01:00
Jens Schauder
956ad24d4f DATAJDBC-487 - Makes the IdentifierProcessing for MySqlDialect dynamic.
This allows to handle the various ways MySQL may behave, depending on the OS it is installed on and on its configuration.

Original pull request: #202.
2020-03-26 11:08:49 +01:00
Jens Schauder
4c3fa05b6c DATAJDBC-455 - Adds dynamic Dialect detection.
So far the user had to specify an `Dialect` themselves if they wanted to use anything but HSQLDB.
We now identify the supported databases and pick the appropriate `Dialect`.

Vendors who want to offer support for their database may provide an implementation of `JdbcDialectProvider` and register it using a  file under the key `org.springframework.data.jdbc.repository.config.DialectResolver$JdbcDialectProvider`.

Original pull request: #202.
2020-03-26 11:08:14 +01:00
Jens Schauder
36192c4d97 DATAJDBC-510 - Polishing.
Minor formatting and removal of a deprecated constructor since this is for a major release anyway.

Original pull request: #192.
2020-03-25 13:49:39 +01:00
mhyeon-lee
54fed8ac5f DATAJDBC-510 - Inject IdentifierProcessing into BasicJdbcConverter.
Before the `IdentifierProcessing` was hardcoded and therefore did not match a properly configured `Dialect`.

Original pull request: #192.
2020-03-25 13:49:27 +01:00
Mark Paluch
f721b20039 DATAJDBC-496 - Updated changelog. 2020-03-25 10:59:47 +01:00
Michal Fotyga
5aabf64662 DATAJDBC-509 - Fix findByFirstnameLike @Query example in README.
Original pull request: #198.
2020-03-20 08:35:03 +01:00
Mark Paluch
8bd787c588 DATAJDBC-454 - Polishing.
Reformat code. Tweak reference doc wording.

Original pull request: #199.
2020-03-19 09:24:22 +01:00
Jens Schauder
5fdfd3a9dc DATAJDBC-454 - Adds generics to events.
Events now have a type parameter for the type of aggregate root they relate to.
In order to utilize this an react to only events relating to a specific type of entity `AbstractRelationalEventListener` was added.

Original pull request: #199.
2020-03-19 09:21:56 +01:00
Jens Schauder
22f9eded60 DATAJDBC-454 - Redesigned events.
Ids are only contained if it can not be guaranteed that an entity is contained which applies to the delete events.
As a side effect Identifier got simplified into a single simple class.

Original pull request: #199.
2020-03-19 09:21:41 +01:00
Michal Fotyga
7a2a3fb2eb DATAJDBC-506 - Fix some typos in code and documentation.
Original pull request: #200.
2020-03-16 08:56:01 +01:00
Jens Schauder
b5344002eb DATAJDBC-486 - After release cleanups. 2020-03-11 09:57:42 +01:00
Jens Schauder
e83e2bb795 DATAJDBC-486 - Prepare next development iteration. 2020-03-11 09:57:41 +01:00
Jens Schauder
6c6a97e9b9 DATAJDBC-486 - Release version 2.0 M4 (Neumann). 2020-03-11 09:47:07 +01:00
Jens Schauder
de02336592 DATAJDBC-486 - Prepare 2.0 M4 (Neumann). 2020-03-11 09:46:29 +01:00
Jens Schauder
9788a69b5f DATAJDBC-486 - Updated changelog. 2020-03-11 09:46:16 +01:00
Mark Paluch
0ba523c780 DATAJDBC-503 - Adapt to Mockito 3.3 changes.
Mockito reports falsely unnecessary stubbings so we're switching to the silent runner for these cases.
2020-03-11 09:00:20 +01:00
Jens Schauder
4371aec0f9 DATAJDBC-490 - Polishing.
Renamed GroupedConditionVisitor to NestedConditionVisitor to match the renamed NestedCondition.

Original pull request: #193.
2020-03-10 10:21:02 +01:00
Mark Paluch
a184cd9e0e DATAJDBC-490 - Rename .group() to .nest() to avoid confusion with GROUP BY.
Original pull request: #193.
2020-03-10 10:20:55 +01:00
Mark Paluch
a4bf09e8e8 DATAJDBC-490 - Incorporate review feedback.
Rename ConditionGroup to GroupedCondition. Introduce Conditions.group(…) factory method instead of applying grouping via `condition.group()`. Introduce getter to introspect conditions.

Original pull request: #193.
2020-03-10 10:20:46 +01:00
Jens Schauder
c4f024bb50 DATAJDBC-490 - Added a test for combining multiple nested conditions.
Original pull request: #193.
2020-03-10 10:19:38 +01:00
Mark Paluch
0156fdd0bf DATAJDBC-490 - Support condition grouping.
We now support condition groups (WHERE (a = b OR b = c) AND (e = f)) with the SQL AST via Condition.group().

Original pull request: #193.
2020-03-10 10:18:51 +01:00
Mark Paluch
7956e2c915 DATAJDBC-472 - Updated changelog. 2020-02-26 11:55:05 +01:00
Mark Paluch
8e2c53e720 DATAJDBC-471 - Updated changelog. 2020-02-26 11:31:47 +01:00
Mark Paluch
188b9d4388 DATAJDBC-491 - Correctly combine schema- and table name.
We no correctly combine schema and table name using separate SqlIdentifier objects instead of leaving the schema name as part of the table name. Previously, the concatenated name failed to resolve with quoted identifiers.
2020-02-21 14:43:09 +01:00
Jens Schauder
c907eb1d35 DATAJDBC-488 - Polishing.
JdbcRepositoryConcurrencyIntegrationTests now only runs with MySql instead of always with MySql.
Also modified it to not use sleep.
Copyright header added.
Formatting.

Original pull request: #191.
2020-02-21 13:16:15 +01:00
mhyeon-lee
06529abf5a DATAJDBC-488 - Avoid deadlocks by first accessing the root entity.
The previous process of deleting referencing entities, updating the root and then inserting referencing entities hat the potential of causing deadlocks.
When one process didn't obtain a lock on delete because there wasn't anything to delete root and referencing entities got locks in opposite order, which is a classical cause for deadlocks.

Original pull request: #191.
2020-02-21 13:15:46 +01:00
Mark Paluch
95428b7022 DATAJDBC-492 - Use JdbcMappingContext in AbstractJdbcConfiguration instead of RelationalMappingContext.
We use now a more concrete type in the configuration to avoid clashes when Spring Data R2DBC is on the class path.
2020-02-20 10:20:46 +01:00
Mark Paluch
d1df76c8b8 DATAJDBC-474 - After release cleanups. 2020-02-12 15:04:22 +01:00
Mark Paluch
f3d5eca356 DATAJDBC-474 - Prepare next development iteration. 2020-02-12 15:04:21 +01:00
Mark Paluch
527d98734a DATAJDBC-474 - Release version 2.0 M3 (Neumann). 2020-02-12 14:47:16 +01:00
Mark Paluch
98c54ae7c1 DATAJDBC-474 - Prepare 2.0 M3 (Neumann). 2020-02-12 14:46:56 +01:00
Mark Paluch
eaf4fa189b DATAJDBC-474 - Updated changelog. 2020-02-12 14:46:48 +01:00
Jens Schauder
91ddda0c3f DATAJDBC-479 - Polishing.
Fixes compiler error from rebase rebase.
Removes IdentifierProcessingAdapter since it wasn't used anymore
Merged UnquotedDialect with NonQuotingDialect since both served the same purpose of a simple Dialect for testing.
Formatting.

Original pull request: #187.
2020-02-11 20:28:05 +01:00
Mark Paluch
592f483699 DATAJDBC-479 - Use SqlIdentifier in SQL AST.
We now use SqlIdentifier to encapsulate names and aliases of tables, columns and functions.

We now use proper delegation to ConditionVisitor to render a JOIN condition.
Previously, we used toString() of Condition segments which rendered an approximation of the condition.
ConditionVisitor applies RenderContext settings that consider identifier quoting and normalization strategies.

Original pull request: #187.
2020-02-11 20:26:57 +01:00
Jens Schauder
595559bf28 DATAJDBC-484 - Fixes a JDK dependent test failure.
Beginning from JDK 10 `Instant` uses nanosecond precision which doesn't make it through the database.
This caused the test to fail.
This fix fixes only the test by making the assertion more lenient.
Actually storing and retrieving nanosecond precision time values is a separate issue.

Also reduced logging in tests again.
2020-02-07 15:35:52 +01:00
taeyeonkim
fe181b2bd9 DATAJDBC-483 - Fixes small documentation issues.
Add anchor to section on JdbcValue in reference documentation.
Correct the type of `BeforeSaveEvent` in example code.

Original pull request: #189.
2020-02-07 11:31:07 +01:00