I meant you still need to put JAXB annotations on your JPA entity as well.
Felipe Gaúcho wrote:
> I tought I was forced to use JAXB, but if I can expose my entities
> directly in the resources, much better ... let me see.............
>
> On Tue, Mar 31, 2009 at 7:55 PM, Arul Dhesiaseelan <arul_at_fluxcorp.com> wrote:
>
>> Felipe Gaúcho wrote:
>>
>>> then I have the persistence layer based on JPA (@Entity).. and I need
>>> JAXB annotated types in order to serialize them through my Jersey
>>> resources ....
>>>
>>> how do you do this conversion ?
>>>
>>> design alternatives also helps.. in case Jersey is not designed to
>>> work on top of a persistence layer.............
>>>
>>>
>>>
>> You could see the bookmark example which uses JPA and JSON. You could easily
>> change it to use JAXB.
>> I prefer to avoid conversion at various layers, so you could probably
>> annotate your JPA entity using JAXB. But, it all depends how you want to
>> expose your model to the users. In my case, I had to add @XmlTransient for
>> some of the data which should not be exposed to users.
>>
>> HTH,
>> -Arul
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>>
>
>
>
>