Skip to content

Commit

Permalink
#506 - Replace custom Eclipselink setup with dedicated starter.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Jul 10, 2019
1 parent 1a1a596 commit f148149
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 42 deletions.
8 changes: 8 additions & 0 deletions jpa/eclipselink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>${eclipselink.version}</version>
</dependency>

<dependency>
<groupId>org.zalando.stups</groupId>
<artifactId>data-jpa-eclipselink-spring-boot-starter</artifactId>
<version>0.10.1</version>
<scope>runtime</scope>
</dependency>

</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@
*/
package example.springdata.jpa.eclipselink;

import java.util.Collections;
import java.util.Map;

import javax.sql.DataSource;

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter;
import org.springframework.transaction.jta.JtaTransactionManager;

/**
* Spring Boot application that uses EclipseLink as the JPA provider.
Expand All @@ -37,37 +26,7 @@
* @author Mark Paluch
*/
@SpringBootApplication
public class Application extends JpaBaseConfiguration {

/**
* @param dataSource
* @param properties
* @param jtaTransactionManagerProvider
*/
protected Application(DataSource dataSource, JpaProperties properties,
ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider) {
super(dataSource, properties, jtaTransactionManagerProvider);
}

/*
* (non-Javadoc)
* @see org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration#createJpaVendorAdapter()
*/
@Override
protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
return new EclipseLinkJpaVendorAdapter();
}

/*
* (non-Javadoc)
* @see org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration#getVendorProperties()
*/
@Override
protected Map<String, Object> getVendorProperties() {

// Turn off dynamic weaving to disable LTW lookup in static weaving mode
return Collections.singletonMap("eclipselink.weaving", "false");
}
public class Application {

public static void main(String[] args) {

Expand Down

0 comments on commit f148149

Please sign in to comment.