Commit Graph

109 Commits

Author SHA1 Message Date
Mark Paluch
9873db6fff DATAJDBC-176 - After release cleanups. 2018-04-13 15:08:34 +02:00
Mark Paluch
b01ab05b17 DATAJDBC-176 - Prepare next development iteration. 2018-04-13 15:08:33 +02:00
Mark Paluch
fa5e94655c DATAJDBC-176 - Release version 1.0 M2 (Lovelace). 2018-04-13 14:30:59 +02:00
Mark Paluch
f83602d78e DATAJDBC-176 - Prepare 1.0 M2 (Lovelace). 2018-04-13 14:30:01 +02:00
Mark Paluch
5a00fc394e DATAJDBC-176 - Updated changelog. 2018-04-13 14:30:00 +02:00
Jens Schauder
cc477f8c89 DATAJDBC-200 - Renamed Events to have an 'Event' suffix.
Original pull request: #60.
2018-04-13 12:06:56 +02:00
Jens Schauder
3f89062bc1 DATAJDBC-199 - Fix @since JavaDoc comments. 2018-04-12 16:32:25 +02:00
Chr1st0ph
5382d3b94e DATAJDBC-198 - Prevent HSQL specific tests to run when a different database profile is selected.
Set active profile on HSQL specific tests to HSQL.

Fixed Readme to properly reflect the need to have a Docker installation.

Original pull request: #59.
2018-04-12 15:30:10 +02:00
Mark Paluch
eb0f62181e DATAJDBC-197 - Polishing.
Rename AfterCreation event to AfterLoadEvent to align with other Spring Data modules. Add missing generics. Remove since tags pointing to version 2.0. Slightly tweak tests.

Original pull request: #58.
2018-04-11 16:19:37 +02:00
Jens Schauder
fbac3a5529 DATAJDBC-197 - Repositories find methods now emit AfterLoadEvents as intended.
Event publishing moved into the JdbcEntityTemplate in order to ensure events for AggregateRoots.

Removed superfluous AggregateChange from AfterCreation event.

Original pull request: #58.
2018-04-11 16:19:12 +02:00
Chr1st0ph
d4b2eca43a DATAJDBC-196 - Integration-test-support for MariaDB.
Original pull request: #57.
2018-04-11 09:34:12 +02:00
Jens Schauder
dba9d3f4ee DATAJDBC-195 - SqlGenerator now uses upper ase key words. 2018-04-10 10:30:23 +02:00
Chr1st0ph
2898e21f8c DATAJDBC-194 - Polish README.adoc.
Typos, links, grammar and similar fixed.

Original pull request: #56.
2018-04-10 10:11:56 +02:00
Jens Schauder
c7958f82a3 DATAJDBC-178 - Polishing.
Renamed MyBatisNamingStrategy into NamespaceStrategy.
This avoids the confusion with the existing NamingStrategy.

Introduced a default instance.
Added a method creating a proper DataAccessStrategy with a NamespaceStrategy.

JavaDoc.

Original pull request: #44.
2018-04-03 14:35:43 +02:00
Kazuki Shimizu
45a6d3467a DATAJDBC-178 - Allow customizing the MyBatis namespace.
The MyBatis namespace used can now be customised by providing a NamespaceStrategy to the MyBatisDataAccessStrategy.

Original pull request: #44.
2018-04-03 14:26:03 +02:00
Christoph Strobl
db2b44db63 DATAJDBC-155 - Polishing.
Update Javadoc, assert state, default nullable properties in afterPropertiesSets and add tests.

Original pull request: #54.
2018-03-27 14:37:24 +02:00
Jens Schauder
aaae9a5f5c DATAJDBC-155 - Simplified construction of JdbcRepositoryFactory.
Made the DefaultDataAccessStrategy actually the default for JdbcRepositoryFactoryBean.
Therefore the injection of a strategy is optional.

Simplified constructors of DefaultDataAccessStrategy.
Created factory method to construct a correct DataAccessStrategy for use with MyBatis.

Did some untangling in the test application context configurations.

Original pull request: #54.
2018-03-27 14:36:07 +02:00
Kazuki Shimizu
ce020a403e DATAJDBC-191 - Upgrade to MyBatis 3.4.6 and MyBatis-Spring 1.3.2.
Original pull request: #55.
2018-03-26 08:46:28 +02:00
Kazuki Shimizu
6303227732 DATAJDBC-190 - Fix some wrong/weird usage of AssertJ.
Original pull request: #50.
2018-03-23 14:44:34 +01:00
Jens Schauder
e477d763c1 DATAJDBC-189 - Polishing.
Removed DefaultNamingStrategy since we don't have GA release breaking APIs is still ok.
Introduced an instance of NamingStrategy so we don't have to create a new class whereever we just want the default implementation.

JavaDoc.
Formatting

Original pull request: #36.
2018-03-23 14:11:26 +01:00
Michael J. Simons
a6e4380789 DATAJDBC-189 - Move default implementation to NamingStrategy
This makes it nicer to overwrite certain aspects with a lambda instead of an anonymous class. Brings the naming strategy in line with pairs like WebMvcConfigurer / WebMvcConfigurerAdapter.

Original pull request: #36.
2018-03-23 13:00:40 +01:00
Jens Schauder
b1115833ab DATAJDBC-184 - Polishing.
Minor changes to JavaDoc and formatting.

Original pull request: #49.
2018-03-23 12:47:38 +01:00
Kazuki Shimizu
924bb55394 DATAJDBC-184 - Support the delimiter character naming strategy.
Original pull request: #49.
2018-03-23 12:45:06 +01:00
Jens Schauder
46f65149b8 DATAJDBC-186 - Polishing.
JavaDoc.
2018-03-21 11:45:11 -05:00
Jens Schauder
f7274a2efa DATAJDBC-186 - Removed requirement for id properties.
It is now ok for an entity to be “new” after saving.
We now only check that an entity is not new when the id is provided by the database.
If in such a case the entity is still “new” after saving it basically means obtaining the id from JDBC and setting it in the entity failed.

Removed need for entities in maps to have an id.

Together these changes simplify the requirements for Map values, which now can be value objects.
2018-03-21 11:44:59 -05:00
Jens Schauder
8885ce342b DATAJDBC-183 - Polishing.
Removed calls to System.out.
Formatting.
Import order.
2018-03-21 11:42:58 -05:00
Jens Schauder
cb302e90a6 DATAJDBC-183 - Using dedicated class for handling map entries.
Instead of using Map.Entry we now use a dedicated class to hold key and value of a map entry.
This avoids side effects from the implementation of Map.Entry.

Replaced call to saveReferencedEntities with insertReferencedEntities which is simpler but equivalent since referenced entities always get only inserted, never updated.

Removed superfluous methods resulting from that change.
2018-03-21 11:42:46 -05:00
Jens Schauder
31eeba743f DATAJDBC-142 - Using getName instead of getColumnName for constructing PropertyPaths. 2018-03-21 11:40:18 -05:00
Jens Schauder
964f319ae6 DATAJDBC-166 - Polishing.
Formatting.
Import order.
Use of AssertJ.
2018-03-21 11:37:32 -05:00
Jens Schauder
a2b7699256 DATAJDBC-166 - Allow registration of RowMappers based on result type.
RowMapper can be configured either via the @Query(rowMapperClass = …​.) or by registerign a RowMapperMap bean and register RowMapper per method return type.

                @Bean
                RowMapperMap rowMappers() {
                        return new ConfigurableRowMapperMap() //
                                        .register(Person.class, new PersonRowMapper()) //
                                        .register(Address.class, new AddressRowMapper());
                }

When determining the RowMapper to use for a method the following steps are followed based on the return type of the method:

1. If the type is a simple type no RowMapper is used. Instead the query is expected to return a single row with a single column and a conversion to the return type is applied to that value.

2. The entity classes in the RowMapperMap are iterated until one is found that is a superclass or interface of the return type in question. The RowMapper registered for that class is used. Iterating happens in the order of registration, so make sure to register more general types after specific ones.

If applicable wrapper type like collections or Optional are unwrapped. So a return type of Optional<Person> will use the type Person in the steps above.
2018-03-21 11:37:05 -05:00
Jens Schauder
b49b7674f2 DATAJDBC-181 - Polishing.
Removed superfluous @RequiredArgsConstructor annotations.
2018-03-09 09:18:38 -06:00
Jens Schauder
18bf6ca77c DATAJDBC-181 - Use NamingStrategy for instantiating entities.
The ResultSetParameterValueProvider uses the relevant property for a requested parameter in order to obtain the proper column name to use.

Improved mocking of ResultSets in tests to actually fail when a non existing column gets requested instead of just returning null.
2018-03-09 09:18:28 -06:00
Jens Schauder
043bd4de35 DATAJDBC-165 - Allows configuration of custom RowMapper on @Query annotation. 2018-03-09 09:15:31 -06:00
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