Skip to content

Commit

Permalink
Upgraded to Spring Boot.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Nov 5, 2013
1 parent 1816139 commit b1314b2
Show file tree
Hide file tree
Showing 27 changed files with 213 additions and 244 deletions.
107 changes: 16 additions & 91 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<version>1.1.0.RELEASE</version>
<packaging>pom</packaging>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>0.5.0.M5</version>
</parent>

<name>Spring Data JPA sample projects</name>
<description>Sample projects for Spring Data JPA</description>
<url>http://www.springframework.org/spring-data</url>
Expand All @@ -28,13 +34,7 @@
</developers>

<properties>
<spring.version>3.2.4.RELEASE</spring.version>
<jpa.version>2.0.0</jpa.version>
<junit.version>4.11</junit.version>
<hibernate.version>4.2.6.Final</hibernate.version>
<slf4j.version>1.7.5</slf4j.version>
<aspectj.version>1.6.12</aspectj.version>
<jodatime.version>2.3</jodatime.version>
<spring.version>4.0.0.RC1</spring.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.data.jpa.version>1.4.2.RELEASE</spring.data.jpa.version>
</properties>
Expand All @@ -44,10 +44,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
Expand All @@ -73,105 +72,31 @@
<dependencies>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring.data.jpa.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>

<!-- HSQL -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.8</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime.version}</version>
</dependency>

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
<scope>runtime</scope>
</dependency>

</dependencies>

<repositories>
<repository>
<id>spring-libs-milestone</id>
<id>spring-milestones</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://repo.springsource.org/libs-milestone</url>
</repository>
Expand Down
1 change: 0 additions & 1 deletion spring-data-jpa-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<includes>
<include>**/*.java</include>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.jpa.example.auditing;

import org.springframework.data.repository.CrudRepository;

/**
* @author Oliver Gierke
*/
public interface AuditableUserRepository extends CrudRepository<AuditableUser, Long> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

<bean id="auditorAware" class="org.springframework.data.jpa.example.auditing.AuditorAwareImpl" />

<jpa:repositories base-package="org.springframework.data.jpa.example.repository.simple" />
<jpa:repositories base-package="org.springframework.data.jpa.example.auditing" />

</beans>
12 changes: 0 additions & 12 deletions spring-data-jpa-example/src/main/resources/log4j.properties

This file was deleted.

16 changes: 16 additions & 0 deletions spring-data-jpa-example/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>

<logger name="org.springframework" level="error" />

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

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.data.jpa.example.auditing.AuditableUser;
import org.springframework.data.jpa.example.auditing.AuditableUserRepository;
import org.springframework.data.jpa.example.auditing.AuditorAwareImpl;
import org.springframework.data.repository.CrudRepository;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -37,7 +37,7 @@
@Transactional
public abstract class AbstractAuditableUserSample {

@Autowired CrudRepository<AuditableUser, Long> repository;
@Autowired AuditableUserRepository repository;
@Autowired AuditorAwareImpl auditorAware;
@Autowired AuditingEntityListener<?> listener;

Expand Down
2 changes: 1 addition & 1 deletion spring-data-jpa-example/template.mf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Import-Package:
Export-Template:
org.springframework.data.jpa.example.*;version="${project.version}"
Import-Template:
javax.persistence.*;version="${jpa.version:[=.=.=,+1.0.0)}",
javax.persistence.*;version="[2.0.0,3.0.0)",
org.springframework.*;version="${spring.version:[=.=.=.=,+1.0.0)}",
org.springframework.data.*;version="${project.version:[=.=.=.=,+1.0.0)}"
Import-Library:
Expand Down
12 changes: 0 additions & 12 deletions spring-data-jpa-interceptors/src/test/resources/log4j.properties

This file was deleted.

16 changes: 16 additions & 0 deletions spring-data-jpa-interceptors/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>

<logger name="org.springframework" level="error" />

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

</configuration>
2 changes: 1 addition & 1 deletion spring-data-jpa-interceptors/template.mf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Import-Package:
Export-Template:
org.springframework.data.jpa.sample.*;version="${project.version}"
Import-Template:
javax.persistence.*;version="${jpa.version:[=.=.=,+1.0.0)}",
javax.persistence.*;version="[2.0.0,3.0.0)",
org.aopalliance.aop;version="[1.0,2.0)",
org.springframework.*;version="${spring.version:[=.=.=.=,+1.0.0)}",
org.springframework.data.*;version="${project.version:[=.=.=.=,+1.0.0)}"
Expand Down
5 changes: 2 additions & 3 deletions spring-data-jpa-showcase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<properties>
<querydsl.version>3.2.4</querydsl.version>
<spring.version>4.0.0.RC1</spring.version>
</properties>

<build>
Expand All @@ -34,7 +35,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-source</id>
Expand Down Expand Up @@ -66,7 +66,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<excludes>
<exclude>**/snippets/**/*.java</exclude>
Expand Down Expand Up @@ -105,7 +104,7 @@
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.8</version>
<version>1.1.0</version>
<dependencies>
<dependency>
<groupId>com.mysema.querydsl</groupId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions spring-data-jpa-showcase/src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ INSERT INTO Customer (id, firstname, lastname) VALUES (1, 'Dave', 'Matthews');
INSERT INTO Customer (id, firstname, lastname) VALUES (2, 'Carter', 'Beauford');
INSERT INTO Customer (id, firstname, lastname) VALUES (3, 'Stephan', 'Lassard');

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

INSERT INTO Customer (id, firstname, lastname) VALUES (4, 'Charly', 'Matthews');
INSERT INTO Customer (id, firstname, lastname) VALUES (5, 'Chris', 'Matthews');
Expand Down
Loading

0 comments on commit b1314b2

Please sign in to comment.