springjpaeclipselinkentitymanagercompile-time-weaving

What are the values and their differences for eclipselink.weaving property?


Which values exist for the eclipselink.weaving property and what is their meaning?

In Spring we can create the entityManager using Java configuration or XML configuration, the following example is for XML:

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="jpaProperties">
        <props>
            <prop key="eclipselink.weaving">false</prop>
            ...
        </props>
    </property>
   ...
</bean>

We have the following option:

What does the false means? And which options can we pass to eclipselink.weaving property?

EDIT: I want to configure the weaving during compile time. I am using this maven plugin

<groupId>com.ethlo.persistence.tools</groupId>
<artifactId>eclipselink-maven-plugin</artifactId>

What value should I use false or static ?


Solution

  • Javadoc for the eclipselink.weaving property state 3 values:

    True aka Dynamic implies there is an agent that will weave the entities in the JVM. See the doc for setting it up outside of a container. Static tells EclipseLink you've done the weaving yourself on the java classes within the class loader (see the wiki for how to set it up), while false turns off any options that require woven classes (change tracking, lazy one to ones and more).