generator-jhipster icon indicating copy to clipboard operation
generator-jhipster copied to clipboard

Search repositories generated for all entities

Open Rapster opened this issue 3 years ago • 11 comments

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

  • [x] Checking this box is mandatory (this is just to show you read everything)

Rapster avatar Jun 27 '22 12:06 Rapster

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

Rapster avatar Jun 27 '22 12:06 Rapster

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

mshima avatar Jun 27 '22 12:06 mshima

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

ko5tik avatar Jun 27 '22 13:06 ko5tik

IMO we should stay will current behavior.

mshima avatar Jun 27 '22 16:06 mshima

Any reason you have in mind?

Rapster avatar Jun 27 '22 20:06 Rapster

This behavior is more new comers friendly.

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

mshima avatar Jun 27 '22 20:06 mshima

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

Rapster avatar Jun 27 '22 21:06 Rapster

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

mshima avatar Jun 27 '22 23:06 mshima

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

Rapster avatar Jun 27 '22 23:06 Rapster

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

Rapster avatar Sep 14 '22 08:09 Rapster

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: @.***>

ko5tik avatar Sep 14 '22 09:09 ko5tik

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[bot] avatar Dec 16 '23 00:12 github-actions[bot]