I create file with JDL studio without error but when I import the file with jhipster cli I have the following error:
Using JHipster version installed locally in current project's node_modules Executing jhipster:import-jdl ./thearthacker-jdl.jh Options: The jdl is being parsed. events.js:182 throw er; // Unhandled 'error' event ^ Error: ERROR! Error while parsing entities from JDL at Environment.error (E:\web_project\_PROJECT\thearthackers\node_modules\yeoman-environment\lib\environment.js:140:40) at constructor.error (E:\web_project\_PROJECT\thearthackers\node_modules\generator-jhipster\generators\generator-base.js:1686:18) at constructor.parseJDL (E:\web_project\_PROJECT\thearthackers\node_modules\generator-jhipster\generators\import-jdl\index.js:108:22) at Object. (E:\web_project\_PROJECT\thearthackers\node_modules\yeoman-generator\lib\index.js:417:23) at E:\web_project\_PROJECT\thearthackers\node_modules\run-async\index.js:25:25 at Promise () at E:\web_project\_PROJECT\thearthackers\node_modules\run-async\index.js:24:19 at E:\web_project\_PROJECT\thearthackers\node_modules\yeoman-generator\lib\index.js:418:9 at runCallback (timers.js:781:20) at tryOnImmediate (timers.js:743:5)
and this is my JDL file:
entity Video {
name String required,
type String required,
url String required,
quality String,
description String required,
submissionDate ZonedDateTime required
}
entity Picture {
name String required minlength(3),
type String required,
url String required,
size String,
description String,
submissionDate ZonedDateTime required
}
entity Blog {
name String required minlength(3),
}
entity Entry {
title String required,
content String required,
date ZonedDateTime required
}
entity Tag {
name String required minlength(2)
}
relationship ManyToMany {
Entry{tag(name)} to Tag{entry}
}
relationship ManyToMany {
Picture{tag(name)} to Tag{Picture}
}
relationship ManyToMany {
Video{tag(name)} to Tag{Video}
}
relationship ManyToMany {
Blog{tag(name)} to Tag{Blog}
}
relationship ManyToMany {
User{tag(name)} to Tag{User}
}
relationship ManyToOne {
Video{video} to User
}
relationship ManyToOne {
Picture{video} to User
}
relationship ManyToOne {
Blog{video} to User
}
relationship ManyToOne {
Entry{video} to Blog
}
paginate Entry, Tag with infinite-scroll
dto * with mapstruct
any idea ?
thanks for help.
I just tried your JDL and had this error message:
IllegalAssociationException: Relationships from User entity is not supported in the declaration between User and Tag.
Please note that I'm using the current development branch, so I have an error message that you probably don't have (you don't give your version number, but that was improved very recently).
What this means is that you can't do relationships from the User entity, as it can't be modified by the JDL - that's specific to the User entity. You can find more information on the relationships documentation.
There are several solutions to this: you can do a one-to-one relationship to the User, and have another entity that you manage through the JDL. Or you can modify the User entity manually (some people sub-class it and work on the sub-class, in order not to change the User).