Commit Graph

257 Commits

Author SHA1 Message Date
Mingyuan Wu
dd7c713980 #344 - Add support for support distinct derived query methods.
We now support distinct derived queries that are useful with projections to retrieve distinct results.

interface UserRepository extends Repository<User, Long> {

  Mono<UserProjection> findDistinctByFirstName(String firstName);

}

interface UserProjection {

  String getFirstName();

}

Original pull request: #346.
2020-04-21 15:31:52 +02:00
Mark Paluch
ea464b2d37 #341 - Polishing.
Consider modifying indicators in query execution. Consider absence of Criteria for delete and update queries. Add test.

Reformat code, update documentation.

Original pull request: #345.
2020-04-21 14:38:48 +02:00
Mingyuan Wu
a210a2ea6f #341 - Add support for derived delete query methods.
Original pull request: #345.
2020-04-21 14:38:39 +02:00
Mark Paluch
d901566ed4 #342 - Polishing.
Remove Kotlin extension for Criteria as it should live in Spring Data Relational. Add author tags. Reformat code.
2020-04-21 14:13:15 +02:00
Mingyuan Wu
be00ea84ef #342 - Move off deprecated Criteria and Update. 2020-04-21 14:13:08 +02:00
Mark Paluch
af192fd488 #349 - Polishing.
Update reference documentation about query derivation support.
2020-04-21 14:02:33 +02:00
Mark Paluch
5c921c56a4 #349 - Fix parameter binding for Between queries.
We now bind the correct parameter when issuing Between queries.
2020-04-21 14:02:11 +02:00
Mark Paluch
ee46695cdd #350 - Use Testcontainers constructor with image name.
Create database containers using the constructor accepting the image name to make sure that the exposed port gets registered. A recent change in Testcontainers caused that the port is no longer registered when using the default constructor.
2020-04-20 09:39:28 +02:00
Mark Paluch
f54cc8bc5b #330 - Adapt to Criteria objects in Spring Data Relational. 2020-04-08 09:39:29 +02:00
Mark Paluch
5e1d1b2919 #335 - Consider Pageable in derived queries.
We now consider Pageable arguments in derived queries. Previously only limiting queries (findFirst10) were considered.
2020-04-02 14:20:45 +02:00
m1ngyuan
e7214cfb73 #332 - Fix typos in reference documentation. 2020-04-01 14:06:09 +02:00
Mark Paluch
73f6bbcb74 #333 - Move off deprecated EntityInstantiators. 2020-04-01 14:05:34 +02:00
Mark Paluch
669a91f780 #317 - Prepare 1.1 RC1 (Neumann). 2020-03-31 14:59:20 +02:00
Mark Paluch
382121bb8d #317 - Updated changelog. 2020-03-31 14:59:17 +02:00
Mark Paluch
df7919a98d #318 - Add support for Postgres JSON type.
We now pass-thru Postgres's JSON type that can be used in entities and simple queries.
2020-03-31 12:37:56 +02:00
Mark Paluch
020d46b34f #282 - Add documentation.
Original pull request: #295.
2020-03-27 16:40:56 +01:00
Mark Paluch
4e5bf95504 #282 - Polishing.
Move query derivation infrastructure to Spring Data Relational. Adapt to newly introduced ValueFunction for deferred value mapping. Use query derivation in integration tests.

Tweak javadoc, add since and author tags, reformat code.

Related ticket: https://jira.spring.io/browse/DATAJDBC-514
Original pull request: #295.
2020-03-27 16:40:56 +01:00
Mark Paluch
a9a3919cf1 #330 - Adapt to Criteria objects in Spring Data Relational. 2020-03-27 16:40:56 +01:00
Roman Chigvintsev
dbe935c45a #282 - Add support for query derivation.
We now support query derivation for R2DBC repositories:

interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> {

  Flux<Person> findByFirstname(String firstname);

  Flux<Person> findByFirstname(Publisher<String> firstname);

  Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);

  Flux<Person> findFirstByLastnameLike(String pattern);
}

Original pull request: #295.
2020-03-27 16:40:08 +01:00
Mark Paluch
6dcd8787c1 #328 - Polishing.
Fix javadoc.
2020-03-26 16:00:43 +01:00
Mark Paluch
81adff3f80 #320 - Update documentation regarding @Transient properties usage in the persistence constructor. 2020-03-19 15:39:22 +01:00
Mark Paluch
048bcb8baa #321 - Polishing.
Add optimizations for void projections.
2020-03-19 10:43:12 +01:00
Mark Paluch
b0348e272a #321 - Bind only bindable query method parameters.
We now only bind parameters to the query that are actually bindable instead of consuming the entire parameter list.
2020-03-19 10:12:45 +01:00
Jens Schauder
edc6d9b042 #289 - Polishing.
Minor formatting.

Original pull request: #308.
2020-03-17 11:34:17 +01:00
Mark Paluch
10ec677c53 #189 - Incorporate review feedback.
Fix nullability annotations. Relax generics at DatabaseClient.StatementFilterSpec.filter(…).

Original pull request: #308.
2020-03-17 11:34:11 +01:00
Jens Schauder
4a5184830d #189 - Polishing.
Refactored DefaultDatabaseClientUnitTests in order to make the relevant differences in setup easier to spot.

Original pull request: #308.
2020-03-17 11:34:05 +01:00
Jens Schauder
6a8ab608e5 #189 - Polishing.
Made assertions in tests more strict.

Original pull request: #308.
2020-03-17 11:33:59 +01:00
Mark Paluch
366c10be40 #189 - Accept StatementFilterFunction in DatabaseClient.
We now accept StatementFilterFunction and ExecuteFunction via DatabaseClient to filter Statement execution. StatementFilterFunctions can be used to pre-process the statement or post-process Result objects.

databaseClient.execute(…)
		.filter((s, next) -> next.execute(s.returnGeneratedValues("my_id")))
		.filter((s, next) -> next.execute(s.fetchSize(25)))

databaseClient.execute(…)
		.filter(s -> s.returnGeneratedValues("my_id"))
		.filter(s -> s.fetchSize(25))

Original pull request: #308.
2020-03-17 11:33:21 +01:00
Jens Schauder
ce3eef6827 #301 - Prepare 1.1 M4 (Neumann). 2020-03-11 09:46:29 +01:00
Jens Schauder
63fe35a002 #301 - Updated changelog. 2020-03-11 09:46:23 +01:00
Mark Paluch
228c6748bf #316 - Adapt to Mockito 3.3.
Mockito reports falsely unnecessary stubbings so we're switching to the silent runner for these cases.
2020-03-11 09:04:40 +01:00
Jens Schauder
ed297c08fe #289 - Polishing.
Refactored DefaultDatabaseClientUnitTests in order to make the relevant differences in setup easier to spot.
Formatting and nullability annotations.

Original pull request: #307.
2020-03-10 16:15:02 +01:00
Mark Paluch
0e5a584277 #289 - Add support for Criteria composition.
We now support composition of Criteria objects to create a Criteria from one or more top-level criteria and to compose nested AND/OR Criteria objects:

Criteria.where("name").is("Foo")).and(Criteria.where("name").is("Bar").or("age")
				.lessThan(49).or(Criteria.where("name").not("Bar").and("age").greaterThan(49))

Original pull request: #307.
2020-03-10 16:13:37 +01:00
Mark Paluch
b3d00022d5 #42 - Polishing.
Obtain generated ID value only once.
2020-03-05 13:22:21 +01:00
Mark Paluch
341c796816 #42 - Add dialect resolution for r2dbc-mariadb driver.
We now use the MySQL dialect when using the R2DBC MariaDB driver.
2020-03-05 13:21:59 +01:00
Mark Paluch
7ed68ee532 #311 - Use R2dbcMappingContext in AbstractR2dbcConfiguration instead of RelationalMappingContext.
We use now a more concrete type in the configuration to avoid clashes when Spring Data JDBC is on the class path.
2020-02-20 10:42:28 +01:00
Mark Paluch
6027e29305 #164 - Support @Query definitions with SpEL expressions.
We now support SpEL expressions in string-based queries to bind parameters for more dynamic queries. SpEL expressions are enclosed in :#{…} and rendered as synthetic named parameter so their values are substituted with bound parameters to avoid SQL injection attach vectors.

interface PersonRepository extends Repository<Person, String> {

	@Query("SELECT * FROM person WHERE lastname = :#{'hello'}")
	Mono<Person> findHello();

	@Query("SELECT * FROM person WHERE lastname = :#{[0]} and firstname = :firstname")
	Mono<Person> findByLastnameAndFirstname(@Param("value") String value, @Param("firstname") String firstname);

	@Query("SELECT * FROM person WHERE lastname = :#{#person.name}")
	Mono<Person> findByExample(@Param("person") Person person);
}
2020-02-20 10:36:18 +01:00
Mark Paluch
714dec3c94 #310 - Fix bind marker reuse when expanding collection arguments using named parameters.
We now correctly reuse bind markers for named parameter substitution when using collection arguments to create dynamic argument lists. Previously, we allocated a new bind marker for each item in the collection which left the parameters intended for reuse unbound.
2020-02-19 12:02:48 +01:00
Mark Paluch
5a5a5fec9e #290 - Add Kotlin extensions for fluent R2dbcEntityTemplate API. 2020-02-17 17:38:47 +01:00
Mark Paluch
1e64c6461a #300 - Extend unit tests for QueryMapper. 2020-02-17 17:19:36 +01:00
Mark Paluch
bfff1f4aaa #298 - Refine documentation regarding Converter behavior for collections. 2020-02-17 13:09:25 +01:00
Mark Paluch
1e667fc242 #303 - Add note about boxed primitives when implementing custom converters. 2020-02-17 13:01:43 +01:00
Mark Paluch
b9b764b5dd #306 - Polishing.
Enable ignored tests that are no longer required to be disabled.
2020-02-17 12:58:07 +01:00
Mark Paluch
2b024dfd10 #306 - Upgrade to JAsync 1.0.14.
Also enable ignored tests.
2020-02-17 12:57:42 +01:00
Mark Paluch
8828ebb11d #305 - Consistently apply registered converters.
We now apply registered write converters to bindable values that are bound via bind(…) or provided through the Criteria/Update API.
2020-02-17 12:48:47 +01:00
Mark Paluch
6051ab11ae #302 - Add documentation for entity-state detection. 2020-02-14 13:50:31 +01:00
Mark Paluch
f3e8f37890 #280 - Prepare 1.1 M3 (Neumann). 2020-02-12 14:46:56 +01:00
Mark Paluch
1313915489 #280 - Updated changelog. 2020-02-12 14:46:53 +01:00
Mark Paluch
f5b9d658d9 #296 - Rename DatabaseClient bean to r2dbcDatabaseClient. 2020-02-12 14:29:06 +01:00
Mark Paluch
1e1888245f #220 - Polishing.
Update what's new section.
2020-02-12 14:25:18 +01:00