openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Build time Enhancement & Maven dependencies, persistence.xml
Date Tue, 06 Nov 2012 17:30:03 GMT
Hi tcrisera,
The build-time enhancement is a separate process from the dynamic
enhancement that can occur when the Entity classes are loaded into memory.
These processes use different configurations to accomplish their goals.

Build-time enhancement will utilize your pom.xml or ant tasks to accomplish
the enhancement processing.  This is done during your build process, before
you package the entity classes into your jars, wars, or ears.

The dynamic enhancement can be done either via a javaagent (in JSE mode) or
via the container hook when running in an application server, such as
WebSphere.  In this case, the JPA specification states that the entity
classes need to be specified in your persistence.xml.  Most JPA providers,
including OpenJPA, also allow dynamic enhancement for classes not
explicitly listed.  But, to be spec-compliant, you should list the classes.

If during the dynamic enhancement processing, a previously-enhanced class
is detected (ie. build-time enhancement), then this class is just skipped.
No need to duplicate the effort.

Here are a couple of references to help understand the enhancement
processing:
http://openjpa.apache.org/entity-enhancement.html
http://webspherepersistence.blogspot.com/2009/02/openjpa-enhancement.html

Hope this helps,
Kevin

On Sat, Nov 3, 2012 at 10:52 AM, tcrisera
<tony.crisera@envisagesystems.com>wrote:

> I'm starting to work on a new project that is broken up into separate Maven
> projects.  (Bear w/ me, not THAT familiar w/ Maven yet.)  The web project
> will be built with dependencies to one or more projects containing entity
> objects.   It is clear from the documentation that you can specify paths to
> classes that you want enhanced at build time.
> <configuration>
>                 <includes>**/entities/*.class</includes>
> But if I understand correctly, it will also do enhancement on classes in
> your persistent class list, which should include jars specified in
> persistence.xml w/ jar-file*.
> 1) I'm not sure if that is ONLY when you don't specify anything in the POM.
> 2) Primarily, I'm not sure how to specify the path of the jar in
> persistence.xml
>
> I'm sure I'm not trying to do something that is uncommon.  So basically
> what
> I need to do is enhance entities pulled in as dependencies to a project
> configured for OpenJPA.
>
> Thanks for any assistance.
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Build-time-Enhancement-Maven-dependencies-persistence-xml-tp7581599.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message