Commit Graph

2128 Commits

Author SHA1 Message Date
Christoph Strobl
7ed72ff41f DATACMNS-1767 - Disable ClassGeneratingEntityInstantiator when running native-image.
Always fall back to reflection when the system property for org.graalvm.nativeimage.imagecode is set.
This is required because on the fly code generation is not supported in this case.

Original pull request: #456.
2020-07-13 14:26:08 +02:00
Mark Paluch
f212e3e0ef DATACMNS-1758 - Revert optimizations from DATACMNS-1698.
We ensure that each EntityCallback retrieval operates on its own List to not share the retrieved callback list with other threads.
2020-07-09 14:15:59 +02:00
Mark Paluch
ff7a608cc7 DATACMNS-1725 - Updated changelog. 2020-06-25 12:00:17 +02:00
Mark Paluch
441609c4bf 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:48:15 +02:00
Gerrit Meier
895311c208 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:47:25 +02:00
Mark Paluch
06184a3be5 DATACMNS-1750 - Polishing. 2020-06-22 15:48:16 +02:00
Mark Paluch
75f91975df DATACMNS-1750 - Refrain from inspecting Page contents if first item is null. 2020-06-22 15:48:15 +02:00
Oliver Drotbohm
7a7b1683ed 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:37:15 +02:00
Oliver Drotbohm
ba012ff25b 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 16:37:15 +02:00
Oliver Drotbohm
18d6e63ab0 DATACMNS-1745 - Polishing.
Made the reference to RepositoryInformation non-nullable from the RepositoryAnnotationTransactionAttributeSource (previously RepositoryInformationPreferring…). Adapted test cases accordingly.
2020-06-16 14:38:09 +02:00
Mark Paluch
bda90f037d 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:38:03 +02:00
Oliver Drotbohm
fb944b3b98 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:09:39 +02:00
Mark Paluch
ab9d3717f0 DATACMNS-1744 - Drop the use of the term white list. 2020-06-15 13:45:19 +02:00
Mark Paluch
9c94321657 DATACMNS-1724 - After release cleanups. 2020-06-10 14:29:28 +02:00
Mark Paluch
5d07e2e3d3 DATACMNS-1724 - Prepare next development iteration. 2020-06-10 14:29:25 +02:00
Mark Paluch
9d6a98f973 DATACMNS-1724 - Release version 2.3.1 (Neumann SR1). 2020-06-10 14:02:26 +02:00
Mark Paluch
a5ff62f9e1 DATACMNS-1724 - Prepare 2.3.1 (Neumann SR1). 2020-06-10 14:01:58 +02:00
Mark Paluch
eafc3edd2c DATACMNS-1724 - Updated changelog. 2020-06-10 14:01:36 +02:00
Mark Paluch
9688de52e5 DATACMNS-1712 - Updated changelog. 2020-06-10 12:29:56 +02:00
Mark Paluch
7b0c3cfcbf DATACMNS-1711 - Updated changelog. 2020-06-10 11:41:21 +02:00
Mark Paluch
7a887ea0d8 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:57 +02:00
Oliver Drotbohm
95f069c755 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:15 +02:00
Mark Paluch
0d34687896 DATACMNS-1733 - Fix Javadoc for Range factory methods.
Range.open(…) is now correctly documented with exclusive bounds.
2020-05-27 10:15:03 +02:00
Mark Paluch
a8aa074328 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:04 +02:00
mhyeon-lee
0e9544052c 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:31:10 +02:00
Mark Paluch
075aac6c12 DATACMNS-1706 - Polishing.
Improve Javadoc.

Original pull request: #437.
2020-05-26 09:12:14 +02:00
mhyeon-lee
31f821e7ff 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:12:14 +02:00
Mark Paluch
d36a8175d4 DATACMNS-1713 - After release cleanups. 2020-05-12 12:46:21 +02:00
Mark Paluch
37dca1e7bd DATACMNS-1713 - Prepare next development iteration. 2020-05-12 12:40:53 +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