Based on the discussion at https://stackoverflow.com/questions/52978700/how-to-write-a-custom-query-in-spring-data-jdbc