Commit Graph

85 Commits

Author SHA1 Message Date
Mark Paluch
938a52cb33 DATAJDBC-391 - Revise readme for a consistent structure. 2019-07-09 11:19:19 +02:00
Jens Schauder
51b3a8cb11 DATAJDBC-383 - preliminary fix for not using http for MyBatis DTDs.
Currently there seems to be now well maintained https resource for MyBatis DTDs.
We therefore use the tagged sources directly for now.

See also: https://github.com/mybatis/mybatis-3/issues/1559
2019-06-18 11:01:35 +02:00
Christoph Strobl
c6b1894eed DATAJDBC-360 - Prepare next development iteration. 2019-06-14 15:12:51 +02:00
Christoph Strobl
2d2264048b DATAJDBC-360 - Release version 1.1 RC1 (Moore). 2019-06-14 14:44:25 +02:00
Christoph Strobl
b65f866fd5 DATAJDBC-384 - Polishing.
Update nullable annotations.

Original Pull Request: #157
2019-06-13 13:43:23 +02:00
Jens Schauder
bd03ef83d6 DATAJDBC-384 - Fixed MyBatisDataAccessStrategy.findAllByPath.
findAllByPath now falls back to the older findAllByProperty for better backward compatibility.
Also the path is included in the query name used for MyBatis.

Original Pull Request: #157
2019-06-13 13:42:58 +02:00
Christoph Strobl
3524d7bacf DATAJDBC-378 - Polishing
Move non integration tests to separate class.

Original Pull Request: #155
2019-06-13 10:32:58 +02:00
Jens Schauder
619396357a DATAJDBC-378 - Proper handling of null and empty collections in JdbcAggregateTemplate.
Original Pull Request: #155
2019-06-13 10:03:59 +02:00
Mark Paluch
bb70b89211 DATAJDBC-377 - Use testcontainers version property.
We now use the version property from Spring Data Build and import testcontainers-bom.
2019-05-22 14:57:46 +02:00
Jens Schauder
ebe76a0c7f DATAJDBC-374 - Polishing.
Clarified the effects of collections on nullable embedded entities.

Original pull request: #154.
2019-05-22 12:49:17 +02:00
Christoph Strobl
55a3f9c372 DATAJDBC-374 - Introduce shortcuts for Embedded#onEmpty(…)
@Embedded.Nullable & @Embedded.Empty offer shortcuts for @Embedded(onEmpty = USE_NULL) and @Embedded(onEmpty = USE_EMPTY) to reduce verbositility and simultaneously set JSR-305 @javax.annotation.Nonnull accordingly.

    @Embedded.Nullable
    EmbeddedEntity embeddedEntity;

Original pull request: #154.
2019-05-22 12:47:24 +02:00
Christoph Strobl
5830b83cf4 DATAJDBC-374 - Add onEmpty attribute to Embedded annotation.
The onEmpty attribute allows to define if an embedded entity should be set to null or a default instance if all properties backing the entity are actually null.

    @Embedded(onEmpty = USE_NULL)
    EmbeddedEntity embeddedEntity;

Original pull request: #154.
2019-05-22 12:46:46 +02:00
Mark Paluch
f69aa31958 DATAJDBC-223 - Polishing.
Simplify conditionals with nested ternary operators. Migrate RelationResolver.findAllBy to returning Iterable of Object instead of T as there is no type contract present. Use Spring utilities where applicable. Simplify tests. Fix warnings, Javadoc, Formatting.

Original pull request: #153.
2019-05-22 11:57:52 +02:00
Jens Schauder
097190ee42 DATAJDBC-223 - Chains of Lists or Maps get properly stored and loaded.
Also solved DATAJDBC-369 since it made refactoring easier.

Known limitation: Back-references to intermediate key columns currently can't get renamed and use the name defined by the property where they become part of the path.

Backward compatibility of the JdbcConfiguration is still broken.

Original pull request: #153.
2019-05-22 11:57:21 +02:00
Mark Paluch
221eb9dcc8 DATAJDBC-363 - Prepare next development iteration. 2019-05-13 12:17:52 +02:00
Mark Paluch
75aabdabba DATAJDBC-363 - Release version 1.1 M4 (Moore). 2019-05-13 11:59:50 +02:00
Jens Schauder
bf3f99c585 DATAJDBC-370 - Polishing.
Refactored code to better use existing code.

Original Pull Request: #151
2019-05-13 09:24:13 +02:00
Christoph Strobl
3a89ec0444 DATAJDBC-370 - Fix read/write of nulled embedded objects.
We now allow read and write of Objects annotated with Embedded that are actually null.
When writing all contained fields will be nulled.
Reading back the entity considers an embedded object to be null itself if all contained properties are null within the backing result.

Relates to DATAJDBC-364

Original Pull Request: #151
2019-05-13 09:24:13 +02:00
Christoph Strobl
7f50c92477 DATAJDBC-370 - Polishing.
Re add wither method and add explicit test for immutable value.

Original Pull Request: #151
2019-05-13 09:23:57 +02:00
Jens Schauder
5854922ae8 DATAJDBC-370 - Fixed handling of entities with no withers.
We tried to set all the properties, even when they were already set via constructor.
Fixed it by unifying the three instances where we created and populated instances.

Original Pull Request: #151
2019-05-13 09:21:53 +02:00
Jens Schauder
060e404991 DATAJDBC-370 - Polishing.
Adding a missing issue reference to a test.

Original Pull Request: #151
2019-05-13 09:21:28 +02:00
Mark Paluch
f43f054eff DATAJDBC-359 - Polishing.
Deprecate remaining DataAccessStrategy types in jdbc.core and create replacements in jdbc.core.convert. Migrate using code to replacement types.

Simplify warnings and if flows. Add since version to deprecations.

Move MyBatisDataAccessStrategyUnitTests from core to mybatis package.

Original pull request: #150.
2019-05-07 15:48:25 +02:00
Jens Schauder
b1c68d901e DATAJDBC-359 - Support for arbitrary chains of entities with or without Id.
Introduced a `ReadingContext` in the `EntityRowMapper` to avoid passing the `ResultSet` and the `path` all over the place.

Added a dependency test to Spring Data Relational and fixed the test failure by moving the PersistentPropertyPathExtension to core.mapping.

Original pull request: #150.
2019-05-07 15:48:10 +02:00
Michael Simons
eb90efc24a DATAJDBC-361 - Fix minor typos in SqlGenerator.
Original pull request: #148.
2019-04-12 12:29:35 +02:00
Christoph Strobl
727af3658f DATAJDBC-337 - Prepare next development iteration. 2019-04-11 12:00:19 +02:00
Christoph Strobl
7d48a3f98a DATAJDBC-337 - Release version 1.1 M3 (Moore). 2019-04-11 11:24:31 +02:00
Mark Paluch
141f2d77ac DATAJDBC-340 - Polishing.
Encapsulate column caches in Columns type.

Relax RelationalMappingContext to MappingContext with appropriate generics. Remove unused SQL generator source. Cache table and Id column objects. Simplify assertions. Consistently use naming pattern for named parameters.

Migrate http URLs to https.

Original pull request: #147.
2019-04-09 09:48:38 +02:00
Jens Schauder
810c62b603 DATAJDBC-340 - Using new SQL generation DSL.
SqlGenerator basically got rewritten using the new SQL rendering API.

The SQL rendering API got some minor improvements in the process.

The whole generation process is now based on paths instead of properties which makes the actual logic of the construction much more obvious.

Original pull request: #147.
2019-04-09 09:38:41 +02:00
Jens Schauder
ea089becee DATAJDBC-346 - Polishing.
Original pull request: #144.
2019-04-08 11:03:53 +02:00
Salim Achouche
1481803ab9 DATAJDBC-346 - Fixed test failures when using MSSQL database.
Original pull request: #144.
2019-04-08 11:03:38 +02:00
Sanghyuk Jung
082eafb62d DATAJDBC-355 - Remove unnecessary null check.
The source parameter must not be null according to Javadoc of Converter.

See also: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/core/convert/converter/Converter.html

Original pull request: #146.
2019-04-08 10:18:05 +02:00
Mark Paluch
6f18648412 DATAJDBC-354 - Fix test fixture after Mockito upgrade. 2019-04-08 08:48:14 +02:00
Spring Operator
913238a822 DATAJDBC-336 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 282 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #140
2019-03-22 11:22:54 +01:00
Spring Operator
17128311f4 DATAJDBC-336 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* [ ] http://www.mybatis.org/mybatis-3/logging.html (200) with 1 occurrences could not be migrated:
   ([https](https://www.mybatis.org/mybatis-3/logging.html) result SSLHandshakeException).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://en.wikipedia.org/wiki/Dependency_Injection with 2 occurrences migrated to:
  https://en.wikipedia.org/wiki/Dependency_Injection ([https](https://en.wikipedia.org/wiki/Dependency_Injection) result 200).
* [ ] http://github.com/spring-projects/spring-data-jdbc with 1 occurrences migrated to:
  https://github.com/spring-projects/spring-data-jdbc ([https](https://github.com/spring-projects/spring-data-jdbc) result 200).
* [ ] http://spring.io/blog with 2 occurrences migrated to:
  https://spring.io/blog ([https](https://spring.io/blog) result 200).
* [ ] http://stackoverflow.com/questions/tagged/spring-data-jdbc with 2 occurrences migrated to:
  https://stackoverflow.com/questions/tagged/spring-data-jdbc ([https](https://stackoverflow.com/questions/tagged/spring-data-jdbc) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html ([https](https://docs.spring.io/spring-data/data-commons/docs/current/api/index.html?org/springframework/data/domain/Persistable.html) result 301).
* [ ] http://docs.spring.io/spring-framework/docs/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-framework/docs/ ([https](https://docs.spring.io/spring-framework/docs/) result 301).
* [ ] http://help.github.com/forking/ with 2 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://projects.spring.io/spring-data with 2 occurrences migrated to:
  https://projects.spring.io/spring-data ([https](https://projects.spring.io/spring-data) result 301).
* [ ] http://projects.spring.io/spring-framework with 2 occurrences migrated to:
  https://projects.spring.io/spring-framework ([https](https://projects.spring.io/spring-framework) result 301).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).

Original Pull Request: #133
2019-03-21 10:07:21 +01:00
Spring Operator
323a13e118 DATAJDBC-336 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://mybatis.org/dtd/mybatis-3-mapper.dtd (301) with 2 occurrences could not be migrated:
   ([https](https://mybatis.org/dtd/mybatis-3-mapper.dtd) result SSLHandshakeException).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://maven.apache.org/xsd/maven-4.0.0.xsd with 4 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://projects.spring.io/spring-data-jdbc with 2 occurrences migrated to:
  https://projects.spring.io/spring-data-jdbc ([https](https://projects.spring.io/spring-data-jdbc) result 301).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0 with 8 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 4 occurrences

Original Pull Request: #132
2019-03-21 10:06:15 +01:00
Mark Paluch
78f26aa0a7 DATAJDBC-327 - Polishing.
Extend Javadoc. Reorder constructors in the order of their parameter number. Add missing assertions. Introduce utility to create predicates. Remove unused fields. Add since tags. Reformat.

Original pull request: #123.
2019-03-12 12:32:24 +01:00
Jens Schauder
35d9bb6e57 DATAJDBC-327 - Polishing.
Removed author tag for package-info.java

Original pull request: #123.
2019-03-12 12:32:24 +01:00
Jens Schauder
ceb15fe826 DATAJDBC-327 - Add support for conversion to JdbcValue and store byte[] as binary.
Some JDBC drivers depend on correct explicit type information in order to pass on parameters to the database.
So far CustomConversion had no way to provide that information.
With this change one can use @WritingConverter that converts to JdbcTypeAware in order to provide that information.

byte[] now also get stored as BINARY.

Original pull request: #123.
2019-03-12 12:32:24 +01:00
Christoph Strobl
4fb0cf0487 DATAJDBC-308 - Prepare next development iteration. 2019-03-07 10:07:28 +01:00
Christoph Strobl
4242a65270 DATAJDBC-308 - Release version 1.1 M2 (Moore). 2019-03-07 09:42:21 +01:00
Mark Paluch
1764457835 DATAJDBC-326 - Polishing.
Add Javadoc. Tweak naming and factory methods. Add equals/hashcode to Identifier. Extend tests.

Original pull request: #118.
2019-03-05 15:19:32 +01:00
Jens Schauder
ade3324e2c DATAJDBC-326 - Support conversion of backreferences.
Ids used as backreferences now get properly converted.

Introduced Identifier to hold information about data that needs to be considered for inserts or updates but is not part of the entity.
Apart from column names and values they also hold information about the desired JdbcType in order to facilitate conversions.
This replaces the Map handed around in the past.

Original pull request: #118.
2019-03-05 15:18:37 +01:00
Jens Schauder
2b9ae3ef73 DATAJDBC-334 - Polishing.
Original pull request: #120.
2019-02-19 09:29:07 +01:00
Bastian Wilhelm
0f7ca81017 DATAJDBC-334 - Fixes broken parameter names for quoted column names.
When a column has a quoted name it contains characters illegal for parameter names.
Therefore the parameter names now get sanitised.

Original pull request: #120.
2019-02-19 09:29:08 +01:00
Mark Paluch
61a54cac84 DATAJDBC-331 - Polishing.
Simplify column name discovery using Optionals utility methods. Add test to verify Column annotation precedence.

Javadoc, formatting.

Original pull request: #117.
2019-02-13 17:19:25 +01:00
Bastian Wilhelm
6fcff3ea80 DATAJDBC-331 Introduce @MappedCollection annotation.
We now provide a @MappedCollection annotation as replacement for @Column's keyColumn attribute.

class Person {
  @MappedCollection(idColumn = "the_id", keyColumn = "the_key")
  private List<Integer> mappedList;
}

Original pull request: #117.
2019-02-13 17:17:40 +01:00
Jens Schauder
9259cb4edf DATAJDBC-325 - SqlGeneratorSource is now thread safe.
Original pull request: #114.
2019-02-06 15:24:31 +01:00
Jens Schauder
326335c9be DATAJDBC-329 - Polishing.
Applied review feedback.

Original pull request: #116.
2019-02-06 15:15:54 +01:00
Jens Schauder
6bdf430036 DATAJDBC-329 - Replacing JdbcConfiguration.
Reverting breaking changes to JdbcConfiguration.
Deprecating JdbcConfiguration in favor of AbstractJdbcConfiguration.
Cleaning up the API to separate it from spring-data-relational and therefore R2DBC.

Original pull request: #116.
2019-02-06 15:15:36 +01:00
Mark Paluch
3b6f01f83e DATAJDBC-259 - Polishing.
Unwrap multi-dimensional array types to determine the proper component type. Extend tests. Inline isCollectionOf[Entities|SimpleType]Like calls and remove utility methods on RelationalPersistentProperty as the usage-scope is specific to array handling.

Original pull request: #113.
2019-02-06 14:30:16 +01:00