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.45k stars 4.02k forks source link

annotation-based options not working #26812

Closed depressiveRobot closed 2 days ago

depressiveRobot commented 1 month ago
Overview of the issue

For example, if the option filter is applied using the annotation syntax (@filter), no *Criteria classes are generated. Using the regular form (filter Foo) the classes are generated.

The same applies at least for pagination, too (which I have tested also).

Motivation for or Use Case

We are using the annotation-based form for entity options. However, this is not working anymore with JHipster 8.6.0

Reproduce the error
JDL definitions
@filter
@paginate(pagination)
entity Foo {
  name String required
  foo Boolean required
}
Related issues
Suggest a Fix
JHipster Version(s)

JHipster 8.6.0

JHipster configuration
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**

<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "jhipsterExample",
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1721917146123,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "devServerPort": 4200,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "Foo"
    ],
    "feignClient": null,
    "jhipsterVersion": "8.6.0",
    "languages": [
      "en"
    ],
    "lastLiquibaseTimestamp": 1721917480000,
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "com.mycompany.myapp",
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "syncUserWithIdp": null,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
</pre>
</details>

##### **Environment and Tools**

openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment Homebrew (build 17.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)

git version 2.45.2

node: v20.15.1
npm: 10.7.0

Docker version 27.0.3, build 7d4bcd8

##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>
@ChangelogDate("20240725142440")
@Paginate("pagination")
entity Foo {
  name String required
  foo Boolean required
}

service Foo with serviceClass
search Foo with no
filter Foo

</pre>
</details>
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
mshima commented 3 weeks ago

Filter option is converted to jpaMetamodelFiltering property, you should use @JpaMetamodelFiltering annotation.

mraible commented 2 days ago

Closing because a solution was provided. Please re-open if you're still having issues.