ValueGetter

public class ValueGetter

This class is required for retrieving values from entities. Since the history implementation makes additional changes to records involved in relationships and sets additional field, this class gives it an easy way to override the default behaviour.

Constructors

ValueGetter

public ValueGetter(BasePersistenceService persistenceService, BundleContext bundleContext)

Methods

findService

protected MotechDataService findService(Class<?> clazz)

getValue

public Object getValue(Field field, Object instance, Object recordInstance, EntityType type, ObjectReferenceRepository objectReferenceRepository)

updateRecordFields

protected void updateRecordFields(Object newHistoryRecord, Object realCurrentObj)

Updates fields of a new record after it is created. Called for newly created relationship records as well.

Parameters:
  • newHistoryRecord – the newly created record
  • realCurrentObj – the actual current object