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.
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.
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.
Removed the Interpreter and replaced it with AggregateChangeExecutor and AggregateChangeExecutionContext.
The latter handles the mutable data like ids and versions.
Original pull request: #197.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
We now no longer require MappingContext to create BasicRelationalPersistentProperty and BasicJdbcPersistentProperty.
We require only the NamingStrategy so we're just passing that one instead of the entire context.
Original pull request: #186.
RelationalPersistentProperty.getColumnType() and getSqlType() are no longer members of RelationalPersistentProperty but part of the JdbcConverter. Both methods have a strong affinity to JDBC-specifics and belong rather into the conversion strategy and not into mapping-metadata.
Original pull request: #186.
Parameters now get converted to a suitable type supported by JDBC.
In order to support this the logic of finding the "right" type got moved from `BasicRelationalPersistentProperty` to `JdbcCompatibleTypes`.
Original pull request: #186.
Tests that used the `@Column` annotation to map multiple properties to a single database column failed.
Mapping multiple values to one column is possible to allow for entities inside an aggregate to have the id of the aggregate as ID or as part of the ID.
The reason for the test failures was that columns get referred to by different ways:
Once per DerivedSqlIdentifier (i.e. with normalized spelling).
And Once per `@Column` annotation.
SqlIdentifier from an `@Column` annotation have always the same spelling, while the normalized version depends on the `Dialect`.
In order to make the tests work for all databases all references to the column in question had to get a `@Column` annotation.
This in turn required the create scripts to also use quoting when the normal case of the database did not match the case chosen in the annotation.
Finally there were some tests that used hand coded SQL which now uses `SqlIdentifier` and an injected `Dialect` to arrive at the correct SQL syntax.
Removed a couple of `@Ignore` annotations that got left in the code.
Original pull request: #182.
Fix bind marker rendering for delete by Id.
SqlIdentifier provides now a transform(…) method to transform its content instead of exposing prefix(…) and suffix(…) methods. Composite identifiers are created through SqlIdentifier.from(…) instead of exposing a concat(…) method.
We also now apply identifier normalization only to derived identifiers instead of applying normalization to annotated column and table names. This change requires references to derived field names to honor the appropriate letter casing.
Identifier quotation can be disabled globally, via RelationalMappingContext.setForceQuote(false).
Move SqlIdentifier to relational.core.sql package.
Original pull request: #182.
All database identifiers, i.e. table names, column names and so on, now get quoted.
For most databases this means they get enclosed with double quotes.
For some databases this makes the the identifiers case sensitive.
In order to minimize the impact we convert identifiers their default letter casing.
This should be upper case according to the SQL standard but isn't for some databases.
The exact behavior regarding quoting and default letter casing gets controlled by a database specific `Dialect`.
Future changes will make the quoting of annotated columns and the default quoting behavior configurable.
Original pull request: #182.
The default name now does include the name of the domain class.
The default name now is no longer used when no query with the name specified in the `@Query` annotation is found.
Simplified the unit tests by extracting common functionality and improving naming.
Simplified test configuration.
Original pull request: #180.