Class ChangeTrackingUnitOfWork

All Implemented Interfaces:
ConfigurationHolder, MetamodelProvider, UnitOfWork, Wrapper

public class ChangeTrackingUnitOfWork extends AbstractUnitOfWork
  • Constructor Details

  • Method Details

    • readObjectInternal

      protected <T> T readObjectInternal(Class<T> cls, Object identifier, Descriptor descriptor)
      Overrides:
      readObjectInternal in class AbstractUnitOfWork
    • createIndirectCollection

      public Object createIndirectCollection(Object collection, Object owner, Field field)
      Creates an indirect collection, which wraps the specified collection instance and propagates changes to the persistence context.
      Parameters:
      collection - Collection to be proxied
      owner - Collection owner instance
      field - Field filled with the collection
      Returns:
      Indirect collection
    • detachAllManagedInstances

      protected void detachAllManagedInstances()
    • attributeChanged

      public void attributeChanged(Object entity, Field f)
      Description copied from interface: UnitOfWork
      Persists changed value of the specified field.
      Parameters:
      entity - Entity with changes (the clone)
      f - The field whose value has changed
      See Also:
    • attributeChanged

      public void attributeChanged(Object entity, FieldSpecification<?,?> fieldSpec)
      Description copied from interface: UnitOfWork
      Persists changed value of the specified field.
      Parameters:
      entity - Entity with changes (the clone)
      fieldSpec - Metamodel element representing the attribute that changed
    • registerNewObject

      public void registerNewObject(Object entity, Descriptor descriptor)
      Description copied from interface: UnitOfWork
      Registers the specified new object in this Unit of Work.

      The object will be persisted into the context specified by descriptor.

      Specified by:
      registerNewObject in interface UnitOfWork
      Overrides:
      registerNewObject in class AbstractUnitOfWork
      Parameters:
      entity - The object to register
      descriptor - Entity descriptor
    • unregisterObject

      public void unregisterObject(Object object)
      Description copied from interface: UnitOfWork
      Detaches the specified registered object from this Unit of Work.
      Specified by:
      unregisterObject in interface UnitOfWork
      Overrides:
      unregisterObject in class AbstractUnitOfWork
      Parameters:
      object - Clone to detach
    • removeObject

      public void removeObject(Object entity)
      Description copied from interface: UnitOfWork
      Remove the given object from the repository.
      Parameters:
      entity - Object to remove