|
From: Bill B. <bb...@re...> - 2008-07-16 20:52:49
|
Ryan J. McDonough wrote:
>
> On Jul 15, 2008, at 9:22 AM, Bill Burke wrote:
>
>> I don't see why you need a change to Resteasy to do this when the
>> JAX-RS spec allows you to return any arbitrary object from a
>> subresource locator. For example:
>>
>> @Path("/")
>> public class CustomerDatabase {
>>
>> @Path("customers/{id}")
>> public Object getCustomer() {
>>
>> Customer cust = jpa.find(...);
>> return cust;
>> }
>> }
>>
>> public class Customer {
>>
>> @GET
>> public String get() {...}
>>
>> @Path("/address")
>> public String getAddress() {...}
>> }
>>
>> So
>>
>> GET /customers/1
>> GET /customer/1/address
>>
>> Would eventually route to Customer.
>
> I've tried that, and it does not work. You can certainly get the Contact
> entity, but any @Path annotations on the entity are not processed. We
> don't have any unit tests which cover this sort of behavior, so it maybe
> that we don't support this yet? (Or support this with EJB's?) I was also
> taking a look at the Jersey "Bookmark" example app, and they have
> created separate resource classes for child entities. Ideally, I don't
> want to do this. You've got similar patterns being repeated and we've
> got a lot of meta data on the entity that we can use.
>
You'll have to show me an example because I'm not sure exactly what you
are doing here.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|