Skip to content

Commit 955d5d9

Browse files
committed
Upgraded to Spring Boot 1.0.RC1.
Removed more obsolete configuration code \o/. Raised interceptor log level in interceptor sample project. Changed SQL to accomodate new default naming strategy for Hibernate.
1 parent b01ffd8 commit 955d5d9

File tree

7 files changed

+10
-106
lines changed

7 files changed

+10
-106
lines changed

java8-auditing/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818

1919
<dependencies>
2020

21-
<!-- TODO: Remove, once https://github.com/spring-projects/spring-boot/pull/184 gets accepted -->
2221
<dependency>
2322
<groupId>org.springframework</groupId>
2423
<artifactId>spring-aspects</artifactId>
25-
<version>${spring.version}</version>
2624
</dependency>
2725

2826
</dependencies>

java8-auditing/src/test/java/org/springframework/data/jpa/examples/java8/Java8AuditingIntegrationTests.java

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 the original author or authors.
2+
* Copyright 2013-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,28 +18,18 @@
1818
import static org.hamcrest.CoreMatchers.*;
1919
import static org.junit.Assert.*;
2020

21-
import javax.sql.DataSource;
22-
2321
import org.junit.Test;
2422
import org.junit.runner.RunWith;
2523
import org.springframework.beans.factory.annotation.Autowired;
26-
import org.springframework.context.annotation.Bean;
27-
import org.springframework.context.annotation.ComponentScan;
24+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2825
import org.springframework.context.annotation.Configuration;
2926
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
3027
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
31-
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
32-
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
33-
import org.springframework.orm.jpa.JpaTransactionManager;
34-
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
35-
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
3628
import org.springframework.test.context.ContextConfiguration;
3729
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3830

3931
/**
4032
* Integration test to show the usage of Java 8 date time APIs with Spring Data JPA auditing.
41-
* <p>
42-
* TODO: Move to @EnableAutoConfiguration when Boot 0.5 M8 is released
4333
*
4434
* @author Oliver Gierke
4535
*/
@@ -48,35 +38,11 @@
4838
public class Java8AuditingIntegrationTests {
4939

5040
@Configuration
51-
@ComponentScan
41+
@EnableAutoConfiguration
5242
@EnableJpaRepositories
5343
@EnableJpaAuditing
5444
static class Config {
5545

56-
@Bean
57-
LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
58-
59-
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
60-
vendorAdapter.setGenerateDdl(true);
61-
62-
LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
63-
factory.setJpaVendorAdapter(vendorAdapter);
64-
factory.setPackagesToScan(getClass().getPackage().getName());
65-
factory.setMappingResources("META-INF/orm.xml");
66-
factory.setDataSource(dataSource);
67-
68-
return factory;
69-
}
70-
71-
@Bean
72-
DataSource dataSource() {
73-
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL).build();
74-
}
75-
76-
@Bean
77-
JpaTransactionManager transactionManager() {
78-
return new JpaTransactionManager();
79-
}
8046
}
8147

8248
@Autowired CustomerRepository repository;

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.springframework.boot</groupId>
1212
<artifactId>spring-boot-starter-parent</artifactId>
13-
<version>0.5.0.M7</version>
13+
<version>1.0.0.RC1</version>
1414
</parent>
1515

1616
<name>Spring Data JPA sample projects</name>

spring-data-jpa-interceptors/src/main/java/org/spring/data/jpa/sample/interceptors/ApplicationConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 the original author or authors.
2+
* Copyright 2012-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,14 +19,14 @@
1919
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
2020
import org.springframework.aop.interceptor.CustomizableTraceInterceptor;
2121
import org.springframework.aop.support.DefaultPointcutAdvisor;
22+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2223
import org.springframework.context.annotation.Bean;
2324
import org.springframework.context.annotation.Configuration;
2425
import org.springframework.context.annotation.EnableAspectJAutoProxy;
25-
import org.springframework.context.annotation.Import;
2626

2727
@Configuration
28-
@Import(InfrastructureConfiguration.class)
2928
@EnableAspectJAutoProxy
29+
@EnableAutoConfiguration
3030
public class ApplicationConfiguration {
3131

3232
@Bean

spring-data-jpa-interceptors/src/main/java/org/spring/data/jpa/sample/interceptors/InfrastructureConfiguration.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

spring-data-jpa-interceptors/src/test/resources/logback.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</appender>
99

1010
<logger name="org.springframework" level="error" />
11+
<logger name="org.springframework.aop.interceptor" level="trace" />
1112

1213
<root level="error">
1314
<appender-ref ref="console" />

spring-data-jpa-showcase/src/main/resources/data.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ INSERT INTO Customer (id, firstname, lastname) VALUES (1, 'Dave', 'Matthews');
22
INSERT INTO Customer (id, firstname, lastname) VALUES (2, 'Carter', 'Beauford');
33
INSERT INTO Customer (id, firstname, lastname) VALUES (3, 'Stephan', 'Lassard');
44

5-
INSERT INTO Account (id, customer, expiry_date) VALUES (1, 1, '2010-12-31');
6-
INSERT INTO Account (id, customer, expiry_date) VALUES (2, 1, '2011-03-31');
5+
INSERT INTO Account (id, customer_id, expiry_date) VALUES (1, 1, '2010-12-31');
6+
INSERT INTO Account (id, customer_id, expiry_date) VALUES (2, 1, '2011-03-31');
77

88
INSERT INTO Customer (id, firstname, lastname) VALUES (4, 'Charly', 'Matthews');
99
INSERT INTO Customer (id, firstname, lastname) VALUES (5, 'Chris', 'Matthews');

0 commit comments

Comments
 (0)