How to add relationships in JAX-RS via RESTful web service?
问题 OK I can GET POST PUT DELETE simple resources (entities) in my RESTful web service ex. /rest/foos /rest/foos/1 /rest/bars /rest/bars/1 But how to handle adding relationships ex. @OneToMany, @ManyToMany between this relationships using RESTful web service. Suppose I have several Foo entities and several Bar entities how to establish relationships Bar 1 has Foo 3 , etc. I have such approach to GET this relationships: GET /rest/bars/1/foos Above returns collection of foos related with Bar(id=1)