Skip to content
Advertisement

Tag: group-by

How to join two tables with a group query using Hibernate (5.4) Criteria?

This is my Project Entity: ( Project.java ) This is my Task Entity: ( Task.java ) Desired DTO: ( ProjectWithSumOfTaskDto.java ) Table structure in database: tasks: id title description project_id projects: id name description The main question: What I need now is to join the “projects” table and “tasks” table grouping by the “project_id” column. And obtain List as output.

Advertisement