0
静的織りをサポートするようにプロジェクトを設定しましたが、遅延ロードでは機能しません。@ManyToOne使用freamworkのEclipselink静的織り作業がありません
バージョン:
- のEclipseLink-2.6.3-M1.jar
- wildfly 10.0.0
- JPA 2.0
- のEclipseLink-staticweave-達人 - プラグイン: 1.0.4
私の設定:
- のpom.xml:
...
<plugin>
<artifactId>eclipselink-staticweave-maven-plugin</artifactId>
<groupId>au.com.alderaan</groupId>
<version>1.0.4</version>
<executions>
<execution>
<goals>
<goal>weave</goal>
</goals>
<phase>process-classes</phase>
<configuration>
<logLevel>ALL</logLevel>
<includeProjectClasspath>true</includeProjectClasspath>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>${eclipslink-version}</version>
</dependency>
</dependencies>
</plugin>
...
- のpersistence.xml:
...
<validation-mode>NONE</validation-mode>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="eclipselink.target-database" value="MySQL" />
<property name="eclipselink.target-server" value="JBoss" />
<property name="eclipselink.weaving" value="static" />
<!-- LOG DEBUG -->
<property name="eclipselink.logging.level.sql" value="FINEST" />
<property name="eclipselink.logging.parameters" value="true" />
<property name="eclipselink.logging.level.transaction"
value="FINEST" />
<property name="eclipselink.logging.level" value="FINEST" />
<property name="eclipselink.logging.level.cache" value="FINEST" />
</properties>
...
- User.java:
...
@JoinColumn(name = "PARTNER_ID", referencedColumnName = PARTNER_ID", nullable = false)
@ManyToOne(optional = false, fetch = FetchType.LAZY)
private Partner partnerId;
...
- ログ:
14:14:00,696 INFO [stdout] (default task-14) [EL Fine]: 2016-04-24 14:14:00.696--ServerSession(2107137839)--Connection(1003936572)--Thread(Thread[default task-14,5,main])--SELECT USER_ID, USER_LOGIN, USER_MAIL, USER_PWD, PARTNER_ID FROM user WHERE (USER_LOGIN = ?)
14:14:00,696 INFO [stdout] (default task-14) bind => [admin]
14:14:00,703 INFO [stdout] (default task-14) [EL Finest]: 2016-04-24 14:14:00.703--ServerSession(2107137839)--Connection(453922073)--Thread(Thread[default task-14,5,main])--Connection released to connection pool [read].
14:14:00,705 INFO [stdout] (default task-14) [EL Finest]: 2016-04-24 14:14:00.705--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--Execute query ReadObjectQuery(name="partnerId" referenceClass=Partner)
14:14:00,706 INFO [stdout] (default task-14) [EL Finest]: 2016-04-24 14:14:00.706--ServerSession(2107137839)--Connection(1634321100)--Thread(Thread[default task-14,5,main])--Connection acquired from connection pool [read].
14:14:00,706 INFO [stdout] (default task-14) [EL Finest]: 2016-04-24 14:14:00.706--ServerSession(2107137839)--Thread(Thread[default task-14,5,main])--reconnecting to external connection pool
14:14:00,706 INFO [stdout] (default task-14) [EL Fine]: 2016-04-24 14:14:00.706--ServerSession(2107137839)--Connection(415563557)--Thread(Thread[default task-14,5,main])--SELECT PARTNER_ID, DISABLED FROM partner WHERE (PARTNER_ID = ?)
14:14:00,706 INFO [stdout] (default task-14) bind => [1]
14:14:00,852 INFO [stdout] (default task-14) [EL Finest]: 2016-04-24 14:14:00.852--ServerSession(2107137839)--Connection(1992473777)--Thread(Thread[default task-14,5,main])--Connection released to connection pool [read].
14:14:00,853 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.853--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--TX beforeCompletion callback, status=STATUS_ACTIVE
14:14:00,853 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.853--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--begin unit of work commit
14:14:00,859 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.859--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--TX afterCompletion callback, status=COMMITTED
14:14:00,860 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.86--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--end unit of work commit
14:14:00,860 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.86--UnitOfWork(889591992)--Thread(Thread[default task-14,5,main])--release unit of work
14:14:00,861 INFO [stdout] (default task-14) [EL Finer]: 2016-04-24 14:14:00.861--ClientSession(1390020981)--Thread(Thread[default task-14,5,main])--client released
ログにユーザーを読み込むと、常にパートナーを取得するリクエストが表示されます。 ?
私は問題を発見したと思う