Commit Graph

511 Commits

Author SHA1 Message Date
Mark Paluch
8c6364b4bf Polishing.
Simplify R2DBC expression handling. Use new ValueExpression API instead of holding parameter binding duplicates.

Reformat code. Add author tags.

See #1904
Original pull request: #1906
2024-10-09 13:35:18 +02:00
Marcin Grzejszczak
d526cd3a22 Add support for Value Expressions for Repository Query methods.
Closes #1904
Original pull request: #1906
2024-10-09 13:35:16 +02:00
Mark Paluch
8622d70ba4 Polishing.
Refine tests. Extend comment for future-me.

See #1900
Original pull request: #1903
2024-10-02 15:08:11 +02:00
Jens Schauder
ae8651869e Do not convert binary data in List<byte[]> to array SQL type.
byte[] is mapped to BINARY data and is not considered tuple data.

The explicit check for byte[] is not very nice but matches the special handling in MappingJdbcConverter.writeJdbcValue

Closes #1900
Original pull request: #1903
2024-10-02 15:08:10 +02:00
Jens Schauder
b3040a1044 Removes superfluous EnabledOnDatabase.
Closes #1902
2024-10-01 15:57:04 +02:00
Mark Paluch
7cf81aed35 Polishing.
Replace code duplications with doWithBatch(…) method. Return most concrete type in DefaultDataAccessStrategy and MyBatisDataAccessStrategy.

See #1623
Original pull request: #1897
2024-10-01 09:10:59 +02:00
Jens Schauder
c4f62e9f56 Return List instead of Iterable in JDBC Repositories and JdbcAggregateOperations.
Closes #1623
Original pull request: #1897
2024-10-01 09:10:58 +02:00
Jens Schauder
4d5a382a73 Polishing.
Original pull request #1901
2024-09-30 12:20:11 +02:00
Mikhail2048
08daf47842 Refactoring.
Clarified nullabillity for Identifier.
Removed usage of deprecated constructor for StringBasedJdbcQuery.

Original pull request #1901
2024-09-30 12:18:43 +02:00
Tran Ngoc Nhan
146e5495df Minor refactoring.
Original pull request #1895
2024-09-24 09:09:08 +02:00
Tran Ngoc Nhan
9277792d87 Polishing.
Original pull request #1894
2024-09-23 09:20:47 +02:00
Mark Paluch
033ac1f95a Polishing.
Refactor JdbcLookupStrategy to not generally require BeanFactory. Reintroduce deprecated setBeanFactory(…) method.

See #1872
Original pull request: #1874
2024-09-16 09:10:12 +02:00
Jens Schauder
d2bb64f4ca StringBasedJdbcQuery no longer requires BeanFactory.
The lookup is now performed by the `RowMapperFactory`.

Closes #1872
Original pull request: #1874
2024-09-16 09:10:12 +02:00
Jens Schauder
9e91a0e7a5 Polishing.
Fix Javadoc.

See #1872
Original pull request: #1874
2024-09-16 09:10:12 +02:00
Jens Schauder
615c79cb3e Polishing.
See #1873
Original pull request #1875
2024-09-12 09:24:43 +02:00
Mikhail2048
1b9b9b2ed2 Add converter for microsoft.sql.DateTimeOffset.
Original pull request #1875
Closes #1873
2024-09-12 09:23:35 +02:00
Tran Ngoc Nhan
7b2c4e5f23 Remove unused imports.
Original pull request #1877
2024-09-09 08:58:02 +02:00
Mark Paluch
72774135a7 Polishing.
Remove Preprocessor interface. Add property accessors to RelationalQueryLookupStrategy. Reuse property accessors instead of loosely coupled object access.

See #1856
Original pull request #1863
2024-09-04 10:04:55 +02:00
Jens Schauder
f937738038 Support for table names in SpEL expressions.
SpEL expressions in queries get processed in two steps:

1. First SpEL expressions outside parameters are detected and processed.
This is done with a `StandardEvaluationContext` with the variables `tableName` and `qualifiedTableName` added.
This step is introduced by this commit.

2. Parameters made up by SpEL expressions are processed as usual.

Closes #1856
Original pull request #1863
2024-09-04 10:04:55 +02:00
Jens Schauder
4221840538 Polishing.
Fixing a test used for performance reasons.

Formatting a test.
Removing public modifier.
Separating test methods from infrastructure.

Original pull request #1863
See #1856
2024-09-04 10:04:54 +02:00
Jens Schauder
b006923f0d Polishing.
Original pull request #1869
2024-08-30 13:28:27 +02:00
Jens Schauder
848ffee253 Remove deprecated code.
Original pull request #1869
2024-08-30 13:28:01 +02:00
arefbehboudi
c8b9697c51 Refactor code with instanceof pattern variable.
In some cases, we currently use the traditional `instanceof` checks followed by explicit type casting.
With the introduction of pattern matching in recent Java versions, we can refactor these checks to make the code more concise and readable.

Original pull request #1868
2024-08-30 10:13:48 +02:00
Jens Schauder
9b0b91bfd0 Avoid selection of duplicate columns.
Closes #1865
2024-08-29 12:32:29 +02:00
Jens Schauder
7e6f5482ba Dedicated exception for aggregate roots without id property.
We now distinguish between an id not set during insert and a supposed aggregate root without id property.

Closes #1502
Original pull request #1855
2024-08-14 13:19:47 +02:00
Jens Schauder
1c756795d1 Polishing.
Formatting and removing public modifier from test methods.

See #1502
Original pull request #1855
2024-08-14 13:18:52 +02:00
Christoph Strobl
2040247a11 Add support for using custom BeanNameGenerator.
Closes: #1853
2024-08-09 11:19:37 +02:00
Mark Paluch
4978b4c0e3 Polishing.
Correctly assign SQL type for tuples.

See #1323
Original pull request: #1838
2024-07-23 13:42:37 +02:00
Mark Paluch
f0d3b5e425 Polishing.
Refactor convertAndAddParameter method to writeValue(…) decoupling responsibilities for a clearer value conversion code path. Also, refactor collection conversion to functional callback-style and extend test assertions.

See #1323
Original pull request: #1838
2024-07-22 15:05:19 +02:00
Jens Schauder
8241aa1222 Allow passing of tuples to repository query methods.
Closes #1323
Original pull request: #1838
2024-07-22 15:05:18 +02:00
Jens Schauder
23d91d62bb Run test only on HsqlDb.
JdbcRepositoryEmbeddedIntegrationTests no longer runs for all databases, since it doesn't tests anything specific to differen RDBMSs.
Therefore the test also got renamed.

See #1565
2024-07-17 11:18:17 +02:00
Jens Schauder
b3a1dc5638 Consider sanitised names when copying parameter sources.
Closes #1565
2024-07-17 11:13:02 +02:00
Jens Schauder
1b091da5ee Polishing.
Make test methods package private.

See #1565
2024-07-17 10:57:25 +02:00
Jens Schauder
82c84342a2 Replaced all usage of catalog with schema.
Catalog was used by mistake.
Spring Data JDBC has no support for multiple catalogs, only for multiple schema.

Closes #1729
2024-07-16 09:55:47 +02:00
Jens Schauder
effc162d6f Add public factory method to SubselectExpression.
This allows using Select instances as Expression where this isn't yet anticipated.

Closes #1831
2024-07-16 09:55:47 +02:00
Oliver Drotbohm
112c084b29 Avoid double-conversion of values considered simple.
MappingJdbcConverter previously tried to create a JdbcValue for simple values via the ConversionService, only to drop the conversion result if the conversino did not result in a JdbcValue eventually. In that case it triggered an additional (same) conversion to then handle the wrapping of the conversion result into a JdbcValue manually.

This commit alters the flow so that it only triggers the conversion once and manually applies the JdbcValue wrapping only if the result of the original conversion is not a JdbcValue, yet.

Original pull request #1830
2024-07-09 10:03:26 +02:00
Jens Schauder
7bd907c5e6 Fix regression of loading empty arrays.
Closes #1826
See #1812
2024-07-02 15:07:52 +02:00
Jens Schauder
eaa3d66842 Use first column in case of duplicate columns.
Also, fallback on column names when label is not present.

See #1680
Original pull request #1825
2024-07-01 13:33:19 +02:00
Jens Schauder
faee85116a Reestablish warning on duplicate column in query.
Closes #1680
Original pull request #1825
2024-07-01 13:33:18 +02:00
Jens Schauder
5c76ddca9e Fix Auditing for embedded fields.
The reason for auditing to not work on embedded fields is that EmbeddedRelationalPersistentProperty and BasicRelationalPersisntentProperty were not considered equal even when they represent the same field.

Note: the fix is somewhat hackish since it breaks the equals contract for EmbeddedRelationalPersistentProperty.

Closes #1694
See 1545e184ef
2024-06-27 10:39:12 +02:00
Jens Schauder
236d054a0e Create one connection pool for Oracle.
We now use one pooled `DataSource` for Oracle.

This should avoid problems with the TNS-Listener, which seems to have a problem with constantly opening and closing connections.

Closes #1815
Original pull request #1816
2024-06-14 09:17:37 +02:00
Jens Schauder
0a1bb2b48d Refine embeddable emptiness checks to consider whether the collection holds entities.
Embedded entities which contain a empty collection of values that aren't entities are now considered empty, if this collection is empty.

Closes #1737
Original pull request: #1812
2024-06-11 10:21:05 +02:00
Paul Jones
cf26d7e6bc Add unit tests to verify DTO projection with AggregationReference.
Closes #1759
2024-06-10 15:16:27 +02:00
Mark Paluch
702002a538 Polishing.
Simplify code. Remove redundant calls.

Reformat code, remove trailing whitespaces, remove duplicate tests.

See #1802
Original pull request: #1810
2024-06-10 11:15:14 +02:00
Jens Schauder
9e12d0acd5 Fix usage of wrong id value in related selects.
In an aggregate A->B-Collection<C> a select gets executed for loading Collection<C>.
That select used the wrong ID when B had an ID with the same name as A.

This is now fixed.

Closes #1802
Original pull request: #1810
2024-06-10 11:15:13 +02:00
LLEFEVRE
97cf38f1db Upgrade Oracle Database version.
Upgrade database itself to the latest 23ai version.
The JDBC driver to 23.4.0.24.05
The R2DBC driver to 1.2.0

Closes #1804
Original pull request #1805
2024-06-06 16:07:11 +02:00
Mark Paluch
967f0f9179 Upgrade to SQL Server 2022-latest.
See #1768
2024-05-23 08:48:41 +02:00
Mark Paluch
121d3723d6 Polishing.
Reduce test element visibility.

See #1750
Original pull request: #1785
2024-05-15 14:57:00 +02:00
Mark Paluch
3224b49117 Move AggregateReference converter registration into MappingJdbcConverter.
See #1750
Original pull request: #1785
2024-05-15 14:57:00 +02:00
Jens Schauder
08710d8e16 Reuse custom converters from AggregateReferenceConverters.
Let the AggregateReference converters now receive also custom converters as delegates.
Remove the ArrayToObjectConverter which just uses the first element of the array from the DefaultConversion service.

This does NOT solve the underlying problem, of having two DefaultConversionServices at work.
One is in the store conversion, one constructed in the AbstractRelationalConverter.
Although it looks like they get merged, the former contains converters, using that ConversionService as a delegate.

Attempts were made to move AggregateReferenceConverters out of the store converters and just register them directly,
but then no custom read/write targets are detected, leading to failed conversions.
The same problem prevents a registration in CustomConversions as a Function<ConversionService, GenericConverter> or similar, which would allow late registration.
The problem here is that custom read/write targets require the function to get evaluated, before custom read/write targets can be determined.

Closes #1750
Original pull request: #1785
2024-05-15 14:56:58 +02:00