Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Static Weaving"

m
m
Line 13: Line 13:
 
Prior to weaving, you must configure your persistence unit to be understood by EclipseLink. There are two basic configurations:  
 
Prior to weaving, you must configure your persistence unit to be understood by EclipseLink. There are two basic configurations:  
  
==Configuration Using a Jar File==
+
* JAR file, as specified in the JPA 2.0 specification.{{EclipseLink_Spec
This is the configuration specified in the JPA 2.0 specification. Requirements are:
+
|link=http://jcp.org/en/jsr/detail?id=220
* Classes stored at the base in directories based on their package structure
+
|section=Section 11.1.18 "Persistence Unit Packaging"}}
* A <tt>META-INF</tt> directory containing the <tt>persistence.xml</tt> file. Note: Using the persistenceunitinfo setting below, you can avoid this requirement.
+
  
For example, <tt>mypersitenceunit.jar</tt> could contain
+
* Exploded directory structure
 +
 
 +
In both cases, the requirements are:
 +
 
 +
* Classes are stored at the base in directories based on their package structure
 +
* A <tt>META-INF</tt> directory that contains the <tt>persistence.xml</tt> file. Note: Using the <tt>persistenceunitinfo</tt> setting below, you can avoid this requirement.
 +
 
 +
For example, when using a JAR file, <tt>mypersitenceunit.jar</tt> could contain the following:
 
* <tt>mypackage/MyEntity1.class</tt>
 
* <tt>mypackage/MyEntity1.class</tt>
 
* <tt>mypackage/MyEntity2.class</tt>
 
* <tt>mypackage/MyEntity2.class</tt>
Line 24: Line 30:
 
* <tt>META-INF/persistence.xml </tt>
 
* <tt>META-INF/persistence.xml </tt>
  
{{EclipseLink_Spec
+
For example, If your base directory was c:/classes, the exploded directory structure would look as follows:
|link=http://jcp.org/en/jsr/detail?id=220
+
|section=Section 11.1.18 "Persistence Unit Packaging"}}
+
 
+
==Configuration Using an Exploded Directory Structure==
+
  
 +
* <tt>c:/classes/mypackage/MyEntity1.class</tt>
 +
* <tt>c:/classes/mypackage/MyEntity2.class</tt>
 +
* <tt>c:/classes/mypackage2/MyEntity3.class</tt>
 +
* <tt>c:/classes/META-INF/persistence.xml </tt>
  
 
{{EclipseLink_JPA
 
{{EclipseLink_JPA

Revision as of 11:20, 6 May 2011

EclipseLink JPA

link="http://wiki.eclipse.org/EclipseLink"
EclipseLink
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse Source


Configuring Static Weaving

Use this option to weave all applicable class files at build time so that you can deliver pre-woven class files. Consider this option to weave all applicable class files at build time so that you can deliver prewoven class files. By doing so, you can improve application performance by eliminating the runtime weaving step required by dynamic weaving (see Configuring Dynamic Weaving).

In addition, consider using dynamic weaving to weave in Java environments where you cannot configure an agent.

Prior to weaving, you must configure your persistence unit to be understood by EclipseLink. There are two basic configurations:

  • JAR file, as specified in the JPA 2.0 specification.
Elug javaspec icon.gif

For more information, see Section 11.1.18 "Persistence Unit Packaging" in the JPA Specification.

  • Exploded directory structure

In both cases, the requirements are:

  • Classes are stored at the base in directories based on their package structure
  • A META-INF directory that contains the persistence.xml file. Note: Using the persistenceunitinfo setting below, you can avoid this requirement.

For example, when using a JAR file, mypersitenceunit.jar could contain the following:

  • mypackage/MyEntity1.class
  • mypackage/MyEntity2.class
  • mypackage2/MyEntity3.class
  • META-INF/persistence.xml

For example, If your base directory was c:/classes, the exploded directory structure would look as follows:

  • c:/classes/mypackage/MyEntity1.class
  • c:/classes/mypackage/MyEntity2.class
  • c:/classes/mypackage2/MyEntity3.class
  • c:/classes/META-INF/persistence.xml

Eclipselink-logo.gif
Version: 2.2.0 DRAFT
Other versions...