DATAMONGO-439 - Performance improvements in mapping subsystem.
Fixed minor performance problems discovered by the fix for DATAMONGO-439. We're now caching the information whether a constructor parameter is an enclosing class parameter. PersistentEntityParameterValueProvider is throwing an exception now if the parameter is not referring to a property of the entity (via the parameter name).
This commit is contained in:
@@ -41,6 +41,8 @@ public class PersistentEntityParameterValueProviderUnitTests<P extends Persisten
|
||||
|
||||
@Mock
|
||||
PropertyValueProvider<P> propertyValueProvider;
|
||||
@Mock
|
||||
P property;
|
||||
|
||||
/**
|
||||
* @see DATACMNS-134
|
||||
@@ -50,7 +52,11 @@ public class PersistentEntityParameterValueProviderUnitTests<P extends Persisten
|
||||
|
||||
Object outer = new Outer();
|
||||
|
||||
PersistentEntity<Inner, P> entity = new BasicPersistentEntity<Inner, P>(ClassTypeInformation.from(Inner.class));
|
||||
PersistentEntity<Inner, P> entity = new BasicPersistentEntity<Inner, P>(ClassTypeInformation.from(Inner.class)) {
|
||||
public P getPersistentProperty(String name) {
|
||||
return property;
|
||||
}
|
||||
};
|
||||
PreferredConstructor<Inner, P> constructor = entity.getPersistenceConstructor();
|
||||
Iterator<Parameter<Object, P>> iterator = constructor.getParameters().iterator();
|
||||
|
||||
@@ -65,6 +71,8 @@ public class PersistentEntityParameterValueProviderUnitTests<P extends Persisten
|
||||
|
||||
class Inner {
|
||||
|
||||
Object myObject;
|
||||
|
||||
Inner(Object myObject) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user