users@glassfish.java.net

Re: Style question about returning JPA entities from EJB

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Fri, 09 Nov 2007 17:58:46 -0500

Thank you. The persistence.xml would still live inside of the EJB
project, right?

Thanks,
Ryan

Marina Vatkina wrote:
> I think your best option would be to use a separate jar for the
> entities that is placed under <ear>/lib directory.
>
> Regards,
> -marina
>
> Ryan de Laplante wrote:
>> I'm not sure where else to ask a question like this.
>>
>> Back in the EJB 2.x days with CMP, the CPM entities were not returned
>> by session beans. The entity would be converted into POJO value
>> objects before being returned. I used to put the value object POJOs
>> in a common jar file that the EJB project and EJB client project
>> would depend on.
>> In the Java EE5 world, I have been returning the actual JPA entities
>> from my EJB3 session beans. Since the JPA entity classes live inside
>> of the EJB jar file, the persistence.xml lives in there too, and my
>> web project has a build dependency on the EJB project. This hasn't
>> been a big deal for me since I use EJB Local, but I've always
>> wondered if this is the right way to do it.
>>
>> Can anyone share with me the Java EE5 patterns you use, or links to
>> pages that talk about this?
>>
>>
>> Thanks,
>> Ryan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>