Fetch List Using DTO projections using a Constructor Expression and JPQL

前端 未结 3 1169
無奈伤痛
無奈伤痛 2021-02-13 18:14

Perform a search on DisabScreenRequest and fetch its child details also. Using DTO projections using a Constructor Expression and JPQL.

The parent entity with a child

3条回答
  •  终归单人心
    2021-02-13 18:50

    AFAIK, you can't use constructor expression which take a Collection.

    See the JPA 2.2 Spec, section 4.14 BNF, read about the constructor expression:

    constructor_expression ::=
        NEW constructor_name ( constructor_item {, constructor_item}* )
    constructor_item ::=
        single_valued_path_expression |
        scalar_expression |
        aggregate_expression |
        identification_variable
    

提交回复
热议问题