Skip to content

Support of Inline View with Pageable  #3662

@gogoadl

Description

@gogoadl

I found a bug that did not produce a normal count query when using Page with InlineView.

It would be good to test it by referring to the example repository.

I'm attaching a simple example first.

Count queries generated when requesting JPQL queries as below are as follows.

Sample Query

    @Query("SELECT T.id as id,T.name as name,T.address as address FROM (SELECT T2.id as id, T2.name as name,T2.address as address FROM Member T2) T")
    Page<TestInterface> pageRequestWithoutJoin(@Param("id") Long id, PageRequest pageRequest);

HQL Count Query

HQL cannot interpret this query and an error occurs.

    SELECT count(T) FROM (SELECT T2.id as id, T2.name as name, T2.address as address FROM Member T2 ) T

Error Log

org.hibernate.query.SemanticException: The derived SqmFrom[id, name, address] can not be used in a context where the expression needs to be expanded to identifying parts, because a derived model part does not have identifying parts. Replace uses of the root with paths instead e.g. `derivedRoot.get("alias1")` or `derivedRoot.alias1`

The example repository also provides example queries, including inserting example data into the H2 database, so it would be good to use them.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions