使用jhipster创建实体后如何删除实体? [英] How to delete an entity after creating it using jhipster?

查看:106
本文介绍了使用jhipster创建实体后如何删除实体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用"yo jhipster:entity"命令创建了3个实体(作者,书,图书馆),但是在一个实体(库)中我有一个ManyToMany关系(与Book),但是导致"mappedBy通过引用未知目标实体属性:com.tst.testdomain.docmain.Library.books中的com.tst.testdomain.domain.Book.librarys",那么删除Library实体的干净方法是什么.像"yo jhipster:entitydelete"这样的命令有用吗?

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?

推荐答案

为此,我使用git scm.需要删除的不仅仅是生成的文件. jHipster还会修改文件,以便您需要保留文件但撤消更改.

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.

每次创建一个实体时,我都会进行一次单独的提交,这样我就可以跟踪jHipster对每个实体所做的工作.

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

提交在git中是本地的,因此直到您推送这些提交才可以共享它们.

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

这篇关于使用jhipster创建实体后如何删除实体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆