Ok, I think I'm getting away from what I'm trying to accomplish, which
is to figure out the best way to annotate sub-resources. Currently, I
have foo, which is a sub-resource of bar. so I'd like to GET
/bar/1/foo for the list of Foos that bar 1 has. or POST /bar/1/foo to
create a new foo. or GET /bar/1/foo/3, to get foo 3.
Currently, I have created two separate service beans, have with a
class level @PATH annotation of "/bar" and "/bar/{barId}/foo"
respectively, and individual @PATH additions as required (for fooId
and barId as appropriate.
Right now, Bar, the POJO has a very simple JPA and XML mapping.
@XMLRootElement
@Entity
public class Bar {
@Column(name="fooId")
public Foo;
}
(getters, setters, and other fields removed.) How would a equivalent
mapping be expressed in a sub-resource locator? Would it be actually
easier to read?
thanks
Jeff Wang