Oladejo Olajide
Oladejo Olajide

Reputation: 31

How to set fetchType in entity generated from jdl

I am generating an entity using JDL in Jhipster. I want to know how to add @OneToMany(mappedBy = "lostAmount", fetch = FetchType.EAGER, cascade = CascadeType.ALL) by default. Jhipster only generates it as @OneToMany(mappedBy = "lostAmount") and If I manually add the fetchType and cascade, once I regenerate jhipster they will all be wiped out.

Is there a way to make Jhipster do it automatically?

Upvotes: 0

Views: 177

Answers (1)

Gaël Marziou
Gaël Marziou

Reputation: 16294

No, you must modify manually the generated code or write a (local) blueprint to do so.

Keeping your custom changes while re-generating can be done more easily by generating on a git branch and then merging to your main branch.

Writing a blueprint is documented here: https://www.jhipster.tech/modules/creating-a-blueprint/

Upvotes: 0

Related Questions