If the entities are already generated without the filter option, and you want to add it later on, you will need to perform certain steps. The following are two possible approaches:
- With Command Prompt, do the following:
- Open the entity's JSON file under the .jhipster folder, inside of the project directory. For example, for a Country entity, you will see a file named Country.json inside of the .jhipster folder.
- If the value of the service key is no, change it to either serviceClass or serviceImpl. The service layer option has to be enabled for the filtering option.
- Change the value of the key jpaMetamodelFiltering to true.
- Regenerate the entity with the jhipster entity <entity_name> command.
- With JDL, do the following:
- Add a line containing filter <entity_name> to the JDL script file.
- Re-import the definition with the jhipster jhipster-jdl <jdl_file> command.
In both of these scenarios, the customization will be reverted while regenerating the entities, so make a proper back-up before performing this task.