I am using hibernate to get a result like this,
project_id - 123 , 111 , 134
Count - 2 , 5 ,6
Here is my Dao layer -
@Query("SELECT project_id,COUNT(*) FROM lead_master WHERE vendor_id = ?1 and source = 'share' group by project_id ")
List<Map<String,Object>> getProjectLead(userId);
Output - I want the List of Map where the project_id should be the key and the count should be the object associated with that key.so it will be like -
123 - 2
111 - 5
134 - 6
List<Object[]>or projection baeldung.com/…Object[]also has same information project_id at0and count at1indexes