jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.5k stars 4.02k forks source link

Entity generator do not ask for fieldType when no persistence #13604

Closed henri-tremblay closed 11 months ago

henri-tremblay commented 3 years ago
Overview of the issue

I have generate a project which use "No database". I'm generating an entity for it. It used to be forbidden but in version 7.0.0-beta.0 it seems to now be allowed, which is really cool.

The following things do not work:

  1. The generator doesn't ask for any field type. The field type is undefined and the generator fails with an error
  2. Repository classes are generated
  3. Service and IT tests are referring to the repository (which causes compilation errors and a crash in prettier)
  4. The entity is annotated with @Id
Motivation for or Use Case

I want a read-only script that will present information coming from calls on other APIs. So I don't need the persistence but having the UI and controllers is really useful.

Reproduce the error
  1. Generate a project with no persistence
  2. Create an entity
Related issues

N/A

Suggest a Fix
JHipster Version(s)

7.0.0-beta.0

JHipster configuration
{
  "generator-jhipster": {
    "blueprints": [],
    "otherModules": [],
    "applicationType": "monolith",
    "baseName": "allo",
    "jhipsterVersion": "7.0.0-beta.0",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": true,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": [],
    "pages": [],
    "creationTimestamp": 1611021758835,
    "promptValues": {
      "packageName": "com.mycompany.myapp",
      "nativeLanguage": "en"
    },
    "serviceDiscoveryType": false,
    "reactive": false,
    "authenticationType": "jwt",
    "packageName": "com.mycompany.myapp",
    "serverPort": "8080",
    "cacheProvider": "ehcache",
    "enableHibernateCache": false,
    "databaseType": "no",
    "buildTool": "maven",
    "serverSideOptions": [],
    "websocket": false,
    "searchEngine": false,
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "angularX",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": false,
    "nativeLanguage": "en",
    "packageFolder": "com/mycompany/myapp",
    "jwtSecretKey": "OGQ3OGFiYmExMDk2MWNjN2Q2ZDJlMDllMGEyZTJmZGUyNTc4MzA3ZDljZDcxZmQyYWI4NGYzMGYwOTBjOGI3NzY4YjkxNWU1ZTdiMTRkNmM2MTZjZTA5MzA1ZmJhMmJjMjA2MWU3NThlZmEwOTY2NzQwYzdlZTY1NzM4ZDYxZWM=",
    "devDatabaseType": "no",
    "prodDatabaseType": "no",
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en", "fr"]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

N/A

Browsers and Operating System

macOS Catalina

henri-tremblay commented 3 years ago

Side comment: "languages": ["en", "fr"] is weird. I have generated without international support and English as the language.

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

henri-tremblay commented 3 years ago

Issue it still valid with beta-1 1- Create a project without a database 2- Add an entity (jhipster entity Item) with whatever field (e.g name)

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

henri-tremblay commented 3 years ago

Still valid!

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

henri-tremblay commented 3 years ago

Still valid (from as far as I know)!

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

henri-tremblay commented 3 years ago

Still valid

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

henri-tremblay commented 3 years ago

Still valid I think

github-actions[bot] commented 3 years ago

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 :smiley:. Comment or this will be closed in 7 days

sailokeshaithagoni commented 2 years ago

Generating field #1

? Do you want to add a field to your entity? Yes ? What is the name of your field? userid ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add?

================= Bp ================= Fields userid (undefined)

Generating field #2

? Do you want to add a field to your entity? Yes ? What is the name of your field? added_timestamp ? Do you want to add validation rules to your field? No

================= Bp ================= Fields userid (undefined) added_timestamp (undefined)

Generating field #3

? Do you want to add a field to your entity? No

================= Bp ================= Fields userid (undefined) added_timestamp (undefined)

Generating relationships to other entities

? Do you want to add a relationship to another entity? No

================= Bp ================= Fields userid (undefined) added_timestamp (undefined)

? Do you want to use separate service class for your business logic? Yes, generate a separate service interface and implementation ? Do you want to use a Data Transfer Object (DTO)? Yes, generate a DTO with MapStruct ? Is this entity read-only? Yes ? Do you want pagination and sorting on your entity? No

Everything is configured, generating the entity...

ERROR! fieldType is missing in .jhipster/Bp.json for field { "fieldName": "userid", "fieldValidateRules": [] } Error: fieldType is missing in .jhipster/Bp.json for field { "fieldName": "userid", "fieldValidateRules": [] } at EntityGenerator._validateField (/home/mylogic/projects/bpbook/node_modules/generator-jhipster/generators/entity/index.js:1089:13) at /home/mylogic/projects/bpbook/node_modules/generator-jhipster/generators/entity/index.js:454:16 at Array.forEach () at EntityGenerator.configureFields (/home/mylogic/projects/bpbook/node_modules/generator-jhipster/generators/entity/index.js:445:16) at Object. (/home/mylogic/projects/bpbook/node_modules/yeoman-generator/lib/index.js:1097:23) at /home/mylogic/projects/bpbook/node_modules/run-async/index.js:49:25 at new Promise () at /home/mylogic/projects/bpbook/node_modules/run-async/index.js:26:19 at /home/mylogic/projects/bpbook/node_modules/yeoman-generator/lib/index.js:1098:9 at new Promise ()

This issue is still there!!

alina-yur commented 2 years ago

Just ran into this as well:)

github-actions[bot] commented 12 months ago

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

henri-tremblay commented 12 months ago

Still valid from as far as I know