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

Not possible to create a uni-directional many-to-one relation with the CLI #26073

Closed
1 task done
yennor opened this issue May 8, 2024 · 0 comments · Fixed by #26099
Closed
1 task done

Not possible to create a uni-directional many-to-one relation with the CLI #26073

yennor opened this issue May 8, 2024 · 0 comments · Fixed by #26099

Comments

@yennor
Copy link
Contributor

yennor commented May 8, 2024

Overview of the issue

It doesn't seem to be possible to reply No to "Do you want to generate a bidirectional relationship (true)". I've tried out "no", "n" "false", random text. It always creates a bidirectional relationship and it is necessary to delete the "otherEntityRelationshipName" entry from the .json file manually.

Motivation for or Use Case
Reproduce the error

execute

  • jhipster entity entityName
  • create your fields
  • create a many-to-one relationship, and try to make it a uni-directional one.
Related issues
Suggest a Fix

Instead of expection text there, give the user the choice to reply with Y/N as with most other boolean questions.

JHipster Version(s)

8.4.0

JHipster configuration
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "hebammenProfil",
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "vue",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1715019505268,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "devServerPort": 9060,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "Midwife",
      "Section",
      "Canton",
      "MidwifeAbsence",
      "Language",
      "Category",
      "CategoryTranslation"
    ],
    "feignClient": null,
    "jhipsterVersion": "8.4.0",
    "languages": [
      "de",
      "en",
      "fr",
      "it"
    ],
    "lastLiquibaseTimestamp": 1715180817000,
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "de",
    "packageName": "li.rmm.hebammenprofil",
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "skipUserManagement": true,
    "syncUserWithIdp": null,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment (build 17.0.11+9-Debian-1)
OpenJDK 64-Bit Server VM (build 17.0.11+9-Debian-1, mixed mode, sharing)

git version 2.43.0

node: v18.20.1
npm: 9.2.0

Docker version 20.10.25+dfsg1, build b82b9f3

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
@ChangelogDate("20240506213939")
entity Midwife {
  uid String required unique
  firstName String required
  lastName String required
  company String
  street String required
  isPublicStreet Boolean required
  houseNr String
  city String required
  zip String required
  isPublicAddress Boolean required
  phoneNumber String required
  isPublicPhoneNumber Boolean required
  companyPhoneNumber String
  isPublicCompanyPhoneNumber Boolean required
  mobilePhoneNumber String
  isPublicMobilePhoneNumber Boolean required
  email String required
  isPublicEmail Boolean required
  website String
  website2 String
  useSeperateAddressForShv Boolean required
  shvStreet String required
  shvHouseNr String
  shvCity String required
  shvZip String required
  shvPhoneNumber String required
  shvCompanyPhoneNumber String
  shvMobilePhoneNumber String
  shvEmail String required
  lat Float
  lng Float
  profilePicture ImageBlob
  aboutMeDe String
  aboutMeFr String
  aboutMeIt String
  aboutMeEn String
  additionalOffersDe String
  additionalOffersFr String
  additionalOffersIt String
  additionalOffersEn String
  absenceNoticeDe String
  absenceNoticeFr String
  absenceNoticeIt String
  absenceNoticeEn String
  workingAreaDe String
  workingAreaFr String
  workingAreaIt String
  workingAreaEn String
  isFreelancer Boolean required
  offersSmsInquiries Boolean required
  offersChildbedCare Boolean required
}
@ChangelogDate("20240507162940")
entity Section {
  name String required
  isNationalSection Boolean required
  keycloakGroupName String
  proffixId Long
  usesSmsService Boolean required
}
@ChangelogDate("20240507164258")
entity Canton {
  name String required
}
@ChangelogDate("20240507210651")
@Dto("mapstruct")
entity MidwifeAbsence {
  fromDate LocalDate required
  toDate LocalDate required
}
@ChangelogDate("20240507224639")
entity Language {
  name String required unique
  isoCode String required unique
}
@ChangelogDate("20240508145951")
entity Category {
  orderId Integer
}
@ChangelogDate("20240508150657")
entity CategoryTranslation {
  name String required
}
relationship ManyToOne {
  Canton{section required} to Section
  MidwifeAbsence{midwife required} to Midwife
  Category{section required} to Section
  CategoryTranslation{category required} to Category
  CategoryTranslation{language required} to Language
}

dto Midwife with mapstruct
service Midwife with serviceImpl
search Midwife, Section, Canton, MidwifeAbsence, Language, Category, CategoryTranslation with no
filter Midwife

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants