我使用"yo jhipster:entity"命令创建了3个实体(作者,书籍,库)但在一个实体(库)中我有一个ManyToMany关系(预订),但这导致"mappedBy引用一个未知的目标实体属性:com. com.tst.testdomain.docmain.Library.books中的tst.testdomain.domain.Book.librarys"那么删除Library实体的干净方法是什么.像"yo jhipster:entitydelete"这样的命令会有用吗?
Ben*_*ley 15
我为此使用git scm.这不仅仅是需要删除的生成文件.jHipster还修改文件,以便保存文件但退出更改.
每次我创建一个实体时,我都会单独提交,这样我就可以跟踪jHipster为每个实体做了什么.
要清除自上次提交以来的所有更改
git reset --hard
git clean -fd
Run Code Online (Sandbox Code Playgroud)
如果我已经这样做但我还需要退出之前的提交,那么我会这样做
git reset --hard HEAD~1
Run Code Online (Sandbox Code Playgroud)
提交是git本地的,所以直到你推送这些提交它们才会被共享.
您应该删除以下内容:
rm -rf src/main/resources/config/liquibase/changelog/XXX_added_entity_YourEntity.xml
rm -rf src/main/java/com/radsphere/jeces/domain/YourEntity.java
rm -rf src/main/java/com/radsphere/jeces/repository/YourEntityRepository.java
rm -rf src/main/java/com/radsphere/jeces/web/rest/YourEntityResource.java
rm -rf src/main/webapp/scripts/app/entities/YourEntity/YourEntitys.html
rm -rf src/main/webapp/scripts/app/entities/YourEntity/YourEntity-detail.html
rm -rf src/main/webapp/scripts/app/entities/YourEntity/YourEntity.js
rm -rf src/main/webapp/scripts/app/entities/YourEntity/YourEntity.controller.js
rm -rf src/main/webapp/scripts/app/entities/YourEntity/YourEntity-detail.controller.js
rm -rf src/main/webapp/scripts/components/entities/YourEntity/YourEntity.service.js
rm -rf src/test/java/com/radsphere/jeces/web/rest/YourEntityResourceTest.java
rm -rf src/main/webapp/i18n/en/YourEntity.json
rm -rf src/main/webapp/i18n/fr/YourEntity.json
Run Code Online (Sandbox Code Playgroud)
并从config/liquibase/master.xml中删除引用:
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<include file="classpath:config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307175923_added_entity_Company.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307180142_added_entity_UserTypeRecruiter.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307180338_added_entity_UserTypeCandidate.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307180448_added_entity_QuestionType.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307180612_added_entity_Question.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307180849_added_entity_Answer.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307181033_added_entity_CandidateAnswer.xml" relativeToChangelogFile="false"/>
<!--<include file="classpath:config/liquibase/changelog/20150307181249_added_entity_your_removed_entity.xml" relativeToChangelogFile="false"/>-->
<include file="classpath:config/liquibase/changelog/20150307182736_added_entity_ExamTemplate.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20150307182950_added_entity_Exam.xml" relativeToChangelogFile="false"/>
<!-- JHipster will add liquibase changelogs here -->
Run Code Online (Sandbox Code Playgroud)
我做拉取请求添加此功能:https: //github.com/jhipster/generator-jhipster/pull/4369
要使用它,它很简单:
yo jhipster:entity Foo --remove
Run Code Online (Sandbox Code Playgroud)
它删除了liquibase脚本,但在您需要处理已创建但尚未删除的表/列族之后.
如果您对此感兴趣,请投票或评论该问题:https: //github.com/jhipster/generator-jhipster/issues/4372
你是对的,删除命令会很有用.但是这个命令今天不存在.也许它会被添加.如果要删除实体,则必须手动执行.因此,删除实体的所有生成文件:域,存储库,休息,测试,Angularjs控制器和服务,HTML视图,菜单中的链接,HTML视图
| 归档时间: |
|
| 查看次数: |
27247 次 |
| 最近记录: |