( Im not sure if this is possible )
I have a One to Many relationship between A and B ( Multiple Bs for each A modelled using @OneToMany).
In my JpaRepository for B, I want to write a custom Query so as to return a single B which has the highest value for a specific attribute.
Something like:
@Query( value="SELECT a.list_of_Bs.//max(b.version)// FROM A a WHERE a.id = :a_param" )
B findLargestB(A a_param) ;
How will I do max(b.version). ( How will I extract the single B from the list which has the highest version attribute )