如何在Spring Data REST导出的端点中使用列表? [英] How to use List in endpoint exported by Spring Data REST?
本文介绍了如何在Spring Data REST导出的端点中使用列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个对象,Foo和Bar(一个Foo是@ManyToOne,带Bar),以及Spring Boot 2.0中一个非常基本的存储库接口,以及一个方法:
I have 2 objects, Foo and Bar (a Foo is @ManyToOne with Bar), and a very basic repository interface in Spring Boot 2.0, and a method:
List<Foo> findByBarIn(@Param("bar") List<Bar> bar);
Spring将此映射到名为/foos/search/findByBarIn的终结点
This gets mapped by Spring to an endpoint called /foos/search/findByBarIn
我可以指定一个类似
获取 http://host/foos/search/findByBarIn?bar = http://host/bars/33 (其中33是Bar实体的ID)
GET http://host/foos/search/findByBarIn?bar=http://host/bars/33 (where 33 is the ID the of the Bar entity)
但是,如何指定多个条形?
But, how can I specify multiple bars?
我尝试过:(没有成功)
I've tried: (with no success)
获取http://host/foos/search/findByBarIn?bar = http://host/bars/33,http://host/bars/44
查看全文