bensnjo
bensnjo

Reputation: 21

How do I create a Jhipster relationship between an entity and two other entities using the same field?

I have three entities; entity DamagedItems { }, entity Recipe { }, entity RawProduct { }.

In a scenario where the DamagedItems should capture both Recipes and RawMaterial in one field, let's say damagedItemName, how do you relate these three entities using damegedItemName without creating identifier conflict?

   `//this is what I want to achieve
    relationship OnetoOne{
    DamagedItems {damagedItemName} to Recipe,
    DamagedItems {damagedItemName} to RawProduct
     }`

Creating the entities this way has resulted to identifier conflict

Upvotes: 0

Views: 141

Answers (1)

Gaël Marziou
Gaël Marziou

Reputation: 16294

You can't model polymorphic relationships with JDL. You have to code it manually probably using inheritance.

Upvotes: 0

Related Questions