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:
Oliver Gierke
2012-05-03 17:25:51 +02:00
parent f67f9eb4c9
commit e20938a3ae
3 changed files with 22 additions and 3 deletions

View File

@@ -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) {
}