简体   繁体   English

jhipster在解析导入jdl时给出错误

[英]jhipster give error while parsing import jdl

I create a jdl file with " http://www.jhipster.tech/jdl-studio/ ", but when I launch import in my jhipster project I have this error : 我使用“ http://www.jhipster.tech/jdl-studio/ ”创建了一个jdl文件,但是当我在jhipster项目中启动导入时,出现此错误:

I have no error in jdl Studio 我在jdl Studio中没有错误

Using JHipster version installed locally in current project's node_modules
Executing jhipster:import-jdl jhipster-jdl.jh
Options: 
The jdl is being parsed.
events.js:160
  throw er; // Unhandled 'error' event
  ^

Error: ERROR!
Error while parsing entities from JDL

at Environment.error (D:\workspace\yvidya\node_modules\yeoman-environment\lib\environment.js:157:40)
at error (D:\workspace\yvidya\node_modules\generator-jhipster\generators\generator-base.js:1676:18)
at parseJDL (D:\workspace\yvidya\node_modules\generator-jhipster\generators\import-jdl\index.js:105:26)
at Object.<anonymous> (D:\workspace\yvidya\node_modules\yeoman-generator\lib\index.js:399:25)
at D:\workspace\yvidya\node_modules\run-async\index.js:25:25
at D:\workspace\yvidya\node_modules\run-async\index.js:24:19
at self.env.runLoop.add.completed (D:\workspace\yvidya\node_modules\yeoman-generator\lib\index.js:400:11)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)

There is my jdl file 有我的jdl文件

entity Entite {
    nom String required maxlength(100),
    numeroLicence String maxlength(30),
    siret String maxlength(15),
    adresse String maxlength(100),
    adresseComplement String maxlength(100),
    codePostal String maxlength(10),
    ville String maxlength(50)
}

entity TypeEntity {
    nom String required maxlength(30)
}

entity WebService {
    nom String required maxlength(30),
    methode String required maxlength(10)
}

entity Profil {
    nom String required maxlength(20)
}

entity UserFonc {
    nom String required maxlength(30)
}

entity TypeBon {
    nom String required maxlength(15)
}

entity NatureBon {
    nom String required maxlength(15)
}

entity Permission {
}

entity BonSav {
    uuid String required maxlength(40),
    logicielId String required maxlength(40),
    codeMagasin String maxlength(10),
    numeroFournisseur String maxlength(40),
    codeReparation String required maxlength(10),
    libelleReparation Text required,
    dateDepot ZonedDateTime required,
    dateRetrait ZonedDateTime required,
    codeClient String required maxlength(10),
    nomClient String required maxlength(30),
    prenomClient String required maxlength(20),
    emailClient String maxlength(50),
    telephoneClient String maxlength(20),
    photo Blob,
    dateCreation ZonedDateTime required,
    dateModification ZonedDateTime required
}

entity Memo {
    titre String required maxlength(200),
    commentaire Text,
    flagTraiter Boolean,
    dateCreation ZonedDateTime required,
    dateModification ZonedDateTime required
}

relationship ManyToMany {
    Profil{WebService(nom)} to WebService{profil}
}

relationship ManyToMany {
    WebService{TypeEntity(nom)} to TypeEntity{webService}
}

relationship ManyToOne {
    Entite{typeEntity(nom)} to TypeEntity
}

relationship ManyToMany {
    Permission{entite(nom)} to Entite{permission}
}

relationship ManyToOne {
    Permission{profil(nom)} to Profil
}

relationship ManyToOne {
    Permission{UserFonc(nom)} to UserFonc
}

relationship ManyToOne {
    BonSav{entite(nom)} to Entite
}

relationship ManyToOne {
    BonSav{nature(nom)} to NatureBon
}

relationship ManyToOne {
    BonSav{type(nom)} to TypeBon
}

relationship ManyToOne {
    BonSav{destinataire(nom)} to Entite
}

relationship ManyToOne {
    Entite{entiteMere(nom)} to Entite
}

relationship ManyToOne {
    Memo{bonSav} to BonSav
}

relationship ManyToOne {
    Memo{createur(nom)} to UserFonc
}

relationship ManyToOne {
    Memo{modificateur(nom)} to UserFonc
}

relationship ManyToOne {
    BonSav{createur(nom)} to UserFonc
}

relationship ManyToOne {
    BonSav{modificateur(nom)} to UserFonc
}

// Set pagination options
paginate WebService, Profil, NatureBon, TypeBon with infinite-scroll
paginate Entite, TypeEntity, BonSav, Memo, UserFonc, Permission with pagination

dto * with mapstruct

// Set service options to all except few
service all with serviceImpl

Can you give me the error parsing? 您能给我错误解析吗? I don't understand... 我不明白

I am using jhipster 4.9.0 and use function import-jdl 我正在使用jhipster 4.9.0并使用功能import-jdl

Thanks 谢谢

Vince 文斯

Two of your entities ( Memo and BonSav ) use Text datatype. 您的两个实体( MemoBonSav )使用Text数据类型。 This is not a valid JDL datatype. 这不是有效的JDL数据类型。 Either use String or TextBlob 使用StringTextBlob

Another tip, you can actually group relations together: 另一个技巧是,您实际上可以将关系分组在一起:

relationship ManyToOne {
    Memo{modificateur(nom)} to UserFonc
}

relationship ManyToOne {
    BonSav{createur(nom)} to UserFonc
}

relationship ManyToOne {
    BonSav{modificateur(nom)} to UserFonc
}

can be

relationship ManyToOne {
    Memo{modificateur(nom)} to UserFonc
    BonSav{createur(nom)} to UserFonc
    BonSav{modificateur(nom)} to UserFonc
}

will help debugging i guess :) 这将有助于调试我猜:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM