Interface PersistentPropertyAccessor<T>

All Known Subinterfaces:
PersistentPropertyPathAccessor<T>
All Known Implementing Classes:
ConvertingPropertyAccessor, InstantiationAwarePropertyAccessor

public interface PersistentPropertyAccessor<T>
Domain service to allow accessing and setting PersistentPropertys of an entity. Usually obtained through PersistentEntity.getPropertyAccessor(Object). In case type conversion shall be applied on property access, use a ConvertingPropertyAccessor.

This service supports mutation for immutable classes by creating new object instances. These are managed as state of PersistentPropertyAccessor and must be obtained from getBean() after processing all updates.

Since:
1.10
Author:
Oliver Gierke, Mark Paluch, Johannes Englmeier
See Also:
  • Method Details

    • setProperty

      void setProperty(PersistentProperty<?> property, @Nullable Object value)
      Sets the given PersistentProperty to the given value. Will do type conversion if a ConversionService is configured.
      Parameters:
      property - must not be null.
      value - can be null.
      Throws:
      MappingException - in case an exception occurred when setting the property value.
    • getProperty

      @Nullable Object getProperty(PersistentProperty<?> property)
      Returns the value of the given PersistentProperty of the underlying bean instance.
      Parameters:
      property - must not be null.
      Returns:
      can be null.
    • getBean

      T getBean()
      Returns the underlying bean. The actual instance may change between setProperty(PersistentProperty, Object) calls.
      Returns:
      will never be null.