0

The following

>yo jhipster:import-jdl model.jdl

entity Car{
brand String
 }

relationship  ManyToOne{
    Car{owner} to User
}

return parsing error:

ERROR! Error while parsing entities from JDL
[object Object]

The same relationship can be built using the command line. Is there a way to define this relationship in the JDL ?

jhipster 3.5.1

Mohsen
  • 4,536
  • 2
  • 27
  • 49
Nabil Sham
  • 2,305
  • 4
  • 26
  • 38

1 Answers1

0

I've got the same error, and a solution, at lest for my case ;)

$ yo jhipster:import-jdl ./entities-jdl.jh
The jdl is being parsed.
Error jhipster:import-jdl ./entities-jdl.jh 

ERROR! Error while parsing entities from JDL
[object Object]
  1. Add only few entities or relationships in the file (entities-jdl.jh)
  2. Run again yo jhipster:import-jdl ./entities-jdl.jh
  3. Repeat until you find the error
  4. Analyse the syntax of the lasts entities or relationship you added

In my case the JDL error was in this entity:

entity Serie {
    tipus TipusSerie required maxlength(20),
    nom String required,
    prefixe String required
}

enum TipusSerie {
    NORMAL, XEC_ESCOLETA
}

TipusSerie is an enum and cannot be validated with maxlength(20), so the correct JDL is:

entity Serie {
    tipus TipusSerie required,
    nom String required,
    prefixe String required
}

enum TipusSerie {
    NORMAL, XEC_ESCOLETA
}

I suposse that jhipster hasn't an error messages for that kind of error and shows a generic error message.

p3quod
  • 1,449
  • 3
  • 13
  • 15