2016-06-28 59 views
0

我已經使用jdl-studio創建了一個jdl文件。 我綁定使用jdl-import從jdl文件創建實體。jrorster import-jdl不從jdl文件生成實體

以下是我的CMD端子的片段:

D:\spring-boot\examples\espressob>yo jhipster:import-jdl ./jhipster-jdl.jh 
The jdl is being imported. 
D:\spring-boot\examples\espressob> 

問題

它只是打印出的文件JDL正在導入,多數民衆贊成它。 我檢查過它是否爲jdl文件中的實體生成代碼,不幸的是它沒有。


信封細節

.yo-rc.json文件內容:

{ 
    "generator-jhipster": { 
    "jhipsterVersion": "3.4.2", 
    "baseName": "espressob", 
    "packageName": "com.iwantunlimited.espressob", 
    "packageFolder": "com/iwantunlimited/espressob", 
    "serverPort": "8080", 
    "authenticationType": "jwt", 
    "hibernateCache": "hazelcast", 
    "clusteredHttpSession": "hazelcast", 
    "websocket": "spring-websocket", 
    "databaseType": "sql", 
    "devDatabaseType": "postgresql", 
    "prodDatabaseType": "postgresql", 
    "searchEngine": "elasticsearch", 
    "buildTool": "maven", 
    "enableSocialSignIn": true, 
    "jwtSecretKey": "790501d7e04040394e33964a4ee715408ec0408f", 
    "useSass": true, 
    "applicationType": "monolith", 
    "testFrameworks": [ 
     "gatling", 
     "cucumber", 
     "protractor" 
    ], 
    "jhiPrefix": "jhi", 
    "enableTranslation": true, 
    "nativeLanguage": "en", 
    "languages": [ 
     "en", 
     "fr", 
     "hi" 
    ] 
    } 
} 

jhipster-jdl.jh文件內容:

entity InsuranceCategory { 
    name String required, 
    description String, 
    isActive Boolean, 
    createdDate ZonedDateTime, 
    modifiedDate ZonedDateTime, 
} 
relationship ManyToOne { 
    InsuranceCategory{createdBy} to User 
} 
relationship ManyToOne { 
    InsuranceCategory{modifiedBy} to User 
} 

entity InsuranceProvider { 
    name String required, 
    isActive Boolean, 
    createdDate ZonedDateTime, 
    modifiedDate ZonedDateTime, 
} 
relationship ManyToOne { 
    InsuranceProvider{createdBy} to User 
} 
relationship ManyToOne { 
    InsuranceProvider{modifiedBy} to User 
} 
relationship ManyToMany { 
    InsuranceCategory{provider} to InsuranceProvider{category} 
} 

entity Policy { 
    name String required, 
    isActive Boolean, 
    createdDate ZonedDateTime, 
    modifiedDate ZonedDateTime, 
} 
relationship ManyToOne { 
    Policy{createdBy} to User 
} 
relationship ManyToOne { 
    Policy{modifiedBy} to User 
} 

relationship OneToMany { 
    InsuranceCategory{policy} to Policy 
} 

relationship OneToMany { 
    InsuranceProvider{policy} to Policy 
} 

dto all with mapstruct 

嘗試:與用戶實體

  1. 刪除關係 - 不工作

  2. 再在JDL文件安排的條目順序(首先是實體,則關係)> - 不工作

回答

0
>

我試用jijster 3.6.1版本的jdl文件,它的工作原理如下:

$ yo jhipster:import-jdl ./jhipster-jdl.jh 
The jdl is being parsed. 
**Warning: An Entity name 'User' was used: 'User' is an entity created by default by JHipster. All relationships toward it will be kept but any attributes and relationships from it will be disregarded.** 
Writing entity JSON files. 
Generating entities... 

也建議在最後一個字段的實體定義除去末端逗號:

entity InsuranceProvider { 
    name String required, 
    isActive Boolean, 
    createdDate ZonedDateTime, 
    modifiedDate ZonedDateTime 
} 

相反的:

entity InsuranceProvider { 
    name String required, 
    isActive Boolean, 
    createdDate ZonedDateTime, 
    modifiedDate ZonedDateTime , 
}