applyMigration

public final void applyMigration<T extends TransactionalEntity<I, S, ? extends Object>>(I id, Migration<I, T, S> migration)

Applies a given Migration to an entity with the given ID.

The operation is performed in three steps:

  1. Load an entity by the given ID.
  2. Transform it through the migration operation.
  3. Store the entity back to the repository or delete it depending on the migration configuration.

This operation is only supported for entities that are transactional.

See also

the batch version of the method

Throws

if the entity with the given ID is not found in the repository

if the repository manages a non-transactional entity type


public final void applyMigration<T extends TransactionalEntity<I, S, ? extends Object>>(Set<I> ids, Migration<I, T, S> migration)

Applies a Migration to several entities in batch.

The operation is performed in three steps:

  1. Load entities by the given IDs.
  2. Transform each entity through the migration operation.
  3. Store the entities which are not configured to be deleted by the Migration back to the repository.

This operation is only supported for entities that are transactional.

See also

Throws

if the repository manages a non-transactional entity type