www www - 1 month ago 7
reST (reStructuredText) Question

Can't create proper spring data custom query using reference field as parameter

I'm trying to make custom spring Data query using field from reference as query
parameter. When i performed this query via REST i had no results at all:screen1
I enabled hibernate logs and copy it to H2 console and I got many results:
screen2

My Flight and Airport entities are very simplescreen2

So what am I doing wrong? I have other simpler methods and they work fine using browser. I tried the same using Query annotation(second method on second screen), but I got same results. (Copied generated sql query to H2 console and received many results but it didn't work via REST).

EDIT
I found the solution. I just removed quotation marks from URL and
it works well :D enter image description here

Sorry for my inattention.
Regards,

Michal

www www
Answer

I found the solution. It was very simple. Basically I just removed quotation marks from URL and it works well :D enter image description here Actual method in Repository looks like: List findFlightsByFromCityAndToCity(@Param("from") String from, @Param("to") String to);

Regards, Michal