Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in relationship with Authority Entity #14873

Closed
yacosta738 opened this issue May 5, 2021 · 12 comments
Closed

Error in relationship with Authority Entity #14873

yacosta738 opened this issue May 5, 2021 · 12 comments

Comments

@yacosta738
Copy link
Contributor

Overview of the issue

It is possible to create relationships from user-generated entities to the built-in User entity, if a user wants to extend the user without modifying the actual user entity. The same thing is not possible to do with the Authority entity.

Reproduce the error

Generate a new project and import the jdl example:

entity Alpha
entity Beta
entity Gamma


relationship OneToOne {
    Alpha{authority(name)} to Authority
}

relationship ManyToOne {
    Beta{authority(name)} to Authority
}

relationship ManyToMany {
    Gamma{authority(name)} to Authority
}
Related issues

#11062 #11158

jhipster import-jdl jdl-test.jdl


INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing import-jdl jdl-test.jdl
INFO! The JDL is being parsed.
INFO! Found entities: Alpha, Beta, Gamma.
INFO! The JDL has been successfully parsed
INFO! Generating 0 applications.
INFO! Generating 3 entities.
INFO! Generating entities for application undefined in a new parallel process

Found the .jhipster/Alpha.json configuration file, entity can be automatically generated!


Found the .jhipster/Beta.json configuration file, entity can be automatically generated!


Found the .jhipster/Gamma.json configuration file, entity can be automatically generated!

     info Creating changelog for entities Alpha,Beta,Gamma
Error running generator entities: Error: Error looking for otherEntity Authority
Error: Error looking for otherEntity Authority
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/generator-jhipster/generators/entity/index.js:530:19
    at Array.forEach (<anonymous>)
    at EntityGenerator.loadRelationships (/home/acosta/Projects/Desoft/SMRO/test/node_modules/generator-jhipster/generators/entity/index.js:526:36)
    at Object.<anonymous> (/home/acosta/Projects/Desoft/SMRO/test/node_modules/yeoman-generator/lib/index.js:1009:25)
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/run-async/index.js:26:19
    at runLoop.add.once.once (/home/acosta/Projects/Desoft/SMRO/test/node_modules/yeoman-generator/lib/index.js:1010:11)
    at Immediate.<anonymous> (/home/acosta/Projects/Desoft/SMRO/test/node_modules/grouped-queue/lib/subqueue.js:48:34)
    at processImmediate (internal/timers.js:461:21)
ERROR! Error looking for otherEntity Authority
Error: Error looking for otherEntity Authority
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/generator-jhipster/generators/entity/index.js:530:19
    at Array.forEach (<anonymous>)
    at EntityGenerator.loadRelationships (/home/acosta/Projects/Desoft/SMRO/test/node_modules/generator-jhipster/generators/entity/index.js:526:36)
    at Object.<anonymous> (/home/acosta/Projects/Desoft/SMRO/test/node_modules/yeoman-generator/lib/index.js:1009:25)
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /home/acosta/Projects/Desoft/SMRO/test/node_modules/run-async/index.js:26:19
    at runLoop.add.once.once (/home/acosta/Projects/Desoft/SMRO/test/node_modules/yeoman-generator/lib/index.js:1010:11)
    at Immediate.<anonymous> (/home/acosta/Projects/Desoft/SMRO/test/node_modules/grouped-queue/lib/subqueue.js:48:34)
    at processImmediate (internal/timers.js:461:21)

JHipster Version(s)
testas@0.0.0 /home/acosta/Projects/Desoft/SMRO/test
└── generator-jhipster@7.0.1 

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "blueprints": [],
    "otherModules": [],
    "applicationType": "monolith",
    "baseName": "testas",
    "jhipsterVersion": "7.0.1",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": [],
    "pages": [],
    "creationTimestamp": 1620181380554,
    "serviceDiscoveryType": false,
    "reactive": false,
    "authenticationType": "jwt",
    "packageName": "com.mycompany.myapp",
    "serverPort": "8080",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "buildTool": "maven",
    "serverSideOptions": [],
    "websocket": false,
    "searchEngine": false,
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "vue",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "packageFolder": "com/mycompany/myapp",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en"]
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment 18.9 (build 11.0.10+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode)

git version 2.31.1

node: v14.16.1

npm: 6.14.12

Docker version 20.10.6, build 370c28948e

docker-compose version 1.26.2, build eefe0d31

Browsers and Operating System

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.10.32-1-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7-6500U CPU @ 2.50GHz
Memory: 7.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520

@CGarces
Copy link
Contributor

CGarces commented May 5, 2021

Please read this
https://www.jhipster.tech/user-entity/#possible-relationships
Maybe you are lookign for


entity Alpha

relationship OneToOne {
  Alpha{internalUser} to User
}

@yacosta738
Copy link
Contributor Author

No, I need the relationship with Authority.

@atomfrede
Copy link
Member

Would like to contribute the feature? It seems the stale PR was nearly done, just some edge cases regarding oauth open. Maybe you can start with the content in this PR: #11158

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@DanielFran
Copy link
Member

Keep it open

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@DanielFran
Copy link
Member

@yacosta738 Can you confirm you are available to contribute with a PR?

@yacosta738
Copy link
Contributor Author

Sorry for now I can't take it. 😞

@github-actions
Copy link
Contributor

This issue is stale because it has been open for too long without any activity.
Due to the moving nature of jhipster generated application, bugs can become invalid.
If this issue still applies please comment otherwise it will be closed in 7 days

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2023
@laariche-khalid
Copy link

Is there anything new about this functionality, it is very useful for several case studies.
Thank you for taking note of this development, is there a way to contribute to this?

@laariche-khalid
Copy link

Please Keep it open 🙏

@mshima
Copy link
Member

mshima commented Feb 3, 2024

Fixed in #22106.
Not available in v7.1.0.
There are information about customizations inside linked PRs.
UI for angular only right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants