I need to query some count per day and i would like to create named native query that will return this in map. How can i do that ?
<named-native-query name="getLeadNumberByDayInDateRange" result-set-mapping="map">
<query>
SELECT addeddate,
Count(DISTINCT campaignid, email) AS count
FROM leads
GROUP BY addeddate
</query>
</named-native-query>
So i am writing query in xml and i would like to add this into JpaRepository :
@Query
public Map<LocalDateTime, Integer> getLeadNumberByDayInDateRange();