[英]Repository method findById with underscore Spring Boot
In entity class Flights I have fields private City flight_from and private City flight_to and I need repository method to return flights by id of flight_from.在实体 class Flights 中,我有字段 private City flight_from 和 private City flight_to 并且我需要存储库方法通过 flight_from 的 id 返回航班。 I am trying to do like this:
我正在尝试这样做:
List<Flights> findByFlight_toId(Integer id);
I have tried findByFlightToId, findByFlight_to_id, findByFlight__toId with double underscore and other, still can't find it.我试过 findByFlightToId、findByFlight_to_id、带双下划线的 findByFlight__toId 等,还是找不到。 Is there any solution for that?
有什么解决办法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.