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:  
  
# '''Jar file'''
+
==Configuration Using a Jar File==
 +
This is the configuration specified in the JPA 2.0 specification. Requirements are:
 +
* Classes stored at the base in directories based on their package structure
 +
* A <tt>META-INF</tt> directory containing the <tt>persistence.xml</tt> file. Note: Using the persistenceunitinfo setting below, you can avoid this requirement.
  
This is the configuration specified in the JPA 2.0 specification. See
+
For example, <tt>mypersitenceunit.jar</tt> could contain
 +
* <tt>mypackage/MyEntity1.class</tt>
 +
* <tt>mypackage/MyEntity2.class</tt>
 +
* <tt>mypackage2/MyEntity3.class</tt>
 +
* <tt>META-INF/persistence.xml </tt>
 +
 
 +
{{EclipseLink_Spec
 +
|link=http://jcp.org/en/jsr/detail?id=220
 +
|section=Section 11.1.18 "Persistence Unit Packaging"}}
 +
 
 +
==Configuration Using an Exploded Directory Structure==
  
# '''Exploded directory structure'''
 
  
 
{{EclipseLink_JPA
 
{{EclipseLink_JPA

Revision as of 09:42, 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:

Configuration Using a Jar File

This is the configuration specified in the JPA 2.0 specification. Requirements are:

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

For example, mypersitenceunit.jar could contain

  • mypackage/MyEntity1.class
  • mypackage/MyEntity2.class
  • mypackage2/MyEntity3.class
  • META-INF/persistence.xml
Elug javaspec icon.gif

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

Configuration Using an Exploded Directory Structure

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