Browse Source

fix preferred constructor lookup

labs/build-time-domain-type-information
Christoph Strobl 5 years ago
parent
commit
c254f1d7e5
  1. 4
      src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java

4
src/main/java/org/springframework/data/mapping/model/PreferredConstructorDiscoverer.java

@ -104,6 +104,10 @@ public interface PreferredConstructorDiscoverer<T, P extends PersistentProperty< @@ -104,6 +104,10 @@ public interface PreferredConstructorDiscoverer<T, P extends PersistentProperty<
<T, P extends PersistentProperty<P>> PreferredConstructor<T, P> discover(TypeInformation<T> type,
@Nullable PersistentEntity<T, P> entity) {
if(type instanceof DomainTypeInformation) {
return ((DomainTypeInformation)type).getPreferredConstructor();
}
Class<?> rawOwningType = type.getType();
List<Constructor<?>> candidates = new ArrayList<>();

Loading…
Cancel
Save