DATACMNS-597 - Fixed to strict consistency check in PersistentPropertyAccessor lookup.

BasicpersistentEntity now allows subtypes to be handed into the PersistentPropertyAccessor lookup to support inheritance hierarchies as well as interface based PersistentEntity scenarios.
This commit is contained in:
Oliver Gierke
2014-11-19 17:05:50 +01:00
parent 3446c457d5
commit 2388b6fa90
2 changed files with 15 additions and 1 deletions

View File

@@ -372,7 +372,7 @@ public class BasicPersistentEntity<T, P extends PersistentProperty<P>> implement
public PersistentPropertyAccessor getPropertyAccessor(Object bean) {
Assert.notNull(bean, "Target bean must not be null!");
Assert.isTrue(getType().equals(bean.getClass()), "Target bean is not of type of the persistent entity!");
Assert.isTrue(getType().isInstance(bean), "Target bean is not of type of the persistent entity!");
return new BeanWrapper<Object>(bean);
}