This allows ordering by functions like:
ORDER BY GREATEST(table1.created_at, table2.created_at) ASC
or by arbitrary SQL snippets
orderBy(OrderByField.from(Expressions.just("1")).asc()) => ORDER BY 1 ASC
Original pull request #1348
Do not expose setForeignKeyNaming methods on NamingStrategy to make less assumptions about how a naming strategy gets implemented. Provide getRequiredLeafEntity method on PersistentPropertyPathExtension to reduce null and state assertion checks.
Refine getTableName/getQualifiedTableName approach to reduce API surface and avoid deprecations.
See #1147
Original pull request: #1324.
The new default is to take `@Table` annotations into account.
The behaviour can be configured by setting the `foreignKeyNaming` property on the `RelationalMappingContext`.
Closes#1162
See #1147
Original pull request: #1324.
The default version is the behavior that existed so far:
The back reference is the table name as generated by the `NamingStrategy` without taking `@Table` annotations into account.
The new alternative is to take `@Table` into account.
The behavior can be configured by setting the `foreignKeyNaming` property on the `RelationalMappingContext`.
Closes#1161Closes#1147
Original pull request: #1324.
You may now annotate properties of the aggregate root with `@InsertOnlyProperty`.
Properties annotated in such way will be written to the database only during insert operations, but they will not be updated afterwards.
Closes#637
Original pull request #1327
Use consistent method and argument names for newly introduced methods. Reorder and group template API methods to keep related methods together.
See: #1315
Original pull request: #1324.
Code changes to check for both null and empty criteria before proceeding to where clause generation avoids exception.
Closes#1329
Original pull request #1338
Modifying queries are executed directly against the database.
No events or callbacks get called.
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.
Closes#970
Quoting is important since it allows use of keywords as names.
We do not change the letter casing.
In a default setup the database does not care since it is case-insensitive.
If configured to be case-sensitive it makes sense to pass on what ever letter casing there is, since you seem to care.
Closes#1216
See #914
Delete operations that receive a version attribute throw an `OptimisticFailureException` when they delete zero rows.
Otherwise, the NOOP delete gets silently ignored.
Note that save operations that are determined to be an update because the aggregate is not new will still throw an `IncorrectUpdateSemanticsDataAccessException` if they fail to update any row.
This is somewhat asymmetric to the delete-behaviour.
But with a delete the intended result is achieved: the aggregate is gone from the database.
For save operations the intended result is not achieved, hence the exception.
Closes#1313
Original pull request: #1314.
See https://github.com/spring-projects/spring-data-commons/issues/2651
We now issue a COUNT(1) respective SELECT 1 for COUNT queries and EXISTS queries for entities that do not specify an identifier.
Previously these query projections could fail because of empty select lists.
Closes#1310
We now use concatMap on result Fluxes to retain the object order. Previously, we used flatMap on a flux that has led to changes in element ordering.
Closes#1307
We now properly bind values for reused named parameters correctly when using anonymous bind markers (e.g. ? for MySQL). Previously, the subsequent usages of named parameters especially with IN parameters were left not bound.
Closes#1306
This removes most currently deprecated code.
An exception are various deprecations in Spring Data R2DBC for which it is not obvious how to modify the code that is still using the deprecated API.
Original pull request #1304
When the key column of a MappedCollection is also present in the contained entity that column got select twice.
We now check if the column already gets selected before adding it to the selection.
This only works properly if the column names derived for the entity property and the key column match exactly, which might require use of a `@Column` annotation depending on the used NamingStrategy.
Closes#1073
Original pull request #1074
Reuse H2 dialect settings in R2DBC-specific H2 dialect.
Refactor ArrayColumns support classes, into toplevel-types. Let R2DBC H2 sublass the relational H2Dialect to decouple from Postgres.
See #1287
Original pull request #1297