jhipster/generator-jhipster — pull request #919 by devedipoint (2014-12-30 17:39:00+00:00)
Title: JPA entities inheritance

I've done some work on enabling entities inheritance. I created 2 new question. Why the need for so much?
1. Generator asks if an entity wants to be the base entity. We assume only JPA SingleTable Strategy that's why entity needs 2 annotations:
- @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
- @DiscriminatorColumn(name = "type")
This can be done only if user wants this entity to be base.
2. Generator asks if an entity wants to inherite from other entities stored in '.jhipster.inheritance.table.json' file. Also some new metadata is stored within .jhipster entity files. Inheritance works with multilevel class extending.

Of course a liquibase changesets are also updated due to creating inherited entity doesn't require creating new table instead of altering them.

I'm not expert in frontend but I assumed that creating inherited entity needs collect information about all fields, and it's done.

What is missing?
1. I think it's necessary to enable @MappedSuperclass as a base class which entities can inherite with. That's why I omited inheriting with AbstractAuditingEntity. It's @MappedSuperclass, neither an entity nor table. I can and I want to work on this in separate generator ie.: yo jhipster:msc (MappedSuperClass). I know I need it because It cannot be done by using BaseEntity for all other entities - all could be persisted in one table. That's why I think @MappedSuperclass and separate generator is needed.
2. More tests are needed
3. Maybe refactor?