How To Rename An Enity?

12 Views Asked by At

I rename an entity name from "Source" to "Resource" in a JDL file. After rerunning the command "jhipster import-jdl ...", all of the changes are above adding a new entity "Resource" instead of renaming the "Source" entity. The following is what I find online on the subject. And I don't know what I did wrong.

There isn't a direct built-in command in JHipster to rename an existing entity within the JDL file. However, you can achieve this through manual editing and code regeneration. Here's how:

    1. Locate the JDL file: Your entity definition resides in a .jdl file typically located under the src/main/resources/config/liquibase/ directory of your JHipster project.

    2. Edit the JDL file: Open the .jdl file and locate the entity you want to rename. Update the entityName property with the new desired name.

    3. Regenerate code (Important): After modifying the JDL file, you need to regenerate the code to reflect the new entity name.  Don't directly modify the generated code classes or files.
0

There are 0 best solutions below