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

Project genration with JDL with an User relationship does not work #24491

Closed
1 task done
vikreinok opened this issue Dec 6, 2023 · 1 comment
Closed
1 task done

Comments

@vikreinok
Copy link

vikreinok commented Dec 6, 2023

Overview of the issue

jhispter jdl generator does not run with an User entity

Motivation for or Use Case

One should be able to do JDL driven entity generation for a new project

Reproduce the error

jhipster jdl ./jhipster-jdl.jdl

jhipster-jdl.jdl

application {
    config {
        baseName testapp
        applicationType monolith
        packageName com.testapp
        authenticationType jwt
        prodDatabaseType postges
        clientFramework angularX
    }
    entities *
}

entity Message {
    text String
}

relationship OneToOne {
    Message to User with builtInEntity
}

Stack trace:

ERROR! An error occured while running jhipster:bootstrap-application-base#prepareRelationshipsForTemplates
ERROR! ERROR! Error at entity Message: could not find the other side of the relationship {
    "relationshipSide": "left",
    "relationshipType": "one-to-many",
    "otherEntityName": "user",
    "otherEntityRelationshipName": "message",
    "relationshipName": "user",
    "relationshipWithBuiltInEntity": true,
    "otherEntity": "[User Entity]",
    "ownerSide": false,
    "otherEntityField": "id",
    "relationshipLeftSide": true,
    "relationshipRightSide": false,
    "collection": true,
    "relationshipOneToOne": false,
    "relationshipOneToMany": true,
    "relationshipManyToOne": false,
    "relationshipManyToMany": false,
    "otherEntityUser": true,
    "relationshipUpdateBackReference": true,
    "otherSideReferenceExists": false,
    "otherEntityIsEmbedded": false
}
Error: Error at entity Message: could not find the other side of the relationship {
    "relationshipSide": "left",
    "relationshipType": "one-to-many",
    "otherEntityName": "user",
    "otherEntityRelationshipName": "message",
    "relationshipName": "user",
    "relationshipWithBuiltInEntity": true,
    "otherEntity": "[User Entity]",
    "ownerSide": false,
    "otherEntityField": "id",
    "relationshipLeftSide": true,
    "relationshipRightSide": false,
    "collection": true,
    "relationshipOneToOne": false,
    "relationshipOneToMany": true,
    "relationshipManyToOne": false,
    "relationshipManyToMany": false,
    "otherEntityUser": true,
    "relationshipUpdateBackReference": true,
    "otherSideReferenceExists": false,
    "otherEntityIsEmbedded": false
}
    at prepareRelationship (file:///opt/homebrew/lib/node_modules/generator-jhipster/dist/generators/base-application/support/prepare-relationship.mjs:81:19)
    at BootstrapApplicationBase.prepareRelationshipsForTemplates (file:///opt/homebrew/lib/node_modules/generator-jhipster/dist/generators/bootstrap-application-base/generator.mjs:223:17)
    at BootstrapApplicationBase.executeTask (file:///opt/homebrew/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:244:26)
    at env.queueTask.once (file:///opt/homebrew/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:218:56)
    at runLoop.add.once (file:///opt/homebrew/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:381:23)
    at Immediate.<anonymous> (/opt/homebrew/lib/node_modules/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
    at process.processImmediate (node:internal/timers:478:21)


Related issues
Suggest a Fix

Tried also
Message{user} to User with builtInEntity

JHipster Version(s)

8.0.0

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory

Empty folder. Not existing project.

Browsers and Operating System

Mac Ventura 13.5

  • Checking this box is mandatory (this is just to show you read everything)
@vikreinok vikreinok changed the title Project genration with JDL with an user does not work Project genration with JDL with an User relationship does not work Dec 6, 2023
@vikreinok
Copy link
Author

Work with following JDL

application {
    config {
        baseName testapp
        applicationType monolith
        packageName com.testapp
        authenticationType jwt
        prodDatabaseType postgresql
        clientFramework angularX
    }
    entities *
}

entity Message {
    text String
}

relationship OneToOne {
    Message to User with builtInEntity
}


@deepu105 deepu105 added this to the 8.1.0 milestone Dec 11, 2023
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

2 participants