- 参与https://plugins.gradle.org/plugin/org.jamgo.eclipselink-plugin
- 检查日志
[EL警告]:元数据:ServerSession(1559673372)-由于未启用编织,或者为实体类[类com.hybris.caas.order.model.Order]还原了OneToOne或ManyToOne属性[copyCustomer]上的惰性设置。没发生。
@Configuration
public class JpaConfig extends JpaBaseConfiguration {
protected JpaConfig(DataSource dataSource, JpaProperties properties,
ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
@Override
protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
return new EclipseLinkJpaVendorAdapter();
}
@Override
protected Map<String, Object> getVendorProperties() {
final HashMap<String, Object> props = new HashMap<>();
props.put(PersistenceUnitProperties.WEAVING, detectWeavingMode());
return props;
}
private String detectWeavingMode() {
return "static";
}
/**
*
* @param entityManagerFactory
* @return
*/
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory entityManagerFactory) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(entityManagerFactory);
return transactionManager;
}
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.jamgo:eclipselink-plugin:0.2.2"
}
}
apply plugin: "org.jamgo.eclipselink-plugin"