Skip to content

ResultType Project Support in Jakarta Data #3494

@hantsy

Description

@hantsy

In hibernate, it supports a custom type as result type in some cases (with @Query or derived queries by name in the Repository interface), if the ordered name or type are matched.

record PostSummary(title, count){}

@Query("select p.title as title, count(c.id) as count from Post p left join Comment c on c.postId = p.id group by p.id")
List<PostSummary> getPostSummary();

or

interface AnotherRepository extends CrudRepository<Post, UUID>{

   List<PostSummary> find(Limit,Sort...)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: improvementA minor improvement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions