Adding a filter option to existing entities

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:

  1. With Command Prompt, do the following:
    1. 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.
    2. 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.
    3. Change the value of the key jpaMetamodelFiltering to true.
    4. Regenerate the entity with the jhipster entity <entity_name> command. 
  1. With JDL, do the following:
    1. Add a line containing filter <entity_name> to the JDL script file.
    2. 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.133.228