1

I am now developing an organization, but when I use JDL-studio to add a many-to-many relationship to the authority, I can not find the authority entity. But can find this User entity class. please help me, thank you! I'm using jhipstter 4.6.1 now.

run yo jhipster:import-jdl /Users/uqing/Downloads/jhipster-jde.jh The following error occurred:

In the relationship between Role and Authority, Authority is not declared.',

message: 'In the relationship between Role and Authority, Authority is not declared.',

this is jdl

Mohsen
  • 4,536
  • 2
  • 27
  • 49
uqing
  • 11
  • 4
  • `Authority` is not a normal JHipster entity, you can't generate it nor modify it using the generator, it's the same restrictions as for `User` which are documented here: https://jhipster.github.io/managing-relationships/ – Gaël Marziou Jul 19 '17 at 04:36
  • I must admit that I'm not sure special handling that exists in generator for User has also been implemented for Authority. Anyway, for further help you should edit your question and paste your JDL. – Gaël Marziou Jul 19 '17 at 04:39
  • User is not a normal entity, but it can be identified. Is it only Authority that is not recognized?Or is it the wrong name? – uqing Jul 19 '17 at 05:47
  • Error message might be misleading, Authority is the right name. To verify it, just create a many-to-many relationship to the Authority entity, but the other entity Organization) must be the owner of the relationship – Gaël Marziou Jul 19 '17 at 08:09
  • I am going to check how jdl-studio works in depth. However looking at the image you shared. https://i.stack.imgur.com/jN4g2.jpg Is there a typo on line 33. `Role{authority} to Authority{Role}` instead of `Role{authority} to Authority{role}` – Sumit Vairagar Jul 19 '17 at 09:46

1 Answers1

0

As Authority is just a table containing one column of string type, the link can be done with a simple string column. For example

entity MyEntity {
  authority String required
  value String
}

In the database, you'll have something like this:

Authority | Value
--------------------
ROLE_A    | Value 1
ROLE_B    | Value 2
Clemzd
  • 895
  • 2
  • 15
  • 35