Using a Transformation to Roll Up a Subtype Relationship

A subtype relationship is a relationship between a supertype entity and a subtype entity. You can use a subtype relationship to create a hierarchical grouping of entities that share common characteristics.

When you transition from one design layer to another, or when you change a model over time, the way that you represent subtype relationships can change. You can apply a transformation to roll up a subtype entity to the supertype entity.

The main reasons why you apply a transformation to roll up a subtype relationship include:

  • You want to simplify a model.
  • The subtype relationship is not appropriate for the current design layer.
  • You want to improve query performance.

Supertype Subtype Roll-Up Wizard

To roll up a subtype relationship, you select the subtype relationship symbol Sub-category button on erwin Toolbox, and click the Supertype-Subtype RollUp Supertype Subtype Rollup transformation icon icon on the Transformations toolbar.

Result of Rolling Up a Subtype Relationship

When you click Supertype-Subtype RollUp to roll up a subtype relationship, you:

  • Create a supertype entity that contains all primary-key and non-key attributes from the source supertype and subtype entities. When you create attributes in the supertype entity, you preserve the attribute order in the source supertype entity, and then the attribute order in the source subtype entity. The primary key of the supertype entity is the primary key of the source supertype entity. The supertype entity appears in the Model Explorer under the Entities folder.
  • If the source supertype entity that you roll up contains a foreign key (FK), you create a corresponding foreign key in the new supertype entity. If the source subtype entity contains a foreign key, you create a corresponding foreign key in the new supertype entity, as long as the foreign key did not migrate from the source supertype entity.
  • If the source subtype entity contains a foreign key attribute that you have rolenamed, the foreign key becomes an owned attribute in the new supertype entity. The rolename in the new supertype entity is not preserved.
  • Create all relationships associated with the source supertype entity. Any relationship in which the source subtype entity is a parent becomes a relationship in which the new supertype entity is a parent. Any relationship in which the source subtype entity is a child becomes a relationship in which the new supertype entity is a child.
  • Preserve all object properties for the source supertype entity.

Important! Once you apply the Supertype Subtype Roll-Up transformation, it cannot be reversed. While in the current modeling session however, you can undo the action.

More information:

Roll Up a Subtype Relationship with a Transformation