org.qi4j.migration.assembly

## Class EntityMigrationBuilder

- java.lang.Object
- - org.qi4j.migration.assembly.EntityMigrationBuilder

-     public class EntityMigrationBuilder
      extends Object

  Fluent API for creating migration rules for specific entity types.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityMigrationBuilder(VersionMigrationBuilder migrationBuilder, String[] entityTypes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `EntityMigrationBuilder` | `addAssociation(String association, String defaultReference)` Add rule to add an Entity association.
    `EntityMigrationBuilder` | `addManyAssociation(String association, String... defaultReferences)` Add rule to add an Entity many-association.
    `EntityMigrationBuilder` | `addNamedAssociation(String association, Map<String,String> defaultReferences)` Add rule to add an Entity named-association.
    `EntityMigrationBuilder` | `addProperty(String property, Object defaultValue)` Add rule to add an Entity property.
    `EntityMigrationBuilder` | `custom(EntityMigrationOperation operationEntity)` Add rule to perform a custom operation
    `VersionMigrationBuilder` | `end()` Return the version builder
    `EntityMigrationBuilder` | `removeAssociation(String association, String defaultReference)` Add rule to remove an Entity association
    `EntityMigrationBuilder` | `removeManyAssociation(String association, String... defaultReferences)` Add rule to remove an Entity many-association
    `EntityMigrationBuilder` | `removeNamedAssociation(String association, Map<String,String> defaultReferences)` Add rule to remove an Entity named-association
    `EntityMigrationBuilder` | `removeProperty(String property, String defaultValue)` Add rule to remove an Entity property
    `EntityMigrationBuilder` | `renameAssociation(String from, String to)` Add rule to rename an Entity association.
    `EntityMigrationBuilder` | `renameManyAssociation(String from, String to)` Add rule to rename an Entity many-association.
    `EntityMigrationBuilder` | `renameNamedAssociation(String from, String to)` Add rule to rename an Entity named-association.
    `EntityMigrationBuilder` | `renameProperty(String from, String to)` Add rule to rename an Entity property.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EntityMigrationBuilder

          public EntityMigrationBuilder(VersionMigrationBuilder migrationBuilder,
                                String[] entityTypes)

  - ### Method Detail

    - #### end

          public VersionMigrationBuilder end()

      Return the version builder
      Returns:
        current version builder

    - #### renameProperty

          public EntityMigrationBuilder renameProperty(String from,
                                              String to)

      Add rule to rename an Entity property.
      Parameters:
        `from` - property name
        `to` - property name
      Returns:
        the builder

    - #### addProperty

          public EntityMigrationBuilder addProperty(String property,
                                           Object defaultValue)

      Add rule to add an Entity property.
      Parameters:
        `property` - to be added
        `defaultValue` - default value
      Returns:
        the builder

    - #### removeProperty

          public EntityMigrationBuilder removeProperty(String property,
                                              String defaultValue)

      Add rule to remove an Entity property
      Parameters:
        `property` - to be removed
        `defaultValue` - default value (used for downgrading)
      Returns:
        the builder

    - #### renameAssociation

          public EntityMigrationBuilder renameAssociation(String from,
                                                 String to)

      Add rule to rename an Entity association.
      Parameters:
        `from` - assocation name
        `to` - association name
      Returns:
        the builder

    - #### addAssociation

          public EntityMigrationBuilder addAssociation(String association,
                                              String defaultReference)

      Add rule to add an Entity association.
      Parameters:
        `association` - to be added
        `defaultReference` - default reference
      Returns:
        the builder

    - #### removeAssociation

          public EntityMigrationBuilder removeAssociation(String association,
                                                 String defaultReference)

      Add rule to remove an Entity association
      Parameters:
        `association` - to be removed
        `defaultReference` - default value (used for downgrading)
      Returns:
        the builder

    - #### addManyAssociation

          public EntityMigrationBuilder addManyAssociation(String association,
                                                  String... defaultReferences)

      Add rule to add an Entity many-association.
      Parameters:
        `association` - to be added
        `defaultReferences` - default references
      Returns:
        the builder

    - #### removeManyAssociation

          public EntityMigrationBuilder removeManyAssociation(String association,
                                                     String... defaultReferences)

      Add rule to remove an Entity many-association
      Parameters:
        `association` - to be removed
        `defaultReferences` - default value (used for downgrading)
      Returns:
        the builder

    - #### renameManyAssociation

          public EntityMigrationBuilder renameManyAssociation(String from,
                                                     String to)

      Add rule to rename an Entity many-association.
      Parameters:
        `from` - many-assocation name
        `to` - many-association name
      Returns:
        the builder

    - #### addNamedAssociation

          public EntityMigrationBuilder addNamedAssociation(String association,
                                                   Map<String,String> defaultReferences)

      Add rule to add an Entity named-association.
      Parameters:
        `association` - to be added
        `defaultReferences` - default references
      Returns:
        the builder

    - #### removeNamedAssociation

          public EntityMigrationBuilder removeNamedAssociation(String association,
                                                      Map<String,String> defaultReferences)

      Add rule to remove an Entity named-association
      Parameters:
        `association` - to be removed
        `defaultReferences` - default value (used for downgrading)
      Returns:
        the builder

    - #### renameNamedAssociation

          public EntityMigrationBuilder renameNamedAssociation(String from,
                                                      String to)

      Add rule to rename an Entity named-association.
      Parameters:
        `from` - many-assocation name
        `to` - many-association name
      Returns:
        the builder

    - #### custom

          public EntityMigrationBuilder custom(EntityMigrationOperation operationEntity)

      Add rule to perform a custom operation
      Parameters:
        `operationEntity` - the custom operation to be performed during migration
      Returns:
        the builder