I have two JPA entities : VirtualLot and VirtualFiles. VirtualFiles extends VirtualInode.
There is a ManyToMany relation betw
I'm not sure about this solution, but have a try:
Just change your @Query using the following:
@Query(value = "select sum(f.size) from VirtualLot l join l.files f where l.id = ?1", nativeQuery = true)
The nativeQuery parameter is supposed to change your query into a Oracle native query.
See this stackoverflow topic and the links provided there as reference.
Hope this will fix your problem.