Commit Graph

2127 Commits

Author SHA1 Message Date
Phillip Webb
ea263b233b Rename uppercase 'LOGGER' static finals
Rename static final `LOGGER` members to use the lowercase form.
Although the loggers are static final, they are not constant values.
2020-06-25 11:09:16 +02:00
Mark Paluch
c9a5a19738 DATACMNS-1753 - Polishing.
Check for deferred types in ReactiveWrappers so that ReactiveWrapperConverters remains untouched as wrapper conversion from a reactive type into CompletableFuture is still possible from a ReactiveWrapperConverters perspective.

Original pull request: #450.
2020-06-25 10:46:44 +02:00
Gerrit Meier
558272e57b DATACMNS-1753 - Don't consider CompletableFuture as reactive type.
CompletableFuture use is permitted in imperative repositories so we should not use CompletableFuture as indicator to switch a repository implementation to a reactive one.

Original pull request: #450.
2020-06-25 10:45:53 +02:00
Mark Paluch
2c25a591fb DATACMNS-1750 - Polishing. 2020-06-22 15:27:10 +02:00
Mark Paluch
4bc474d8f4 DATACMNS-1750 - Refrain from inspecting Page contents if first item is null. 2020-06-22 15:27:10 +02:00
Mark Paluch
9ff82472ac DATACMNS-1653 - Polishing.
Remove superfluous static keyword from enum declarations.

Original pull request: #444.
2020-06-21 20:06:26 +02:00
Mark Paluch
d3260d3caa DATACMNS-1653 - Add support for RxJava 3.
We now include adapters and registry information for RxJava 3 types.

Original pull request: #444.
2020-06-21 20:05:53 +02:00
Oliver Drotbohm
52154f6986 DATACMNS-1743 - Polishing.
We now avoid identifier conversion in ReflectionrepositoryConverter if not necessary. Reestablish a couple of unit tests for DomainClassConverter that were disabled by accident.
2020-06-16 16:11:26 +02:00
Oliver Drotbohm
aa1c1d4f15 DATACMNS-1743 - Fixed handling of failed aggregate lookup in DomainClassConverter.
We now fall back to null in case the repository lookup for the aggregate results in an absent value rather than returning the source unconverted.
2020-06-16 15:22:06 +02:00
Oliver Drotbohm
f65451d777 DATACMNS-1745 - Polishing.
Made the reference to RepositoryInformation non-nullable from the RepositoryAnnotationTransactionAttributeSource (previously RepositoryInformationPreferring…). Adapted test cases accordingly.
2020-06-16 14:31:15 +02:00
Mark Paluch
a76ed28fe7 DATACMNS-1745 - Refactor CustomAnnotationTransactionAttributeSource to use computeTransactionAttribute template method.
We now no longer duplicate Spring Framework code as AbstractFallbackTransactionAttributeSource exposes computeTransactionAttribute which we can use to override to determine TransactionAttribute from the repository interface.

Renamed CustomAnnotationTransactionAttributeSource to RepositoryInformationPreferringAnnotationTransactionAttributeSource to reflect the nature of our customization.
2020-06-16 14:31:15 +02:00
Oliver Drotbohm
9c50f86061 DATACMNS-1743 - Fix lazy repository lookups in DomainClassConverter.
We now eagerly register DomainClassConverter as converter with the ConversionService in the web setup. We also refrain from explicitly registering the traget converters with the ConversionService as that might trigger a ConcurrentModificationException if called during an iteration over the converters in the first place. As DomainClassConverter registers itself for all ConvertiblePairs and delegates to the individual converters anyway.
2020-06-15 22:10:27 +02:00
Mark Paluch
f93a66fdbc DATACMNS-1744 - Drop the use of the term white list. 2020-06-15 13:45:12 +02:00
Mark Paluch
e7f235e47a DATACMNS-1724 - Updated changelog. 2020-06-10 14:30:55 +02:00
Mark Paluch
ca58560c5c DATACMNS-1712 - Updated changelog. 2020-06-10 12:29:54 +02:00
Mark Paluch
e8f7dbea96 DATACMNS-1711 - Updated changelog. 2020-06-10 11:41:56 +02:00
Mark Paluch
376a892925 DATACMNS-1739 - Use standard Spring code of conduct.
Using https://github.com/spring-projects/.github/blob/master/CODE_OF_CONDUCT.md.
2020-06-09 16:09:38 +02:00
Mark Paluch
40e7e89e27 DATACMNS-1738 - Expose method to obtain the repository query method return type.
We now expose RepositoryMetadata.getReturnType(…) to obtain the declared method return type. While pure Java code can rely on Method.getReturnType(), suspended Kotlin methods (Coroutines) require additional lookups. This is because the Kotlin compiler messes around with the return type in the bytecode. It changes the return type to java.lang.Object while synthesizing an additional method argument:

interface MyCoroutineRepository : Repository<Person, String> {
	suspend fun suspendedQueryMethod(): Flow<Person>
}

compiles to

interface MyCoroutineRepository extends Repository<Person, String> {
	Object suspendedQueryMethod(Continuation<Flow<Person>> arg0);
}

Therefore, the triviality of obtaining a return type becomes an inspection of the actual method arguments.

Related ticket: https://jira.spring.io/browse/DATAMONGO-2562
2020-06-09 11:09:31 +02:00
Oliver Drotbohm
210ab249e3 DATACMNS-1734 - Defer initialization of Repositories in DomainClassConverter.
DomainClassConverter now delays the initialization of the Repositories instances used to avoid the premature initialization of repository instances as that can cause deadlocks if the infrastructure backing the repositories is initialized on a separate thread.

Refactored nested converter classes to allow them to be static ones.

Related issues: spring-projects/spring-boot#16230, spring-projects/spring-framework#25131.
Original pull request: #445.
2020-05-29 09:47:21 +02:00
Mark Paluch
644b65eb71 DATACMNS-1733 - Fix Javadoc for Range factory methods.
Range.open(…) is now correctly documented with exclusive bounds.
2020-05-27 10:15:29 +02:00
Mark Paluch
fbe51ef1bb DATACMNS-1735 - Polishing.
Use mutated object as guard for synchronization. Copy discovered callbacks to cached callbacks.

Reduce concurrency in unit test to reduce test load. Guard synchronization with timeouts.

Original pull request: #446.
2020-05-27 09:53:52 +02:00
mhyeon-lee
d9969cb7d4 DATACMNS-1735 - Fix ConcurrencyModificationException in EntityCallbackDiscoverer.
We now guard modifications of the cached entity callbacks list with a synchronization block.

Original pull request: #446.
2020-05-27 09:32:24 +02:00
Mark Paluch
ce7928b28b DATACMNS-1706 - Polishing.
Improve Javadoc.

Original pull request: #437.
2020-05-26 09:06:26 +02:00
mhyeon-lee
9d482b0e35 DATACMNS-1706 - Improve locking in PreferredConstructor#isConstructorParameter.
Switch property parameter cache from HashMap and external locks to ConcurrentHashMap to improve multi-threaded locking behavior during isConstructorParameter(…) initialization.

Original pull request: #437.
2020-05-26 09:05:00 +02:00
Mark Paluch
7db7e1b19a DATACMNS-1730 - Update releasetrain reference documentation with spring-data-bom artifact. 2020-05-20 09:24:42 +02:00
Mark Paluch
4be5aae181 DATACMNS-1726 - Delombok source files. 2020-05-15 08:46:58 +02:00
Mark Paluch
302fa6335f DATACMNS-1713 - After release cleanups. 2020-05-12 12:40:30 +02:00
Mark Paluch
b06215a239 DATACMNS-1713 - Prepare next development iteration. 2020-05-12 12:40:28 +02:00
Mark Paluch
a038ff5efc DATACMNS-1713 - Release version 2.3 GA (Neumann). 2020-05-12 12:28:23 +02:00
Mark Paluch
017c8d2fd2 DATACMNS-1713 - Prepare 2.3 GA (Neumann). 2020-05-12 12:27:59 +02:00
Mark Paluch
ee91f0ab4a DATACMNS-1713 - Updated changelog. 2020-05-12 12:27:44 +02:00
Mark Paluch
7de360cb7b DATACMNS-1676 - Polishing.
Encapsulate field and introduce getter for ConversionService. Add missing Override annotation. Add author tags. Minor cleanups.

Original pull request: #432.
2020-05-12 10:42:01 +02:00
Pavel Horal
f2f7886105 DATACMNS-1676 - Create shared conversion service for AuditableBeanWrapper.
Prevent performance penalty in creating conversion service each time a domain object is being persisted.

Original pull request: #432.
2020-05-12 10:41:27 +02:00
Cicio Flaviu
d9a1f65f05 DATACMNS-1720 - Fix Javadoc for CustomAnnotationTransactionAttributeSource to correctly describe JTA support.
Original pull request: #441.
2020-05-12 10:21:09 +02:00
John Gesimondo
796c86903c DATACMNS-1713 - Fix typo in doc.
Original pull request: #442.
2020-05-12 10:10:32 +02:00
Christoph Strobl
7c883acece DATACMNS-1721 - Lazily evaluate potential property matches in PropertyReferenceException.
Original pull request: #443.
2020-05-12 09:43:35 +02:00
Oliver Drotbohm
0d4b764c2c DATACMNS-1722 - More defensive lookup of XmlBeamHttpMessageConverter.
We now avoid a type reference to XmlBeamHttpMessageConverter in a field within SpringDataWebConfiguration to avoid a type reference to a potentially unresolvable type. This seems to have caused issues on certain JDK 14 builds [0].

[0] https://github.com/spring-projects/spring-framework/issues/25050
2020-05-12 09:03:17 +02:00
Mark Paluch
152cee7956 DATACMNS-1718 - Migrate tests to JUnit 5. 2020-05-07 11:16:29 +02:00
Mark Paluch
024f87906b DATACMNS-1717 - Mention performance behavior of Lambda EntityCallbacks in reference documentation. 2020-05-06 12:28:00 +02:00
Greg Turnquist
63d868f452 DATACMNS-1715 - Remove Travis CI. 2020-05-04 14:16:18 -05:00
Mark Paluch
14d5747f68 DATACMNS-1694 - After release cleanups. 2020-04-28 15:11:43 +02:00
Mark Paluch
e5ecd556b8 DATACMNS-1694 - Prepare next development iteration. 2020-04-28 15:11:42 +02:00
Mark Paluch
3019b7954a DATACMNS-1694 - Release version 2.3 RC2 (Neumann). 2020-04-28 15:03:53 +02:00
Mark Paluch
832b845244 DATACMNS-1694 - Prepare 2.3 RC2 (Neumann). 2020-04-28 15:03:33 +02:00
Mark Paluch
9887dbee19 DATACMNS-1694 - Updated changelog. 2020-04-28 15:03:21 +02:00
Mark Paluch
4de5913441 DATACMNS-1690 - Updated changelog. 2020-04-28 14:46:49 +02:00
Mark Paluch
141a2f33f8 DATACMNS-1674 - Updated changelog. 2020-04-28 11:59:00 +02:00
Mark Paluch
d2d07fbec5 DATACMNS-1710 - Polishing.
Reformat code. Skip parameter inspection if constructor has no parameters.

Original pull request: #440.
2020-04-27 15:20:37 +02:00
Christoph Strobl
03832c36a4 DATACMNS-1710 - Avoid potentially expensive constructor parameter creation where possible.
Reorder constructor filtering with the goal to delay/avoid potentially expensive PersistenceConstructor creation with parameter lookup as much as possible.

The lookup is (in a default setup) only done once per domain type, but depending on the number of entities to inspect the change can help save some cycles for larger domains.

Before:
Benchmark                                  Mode  Cnt         Score         Error  Units
EntityMetadataBenchmark.alwaysNew         thrpt   10    224318,163 ±   42542,453  ops/s

After:
Benchmark                                  Mode  Cnt         Score         Error  Units
EtityMetadataBenchmark.alwaysNew         	thrpt   10    420053,505 ±    9288,093  ops/s

public class DomainType {

	private String id;
	private @Id String theId;

	private String firstname, lastname;
	private Integer age;

	public DomainType(String id, String theId, String firstname, String lastname, Integer age) {
		this.id = id;
		this.theId = theId;
		this.firstname = firstname;
		this.lastname = lastname;
		this.age = age;
	}

	@PersistenceConstructor
	public DomainType(String firstname, String lastname) {

		this.firstname = firstname;
		this.lastname = lastname;
	}
}

Original pull request: #440.
2020-04-27 15:20:30 +02:00
Mark Paluch
03d5498c22 DATACMNS-1707 - Make CoroutineCrudRepository.deleteAll(Flow) suspended.
Delete by Flow is now suspended as the delete method completion is driven by the given Flow. To allow for synchronization, this method is suspended and awaits completion.
2020-04-23 11:33:07 +02:00