java在Jhipster中创建新实体后,不会在现有数据库中创建表
我在jhipster应用程序中有两个实体,在数据库中分别有两个表。现在,我已经使用jhipster entity命令在jhipster中添加了新的实体,但在运行应用程序之后,并没有在数据库中创建新的实体表。我已经尝试了所有的方法,但没有任何效果,所以我删除了现有的数据库(进行了备份),并在运行应用程序后创建了一个新的数据库
有谁能给我这个奇怪问题的解决方案吗。请查找以下实体。json文件
{
"fluentMethods": true,
"clientRootFolder": "",
"relationships": [
{
"relationshipName": "userId",
"otherEntityName": "user",
"relationshipType": "many-to-one",
"otherEntityField": "login",
"ownerSide": true,
"otherEntityRelationshipName": "emailStats"
}
],
"fields": [
{
"fieldName": "unDeliverable",
"fieldType": "Integer"
},
{
"fieldName": "autoReply",
"fieldType": "Integer"
},
{
"fieldName": "deliveryFailed",
"fieldType": "Integer"
},
{
"fieldName": "normal",
"fieldType": "Integer"
},
{
"fieldName": "mailReceivedDate",
"fieldType": "LocalDate"
}
],
"changelogDate": "20181030122031",
"dto": "mapstruct",
"searchEngine": false,
"service": "serviceImpl",
"entityTableName": "email_stats",
"jpaMetamodelFiltering": true,
"pagination": "pagination"
}
# 1 楼答案
src/main/resources/config/liquibase/changelog/20211215051157_added_entity_NewEntity.xml
文件李>src/main/resources/config/liquibase/master.xml
李># 2 楼答案
在大多数情况下,都会创建表。但是,liquibase配置中肯定有一些错误
尝试通过创建jh文件并导入该文件来生成实体
请参阅:https://www.jhipster.tech/creating-an-entity/
# 3 楼答案
你能在'src/main/resources/config/liquibase/changelog'下找到新的变更集xml文件吗? 如果是,只需检查它是否也在master中。xml
删除现有数据库时,我通常使用以下命令'/mvnw liquibase:dropAll“and”/mvnw清洁'
希望你能尽快修好
# 4 楼答案
我也有同样的问题,试试这个简单的解决方法
将数据库重命名为其他名称,然后创建一个与应用程序-dev.yml或application-prod.yml中提供的名称相同的新数据库/mvnw
# 5 楼答案
运行命令
./mvnw clean
或./gradlew clean
将修复dev
环境中的问题,然后再次运行./mvnw