Java SE style use of JPA from an enterprise application

View: New views
3 Messages — Rating Filter:   Alert me  

Java SE style use of JPA from an enterprise application

by Sahoo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

It is my understanding that when an enterprise application uses JPA in
Java SE style, entity classes don't get enhanced as a result of which
benefits of enhancement (like lazy loading of fields) is not available
to such applications. If user wants to have those benefits, then they
have to either use JPA in container style or statically enhance their
domain classes. Please confirm.

Secondly, does anyone know of any EE platform that behaves differently?

Thanks,
Sahoo

Re: Java SE style use of JPA from an enterprise application

by Gordon Yorke-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sahoo,
   With TopLink ans EclipseLink Java SE style applications can still
have access to dynamically woven classes.  It really depends on the
startup.  Many application servers deploy the PU on deployment of the
application.  This process ensure the provider has the opportunity to
enhance the classes.  Once enhanced within the application all Java SE
style access still uses the enhanced classes.  Because Glassfish delays
deployment of the PU on application deployment there is no opportunity
for the provider to weave the classes.
--Gordon

Sahoo wrote:

> Hi,
>
> It is my understanding that when an enterprise application uses JPA in
> Java SE style, entity classes don't get enhanced as a result of which
> benefits of enhancement (like lazy loading of fields) is not available
> to such applications. If user wants to have those benefits, then they
> have to either use JPA in container style or statically enhance their
> domain classes. Please confirm.
>
> Secondly, does anyone know of any EE platform that behaves differently?
>
> Thanks,
> Sahoo

Re: Java SE style use of JPA from an enterprise application

by Sahoo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You are right, GlassFish does not deploy all the PUs; it only deploys
those PUs that are actually referenced by any Java EE component. That
explains the situation.

Thanks,
Sahoo

Gordon Yorke wrote:

> Sahoo,
>   With TopLink ans EclipseLink Java SE style applications can still
> have access to dynamically woven classes.  It really depends on the
> startup.  Many application servers deploy the PU on deployment of the
> application.  This process ensure the provider has the opportunity to
> enhance the classes.  Once enhanced within the application all Java SE
> style access still uses the enhanced classes.  Because Glassfish
> delays deployment of the PU on application deployment there is no
> opportunity for the provider to weave the classes.
> --Gordon
>
> Sahoo wrote:
>> Hi,
>>
>> It is my understanding that when an enterprise application uses JPA
>> in Java SE style, entity classes don't get enhanced as a result of
>> which benefits of enhancement (like lazy loading of fields) is not
>> available to such applications. If user wants to have those benefits,
>> then they have to either use JPA in container style or statically
>> enhance their domain classes. Please confirm.
>>
>> Secondly, does anyone know of any EE platform that behaves differently?
>>
>> Thanks,
>> Sahoo