Entity duplication

Is there a way to duplicate an entity? I have a bunch of similar entities (40 fields) but some with different fields and instead of creating them from scratch, I was wondering if there was a way to copy/paste and change a few fields.
Or even better, would it be better to create a base entity and inherit that base entity to add additional fields?
For example, i would create an entity called Order with fields OrderID, Date, Transaction, Product.
then I would create another entity called SpecialOder inheriting the Order entity and add fields discount, volume.
Is that possible?

1 Like

Duplicating an entity is now only possible in source code - copy-paste the entity class, rename it, change @Table and @Entity annotations and register the new class in persistence.xml. We will consider adding this capability to Studio - thanks for the hint.

As for base classes, it is certainly possible. When creating a base entity, select “MappedSuperclass” checkbox. When creating concrete entities, select the base entity in “Parent class” drop-down.

Thank you.