Search code examples
postgresqljhipsterjdl

How to use class abstraction with JDL?


I'm doing a project for my last year of university.

I have to make a commercial website using JHipster (in my case Angluar + Spring + PostgreSQL).

Using JDL, I figured out that abstract classes seems to not be supported, therefore it seems impossible to use inheritance. Do you know how to bypass this issue?

Here is the jdl : https://framabin.org/p/?0ec3f3890f12aded#Xum+8i00kbP8p2jGhIVSXgu3Twc8BdwJ5iJ5t6cM/7A=


Solution

  • As you found out there's no support for inheritance in JHipster generated entities, so either you code it manually using Hibernate strategies or by replacing inheritance by composition which is often a good idea.

    You could also compose by using one-to-one relationships and using DTOs to present joined entities as a single object.

    In any case, you'll probably going to modify substantially the generated views in Angular code.