How to delete an entity after creating it using jhipster?

vijay bhatt picture vijay bhatt · Jan 30, 2015 · Viewed 32.7k times · Source

I have created 3 entities (Author, Book, Library) using "yo jhipster:entity" command but in one entity (Library) I had a ManyToMany relationship (to Book) but that caused "mappedBy reference an unknown target entity property: com.tst.testdomain.domain.Book.librarys in com.tst.testdomain.docmain.Library.books" so what is the clean way of deleted the Library entity. Would a command like "yo jhipster:entitydelete" be useful?

Answer

Ben Thurley picture Ben Thurley · Feb 18, 2015

I use git scm for this. It's not just the generated files that need to be deleted. jHipster also modifies files so with those you need to keep the file but back out the change.

Each time I create an entity I do a separate commit so I can track what jHipster did for each entity.

To clear all changes since the last commit I do

git reset --hard
git clean -fd

If I've done that but I also need to back out the previous commit then I do

git reset --hard HEAD~1

Commits are local with git so it's not until you push these commits that they will be shared.