DATACOUCH-149 - Fixed PersistentPropertyAccessor usage in CouchbaseTemplate.findById(…).
Corrected the usage of PersistentPropertyAccessor in CouchbaseTempalte.findById(…) by handing the raw entity into the method creating the accessor, not an accessor.
This commit is contained in:
@@ -187,10 +187,10 @@ public class CouchbaseTemplate implements CouchbaseOperations, ApplicationEventP
|
||||
(String) result.getValue(), converted));
|
||||
|
||||
CouchbasePersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(readEntity.getClass());
|
||||
final PersistentPropertyAccessor beanWrapper = getPropertyAccessor(persistentEntity.getPropertyAccessor(readEntity));
|
||||
final PersistentPropertyAccessor accessor = getPropertyAccessor(readEntity);
|
||||
|
||||
if (persistentEntity.hasVersionProperty()) {
|
||||
beanWrapper.setProperty(persistentEntity.getVersionProperty(), result.getCas());
|
||||
accessor.setProperty(persistentEntity.getVersionProperty(), result.getCas());
|
||||
}
|
||||
|
||||
return (T) readEntity;
|
||||
|
||||
Reference in New Issue
Block a user