Commit Graph

300 Commits

Author SHA1 Message Date
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
Oliver Drotbohm
4923ba7076 DATAJDBC-333 - Updated changelog. 2019-04-01 20:56:25 +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
7a738eed97 DATAJDBC-343 - Omit table prefixes for assignment columns.
INSERT and UPDATE assignments/column lists no longer include the table prefix for a column as columns as the support is Dialect-specific and we should generally assume columns in these clauses to belong to the table used in the statement.
2019-03-18 14:44: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
a08584433a DATAJDBC-308 - Add missing dist.id property required for multi module build. 2019-03-07 14:34:29 +01:00
Christoph Strobl
d3859f1eb7 DATAJDBC-308 - After release cleanups. 2019-03-07 10:07:29 +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
Christoph Strobl
c958a2c0d0 DATAJDBC-308 - Prepare 1.1 M2 (Moore). 2019-03-07 09:41:17 +01:00
Christoph Strobl
722d5af548 DATAJDBC-308 - Updated changelog. 2019-03-07 09:41:09 +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
8eb80ba5cc DATAJDBC-335 - Address review comments.
Original pull request: #121.
2019-03-05 10:24:29 +01:00
Jens Schauder
94a8932b9e DATAJDBC-335 - Polishing.
Formatting and one additional test.

Original pull request: #121.
2019-03-05 10:24:22 +01:00
Mark Paluch
a11c121407 DATAJDBC-335 - Add DSL and renderer for Insert, Update, and Delete.
We now provide Statement builders for Insert, Update, and Delete statements.

Table myTable = SQL.table("mytable");

Insert insert = StatementBuilder.insert().into(myTable).values(SQL.bindMarker()).build();

Update update = StatementBuilder.update(table).set(myTable.column("foo").set(SQL.bindMarker())).build();

Delete delete = StatementBuilder.delete().from(table).where(myTable.column("foo").isEqualTo(SQL.literal("bar"))).build();

Original pull request: #121.
2019-03-05 10:23:45 +01:00
Greg Turnquist
2aa44a38fd DATAJDBC-316 - Polishing. 2019-02-28 11:47:30 -06:00
Greg Turnquist
2835e78ec2 DATAJDBC-316 - Introduce Concourse. 2019-02-28 11:26:59 -06:00
Mark Paluch
307fe5198e DATAJDBC-309 - Polishing.
Javadoc, static factory methods, typos. Refactor SQL rendering from a shared stack-based implementation to independent delegating visitors. Introduce DelegatingVisitor and TypedSubtreeVisitor base classes. Introduce SelectList container. Extract nested renderes to top-level types.

Move SQL renderer to renderer package.

Extend In to multi-expression argument. Introduce helper methods in Table to create multiple columns. Introduce factory method on StatementBuilder to create a new builder given a collection of expressions.

Add support for comparison conditions and LIKE and equal/not equal/less with equals to/greater with equals to conditions.

 Add condition creation methods to Column so Column objects can now create conditions for a fluent DSL as in (.where(left.isGreater(right)).

StatementBuilder.select(left).from(table).where(left.isGreater(right)).build().

Introduce RenderContext and RenderNamingStrategy.

Add since tags. Improve Javadoc.

Original pull request: #119.
2019-02-26 13:35:28 +01:00
Jens Schauder
1c9fad853f DATAJDBC-309 - Reworked visitor structure towards a more modular design.
Also added support for conditions.

Original pull request: #119.
2019-02-26 13:35:24 +01:00
Mark Paluch
10b38c5043 DATAJDBC-309 - Add Statement Builder API for SELECT.
We now provide a Statement Builder API along with a renderer to build statement object graphs and to render these to SQL.

SelectBuilder builder = StatementBuilder.select();

Table employee = SQL.table("employee");
Table department = SQL.table("department");

Column name = employee.column("name").as("emp_name");
Column department_name = employee.column("name").as("department_name");

Select select = builder.select(name, department_name).from(employee).join(department)
		.on(SQL.column("department_id", employee)).equals(SQL.column("id", department))
		.and(SQL.column("tenant", employee)).equals(SQL.column("tenant", department))
		.orderBy(OrderByField.from(name).asc()).build();

String sql = SqlRenderer.render(select);

Original pull request: #119.
2019-02-26 13:32:45 +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
Mark Paluch
1c0bd4fdb8 DATAJDBC-317 - Updated changelog. 2019-02-13 11:47:52 +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
Jens Schauder
83ca6b4739 DATAJDBC-259 - Reading and writing to SQL array types.
Currently works for HsqlDb and Postgres, since the others do not support an array column type.

Original pull request: #113.
2019-02-06 14:30:10 +01:00
Mark Paluch
75ea44536f DATAJDBC-330 - Polishing.
Replace lambdas with method references. Remove extraneous overrides. Inline methods. Formatting.

Original pull request: #115.
2019-02-06 11:47:56 +01:00
Jens Schauder
341700e02d DATAJDBC-330 - Move default bean lookup from JdbcRepositoryConfigExtension to JdbcRepositoryFactoryBean.
So far the lookup of `NamedParameterJdbcOperations` and `DataAccessStrategy` could happend before these beans were registered resulting in failure to consider those beans.

The logic is now split in two parts:
If a bean name is given, this is configured on the BeanDefinition level in the JdbcRepositoryConfigExtension.
If no name is give a bean is looked up by type in the JdbcRepositoryFactoryBean.

This makes the code even simpler and uses standard Spring features instead of reimplementing them.

Original pull request: #115.
2019-02-06 11:47:39 +01:00
Jens Schauder
80e88e081b DATAJDBC-324 - Polishing.
Fixed line breaks.
Fixed Typos.
2019-02-04 14:48:21 +01:00
Oleksandr Kucher
709d6ef4d5 DATAJDBC-324 - Add support of read-only columns.
Columns annotated with `ReadOnlyProperty` will be ignored when generating INSERT or UPDATE statements.

Original pull request: #112.
2019-02-04 14:46:49 +01:00
Jens Schauder
8a2382f727 DATAJDBC-282 - Add JdbcAggregateOperations as a bean to the JdbcConfiguration. 2019-01-24 15:29:26 +01:00
Jens Schauder
13cc4f6dd6 DATAJDBC-111 - Polishing.
Formatting.
Removed some redundant tests.
Some code simplifications.

Original pull request: #110.
2019-01-24 15:24:51 +01:00
Schlagi123
7a26385b5a DATAJDBC-111 - Add support for embeddables.
By annotating a reference with `Embedded` that reference will get stored in the same table as the owning entity.

Original pull request: #110.
2019-01-24 15:24:51 +01:00
Kazuki Shimizu
9b856876fe DATAJDBC-322 - Upgrade MyBatis dependencies
MyBatis 3.5.0
mybatis-spring 2.0.0

Original pull request: #111.
2019-01-24 15:24:51 +01:00
Jens Schauder
7204eaf0b3 DATAJDBC-320 - Removed container-license-acceptance.txt.
This file accepted the license condition of Microsoft for there Docker image when running tests.
Very likely without the person using this knowing that she is accepting a license.
The file now has to be explicitly provided.

The Travis CI build adds the container-license-acceptance.txt for the build only.
2019-01-24 15:24:51 +01:00
Jens Schauder
bddb613c57 DATAJDBC-296 - Polishing.
Moved test into existing class.

Original pull request: #109.
2019-01-17 08:52:41 +01:00
Bastian Wilhelm
807688e63c DATAJDBC-296 - The value of the @Table annotation is now optional.
The default ("") is equivalent to no annotation at all, i.e. the `NamingStrategy` determines the table name.

Original pull request: #109.
2019-01-17 08:46:52 +01:00
Jens Schauder
0d23603efc DATAJDBC-285 - Polishing.
Original pull request: #108.
2019-01-16 16:33:23 +01:00
Bastian Wilhelm
4bff3f22b0 DATAJDBC-285 - Document usage of @Table and @Column.
Original pull request: #108.
2019-01-16 16:33:23 +01:00
Jens Schauder
6f599b7d51 DATAJDBC-282 - Polishing.
Renamed test to match the class under test.
2019-01-15 09:28:16 +01:00