Commit Graph

343 Commits

Author SHA1 Message Date
Mark Paluch
d3823947aa #468 - Correctly map result of exists queries.
We now map results of exists queries to a boolean flag to ensure proper decoding. Previously, results were attempted to be mapped onto a primitive type which failed as there's no converter registered for Row to Boolean.
2020-09-21 15:17:45 +02:00
Mark Paluch
f0b30f0ca0 #467 - Migrate tests to JUnit 5.
Migrate also ExternalDatabase from JUnit rule to BeforeAllCallback and RegisterExtension.
2020-09-21 14:42:05 +02:00
Mark Paluch
68c2304b73 #413 - Disable test used as documentation include. 2020-09-18 09:20:42 +02:00
Mark Paluch
c23485d90e #413 - Introduce constructor to R2dbcEntityTemplate accepting ConnectionFactory.
This is a short-cut constructor that allows for simpler creation of the Template API.
2020-09-17 17:52:18 +02:00
Mark Paluch
ce57b25cd0 #413 - Refine reference documentation after Spring R2DBC migration. 2020-09-17 11:14:01 +02:00
Mark Paluch
1c378bba6f #431 - Prepare 1.2 RC1 (2020.0.0). 2020-09-16 13:57:08 +02:00
Mark Paluch
f26b06bd48 #431 - Updated changelog. 2020-09-16 13:56:59 +02:00
Mark Paluch
2f9cb8d538 #432 - Updated changelog. 2020-09-16 12:16:29 +02:00
Mark Paluch
4506fb67ca #453 - Introduce converters to consume Postgres Json and convert these to String/byte[].
We now ship converters for Postgres' Json data type to map JSON to String and to byte[] for easier and safe consumption.
2020-09-10 09:21:15 +02:00
Mark Paluch
b720249dac #454 - Adapt to changed array assertions in AssertJ. 2020-09-09 15:51:54 +02:00
Mark Paluch
6c3ba72253 #452 - Introduce factory method for StatementMapper. 2020-09-09 13:13:46 +02:00
Mark Paluch
0868f2aaef #423 - Add r2dbc-postgresql Geotypes to simple types.
R2DBC Postgres Geo-types are now considered simple types that are passed-thru to the driver without further mapping. Types such as io.r2dbc.postgresql.codec.Circle or io.r2dbc.postgresql.codec.Box can be used directly in domain models and as bind parameters.
2020-09-09 11:40:04 +02:00
Mark Paluch
7d3bd1f30a #444 - Initialize primitive Id properties upon INSERT.
We now propagate auto-generated Id values to primitive Id properties if the value in the domain model is zero. This happens in addition to non-primitive values being null to ensure that generated values end up in the domain model.
2020-09-09 11:22:48 +02:00
Jay Bryant
158a684c02 #392 - Wording changes.
Removed the language of oppression and violence
and replaced it with more neutral language.

Note that problematic words in the code have
to remain in the docs until the code changes.
2020-09-09 11:00:55 +02:00
hirakida
468ade2ac2 #442 - Fix method name in reference docs. 2020-09-09 10:54:53 +02:00
Mark Paluch
43d5d9d827 #451 - Initialize version for versioned entities after BeforeConvert callback.
We now initialize/increment the version of versioned entities (optimistic locking) after running the BeforeConvert callback. BeforeConvert callbacks may contain features such as auditing and if the auditing callback issues a isNew check, then the version would be already populated which leads to the auditing callback considering the entity not new anymore leaving the created date empty.
2020-09-09 09:25:21 +02:00
Mark Paluch
f0732a5388 #450 - Polishing.
Document version annotation.
2020-09-08 10:43:30 +02:00
Mark Paluch
d7a76609b2 #450 - Add support for @Value when constructing entities using their persistence constructor.
We now support the use of @Value in persistence constructors to compute values for constructor creation.

class MyDomainObject {

	public MyDomainObject(long id, @Value("#root.my_column") String my_column, @Value("5+2") int computed) {
		// …
	}
}
2020-09-08 10:43:30 +02:00
Mark Paluch
a1081bbbb2 #447 - Deprecate ReactiveDataAccessStrategy.
ReactiveDataAccessStrategy is now deprecated in favor of using StatementMapper, UpdateMapper, and R2dbcConverter directly. The access strategy interface was introduced to allow pluggable access strategies in DatabaseClient. With moving DatabaseClient into Spring Framework, this approach is no longer required.
2020-09-08 09:58:07 +02:00
Mark Paluch
28edf271ad #447 - Register MappingR2dbcConverter as bean.
We now register MappingR2dbcConverter as bean r2dbcConverter.
2020-09-08 09:56:31 +02:00
Mark Paluch
51c47fe00d #434 - Fix SpEL query example in reference documentation. 2020-09-07 14:18:36 +02:00
Mark Paluch
b4002e5c3f #440 - Create R2dbcEntityTemplate in R2dbcRepositoryFactoryBean.
We now create R2dbcEntityTemplate as part of R2dbcRepositoryFactoryBean initialization if the factory bean was configured with DatabaseClient and DataAccessStrategy only. Creating the template in the factory bean allows collecting entity callbacks for repository usage.
2020-09-03 11:07:34 +02:00
Mark Paluch
dc8eb79797 #409 - Updated changelog. 2020-08-12 13:25:46 +02:00
Mark Paluch
8fc059d5b6 #391 - Prepare 1.2 M2 (2020.0.0). 2020-08-12 11:51:40 +02:00
Mark Paluch
209de06482 #391 - Updated changelog. 2020-08-12 11:51:31 +02:00
Oh SeungMok
18676b09ea #429 - Fix typos in reference documentation. 2020-08-10 11:56:05 +02:00
Mark Paluch
7bf9ea7156 #411 - Introduce EnumWriteSupport for simpler pass-thru of enum values.
We now provide EnumWriteSupport as base class for enum write converters that should be written as-is to the driver.

R2dbcCustomConversions can now also be created from a dialect for easier R2dbcCustomConversions creation.
2020-08-06 10:59:42 +02:00
Mark Paluch
67c3d492a2 #402 - Exclude id property using initial value when inserting objects.
We now exclude Id properties from being used in the INSERT field list if the Id value is zero and of a primitive type or if the value is null using a numeric wrapper type.
2020-08-05 14:19:50 +02:00
Mark Paluch
ecbb8d8e78 #414 - Adopt SpEL support to use ReactiveEvaluationContextProvider.
We now defer query creation to obtain and resolve SpEL expression dependencies using reactive SpEL context extensions.
2020-08-05 12:17:35 +02:00
Okue
d3276b9d7e #425 - Fix lack of @Modifying in reference documentation code. 2020-08-05 10:20:17 +02:00
Jens Schauder
b0e03ea3a3 #368 - Polishing.
Line breaks after dots in ascii doctor file for easier reading of the source files.
Adds specific deprecation links instead of just links to the general package.
Removes an unused private method in `ConnectionFactoryUtils`

Original pull request: #412.
2020-08-04 14:55:42 +02:00
Mark Paluch
3d59c63bc0 #368 - Polishing.
Original pull request: #412.
2020-08-04 14:53:19 +02:00
Mark Paluch
086c5a1d2d #368 - Use Spring R2DBC.
We now use Spring R2DBC DatabaseClient and utilities to implement Spring Data R2DBC functionality.

Original pull request: #412.
2020-08-04 14:53:16 +02:00
Mark Paluch
f331572167 #368 - Deprecate API provided by Spring R2DBC.
This commit deprecates API that has been moved to Spring R2DBC.

Original pull request: #412.
2020-08-04 14:53:09 +02:00
Mark Paluch
266cc7f80d #416 - Make SimpleR2dbcRepository constructor public to allow subclassing. 2020-08-04 10:56:20 +02:00
Mark Paluch
bc2e977f6e #418 - Polishing.
Fix fluent API documentation headers.
2020-08-04 10:54:28 +02:00
Mark Paluch
a0dc6f1660 #418 - Document optimistic locking using @Version. 2020-08-04 10:54:28 +02:00
Mark Paluch
ad1e75f253 #420 - Fix Spring Framework version property in reference docs. 2020-08-04 10:25:53 +02:00
Mark Paluch
2f9ca57ed5 #421 - Polishing.
Simplify tests. Use ReflectionUtils.isVoid(…) where possible and simplify isVoid(…) flows.

Original pull request: #422.
2020-07-31 11:40:01 +02:00
Stephen Cohen
748d6c3340 #421 - Handle modifying query methods returning kotlin.Unit.
Added check for kotlin.Unit to AbstractR2dbcQuery#getExecutionToWrap. This case is essentially equivalent to a return type of Void, but the singleton Unit instance needs to be returned instead of discarding the result entirely.

It was also necessary to add a check to R2dbcQueryMethod#getEntityInformation, as otherwise a PersistentEntity is created for Unit, which leads to a new instance being created via reflection down the pipeline (which is probably not a thing that should happen).

Original pull request: #422.
2020-07-31 11:39:50 +02:00
Mark Paluch
4f04c87837 #421 - Suppress results for suspended query methods returning kotlin.Unit.
We now discard results for suspended query methods if the return type is kotlin.Unit.

Related ticket: DATACMNS-1779

Original pull request: #422.
2020-07-31 11:39:45 +02:00
Mark Paluch
07be001e54 #410 - Make it possible to write delete/update operations without using matching.
Fluent operations now allow statement execution without the need to specify a Query object allowing for shorter statements.
2020-07-23 15:32:55 +02:00
Mark Paluch
c216d9b904 #281 - Polishing.
Fix assertion messages.
2020-07-23 11:11:49 +02:00
Mark Paluch
f6105beab1 #281 - Add support for auditing.
We now provide auditing support that can be enabled through EnableR2dbcAuditing.

@Configuration
@EnableR2dbcAuditing
class Config {

  @Bean
  public ReactiveAuditorAware<String> myAuditorProvider() {
      return new AuditorAwareImpl();
  }
}
2020-07-23 11:11:49 +02:00
Mark Paluch
ed63cefc84 #407 - Polishing.
Guard find(Sort) against null values. Add author to documentation. Use ReactiveDataAccessStrategy in R2dbcEntityTemplate created in SimpleR2dbcRepository.

Original pull request: #408.
2020-07-23 10:42:35 +02:00
Stephen Cohen
4da92bdc7c #407 - Add ReactiveSortingRepository support.
Implements ReactiveSortingRepository on SimpleR2dbcRepository. Also changed R2dbcRepository to extend ReactiveSortingRepository and updated comments where it felt reasonable.

Added a single unit test for the new method, and changed the base interface of LegoSetRepository in AbstractR2dbcRepositoryIntegrationTests for integration testing purposes.

Clarify documentation on reactive repository base interfaces

Adds some language calling out ReactiveSortingRepository and fixes consistency between related examples.

Original pull request: #408.
2020-07-23 10:42:03 +02:00
Mark Paluch
d51586890c #406 - Polishing.
Fix annotation name in Javadoc.
2020-07-23 10:34:36 +02:00
Mark Paluch
0bd6f8a431 #406 - Allow configuring R2dbcEntityOperations bean reference in EnableR2dbcRepositories.
We now accept a bean reference to R2dbcEntityOperations so that a single application can scan for repositories that use different dialects/database systems.
2020-07-23 10:33:01 +02:00
Jens Schauder
b605daa0e8 #215 - Polishing.
Formatting.

Original pull request: #397.
2020-07-22 14:32:35 +02:00
Mark Paluch
4140981159 #215 - Polishing.
Reintroduce deprecated setBeanFactory(…) method.
Extract code into methods.
Ensure that versioned entities are eagerly initialized to allow retries.

Original pull request: #397.
2020-07-22 14:32:35 +02:00