Commit Graph

552 Commits

Author SHA1 Message Date
Mark Paluch
fa8b95c5f3 DATAJDBC-257 - Polishing.
Move container initialization from static initializer into createDataSource() to not trigger container start when loading the class.
Add TestExecutionListener to ignore tests if the license for a container was not accepted. Add Awaitility to delay test execution until the database is ready so we avoid strange failures due to a delayed container startup.

Fix generics, since tags, author tags. Reformat code.

Original pull request: #213.
2020-05-06 15:54:41 +02:00
Jens Schauder
4bf2b8d0a8 DATAJDBC-257 - Adds DB2 support.
Db2Dialect added in order to support DB2.
Added test configuration files.
Adapted some tests to make them properly work with DB2
QueryAnnotationIntegrationTests converted into an Hsqldb only test since it is next to impossible to make it work across databases since it heavily depends on database and driver specifics.

Removed license acceptance file from the repository in order to not accept a license in the name of someone forking the repository.
For the CI build an appropriate file gets created on the fly.

Original pull request: #213.
2020-05-06 15:49:07 +02:00
Mark Paluch
b0d37bda8a DATAJDBC-529 - Polishing.
Rearrange imports.

Original pull request: #212.
2020-05-05 13:48:53 +02:00
Jens Schauder
370ee4464e DATAJDBC-529 - Use specialized ResultSetExtractor for exists queries.
Exists queries do not look at the value returned in the ResultSet but just check if there is a row.

Original pull request: #212.
2020-05-05 13:45:19 +02:00
Greg Turnquist
2029a0c71d DATAJDBC-532 - Remove Travis CI. 2020-05-04 15:15:24 -05:00
Jens Schauder
ac88f1d4f9 DATAJDBC-530 - Polishing.
Original pull request: #210.
2020-05-04 09:19:35 +02:00
mhyeon-lee
f9bc40cc46 DATAJDBC-530 - The sorting property set as the property name.
Original pull request: #210.
2020-05-04 09:17:18 +02:00
Mark Paluch
8c70bbf7e0 DATAJDBC-517 - After release cleanups. 2020-04-28 15:11:43 +02:00
Mark Paluch
40037023f3 DATAJDBC-517 - Prepare next development iteration. 2020-04-28 15:11:42 +02:00
Mark Paluch
82f9e59b42 DATAJDBC-517 - Release version 2.0 RC2 (Neumann). 2020-04-28 15:03:53 +02:00
Mark Paluch
ba550a12d7 DATAJDBC-517 - Prepare 2.0 RC2 (Neumann). 2020-04-28 15:03:33 +02:00
Mark Paluch
1ad7044cd2 DATAJDBC-517 - Updated changelog. 2020-04-28 15:03:22 +02:00
Mark Paluch
6fc70b8e13 DATAJDBC-511 - Updated changelog. 2020-04-28 14:46:50 +02:00
Mark Paluch
3d4da895f9 DATAJDBC-495 - Updated changelog. 2020-04-28 11:59:00 +02:00
Jens Schauder
6420205eed DATAJDBC-524 - Fixed dependency cycles triggered by DATAJDBC-318.
Moved Identifier and IdentifierBuilder to ...jdbc.core.convert.
Moved RelationaAuditingCallback to ..mapping.event.

Improved DependencyTests to properly consider "relational" a main module.
2020-04-28 11:09:52 +02:00
Jens Schauder
d80614b4d8 DATAJDBC-318 - Fixed the generation of the select list.
The select list must include columns for 1:1 relationships.

The implementation is copied from SqlGenerator and will be unified in the near future.

Original pull request: #209.
2020-04-28 09:23:52 +02:00
Mark Paluch
aadbb667ed DATAJDBC-318 - Extend query method validation.
We now reject criteria predicates for collections, maps and references. The select list selects all columns until DATAJDBC-523 is solved.

Original pull request: #209.
2020-04-28 09:23:52 +02:00
Jens Schauder
fd98e16038 DATAJDBC-318 - Adding a failing test.
Added failing tests for entities with references.

Code deduplication.
Documentation wording.
Formatting.

Original pull request: #209.
2020-04-28 09:23:52 +02:00
Mark Paluch
999bf29321 DATAJDBC-318 - Initial support for query derivation.
Move JdbcRepositoryQuery into repository.query package. Split JdbcRepositoryQuery into AbstractJdbcQuery and StringBasedJdbcQuery.
Add QueryMapper for mapping of Criteria.
Initial support for query derivation.

Emit events and issue entity callbacks only for default RowMapper.
Custom RowMapper/ResultSetExtractor are in full control of the mapping and can issue events/callbacks themselves.

Update reference documentation.

Original pull request: #209.
2020-04-28 09:23:52 +02:00
Jens Schauder
2f3f00bd71 DATAJDBC-318 - Adapting DependencyTests.
Without this change we see cyclic dependencies between modules (i.e. subpackages).
The following subpackages had a cycle:

repository.query and repository.query.parser

PartTreeJdbcQuery and JdbcQueryCreator(repository.query from jdbc) depend on PartTree (repository.query.parser)

AbstractQueryCreator (repository.query.parser) depends on ParameterAccessor (repository.query from commons)

This change changes the definition of a module, bundling all the modules above into one module (repository).

Alternative changes that should fix the problem:
1. Move ParameterAccessor to a different (probably new package)
2. Move AbstractQueryCreator to a different (probably new package)
3. org.springframework.data.jdbc.repository.query to e.g. org.springframework.data.jdbc.repository.query.jdbc

Original pull request: #209.
2020-04-28 09:23:52 +02:00
Jens Schauder
c8cbdc5ea0 DATAJDBC-507 - Polishing.
Reduced code duplication.
Fixed Lombok related warnings.

Original pull request: #208.
2020-04-20 12:42:40 +02:00
tirbison
d7fe83c256 DATAJDBC-507 - Optimistic locking version for non primitives start with 0.
This makes the behaviour consistent with that of other Spring Data modules.

Original pull request: #208.
2020-04-20 12:42:40 +02:00
Jens Schauder
c20b63eef8 DATAJDBC-520 - Polishing.
Put the parts about references back.

Original pull request: #206.
2020-04-20 10:55:37 +02:00
orange-buffalo
32f997ebd9 DATAJDBC-520 - Improved documentation for MappedCollection annotation.
Original pull request: #206.
2020-04-14 14:40:15 +02:00
Mark Paluch
eb9e346c66 DATAJDBC-518 - Polishing.
Tweak Javadoc to reflect the used type. Create Criteria objects via Criteria.from(…) to expose the Criteria API without the need of casting.

Original pull request: #205.
2020-04-08 09:38:38 +02:00
Jens Schauder
8df5037061 DATAJDBC-518 - Allows the combination for CriteriaDefinition.
Original pull request: #205.
2020-04-08 09:38:33 +02:00
Jens Schauder
2b6f7b2b48 DATAJDBC-480 - Removed various deprecated symbols.
Removal of public API that was deprecated in version 1.1 or older.

Original pull request: #204.
2020-04-01 13:57:21 +02:00
Jens Schauder
10b4ea0a10 DATAJDBC-480 - Removed usage of deprecated EntityInstantiators and EntityInstantiator.
See also: DATACMNS-1639.

Original pull request: #204.
2020-04-01 13:57:16 +02:00
Mark Paluch
662d38b055 DATAJDBC-504 - After release cleanups. 2020-03-31 15:08:05 +02:00
Mark Paluch
89b81588b5 DATAJDBC-504 - Prepare next development iteration. 2020-03-31 15:08:04 +02:00
Mark Paluch
2fbf7f053e DATAJDBC-504 - Release version 2.0 RC1 (Neumann). 2020-03-31 14:59:41 +02:00
Mark Paluch
a61350425a DATAJDBC-504 - Prepare 2.0 RC1 (Neumann). 2020-03-31 14:59:20 +02:00
Mark Paluch
be2f1319a6 DATAJDBC-504 - Updated changelog. 2020-03-31 14:59:12 +02:00
Mark Paluch
2950a8b1ea DATAJDBC-516 - Consider simple types and custom conversions in BasicRelationalConverter read/write. 2020-03-31 12:32:14 +02:00
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