Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What feature need to be enabled for entities filtering on Jhipster?

Tags:

jhipster

What those words "When this feature is enabled" on this documentation http://www.jhipster.tech/entities-filtering/ refer to ?

My jdl file is OK (thanks for the recent implemenattion : https://github.com/jhipster/generator-jhipster/issues/6286 )

Command jhipster import-jdl my_jdl_file.jdl work well.

But, I don't know what refer to "this feature" so it doesn't work (with swagger or postman).

Thanks

like image 552
DamDam Avatar asked Nov 03 '17 12:11

DamDam


1 Answers

If you want to enable filtering in JDL you have to:

  • Use the filter keyword
  • Your entities must use a service class or implementation.

The sample JDL below will create the filter classes for entity A:

entity A
entity B
filter * except B
service * with serviceClass

If you generate your entities through the prompts, make sure to enable Service Class and Filtering options.

As an example with a Foo entity, in your foo.component.ts, you can add keys to the query object to filter on those fields:

this.fooService.query({ 'id.equals': 953 })

JDL Docs

Entity Filtering Docs

like image 54
Ckram Avatar answered Sep 19 '22 13:09

Ckram