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

Search repositories generated for all entities #19023

Closed Rapster closed 9 months ago

Rapster commented 2 years ago
Overview of the issue

Following up https://github.com/jhipster/generator-jhipster/issues/17142 for a monolith application.

Motivation for or Use Case

Generate search repositories only for entities that has been declared as searchable. So far, from the moment you declare one entity searchable, everything gets searchable

Reproduce the error

See JDL

Related issues

https://github.com/jhipster/generator-jhipster/issues/17142

JHipster Version(s)

7.8.1

JHipster configuration
.yo-rc.json
    {
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "bug_jhipster_json_properties",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1655567508706,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": ["A", "B", "C", "D"],
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.8.1",
    "jwtSecretKey": "YjA2MDBmNzNlN2JjZmFkOTk5NmVlYzRjMGI3YmNlMzlmZTMwYTRhNTJhN2VjZjg1YTZhMmVlY2ExZDU1NjgwY2UzMDI4YzllOThjNThjZWY0YTc0YTZiYzczNzZiNWE2MGYzZWU4MGYwY2IyNjM4YzM2YzlmOGIxODg0ZTk0Zjg=",
    "languages": ["en", "fr"],
    "lastLiquibaseTimestamp": 1655568046000,
    "messageBroker": false,
    "nativeLanguage": "fr",
    "otherModules": [],
    "packageName": "com.mycompany.myapp",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": "elasticsearch",
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": false
  }
}
  
JDL definitions
entity A {

}

entity B {

}

entity C {

}

entity D {

}

relationship ManyToOne {
    A{b} to B
    B{c} to C
}

search A with elasticsearch
Browsers and Operating System

Windows 10

Rapster commented 2 years ago

Pinging @ko5tik if you're still interested in that issue

mshima commented 2 years ago

At monoliths and probably microfrontends, search is opt-out @SearchEngine(false). This behavior is more new comers friendly.

ko5tik commented 2 years ago

If it is desired I can port this to other parts.

mshima commented 2 years ago

IMO we should stay will current behavior.

Rapster commented 2 years ago

Any reason you have in mind?

mshima commented 2 years ago

This behavior is more new comers friendly.

Set the searchEngine and every entity is searchable. This is much easier to new comers.

Rapster commented 2 years ago

I don't mind that by default if search engine is set. But other options like dto, service etc. works the very same way I think

mshima commented 2 years ago

We should start v8 cycle soon, so it’s time to discuss. What’s your proposal?

Rapster commented 2 years ago

Similar to https://github.com/jhipster/generator-jhipster/issues/17142?

Rapster commented 2 years ago

To clarify, proposal:

ko5tik commented 2 years ago

Have no use case at the moment - current project does not involve jhipster. But everything is implemented and in pull request - which will of course need. rebasing. My idea was. that entities shall be omitted if indexing is specified to "no". and be indexed bz default

========[] Lines game back in Appstore - check it out! []=============== https://play.google.com/store/apps/details?id=de.pribluda.games.android.lines

Blog: https://www.pribluda.de

On Wed, 14 Sept 2022 at 11:51, Sébastien Lepage @.***> wrote:

To clarify, proposal:

  • If search set but no entities specified then generate for all entities
  • If search set and entities specified, only generate for specified entities

— Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/19023#issuecomment-1246448107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSUDX6OH45WMFDNUMTFULV6GGZBANCNFSM5Z6ILQMQ . You are receiving this because you were mentioned.Message ID: @.***>

github-actions[bot] commented 9 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