Commit Graph

368 Commits

Author SHA1 Message Date
Jens Schauder
4edb39800e Move Lock to relational module.
This allows both Spring Data R2DBC and Spring Data JDBC to use the same annotation.

See spring-projects/spring-data-jdbc/issues/1041, spring-projects/spring-data-r2dbc/pull/720, spring-projects/spring-data-jdbc/pull/1158
2022-02-22 16:17:22 +01:00
Jens Schauder
a4e04dde56 Avoid conversion when return value is null.
Closes #1167
2022-02-21 15:16:28 +01:00
Mark Paluch
9a42776381 Import Spring Data R2DBC module into Spring Data Relational.
Closes #1179
2022-02-21 10:43:01 +01:00
Oliver Drotbohm
99d2f62646 Adapt to changes in entity creation metadata APIs in Spring Data Commons. 2022-02-16 08:01:00 +01:00
Jens Schauder
21a2228204 Fixes NPE in PersistentPropertyPathExtension.equals.
Closes #1164
2022-02-15 11:49:00 +01:00
Jens Schauder
606f63b2ab Polishing.
Adding references to issues on test annotations.
Made test methods package private.

See #1164
2022-02-15 11:49:00 +01:00
Jens Schauder
351ed47d7c Polishing.
Refactored the unit tests to include a negative case and to separate the different scenarios tested.

Removed the default LockMode from the Lock annotation.
I have the feeling that most users will assume an exclusive Lock when none is specified, but also don't want to request stronger locks than required.

Original pull request #1158
See #1041
2022-02-15 11:49:00 +01:00
Diego Krupitza
11a236402b Introduced pessimistic locks for derived queries.
Methods which use the derive query functionality now can be annotated with `@Lock` to used a given `LockMode`. Right now there are two different modes `PESSIMISTIC_READ` and `PESSIMISTIC_WRITE`. Based on the dialect the right select is generated. For example for HSQLDB `Select ... FOR UPDATE`.

See #1041
Original pull request #1158
2022-02-15 11:49:00 +01:00
Jens Schauder
4066df9cf9 Polishing.
Rename "null handling" to "null precedence".
This is somewhat inconsistent with commons null handling, but more descriptive.

Minor formatting.

Original pull request #1156
See #821
2022-02-15 11:49:00 +01:00
Chirag Tailor
60a59b61c1 Null precedence is now supported if the underlying database supports it.
Original pull request #1156
Closes #821
2022-02-15 11:48:59 +01:00
Jens Schauder
73a6b3390e Replaces java.sql.Types constants with java.sql.SQLType values.
java.sql.Types constants are int values and therefore make it tedious to read and debug the code.
SQLType values are mostly enum constants which are much nicer to use.

Original pull request #1142
2022-02-15 11:46:55 +01:00
Jens Schauder
38372544f3 Polishing.
See #1046
Original pull request #1144
2022-02-15 11:40:32 +01:00
Jens Schauder
7babd7ab86 Replaces broken test with a working one.
See #1046, #498
Original pull request #1144
2022-02-15 11:40:10 +01:00
Chirag Tailor
9aa67f5e51 Support element conversion of array results.
This is achieved by passing the full availabe type information of the conversion target to the conversion service.

This broke a test which wasn't functional in the first place which becomes obvious when adding the proper assertion.

Closes #1046
Original pull request #1144
2022-02-15 11:39:52 +01:00
Jens Schauder
45b4092e8c Follow through with the split of CRUD repository and sorting repository.
See #1165
2022-02-11 11:18:20 +01:00
Mark Paluch
5a312d4b2d Prepare next development iteration.
See #1126
2022-01-14 14:43:19 +01:00
Mark Paluch
595d58b18a Release version 3.0 M1 (2022.0.0).
See #1126
2022-01-14 14:35:09 +01:00
Jens Schauder
07cef3f21a Moved JdbcValue
This avoids cyclic dependencies between mapping and conversion.

Closes #1062
See #1128
2022-01-14 09:31:13 +01:00
Jens Schauder
a5d584ec42 Remove Eclipse Non-Javadoc comments.
Closes #1120
2022-01-14 08:48:28 +01:00
Jens Schauder
4042522474 Reimplemented dependency tests using ArchUnit.
Moved RelationalAuditingCallback and JdbcArrayColumns to remove dependency cycle.

Closes #1058
Original pull request #1107
2022-01-14 08:48:28 +01:00
Jens Schauder
a75dba3d20 Moving off removed constructor of AuditHandler
See #1055
2022-01-14 08:48:28 +01:00
Jens Schauder
2646fd5bba Disabling Degraph DependencyTests.
See #1058
2022-01-14 08:48:28 +01:00
Jens Schauder
f0bc1b179f Fixed inconsistent poms.
See: #1055
2022-01-14 08:48:27 +01:00
Jens Schauder
794b031507 Prepared move of JdbcValue to mapping.
This is to avoid dependency cycles between mapping and conversion.

Closes #1128
2022-01-14 08:45:05 +01:00
Jens Schauder
09f78c4786 Add JdbcValue as a simple type.
Closes #1122
2022-01-12 11:45:36 +01:00
Jens Schauder
1acb66645d Fix missing class issue with H2 version 2.0.202
With older versions H2 returned a proprietary  instance of `TimestampWithTimeZone` from `ResultSet.getObject()`.
We used to support the conversion of that to an `OffsetDateTime`.

With the most recent versions `TimestampWithTimeZone` is no longer part of the H2 driver, and we only register the converter when we encounter older versions of H2.

Closes #1114
See https://github.com/h2database/h2database/pull/1359
2021-12-17 09:15:55 +01:00
Jens Schauder
ee1f420d81 Polishing.
Original pull request #1097
2021-12-07 15:22:57 +01:00
Charles
af72307d4b Fix Flaky Tests.
Original pull request #1097
2021-12-07 15:02:27 +01:00
Jens Schauder
cdff3850ae Migrate off Slf4J to JCL.
Closes #1091
Original pull request #1092
2021-12-07 10:58:11 +01:00
Jens Schauder
2fc35f4ced Postgres geometric types are considered simple.
Closes #1065
Original pull request #1085
2021-12-07 10:42:50 +01:00
Jens Schauder
61c6438bc3 Polishing.
Simplified the code structure.
Ensured backward compatibility by recreating some methods often immediately deprecating them.

Moved new classes to the places where they belong, so that the package ...core.sql.render depends on ...core.dialect and not the other way round.
This causes dependency cycles because dependencies in the other direction already exists.
This will be properly fixed by #1105.
For now the offending classes are ignored by the DependencyTests.

See #777
See #1105

Polishing
2021-12-01 13:39:54 +01:00
Mikhail-Polivakha
7551cbd763 Support inserts for id only entities.
This broke in the past for some databases that do not support empty value lists.

Closes #777
Original pull request #1047
2021-11-29 15:24:24 +01:00
Jens Schauder
7dc249d117 Prepare next development iteration.
See #1070
2021-11-12 10:59:41 +01:00
Jens Schauder
5040f949c9 Release version 2.3 GA (2021.1.0).
See #1070
2021-11-12 10:49:36 +01:00
Mark Paluch
239f8c75bd Polishing.
Use column aliases in order-by/expressions when column is aliased. Reduce method visibility in tests.

Closes #968
Original pull request: #1080.
2021-11-08 10:22:07 +01:00
Jens Schauder
7d1ed85cbe Use fully qualified names in ORDER BY clause.
Closes #968
Original pull request: #1080.
2021-11-08 10:22:03 +01:00
Jens Schauder
baee76a46d Make Oracle tests work with Testcontainers 1.16.2.
The new Testcontainers version comes with a standard Oracle image configured and doesn't work with the one we used so far.
Making the standard image work required some tweaks to the setup so that the test user has the required privileges.

Closes #1081
2021-11-05 09:20:16 +01:00
Mark Paluch
546d7dccda Prepare next development iteration.
See #1052
2021-10-18 13:55:38 +02:00
Mark Paluch
a8fc77b14c Release version 2.3 RC1 (2021.1.0).
See #1052
2021-10-18 13:48:13 +02:00
Mark Paluch
4be6bc21ad Polishing.
Reduce test element visibility according to JUnit 5 requirements.

See #1061
2021-10-06 09:07:17 +02:00
Mark Paluch
09596ce1eb Log a warning when a query method is annotated with a query and a query name.
We now log when a query method has an ambiguous declaration to clarify that the declared query is used.

Closes #1061.
2021-10-06 09:07:16 +02:00
Jens Schauder
3cd25ee01f Introducing AfterConvertCallback/Event.
This is to replace the AfterLoadCallback/Event in order to match the naming of other store modules.

AfterLoadCallback/Event is still in place for now, but deprecated.

Closes #1053
Original pull request: #1060.
2021-10-01 10:33:59 +02:00
Mark Paluch
b02ee3c083 Polishing.
Encapsulate array support in JdbcArrayColumns.

See #1033
Original pull request: #1037.
2021-09-30 14:35:41 +02:00
Jens Schauder
933b2f125d Add the appropriate SQL type representation for floats in Postgres arrays.
Note that there is a separate problem with loading arrays of floats.

Original pull request #1037
See #1046
2021-09-30 14:35:34 +02:00
Jens Schauder
bc0d307415 SQL type used in array construction depends on Dialect.
Postgres requires the non standard type "FLOAT8" for "DOUBLE".
This is accomplished by making the conversion dependent on the dialect.

This required a new JdbcDialect interface in order to keep the JDBC annotation out of the relational module.

Closes #1033
Original pull request: #1037.
2021-09-30 14:35:03 +02:00
Mark Paluch
22e57fdffc Polishing.
See #1022
Original pull request: #1039.
2021-09-28 15:53:20 +02:00
Jens Schauder
cc6859b8b8 Fixes annotated named queries.
@Query.name wasn't considered when trying to find a named query for a query method.

Closes #1022
Original pull request: #1039.
2021-09-28 15:53:10 +02:00
Jens Schauder
f6eacf327c Support for in line queries for tables.
`InlineQuery` can be used wherever a `Table` was used up to now.

```
Table one = ...;
Select select = Select.builder()
		.select(one.column("id"), employee.column("name"))
		.from(one)
		.build();

InlineQuery inline = InlineQuery.create(select, "inline");
Select select = Select.builder()
		.select(inline.column("id"), inline.column("name"))
		.from(inline)
		.build();
```

Join and From renderer now use the same FromTableVisitor.
Also the SelectListVisitor reuses now the ExpressionVisitor.

Fixes #1003
Original pull request: #1018.
2021-09-28 10:50:51 +02:00
Mark Paluch
562561b93c Prepare next development iteration.
See #1026
2021-09-17 09:52:18 +02:00
Mark Paluch
a0cdb079d5 Release version 2.3 M3 (2021.1.0).
See #1026
2021-09-17 09:44:56 +02:00