0

guys can anyone help me i have a weird situation, i have created an entity using j hipster and it created classes with that name and data base table as well, now my question is how can just change my class name. i made some changes in the classes and i don't want to loose those changes

how could i change only the class name without loosing those changes

what i tried is How to modify existing entity generated with jhipster?

after this all code changes are gone, so with loosing code changes how can i do it?

rakesh
  • 73
  • 3
  • 12

1 Answers1

1

This is not an answer, but I faced the same issue lot of times, Usually I do this manually, trust me its not a lot of work.

General Steps.

Step 1: In the .jhipster folder, replace the classname.json file with your file new class name. Replace relationships if any.

Step 2: Change domain, repository, service(if exist), resource.

Step 3: Change the ui code.

This is a find/replace job just need to be more careful thats it.

There is one tricky way though.

Step 1: Create a new branch, if using git

Step 2: Create a new new_class_name.json file in the .jhipster project.

Step 3: Copy the json from old_class_name.json file in the new_class_name.json

Step 4: run the command "yo jhipster:entity new_class_name"

Step 5: This will create all the new files.

Step 6: Copy paste your changes in the new one.

Step 7: Delete old files.

I usually follow the first one. Trust me its not that difficult.

Sumit Vairagar
  • 486
  • 3
  • 12