Closed lrkwz closed 8 years ago
BTW Using
$ jhipster-uml jhipster-jdl.jh
somehow leads to a result.
Hi, I don't have time right now to check this out, but it seems a very simple issue... I'll fix it tonight. In the meantime, @deepu105 can you look into this?
Update: the issue is here, if there's one in the first place.
Relationship from User entity is not supported by JHipster and JDL and its clearly documented as well
You can only do relationships to User entity that too only many-to-one, one-to-one and many-to-many and User cannot be owner in any of these case
relationship OneToMany{
User{customer} to Customer
}
Not sure why the error message appears as object though
Thanks Deepu :)
Its weird when I run the same JDL I see proper error message but @irkwz seems to get [object Object]
PS D:\Projects\test\testNew> yo jhipster:import-jdl .\jhipster-jdl.jh
The jdl is being parsed.
Error jhipster:import-jdl .\jhipster-jdl.jh
ERROR! Error while parsing entities from JDL
Relationships from User entity is not supported in the declaration between User and Customer.
PS D:\Projects\test\testNew>
@MathieuAA can you run the JDL when you have time and see if you are getting the same error as mine above.
Just discovered that the installed core is "jhipster-core@1.1.2" which is the declared dependency for generator 3.5.1
Can I safely upgrade the core? how?
@deepu105 what you say is perfectly reasonable to me but still the is the problem:
I've created a simple project which you can use https://github.com/lrkwz/jhipster-extend-user-test
Try
yo jhipster:import-jdl customer.jh user-to-customer.jh
and
yo jhipster:import-jdl customer.jh customer-to-user.jh
where user-to-customer.jh
is
relationship OneToMany{
User{customer} to Customer
}
and customer-to-user.js
is
relationship ManyToOne{
Customer{user} to User
}
@lrkwz as I said we do not support relationships from User so your customer-to-user.js
is valid but user-to-customer.jh
is invalid as User
is a special entity and we do not support any relationships that alter this entity. If you need a relationship from User you would have to do it manually by hand.
The project you shared doesnt have any relationship to customer from User, may be you used an older version of JDL or JHUML where the error message was not thrown and the relationship was just ignored
Overview of the issue
(from https://github.com/jhipster/generator-jhipster/issues/3977)
I wish to use the User entity in order to associate each User with a Customer.
JDL-Importing such a definition generates an error
further inspecting the error is In the relationship between User and Customer, User is not declared.
Reproduce the error
jhipster-jdl.jh
JHipster Version(s)
BTW I'm quite sure it is a regression bug.
JHipster configuration, a
.yo-rc.json
file generated in the root folderEntity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
git version 1.9.1
node: v4.2.1
npm: 3.10.5
bower: 1.7.9
gulp: [14:40:57] CLI version 1.2.2 [14:40:57] Local version 3.9.1
yeoman: 1.7.1
Docker version 1.11.2, build b9f10c9
docker-compose version 1.7.1, build 0a9ab35