Commit Graph

76 Commits

Author SHA1 Message Date
Jens Schauder
5f6a44d00a DATAJDBC-182 - Polishing.
Extracted method to maintain a single level of abstraction.
Added description to assertion that wasn't obvious to me.
Added JavaDoc on existing method.
Commented repository methods in test with issue ids to ease understanding the purpose of each method.
2018-03-09 10:19:55 +01:00
Kazuki Shimizu
73fe1ca93b DATAJDBC-182 - Support modifying annotated queries.
Added @Modify for marking queries that perform DML or DDL.
Modifying queries with return type boolean or Boolean return wether the number of updated rows is greater 0.
This shouldn't be used for DML statements since it will always return false.

Original pull request: ##48.
2018-03-09 10:18:14 +01:00
Jens Schauder
ac4da66d99 DATAJDBC-175 - Polishing.
Code formatting.
2018-03-07 16:14:18 +01:00
Kazuki Shimizu
369ca6d599 DATAJDBC-175 - Supports simple types as return type for annotated methods.
Original pull request: #43.
2018-03-07 16:01:32 +01:00
Greg Turnquist
4cb50caf79 DATAJDBC-179 - Add project details.
Original pull request: #45.
2018-03-05 11:25:55 +01:00
Tadaya Tsuyukubo
2ace9b8663 DATAJDBC-180 - Upgrade Testcontainers from 1.5.1 to 1.6.0.
Original pull request: #46.
2018-03-05 10:41:14 +01:00
Tadaya Tsuyukubo
7d38a95c60 DATAJDBC-180 - Polishing pom.xml
Fixed wrong name on Testcontainers version.
Aligned formatting to Spring style.

Original pull request: #46.
2018-03-05 10:39:38 +01:00
Jens Schauder
1603296385 DATAJDBC-130 - Polishing.
Formatting.
Tiny fixes in JavaDoc.
Fixed some type parameters.
Replaced concrete classes with interfaces.
2018-02-22 13:05:52 -06:00
Jens Schauder
f5de195768 DATAJDBC-130 - Support entities with List valued properties. 2018-02-22 13:05:39 -06:00
Jens Schauder
7ed2ed7d7e DATAJDBC-172 - Polishing.
Formatting.
Added @author tag.
2018-02-08 15:30:04 +01:00
Jens Schauder
30651606b8 DATAJDBC-172 - Added tests.
Added test for too many results.
Removed FOR UPDATE clause from test statements.
2018-02-08 15:30:04 +01:00
Kazuki Shimizu
6f6499026a DATAJDBC-172 - Support entity type, Optional and Stream as return type of @Query methods.
Original pull request: #40.
2018-02-08 15:27:30 +01:00
Jens Schauder
9a90d7e09b DATAJDBC-161 - Polishing.
Removed second constructor and made tests use the new constructor.
Changed parameter type to the interface SqlSession.
Added some JavaDoc.
2018-02-06 14:22:39 +01:00
Kazuki Shimizu
66556f93c4 DATAJDBC-161 - Share a SqlSession between statements.
Original pull request: #29.
2018-02-06 14:21:34 +01:00
Christoph Strobl
171353484a DATAJDBC-171 - After release cleanups. 2018-02-06 10:11:17 +01:00
Christoph Strobl
ca2b6c89c8 DATAJDBC-171 - Prepare next development iteration. 2018-02-06 10:11:15 +01:00
Christoph Strobl
39b40f3668 DATAJDBC-171 - Release version 1.0 M1 (Lovelace). 2018-02-06 09:47:10 +01:00
Christoph Strobl
2122899b91 DATAJDBC-171 - Prepare 1.0 M1 (Lovelace). 2018-02-06 09:45:50 +01:00
Christoph Strobl
06c1fa440c DATAJDBC-171 - Updated changelog. 2018-02-06 09:45:49 +01:00
Greg Turnquist
76fcb3d73e DATAJDBC-169 - Polishing. 2018-02-05 15:54:34 -06:00
Jens Schauder
5bed9068db DATAJDBC-169 Added .travis.yml. 2018-02-05 15:53:38 -06:00
Mark Paluch
3303c47ca0 DATAJDBC-170 - Add commons Spring Data project resources. 2018-02-05 09:49:45 +01:00
Jens Schauder
8af7553e1d DATAJDBC-168 - Polishing.
Simplified initialization of MySql database.
Extracted dependency versions into properties.
Added JavaDoc.
2018-02-02 11:34:51 +01:00
sedooe
0fe791f2bc DATAJDBC-168 - Run integration tests with testcontainers.
Added testcontainers as dependency and configured MySql and Postrgres datasources to use it.

Original pull request: #34.
2018-02-02 11:33:58 +01:00
Greg Turnquist
0fdd885224 DATAJDBC-164 - Polishing. 2018-01-26 09:49:51 -06:00
Jens Schauder
bc209b1114 DATAJDBC-164 - Add support for basic @Query annotation. 2018-01-26 09:48:43 -06:00
Jens Schauder
2163a26917 DATAJDBC-157 - Replace dots in MyBatis statement ids with dashes. 2018-01-26 09:32:43 -06:00
Jens Schauder
ab6da6edff DATAJDBC-156 - Describe available mappings in README.
Includes the major limitations and their rational.
2018-01-26 09:26:20 -06:00
Mark Paluch
06b15da50d DATAJDBC-163 - Update copyright years to 2018. 2018-01-09 08:49:39 +01:00
Jens Schauder
fe00e928a5 DATAJDBC-162 - Prevent NPE for missing PropertyPath in DbActionExecutionException. 2018-01-08 10:59:01 +01:00
Michael Simons
235abe44e8 Fix typo (#28)
Thanks
2017-12-14 15:57:41 +01:00
Jens Schauder
ae4e2a7deb DATAJDBC-158 - BasicJdbcPersistentEntityInformation honors Persistable implementations. 2017-12-04 09:27:34 -06:00
Jens Schauder
08691d6c45 DATAJDBC-151 - Polishing.
Removed unused code.

Moved more of the context configuration into the common TestConfiguration.
2017-11-28 15:20:35 +01:00
Greg Turnquist
b044a13af1 DATAJDBC-151 - Reform Spring Data JDBC to stop autoconfiguration
In the past, Spring Data JDBC performed autoconfiguration such as gleaning whether or not MyBatis is on the classpath, and also whether or not certain other beans exist. This commit removes such flexible settings and instead wires up a JdbcMappingContext seeking an optional NamingStrategy and optional ConversionCustomizer. The other required beans will alert the end user if they don't exist.

All relevant test cases are updated to inject the proper components.

All autoconfiguration is being moved outside Spring Data JDBC, to eventually join Spring Boot after being shook out as an independent module.
2017-11-28 15:20:21 +01:00
Jens Schauder
0b2708ff9a DATAJDBC-150 - Provides better error message when execution of a DbAction fails. 2017-11-27 11:43:34 -06:00
Greg Turnquist
0ef1a63bda DATAJDBC-154 - Polishing. 2017-11-27 11:43:13 -06:00
Jens Schauder
d5193e4418 DATAJDBC-154 - Include some basic getting started documentation in the readme. 2017-11-27 11:27:52 -06:00
Jens Schauder
3c9765c9b8 DATAJDBC-147 - Support registration von converters via ConversionCustomizers. 2017-11-01 10:44:44 -05:00
Jens Schauder
207278c891 DATAJDBC-145 - Back-reference in insert now honours NamingStrategy.
Added a property path to DbActions in order to make them aware of the property it is related to.
Then used the JdbcPersistentProperty based on that get the name of the back-reference name of that property back to the root entity of that property.
This gets the NamingStrategy properly involved, as it should.

Instead of using the vanilla PropertyPath a new JdbcPropertyPath is introduced.
It allows for an empty path avoiding various null-checks.

Upgraded SD-Commons dependency to 2.1.x in order to utilise DATACMNS-1199.
Removed the now superfluous PropertyPaths and used PropertyPath methods instead.

Related issues:
DATACMNS-1204
DATACMSN-1199
2017-11-01 10:27:05 -05:00
Jens Schauder
eeafc04fde DATAJDBC-146 - Excluding id when provided as additional parameter.
If the id of an entity is provided as an additional parameter, i.e. the foreign key to an entity is the primary key, no id column is generated in the insert since it gets generated for the additional parameter.
2017-11-01 10:04:06 -05:00
Jens Schauder
2fbb3b00c7 DATAJDBC-136 - Fix ClassNotFoundException when MyBatis is not on the classpath. 2017-10-27 12:13:51 -05:00
Greg Turnquist
1291b5d33c DATAJDBC-131 - Fix unit tests driven by DATAJDBC-144 2017-10-27 10:31:05 -05:00
Jens Schauder
1ae44c0006 DATAJDBC-131 - Polishing after review.
Put generics back in and added @SupressWarnings where this caused warnings.
Extracted the test “isMap” into a “isQualified” method on the property.
2017-10-27 10:30:59 -05:00
Jens Schauder
b385f7f24f DATAJDBC-131 - Basic support for Maps
Aggregate roots with properties of type java.util.Map get properly inserted, updated and deleted.

Known limitations:
- Naming strategy does not allow for multiple references via Set, Map or directly to the same entity.
- The table for the referenced Entity contains the column for the map key.
    A workaround for that would be to manipulate the DbActions in the AggregateChange yourself.
2017-10-27 10:30:54 -05:00
Jens Schauder
482f330f02 DATAJDBC-144 - Using correct column names from NamingStrategy.
The list of columns used in the SqlGenerator contained property names instead of column names, leading to errors when a non-trivial NamingStrategy was used.
2017-10-27 10:17:03 -05:00
Mark Paluch
3706826739 DATAJDBC-134 - Added explicit automatic module name for JDK 9. 2017-09-21 14:17:53 +02:00
Jens Schauder
20ecbcb151 DATAJDBC-123 - Polishing.
Incorporating review comments.

Code formatting.
Improved comments.
Better method name.
Converted initialiser to before method.
2017-09-19 11:13:55 -05:00
Jens Schauder
806bb24ff5 DATAJDBC-123 - MyBatis integration on DbAction level.
If MyBatis-spring is available and a SqlSessionFactory in the Application Context we look for matching mapped sql statements instead of using the default generated SQL.

Introduced DataAccessStrategy as a new abstraction level, operating on a single entity. JdbcEntityOperations only contain operations related to complete Aggregates. Thereby also solving DATAJDBC-132.

Integration tests ending in HsqlIntegrationTest will only get executed using HsqlDb.

Related issue: DATAJDBC-132.
2017-09-19 11:13:42 -05:00
Jens Schauder
fd2ae05795 DATAJDBC-113 - Polishing.
Applied changes from review.
Removed superfluous @ConstructorProperties annotations.
Fixed formatting.
Improved usage of generics.
2017-09-13 09:33:29 -05:00
Jens Schauder
9b7b1267bb DATAJDBC-113 - Added support for Set-valued references.
When loading the referenced entities get loaded by a separate select statement.
Changes to a collection get handled just like 1-1 relationships by deleting all and reinserting them again.

Introduced a separate method in JdbcPersistentProperty instead of just unsing the table name, although it currently still is the table name.

Now providing SqlTypes in SqlParameterSource, since MySql has a problem with null parameters when it doesn't know the type.

Fixed an error where a SQL-statement generated by the SqlGenerator was obviously wrong.
2017-09-13 09:33:13 -05:00