I have two JPA entities : VirtualLot and VirtualFiles. VirtualFiles extends VirtualInode.
There is a ManyToMany relation betw
size is a reserved keyword like default or for in Java. Therefore either change your name for your variable in perhabs nodeSize or use the @Column(name = "nodeSize") Annotation with the name attribute to give a basic column a special name.
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.