Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Weaving/Static Weaving

EclipseLink JPA

Eclipselink-logo.gif
EclipseLink
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug 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...

Back to the top